Search in sources :

Example 1 with PipeSize

use of muramasa.antimatter.pipe.PipeSize in project GT-4-Reimagined by Trinsdar.

the class WireCablesPlates method loadRecipes.

@SuppressWarnings("unchecked")
public static void loadRecipes(Consumer<IFinishedRecipe> output, AntimatterRecipeProvider provider) {
    AntimatterAPI.all(Wire.class, wire -> {
        ImmutableSet<PipeSize> sizes = wire.getSizes();
        Map<PipeSize, Item> wires = sizes.stream().map(s -> new Pair<>(s, wire.getBlockItem(s))).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond));
        PipeSize[] val = values();
        for (int i = 1; i < val.length; i += 2) {
            twoToOne(wires, val[i - 1], val[i], output, provider);
            oneToTwo(wires, val[i], val[i - 1], output, provider);
            if (i > 1) {
                fourToOne(wires, val[i - 2], val[i], output, provider);
            }
        }
        if (wire.getMaterial().has(PLATE)) {
            provider.shapeless(output, "platewire", "wire", "has_cutter", criterion(WIRE_CUTTER.getTag(), provider), new ItemStack(wires.get(VTINY)), WIRE_CUTTER.getTag(), PLATE.get(wire.getMaterial(), 1));
        }
    });
    INGOT.all().stream().filter(p -> p.has(PLATE)).forEach(p -> provider.shapeless(output, "ingothammer", "plate", "has_hammer", criterion(HAMMER.getTag(), provider), new ItemStack(PLATE.get(p), 1), HAMMER.getTag(), INGOT.get(p)));
}
Also used : Arrays(java.util.Arrays) ImmutableSet(com.google.common.collect.ImmutableSet) AntimatterAPI(muramasa.antimatter.AntimatterAPI) AntimatterRecipeProvider(muramasa.antimatter.datagen.providers.AntimatterRecipeProvider) Item(net.minecraft.item.Item) Collectors(java.util.stream.Collectors) Pair(com.mojang.datafixers.util.Pair) CraftingHelper.criterion(trinsdar.gt4r.loader.crafting.CraftingHelper.criterion) Consumer(java.util.function.Consumer) ItemStack(net.minecraft.item.ItemStack) Wire(muramasa.antimatter.pipe.types.Wire) PipeSize(muramasa.antimatter.pipe.PipeSize) Map(java.util.Map) IFinishedRecipe(net.minecraft.data.IFinishedRecipe) Data(muramasa.antimatter.Data) Item(net.minecraft.item.Item) ItemStack(net.minecraft.item.ItemStack) PipeSize(muramasa.antimatter.pipe.PipeSize) Pair(com.mojang.datafixers.util.Pair)

Example 2 with PipeSize

use of muramasa.antimatter.pipe.PipeSize in project GT-4-Reimagined by Trinsdar.

the class AssemblyLoader method init.

public static void init() {
    AntimatterAPI.all(Wire.class, t -> {
        Cable<?> cable = AntimatterAPI.get(Cable.class, "cable" + "_" + t.getMaterial().getId());
        if (cable == null)
            return;
        ImmutableSet<PipeSize> sizes = t.getSizes();
        sizes.forEach(size -> {
            Item wireItem = t.getBlockItem(size);
            Item cableItem = cable.getBlockItem(size);
            ASSEMBLING.RB().ii(of(wireItem, 1), of(INGOT.get(Rubber, size.getCableThickness()))).io(new ItemStack(cableItem, 1)).add(size.getCableThickness() * 20L, 8);
        });
    });
    ASSEMBLING.RB().ii(of(getTag("forge", "rods/wooden"), 1), of(getTag("minecraft", "coals"), 1)).io(new ItemStack(Items.TORCH, 4)).add(400, 1);
    ASSEMBLING.RB().ii(of(getTag("forge", "string"), 1), of(getTag("forge", "slimeballs"), 1)).io(new ItemStack(Items.LEAD, 2)).add(200, 2);
    ASSEMBLING.RB().ii(of(CircuitBoardAdv, 1), of(AdvCircuitParts, 2)).io(new ItemStack(CircuitAdv, 1)).add(1600, 2);
    ASSEMBLING.RB().ii(of(CircuitBoardProcessor, 1), of(CircuitDataStorage, 1)).io(new ItemStack(CircuitDataControl, 2)).add(3200, 4);
}
Also used : Item(net.minecraft.item.Item) ItemStack(net.minecraft.item.ItemStack) PipeSize(muramasa.antimatter.pipe.PipeSize)

Aggregations

PipeSize (muramasa.antimatter.pipe.PipeSize)2 Item (net.minecraft.item.Item)2 ItemStack (net.minecraft.item.ItemStack)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 Pair (com.mojang.datafixers.util.Pair)1 Arrays (java.util.Arrays)1 Map (java.util.Map)1 Consumer (java.util.function.Consumer)1 Collectors (java.util.stream.Collectors)1 AntimatterAPI (muramasa.antimatter.AntimatterAPI)1 Data (muramasa.antimatter.Data)1 AntimatterRecipeProvider (muramasa.antimatter.datagen.providers.AntimatterRecipeProvider)1 Wire (muramasa.antimatter.pipe.types.Wire)1 IFinishedRecipe (net.minecraft.data.IFinishedRecipe)1 CraftingHelper.criterion (trinsdar.gt4r.loader.crafting.CraftingHelper.criterion)1