Search in sources :

Example 1 with AntimatterRecipeProvider

use of muramasa.antimatter.datagen.providers.AntimatterRecipeProvider 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)

Aggregations

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 PipeSize (muramasa.antimatter.pipe.PipeSize)1 Wire (muramasa.antimatter.pipe.types.Wire)1 IFinishedRecipe (net.minecraft.data.IFinishedRecipe)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1 CraftingHelper.criterion (trinsdar.gt4r.loader.crafting.CraftingHelper.criterion)1