diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java b/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java index a41f9a2aa..564137a39 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java @@ -25,7 +25,8 @@ public class ActuallyAdditionsData { BlockTagsGenerator generatorBlockTags = new BlockTagsGenerator(generator, helper); // generator.addProvider(new GeneratorLoot(generator)); - // generator.addProvider(new GeneratorRecipes(generator)); + generator.addProvider(new BlockRecipeGenerator(generator)); + generator.addProvider(new ItemRecipeGenerator(generator)); generator.addProvider(generatorBlockTags); generator.addProvider(new ItemTagsGenerator(generator, generatorBlockTags, helper)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java new file mode 100644 index 000000000..07425882f --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -0,0 +1,49 @@ +package de.ellpeck.actuallyadditions.data; + +import com.google.gson.JsonObject; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; +import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; +import net.minecraft.data.*; +import net.minecraft.item.Items; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.Tags; + +import java.nio.file.Path; +import java.util.function.Consumer; + +public class BlockRecipeGenerator extends RecipeProvider { + public BlockRecipeGenerator(DataGenerator generatorIn) { + super(generatorIn); + } + + @Override + protected void registerRecipes(Consumer consumer) { + // //Battery Box + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockBatteryBox), new ItemStack(InitBlocks.blockEnergizer), new ItemStack(InitBlocks.blockEnervator), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); + ShapelessRecipeBuilder.shapelessRecipe(ActuallyBlocks.blockBatteryBox.get()) + .addIngredient(ActuallyBlocks.blockEnergizer.get()) + .addIngredient(ActuallyBlocks.blockEnervator.get()) + .addIngredient(ActuallyItems.itemCoil.get()) + .addCriterion("", hasItem(Items.AIR)) + .build(consumer, new ResourceLocation(ActuallyAdditions.MODID, "battery_box")); + + // //Farmer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFarmer), "ISI", "SCS", "ISI", 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'S', new ItemStack(Items.WHEAT_SEEDS)); + ShapedRecipeBuilder.shapedRecipe(ActuallyBlocks.blockFarmer.get()) + .patternLine("ISI") + .patternLine("SCS") + .patternLine("ISI") + .key('I', ActuallyBlocks.CRYSTAL_ENORI.get()) + .key('C', ActuallyBlocks.blockIronCasing.get()) + .key('S', Tags.Items.SEEDS) + .addCriterion("", hasItem(Items.AIR)) + .build(consumer, new ResourceLocation(ActuallyAdditions.MODID, "farmer")); + + } + + @Override + protected void saveRecipeAdvancement(DirectoryCache cache, JsonObject cache2, Path advancementJson) { + //Nope... + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java new file mode 100644 index 000000000..448eb5a77 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java @@ -0,0 +1,26 @@ +package de.ellpeck.actuallyadditions.data; + +import com.google.gson.JsonObject; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.DirectoryCache; +import net.minecraft.data.IFinishedRecipe; +import net.minecraft.data.RecipeProvider; + +import java.nio.file.Path; +import java.util.function.Consumer; + +public class ItemRecipeGenerator extends RecipeProvider { + public ItemRecipeGenerator(DataGenerator generatorIn) { + super(generatorIn); + } + + @Override + protected void registerRecipes(Consumer consumer) { + super.registerRecipes(consumer); + } + + @Override + protected void saveRecipeAdvancement(DirectoryCache cache, JsonObject cache2, Path advancementJson) { + //Nope... + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index 1b1b24879..205f5719a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; @@ -25,12 +26,16 @@ public final class ActuallyBlocks { public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID); public static final RegistryObject blockMisc = BLOCKS.register("block_misc", BlockMisc::new); - public static final RegistryObject blockLavaCasing = BLOCKS.register("block_misc", BlockMisc::new); + public static final RegistryObject blockWoodCasing = BLOCKS.register("block_wood_casing", BlockMisc::new); //TODO + public static final RegistryObject blockIronCasing = BLOCKS.register("block_iron_casing", BlockMisc::new); //TODO + public static final RegistryObject blockEnderCasing = BLOCKS.register("block_ender_casing", BlockMisc::new); //TODO + public static final RegistryObject blockLavaCasing = BLOCKS.register("block_lava_casing", BlockMisc::new); public static final RegistryObject blockWildPlant = BLOCKS.register("block_wild", BlockWildPlant::new); public static final RegistryObject blockFeeder = BLOCKS.register("block_feeder", BlockFeeder::new); public static final RegistryObject blockGrinder = BLOCKS.register("block_grinder", () -> new BlockGrinder(false)); public static final RegistryObject blockGrinderDouble = BLOCKS.register("block_grinder_double", () -> new BlockGrinder(true)); + public static final RegistryObject blockCrystalClusterRedstone = BLOCKS.register("block_crystal_cluster_redstone", () -> new BlockCrystalCluster(TheCrystals.REDSTONE)); public static final RegistryObject blockCrystalClusterLapis = BLOCKS.register("block_crystal_cluster_lapis", () -> new BlockCrystalCluster(TheCrystals.LAPIS)); public static final RegistryObject blockCrystalClusterDiamond = BLOCKS.register("block_crystal_cluster_diamond", () -> new BlockCrystalCluster(TheCrystals.DIAMOND));