diff --git a/CraftTweakerCompat.md b/CraftTweakerCompat.md deleted file mode 100644 index f4bb6ca5..00000000 --- a/CraftTweakerCompat.md +++ /dev/null @@ -1,69 +0,0 @@ -# Editing Nature's Aura recipes with CraftTweaker -Note that [CraftTweaker](https://minecraft.curseforge.com/projects/crafttweaker) is required for this compatibility. - -***This documentation is for 1.15. For the 1.12 documentation, [click here](https://github.com/Ellpeck/NaturesAura/blob/1.12/CraftTweakerCompat.md).*** - -A few notes that apply for most of the recipe types: -- If you don't know how the CraftTweaker syntax works, [read up on it](https://docs.blamejared.com/en/#Getting_Started/) first. -- `name` is the name of a recipe. Read on for more information about this. -- `aura` is the amount of Aura required and represents the total amount required for the completion of the recipe (for reference, 1,000,000 is the default amount of Aura present in the world and 2,000,000 is the amount that is required for the Environmental Eye's bar to fill up fully) -- `time` is the time processes take in ticks -- For most removal recipes, `output` is the output of the recipe that should be removed. All recipes with the given outupt will be removed. - -## On the Importance of Recipe Names -When replacing an existing recipe with a new one, the `name` variable of the recipe matters greatly, both for Nature's Aura's custom recipe types and for [vanilla crafting recipes](https://crafttweaker.readthedocs.io/en/latest/#Vanilla/Recipes/Crafting/Recipes_Crafting_Table/), if the replacement recipe should be displayed correctly in the Book of Natural Aura in place of the original recipe. -__The replacement recipe that is added for any given item inside of Nature's Aura needs to be named after the item id of the item that is being crafted.__ - -As an example, the following piece of code will remove the existing recipe of the Imperceptible Builder and replace it with a new one. Checking its Book of Natural Aura entry will then also display the new recipe correctly without errors. -``` -recipes.remove(); -recipes.addShapeless("placer", , [, ]); -``` -Note that the name of the recipe is supplied as `placer` because the item id of the Imperceptible Builder is `naturesaura:placer`. Not doing this would lead to the Book of Natural Aura not displaying the new recipe. - -_When adding a new recipe without replacing an existing one, the name of the newly added recipe does not matter._ - -## Natural Altar -```zs -mods.naturesaura.Altar.addRecipe(String name, IIngredient input, IItemStack output, String auraType, int aura, int time, IIngredient catalyst) -``` - -- `auraType` is the type of aura required for this recipe. For the regular Natural Altar, use `naturesaura:overworld`. For the nether variant of the altar, use `naturesaura:nether`. -- `catalyst` is the catalyst block that is placed on one of the four corner blocks, can be `null` - -```zs -mods.naturesaura.Altar.removeRecipe(IItemStack output) -``` - -## Altar of Birthing -```zs -mods.naturesaura.AnimalSpawner.addRecipe(String name, String entity, int aura, int time, IIngredient[] ingredients) -``` -- `entity` is the registry name of the entity that you want to spawn - -```zs -mods.naturesaura.AnimalSpawner.removeRecipe(String name) -``` -- `entity` is the registry name of the entity whose spawning recipe should be removed - -## Offering to the Gods -```zs -mods.naturesaura.Offering.addRecipe(String name, IIngredient input, int inputAmount, IIngredient startItem, IItemStack output) -``` -- `inputAmount` is the amount of items required for the input. Note that this means that the amount of the `input` variable is ignored -- `startItem` is the item required to start the offering, should pretty much always be `naturesaura:calling_spirit` - -```zs -mods.naturesaura.Offering.removeRecipe(IItemStack output) -``` - -## Ritual of the Forest -```zs -mods.naturesaura.TreeRitual.addRecipe(String name, IIngredient saplingType, IItemStack result, int time, IIngredient[] items) -``` -- `saplingType` is an item representation of the sapling that needs to be placed and grown into a tree -- `items` are the items that need to be placed on the wooden stands - -```zs -mods.naturesaura.TreeRitual.removeRecipe(IItemStack output) -``` \ No newline at end of file diff --git a/build.gradle b/build.gradle index c4cf1473..c0ea2415 100644 --- a/build.gradle +++ b/build.gradle @@ -98,7 +98,7 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.15.2-31.1.19' + minecraft 'net.minecraftforge:forge:1.15.2-31.1.24' compileOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2:api") runtimeOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2") diff --git a/src/main/java/de/ellpeck/naturesaura/ModConfig.java b/src/main/java/de/ellpeck/naturesaura/ModConfig.java index 73bcf2be..7227f8ed 100644 --- a/src/main/java/de/ellpeck/naturesaura/ModConfig.java +++ b/src/main/java/de/ellpeck/naturesaura/ModConfig.java @@ -3,7 +3,7 @@ package de.ellpeck.naturesaura; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.type.BasicAuraType; import de.ellpeck.naturesaura.api.aura.type.IAuraType; -import de.ellpeck.naturesaura.api.recipes.WeightedOre; +import de.ellpeck.naturesaura.api.misc.WeightedOre; import de.ellpeck.naturesaura.chunk.effect.OreSpawnEffect; import net.minecraft.block.Block; import net.minecraft.entity.EntityType; @@ -21,7 +21,6 @@ public final class ModConfig { public static ModConfig instance; public ForgeConfigSpec.ConfigValue> additionalBotanistPickaxeConversions; - public ForgeConfigSpec.ConfigValue> additionalFlowers; public ForgeConfigSpec.ConfigValue> auraTypeOverrides; public ForgeConfigSpec.ConfigValue> additionalOres; public ForgeConfigSpec.ConfigValue> oreExceptions; @@ -56,10 +55,6 @@ public final class ModConfig { .comment("Additional conversion recipes for the Botanist's Pickaxe right click function. Each entry needs to be formatted as modid:input_block[prop1=value1,...]->modid:output_block[prop1=value1,...] where block state properties are optional") .translation("config." + NaturesAura.MOD_ID + ".additionalBotanistPickaxeConversions") .defineList("additionalBotanistPickaxeConversions", Collections.emptyList(), s -> true); - this.additionalFlowers = builder - .comment("Additional blocks that several mechanics identify as flowers. Each entry needs to be formatted as modid:block[prop1=value1,...] where block state properties are optional") - .translation("config." + NaturesAura.MOD_ID + ".additionalFlowers") - .defineList("additionalFlowers", Collections.emptyList(), s -> true); this.auraTypeOverrides = builder .comment("Additional dimensions that map to Aura types that should be present in them. This is useful if you have a modpack with custom dimensions that should have Aura act similarly to an existing dimension in them. Each entry needs to be formatted as dimension_name->aura_type, where aura_type can be any of naturesaura:overworld, naturesaura:nether and naturesaura:end.") .translation("config." + NaturesAura.MOD_ID + ".auraTypeOverrides") @@ -185,13 +180,6 @@ public final class ModConfig { NaturesAura.LOGGER.warn("Error parsing additionalBotanistPickaxeConversions", e); } - try { - for (String s : this.additionalFlowers.get()) - NaturesAuraAPI.FLOWERS.add(Helper.getStateFromString(s)); - } catch (Exception e) { - NaturesAura.LOGGER.warn("Error parsing additionalFlowers", e); - } - try { for (String s : this.auraTypeOverrides.get()) { String[] split = s.split("->"); @@ -206,8 +194,7 @@ public final class ModConfig { try { for (String s : this.additionalOres.get()) { String[] split = s.split(":"); - Tag tag = BlockTags.getCollection().get(new ResourceLocation(split[0])); - WeightedOre ore = new WeightedOre(tag, Integer.parseInt(split[1])); + WeightedOre ore = new WeightedOre(new ResourceLocation(split[0]), Integer.parseInt(split[1])); String dimension = split[2]; if ("nether".equalsIgnoreCase(dimension)) NaturesAuraAPI.NETHER_ORES.add(ore); diff --git a/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java b/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java index 75bb4ad5..f911eade 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java +++ b/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java @@ -9,11 +9,10 @@ import de.ellpeck.naturesaura.api.aura.item.IAuraRecharge; import de.ellpeck.naturesaura.api.aura.type.BasicAuraType; import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.api.misc.IWorldData; +import de.ellpeck.naturesaura.api.misc.WeightedOre; import de.ellpeck.naturesaura.api.multiblock.IMultiblock; import de.ellpeck.naturesaura.api.multiblock.Matcher; -import de.ellpeck.naturesaura.api.recipes.*; import net.minecraft.block.BlockState; -import net.minecraft.block.FlowerBlock; import net.minecraft.entity.EntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.ResourceLocation; @@ -43,31 +42,6 @@ public final class NaturesAuraAPI { public static final String MOD_ID = "naturesaura"; public static final String API_ID = MOD_ID + "api"; public static final String VERSION = "9"; - /** - * The list of all {@link AltarRecipe} instances which are the recipes used - * by the Natural Altar. Newly created recipes can be easily added using - * {@link AltarRecipe#register()}. - */ - public static final Map ALTAR_RECIPES = new HashMap<>(); - /** - * The list of all {@link TreeRitualRecipe} instances which are the recipes - * used in the Ritual of the Forest. Newly created recipes can be easily - * added using {@link TreeRitualRecipe#register()}. - */ - public static final Map TREE_RITUAL_RECIPES = new HashMap<>(); - /** - * The list of all {@link OfferingRecipe} instances which are the recipes - * used by the Offering Table. Newly created recipes can by easily added - * using {@link OfferingRecipe#register()}. - */ - public static final Map OFFERING_RECIPES = new HashMap<>(); - /** - * The list of all types of blocks that several mechanics in the mod use as - * flowers. Right now, this includes the Herbivorous Absorber and the - * Offering Table. By default, all {@link FlowerBlock} instances and all - * blocks specified in the config file are added - */ - public static final List FLOWERS = new ArrayList<>(); /** * A map of all of the block states that the Botanist's Pickaxe can convert * into their mossy variations. Contains mossy brick and mossy cobblestone @@ -106,12 +80,6 @@ public final class NaturesAuraAPI { * using the multiblock maker debug tool. */ public static final Map MULTIBLOCKS = new HashMap<>(); - /** - * A map of all {@link AnimalSpawnerRecipe} objects that are used with the - * animal spawner block. To register a recipe, use {@link - * AnimalSpawnerRecipe#register()}. - */ - public static final Map ANIMAL_SPAWNER_RECIPES = new HashMap<>(); /** * A list of all {@link WeightedOre} objects that represent ores that can * spawn inside of stone blocks in the overworld diff --git a/src/main/java/de/ellpeck/naturesaura/api/misc/WeightedOre.java b/src/main/java/de/ellpeck/naturesaura/api/misc/WeightedOre.java new file mode 100644 index 00000000..5db91f31 --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/api/misc/WeightedOre.java @@ -0,0 +1,14 @@ +package de.ellpeck.naturesaura.api.misc; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.WeightedRandom; + +public class WeightedOre extends WeightedRandom.Item { + + public final ResourceLocation tag; + + public WeightedOre(ResourceLocation tag, int weight) { + super(weight); + this.tag = tag; + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/api/multiblock/IMultiblock.java b/src/main/java/de/ellpeck/naturesaura/api/multiblock/IMultiblock.java index ab0ce487..707ad4ca 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/multiblock/IMultiblock.java +++ b/src/main/java/de/ellpeck/naturesaura/api/multiblock/IMultiblock.java @@ -3,13 +3,14 @@ package de.ellpeck.naturesaura.api.multiblock; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; +import net.minecraft.world.World; import java.util.Map; import java.util.function.BiFunction; public interface IMultiblock { - boolean isComplete(IWorld world, BlockPos center); + boolean isComplete(World world, BlockPos center); boolean forEach(BlockPos center, char c, BiFunction function); diff --git a/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java b/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java index 5db0bb4d..677302b3 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java +++ b/src/main/java/de/ellpeck/naturesaura/api/multiblock/Matcher.java @@ -6,6 +6,7 @@ import net.minecraft.block.Blocks; import net.minecraft.tags.Tag; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; +import net.minecraft.world.World; public class Matcher { @@ -34,6 +35,6 @@ public class Matcher { } public interface ICheck { - boolean matches(IWorld world, BlockPos start, BlockPos offset, BlockPos pos, BlockState state, char c); + boolean matches(World world, BlockPos start, BlockPos offset, BlockPos pos, BlockState state, char c); } } diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/AltarRecipe.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/AltarRecipe.java deleted file mode 100644 index 8eeafd6a..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/AltarRecipe.java +++ /dev/null @@ -1,33 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes; - -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.aura.type.IAuraType; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; - -public class AltarRecipe { - - public final ResourceLocation name; - public final Ingredient input; - public final ItemStack output; - public final IAuraType requiredType; - public final Ingredient catalyst; - public final int aura; - public final int time; - - public AltarRecipe(ResourceLocation name, Ingredient input, ItemStack output, IAuraType requiredType, Ingredient catalyst, int aura, int time) { - this.name = name; - this.input = input; - this.output = output; - this.requiredType = requiredType; - this.catalyst = catalyst; - this.aura = aura; - this.time = time; - } - - public AltarRecipe register() { - NaturesAuraAPI.ALTAR_RECIPES.put(this.name, this); - return this; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/AnimalSpawnerRecipe.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/AnimalSpawnerRecipe.java deleted file mode 100644 index 9421b64d..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/AnimalSpawnerRecipe.java +++ /dev/null @@ -1,47 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes; - -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.MobEntity; -import net.minecraft.entity.SpawnReason; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.MathHelper; -import net.minecraft.world.World; - -public class AnimalSpawnerRecipe { - - public final ResourceLocation name; - public final Ingredient[] ingredients; - public final EntityType entity; - public final int aura; - public final int time; - - public AnimalSpawnerRecipe(ResourceLocation name, EntityType entity, int aura, int time, Ingredient... ingredients) { - this.name = name; - this.ingredients = ingredients; - this.entity = entity; - this.aura = aura; - this.time = time; - } - - public Entity makeEntity(World world, double x, double y, double z) { - Entity entity = this.entity.create(world); - if (x == 0 && y == 0 && z == 0) - return entity; - entity.setLocationAndAngles(x, y, z, MathHelper.wrapDegrees(world.rand.nextFloat() * 360F), 0F); - if (entity instanceof MobEntity) { - MobEntity living = (MobEntity) entity; - living.rotationYawHead = entity.rotationYaw; - living.renderYawOffset = entity.rotationYaw; - living.onInitialSpawn(world, world.getDifficultyForLocation(living.getPosition()), SpawnReason.SPAWNER, null, null); - } - return entity; - } - - public AnimalSpawnerRecipe register() { - NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES.put(this.name, this); - return this; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/OfferingRecipe.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/OfferingRecipe.java deleted file mode 100644 index 551c0e04..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/OfferingRecipe.java +++ /dev/null @@ -1,26 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes; - -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; - -public class OfferingRecipe { - - public final ResourceLocation name; - public final Ingredient input; - public final Ingredient startItem; - public final ItemStack output; - - public OfferingRecipe(ResourceLocation name, Ingredient input, Ingredient startItem, ItemStack output) { - this.name = name; - this.input = input; - this.startItem = startItem; - this.output = output; - } - - public OfferingRecipe register() { - NaturesAuraAPI.OFFERING_RECIPES.put(this.name, this); - return this; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/TreeRitualRecipe.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/TreeRitualRecipe.java deleted file mode 100644 index 7d1c16be..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/TreeRitualRecipe.java +++ /dev/null @@ -1,28 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes; - -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; - -public class TreeRitualRecipe { - - public final ResourceLocation name; - public final Ingredient saplingType; - public final Ingredient[] ingredients; - public final ItemStack result; - public final int time; - - public TreeRitualRecipe(ResourceLocation name, Ingredient saplingType, ItemStack result, int time, Ingredient... ingredients) { - this.name = name; - this.saplingType = saplingType; - this.ingredients = ingredients; - this.result = result; - this.time = time; - } - - public TreeRitualRecipe register() { - NaturesAuraAPI.TREE_RITUAL_RECIPES.put(this.name, this); - return this; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/WeightedOre.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/WeightedOre.java deleted file mode 100644 index 8f5bbdb2..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/WeightedOre.java +++ /dev/null @@ -1,15 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes; - -import net.minecraft.block.Block; -import net.minecraft.tags.Tag; -import net.minecraft.util.WeightedRandom; - -public class WeightedOre extends WeightedRandom.Item { - - public final Tag tag; - - public WeightedOre(Tag tag, int weight) { - super(weight); - this.tag = tag; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/ing/AmountIngredient.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/ing/AmountIngredient.java deleted file mode 100644 index ea46bdaa..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/ing/AmountIngredient.java +++ /dev/null @@ -1,55 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes.ing; - -import it.unimi.dsi.fastutil.ints.IntList; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; - -import java.util.stream.Stream; - -public class AmountIngredient extends Ingredient { - - public final Ingredient delegate; - public final int amount; - private ItemStack[] matchingStacks; - - public AmountIngredient(Ingredient delegate, int amount) { - super(Stream.empty()); - this.delegate = delegate; - this.amount = amount; - } - - public AmountIngredient(ItemStack stack) { - this(Ingredient.fromStacks(stack), stack.getCount()); - } - - @Override - public ItemStack[] getMatchingStacks() { - if (this.matchingStacks == null) { - ItemStack[] delegate = this.delegate.getMatchingStacks(); - this.matchingStacks = new ItemStack[delegate.length]; - for (int i = 0; i < delegate.length; i++) { - ItemStack copy = delegate[i].copy(); - copy.setCount(this.amount); - this.matchingStacks[i] = copy; - } - } - return this.matchingStacks; - } - - @Override - public boolean test(ItemStack stack) { - if (!this.delegate.test(stack)) - return false; - return stack.getCount() >= this.amount; - } - - @Override - public IntList getValidItemStacksPacked() { - return this.delegate.getValidItemStacksPacked(); - } - - @Override - public boolean isSimple() { - return this.delegate.isSimple(); - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/recipes/ing/NBTIngredient.java b/src/main/java/de/ellpeck/naturesaura/api/recipes/ing/NBTIngredient.java deleted file mode 100644 index 61152bde..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/recipes/ing/NBTIngredient.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.ellpeck.naturesaura.api.recipes.ing; - -import net.minecraft.item.ItemStack; - -public class NBTIngredient extends net.minecraftforge.common.crafting.NBTIngredient { - public NBTIngredient(ItemStack stack) { - super(stack); - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockWoodStand.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockWoodStand.java index 194abad4..0de07e64 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockWoodStand.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockWoodStand.java @@ -2,7 +2,9 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; +import de.ellpeck.naturesaura.recipes.ModRecipe; +import de.ellpeck.naturesaura.recipes.ModRecipes; +import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import de.ellpeck.naturesaura.blocks.multi.Multiblocks; import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities; import de.ellpeck.naturesaura.blocks.tiles.TileEntityWoodStand; @@ -67,11 +69,11 @@ public class BlockWoodStand extends BlockContainerImpl implements ITESRProvider< IWorld world = event.getWorld(); BlockPos pos = event.getPos(); if (!world.isRemote()) { - if (Multiblocks.TREE_RITUAL.isComplete(world, pos)) { + if (Multiblocks.TREE_RITUAL.isComplete((World) world, pos)) { BlockState sapling = world.getBlockState(pos); ItemStack saplingStack = sapling.getBlock().getItem(world, pos, sapling); if (!saplingStack.isEmpty()) { - for (TreeRitualRecipe recipe : NaturesAuraAPI.TREE_RITUAL_RECIPES.values()) { + for (TreeRitualRecipe recipe : ((World) world).getRecipeManager().getRecipes(ModRecipes.TREE_RITUAL_TYPE, null, null)) { if (recipe.saplingType.test(saplingStack)) { List required = new ArrayList<>(Arrays.asList(recipe.ingredients)); MutableObject toPick = new MutableObject<>(); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblock.java b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblock.java index f8ae7417..d646e06a 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblock.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblock.java @@ -9,6 +9,7 @@ import net.minecraft.block.BlockState; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; +import net.minecraft.world.World; import java.util.HashMap; import java.util.Map; @@ -107,7 +108,7 @@ public class Multiblock implements IMultiblock { } @Override - public boolean isComplete(IWorld world, BlockPos center) { + public boolean isComplete(World world, BlockPos center) { BlockPos start = this.getStart(center); return this.forEach(center, (char) 0, (pos, matcher) -> { BlockPos offset = pos.subtract(start); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java index ed46e153..146a918c 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java @@ -7,6 +7,7 @@ import de.ellpeck.naturesaura.api.multiblock.IMultiblock; import de.ellpeck.naturesaura.api.multiblock.Matcher; import de.ellpeck.naturesaura.blocks.BlockNatureAltar; import de.ellpeck.naturesaura.blocks.ModBlocks; +import de.ellpeck.naturesaura.recipes.ModRecipes; import net.minecraft.block.Blocks; import net.minecraft.block.LogBlock; import net.minecraft.block.SaplingBlock; @@ -53,7 +54,7 @@ public final class Multiblocks { // try-catch to prevent blocks that need to have been placed crashing here try { ItemStack stack = state.getBlock().getItem(world, pos, state); - return !stack.isEmpty() && NaturesAuraAPI.TREE_RITUAL_RECIPES.values().stream().anyMatch(recipe -> recipe.saplingType.test(stack)); + return !stack.isEmpty() && world.getRecipeManager().getRecipes(ModRecipes.TREE_RITUAL_TYPE, null, null).stream().anyMatch(r -> r.saplingType.test(stack)); } catch (Exception e) { return false; } @@ -76,7 +77,7 @@ public final class Multiblocks { new String[][]{ {" RRRRR ", " R R ", "R RRR R", "R R R R", "R R 0 R R", "R R R R", "R RRR R", " R R ", " RRRRR "}}, 'R', new Matcher(Blocks.POPPY.getDefaultState(), - (world, start, offset, pos, state, c) -> NaturesAuraAPI.FLOWERS.contains(state)), + (world, start, offset, pos, state, c) -> BlockTags.SMALL_FLOWERS.contains(state.getBlock())), '0', ModBlocks.OFFERING_TABLE, ' ', Matcher.wildcard()); public static final IMultiblock ANIMAL_SPAWNER = NaturesAuraAPI.instance().createMultiblock( diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java index 3a35b59f..a53b8122 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAnimalSpawner.java @@ -4,10 +4,11 @@ import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.type.IAuraType; -import de.ellpeck.naturesaura.api.recipes.AnimalSpawnerRecipe; +import de.ellpeck.naturesaura.recipes.AnimalSpawnerRecipe; import de.ellpeck.naturesaura.blocks.multi.Multiblocks; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; +import de.ellpeck.naturesaura.recipes.ModRecipes; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; @@ -67,7 +68,7 @@ public class TileEntityAnimalSpawner extends TileEntityImpl implements ITickable List items = this.world.getEntitiesWithinAABB(ItemEntity.class, new AxisAlignedBB(this.pos).grow(2)); - for (AnimalSpawnerRecipe recipe : NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES.values()) { + for (AnimalSpawnerRecipe recipe : this.world.getRecipeManager().getRecipes(ModRecipes.ANIMAL_SPAWNER_TYPE, null, null)) { if (recipe.ingredients.length != items.size()) continue; List required = new ArrayList<>(Arrays.asList(recipe.ingredients)); @@ -150,8 +151,10 @@ public class TileEntityAnimalSpawner extends TileEntityImpl implements ITickable super.readNBT(compound, type); if (type != SaveType.BLOCK) { if (compound.contains("recipe")) { - ResourceLocation name = new ResourceLocation(compound.getString("recipe")); - this.currentRecipe = NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES.get(name); + if (this.hasWorld()) { + ResourceLocation name = new ResourceLocation(compound.getString("recipe")); + this.currentRecipe = (AnimalSpawnerRecipe) this.world.getRecipeManager().getRecipe(name).orElse(null); + } this.spawnX = compound.getDouble("spawn_x"); this.spawnZ = compound.getDouble("spawn_z"); this.time = compound.getInt("time"); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java index 189a7e56..48a0b9da 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java @@ -12,6 +12,7 @@ import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.INBT; import net.minecraft.nbt.ListNBT; +import net.minecraft.tags.BlockTags; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; @@ -41,9 +42,8 @@ public class TileEntityFlowerGenerator extends TileEntityImpl implements ITickab for (int z = -range; z <= range; z++) { BlockPos offset = this.pos.add(x, y, z); BlockState state = this.world.getBlockState(offset); - if (NaturesAuraAPI.FLOWERS.contains(state)) { + if (BlockTags.SMALL_FLOWERS.contains(state.getBlock())) possible.add(offset); - } } } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java index 65d72cda..ac9bf2f4 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java @@ -5,11 +5,12 @@ import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.container.BasicAuraContainer; import de.ellpeck.naturesaura.api.aura.container.IAuraContainer; import de.ellpeck.naturesaura.api.aura.type.IAuraType; -import de.ellpeck.naturesaura.api.recipes.AltarRecipe; +import de.ellpeck.naturesaura.recipes.AltarRecipe; import de.ellpeck.naturesaura.blocks.multi.Multiblocks; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticleStream; import de.ellpeck.naturesaura.packet.PacketParticles; +import de.ellpeck.naturesaura.recipes.ModRecipes; import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; @@ -203,7 +204,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickableTi private AltarRecipe getRecipeForInput(ItemStack input) { IAuraType type = IAuraType.forWorld(this.world); - for (AltarRecipe recipe : NaturesAuraAPI.ALTAR_RECIPES.values()) { + for (AltarRecipe recipe : this.world.getRecipeManager().getRecipes(ModRecipes.ALTAR_TYPE, null, null)) { if (recipe.input.test(input) && (recipe.requiredType == null || type.isSimilar(recipe.requiredType))) { if (recipe.catalyst == Ingredient.EMPTY) return recipe; @@ -250,7 +251,8 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickableTi } if (type == SaveType.TILE) { if (compound.contains("recipe")) { - this.currentRecipe = NaturesAuraAPI.ALTAR_RECIPES.get(new ResourceLocation(compound.getString("recipe"))); + if (this.hasWorld()) + this.currentRecipe = (AltarRecipe) this.world.getRecipeManager().getRecipe(new ResourceLocation(compound.getString("recipe"))).orElse(null); this.timer = compound.getInt("timer"); } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOfferingTable.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOfferingTable.java index 149a801c..35e43583 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOfferingTable.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOfferingTable.java @@ -2,7 +2,8 @@ package de.ellpeck.naturesaura.blocks.tiles; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.OfferingRecipe; +import de.ellpeck.naturesaura.recipes.ModRecipes; +import de.ellpeck.naturesaura.recipes.OfferingRecipe; import de.ellpeck.naturesaura.blocks.multi.Multiblocks; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; @@ -15,6 +16,7 @@ import net.minecraft.nbt.ListNBT; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; @@ -36,8 +38,8 @@ public class TileEntityOfferingTable extends TileEntityImpl implements ITickable super(ModTileEntities.OFFERING_TABLE); } - private static OfferingRecipe getRecipe(ItemStack input) { - for (OfferingRecipe recipe : NaturesAuraAPI.OFFERING_RECIPES.values()) + private OfferingRecipe getRecipe(ItemStack input) { + for (OfferingRecipe recipe : this.world.getRecipeManager().getRecipes(ModRecipes.OFFERING_TYPE, null, null)) if (recipe.input.test(input)) return recipe; return null; @@ -58,7 +60,7 @@ public class TileEntityOfferingTable extends TileEntityImpl implements ITickable if (items.isEmpty()) return; - OfferingRecipe recipe = getRecipe(stack); + OfferingRecipe recipe = this.getRecipe(stack); if (recipe == null) return; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWoodStand.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWoodStand.java index b81a4bbd..5a91261f 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWoodStand.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWoodStand.java @@ -1,7 +1,7 @@ package de.ellpeck.naturesaura.blocks.tiles; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; +import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import de.ellpeck.naturesaura.blocks.multi.Multiblocks; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticleStream; @@ -208,7 +208,8 @@ public class TileEntityWoodStand extends TileEntityImpl implements ITickableTile if (compound.contains("recipe")) { this.ritualPos = BlockPos.fromLong(compound.getLong("ritual_pos")); this.timer = compound.getInt("timer"); - this.recipe = NaturesAuraAPI.TREE_RITUAL_RECIPES.get(new ResourceLocation(compound.getString("recipe"))); + if (this.hasWorld()) + this.recipe = (TreeRitualRecipe) this.world.getRecipeManager().getRecipe(new ResourceLocation(compound.getString("recipe"))).orElse(null); } } } diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/OreSpawnEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/OreSpawnEffect.java index 7fdc0089..9b3ffb10 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/OreSpawnEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/OreSpawnEffect.java @@ -6,7 +6,7 @@ import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.chunk.IDrainSpotEffect; import de.ellpeck.naturesaura.api.aura.type.IAuraType; -import de.ellpeck.naturesaura.api.recipes.WeightedOre; +import de.ellpeck.naturesaura.api.misc.WeightedOre; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -14,6 +14,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; +import net.minecraft.tags.Tag; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.world.World; @@ -102,7 +103,10 @@ public class OreSpawnEffect implements IDrainSpotEffect { outer: while (true) { WeightedOre ore = WeightedRandom.getRandomItem(world.rand, ores, totalWeight); - for (Block toPlace : ore.tag.getAllElements()) { + Tag tag = world.getTags().getBlocks().get(ore.tag); + if (tag == null) + continue; + for (Block toPlace : tag.getAllElements()) { if (toPlace == null || toPlace == Blocks.AIR) continue; diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AddAction.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AddAction.java deleted file mode 100644 index e916c51d..00000000 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AddAction.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.ellpeck.naturesaura.compat.crafttweaker; - -import com.blamejared.crafttweaker.api.actions.IAction; -import com.blamejared.crafttweaker.api.actions.IRuntimeAction; -import net.minecraft.util.ResourceLocation; - -import java.util.Map; - -public class AddAction implements IRuntimeAction { - - private final Map registry; - private final ResourceLocation res; - private final T recipe; - - public AddAction(Map registry, ResourceLocation res, T recipe) { - this.registry = registry; - this.res = res; - this.recipe = recipe; - } - - @Override - public void apply() { - this.registry.put(this.res, this.recipe); - } - - @Override - public String describe() { - return "Adding recipe " + this.res; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AltarTweaker.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AltarTweaker.java deleted file mode 100644 index 46415cac..00000000 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AltarTweaker.java +++ /dev/null @@ -1,40 +0,0 @@ -package de.ellpeck.naturesaura.compat.crafttweaker; - -import com.blamejared.crafttweaker.api.CraftTweakerAPI; -import com.blamejared.crafttweaker.api.annotations.ZenRegister; -import com.blamejared.crafttweaker.api.item.IIngredient; -import com.blamejared.crafttweaker.api.item.IItemStack; -import de.ellpeck.naturesaura.Helper; -import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.AltarRecipe; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; -import org.openzen.zencode.java.ZenCodeType; - -import java.util.*; - -@ZenRegister -@ZenCodeType.Name("mods." + NaturesAura.MOD_ID + ".Altar") -public final class AltarTweaker { - - @ZenCodeType.Method - public static void addRecipe(String name, IIngredient input, IItemStack output, String auraType, int aura, int time, @ZenCodeType.Optional IIngredient catalyst) { - ResourceLocation res = new ResourceLocation("crafttweaker", name); - CraftTweakerAPI.apply(new AddAction<>(NaturesAuraAPI.ALTAR_RECIPES, res, new AltarRecipe(res, - input.asVanillaIngredient(), - output.getInternal(), - NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(auraType)), - catalyst == null ? Ingredient.EMPTY : catalyst.asVanillaIngredient(), - aura, time))); - } - - @ZenCodeType.Method - public static void removeRecipe(IItemStack output) { - List recipes = new ArrayList<>(); - for (AltarRecipe recipe : NaturesAuraAPI.ALTAR_RECIPES.values()) - if (Helper.areItemsEqual(recipe.output, output.getInternal(), true)) - recipes.add(recipe.name); - CraftTweakerAPI.apply(new RemoveAction(NaturesAuraAPI.ALTAR_RECIPES, recipes)); - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AnimalSpawnerTweaker.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AnimalSpawnerTweaker.java deleted file mode 100644 index 6d06b2ff..00000000 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/AnimalSpawnerTweaker.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.ellpeck.naturesaura.compat.crafttweaker; - -import com.blamejared.crafttweaker.api.CraftTweakerAPI; -import com.blamejared.crafttweaker.api.annotations.ZenRegister; -import com.blamejared.crafttweaker.api.item.IIngredient; -import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.AnimalSpawnerRecipe; -import de.ellpeck.naturesaura.compat.Compat; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.registries.ForgeRegistries; -import org.openzen.zencode.java.ZenCodeType; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Map; - -@ZenRegister -@ZenCodeType.Name("mods." + NaturesAura.MOD_ID + ".AnimalSpawner") -public final class AnimalSpawnerTweaker { - - @ZenCodeType.Method - public static void addRecipe(String name, String entity, int aura, int time, IIngredient[] ingredients) { - ResourceLocation res = new ResourceLocation("crafttweaker", name); - CraftTweakerAPI.apply(new AddAction<>(NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES, res, new AnimalSpawnerRecipe(res, - ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entity)), aura, time, - Arrays.stream(ingredients).map(IIngredient::asVanillaIngredient).toArray(Ingredient[]::new)))); - } - - @ZenCodeType.Method - public static void removeRecipe(String name) { - CraftTweakerAPI.apply(new RemoveAction(NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES, Collections.singletonList(new ResourceLocation(name)))); - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/OfferingTweaker.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/OfferingTweaker.java deleted file mode 100644 index 51616ee9..00000000 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/OfferingTweaker.java +++ /dev/null @@ -1,39 +0,0 @@ -package de.ellpeck.naturesaura.compat.crafttweaker; - -import com.blamejared.crafttweaker.api.CraftTweakerAPI; -import com.blamejared.crafttweaker.api.annotations.ZenRegister; -import com.blamejared.crafttweaker.api.item.IIngredient; -import com.blamejared.crafttweaker.api.item.IItemStack; -import de.ellpeck.naturesaura.Helper; -import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.OfferingRecipe; -import de.ellpeck.naturesaura.api.recipes.ing.AmountIngredient; -import de.ellpeck.naturesaura.compat.Compat; -import net.minecraft.util.ResourceLocation; -import org.openzen.zencode.java.ZenCodeType; - -import java.util.*; - -@ZenRegister -@ZenCodeType.Name("mods." + NaturesAura.MOD_ID + ".Offering") -public final class OfferingTweaker { - - @ZenCodeType.Method - public static void addRecipe(String name, IIngredient input, int inputAmount, IIngredient startItem, IItemStack output) { - ResourceLocation res = new ResourceLocation("crafttweaker", name); - CraftTweakerAPI.apply(new AddAction<>(NaturesAuraAPI.OFFERING_RECIPES, res, new OfferingRecipe(res, - new AmountIngredient(input.asVanillaIngredient(), inputAmount), - startItem.asVanillaIngredient(), - output.getInternal()))); - } - - @ZenCodeType.Method - public static void removeRecipe(IItemStack output) { - List recipes = new ArrayList<>(); - for (OfferingRecipe recipe : NaturesAuraAPI.OFFERING_RECIPES.values()) - if (Helper.areItemsEqual(recipe.output, output.getInternal(), true)) - recipes.add(recipe.name); - CraftTweakerAPI.apply(new RemoveAction(NaturesAuraAPI.OFFERING_RECIPES, recipes)); - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/RemoveAction.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/RemoveAction.java deleted file mode 100644 index cf3fb66b..00000000 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/RemoveAction.java +++ /dev/null @@ -1,31 +0,0 @@ -package de.ellpeck.naturesaura.compat.crafttweaker; - -import com.blamejared.crafttweaker.api.actions.IAction; -import com.blamejared.crafttweaker.api.actions.IRuntimeAction; -import net.minecraft.util.ResourceLocation; -import org.apache.commons.lang3.tuple.Pair; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -public class RemoveAction implements IRuntimeAction { - private final Map registry; - private final List recipes; - - public RemoveAction(Map registry, List recipes) { - this.registry = registry; - this.recipes = recipes; - } - - @Override - public void apply() { - for (ResourceLocation recipe : this.recipes) - this.registry.remove(recipe); - } - - @Override - public String describe() { - return "Removing recipes " + this.recipes; - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/TreeRitualTweaker.java b/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/TreeRitualTweaker.java deleted file mode 100644 index 27da29a3..00000000 --- a/src/main/java/de/ellpeck/naturesaura/compat/crafttweaker/TreeRitualTweaker.java +++ /dev/null @@ -1,41 +0,0 @@ -package de.ellpeck.naturesaura.compat.crafttweaker; - -import com.blamejared.crafttweaker.api.CraftTweakerAPI; -import com.blamejared.crafttweaker.api.annotations.ZenRegister; -import com.blamejared.crafttweaker.api.item.IIngredient; -import com.blamejared.crafttweaker.api.item.IItemStack; -import de.ellpeck.naturesaura.Helper; -import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; -import de.ellpeck.naturesaura.compat.Compat; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; -import org.openzen.zencode.java.ZenCodeType; - -import java.util.*; - -@ZenRegister -@ZenCodeType.Name("mods." + NaturesAura.MOD_ID + ".TreeRitual") -public final class TreeRitualTweaker { - - @ZenCodeType.Method - public static void addRecipe(String name, IIngredient saplingType, IItemStack result, int time, IIngredient[] items) { - ResourceLocation res = new ResourceLocation("crafttweaker", name); - CraftTweakerAPI.apply(new AddAction<>(NaturesAuraAPI.TREE_RITUAL_RECIPES, res, new TreeRitualRecipe(res, - saplingType.asVanillaIngredient(), - result.getInternal(), - time, - Arrays.stream(items).map(IIngredient::asVanillaIngredient).toArray(Ingredient[]::new) - ))); - } - - @ZenCodeType.Method - public static void removeRecipe(IItemStack output) { - List recipes = new ArrayList<>(); - for (TreeRitualRecipe recipe : NaturesAuraAPI.TREE_RITUAL_RECIPES.values()) - if (Helper.areItemsEqual(recipe.result, output.getInternal(), true)) - recipes.add(recipe.name); - CraftTweakerAPI.apply(new RemoveAction(NaturesAuraAPI.TREE_RITUAL_RECIPES, recipes)); - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/AltarCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/AltarCategory.java index a19c6d97..53a870a3 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/AltarCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/AltarCategory.java @@ -2,7 +2,7 @@ package de.ellpeck.naturesaura.compat.jei; import com.google.common.collect.ImmutableList; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.recipes.AltarRecipe; +import de.ellpeck.naturesaura.recipes.AltarRecipe; import de.ellpeck.naturesaura.blocks.ModBlocks; import de.ellpeck.naturesaura.items.ItemAuraBottle; import de.ellpeck.naturesaura.items.ModItems; diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java index af3be3f9..f0a79401 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/AnimalSpawnerCategory.java @@ -4,7 +4,7 @@ import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.recipes.AnimalSpawnerRecipe; +import de.ellpeck.naturesaura.recipes.AnimalSpawnerRecipe; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.drawable.IDrawable; diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java index 814c4790..7a59232f 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java @@ -7,6 +7,7 @@ import de.ellpeck.naturesaura.blocks.ModBlocks; import de.ellpeck.naturesaura.items.ItemAuraBottle; import de.ellpeck.naturesaura.items.ItemEffectPowder; import de.ellpeck.naturesaura.items.ModItems; +import de.ellpeck.naturesaura.recipes.ModRecipes; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; import mezz.jei.api.helpers.IGuiHelper; @@ -15,7 +16,9 @@ import mezz.jei.api.registration.IRecipeCatalystRegistration; import mezz.jei.api.registration.IRecipeCategoryRegistration; import mezz.jei.api.registration.IRecipeRegistration; import mezz.jei.api.registration.ISubtypeRegistration; +import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.RecipeManager; import net.minecraft.util.ResourceLocation; @JeiPlugin @@ -68,9 +71,10 @@ public class JEINaturesAuraPlugin implements IModPlugin { @Override public void registerRecipes(IRecipeRegistration registration) { - registration.addRecipes(NaturesAuraAPI.TREE_RITUAL_RECIPES.values(), TREE_RITUAL); - registration.addRecipes(NaturesAuraAPI.ALTAR_RECIPES.values(), ALTAR); - registration.addRecipes(NaturesAuraAPI.OFFERING_RECIPES.values(), OFFERING); - registration.addRecipes(NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES.values(), SPAWNER); + RecipeManager manager = Minecraft.getInstance().world.getRecipeManager(); + registration.addRecipes(manager.getRecipes(ModRecipes.TREE_RITUAL_TYPE, null, null), TREE_RITUAL); + registration.addRecipes(manager.getRecipes(ModRecipes.ALTAR_TYPE, null, null), ALTAR); + registration.addRecipes(manager.getRecipes(ModRecipes.OFFERING_TYPE, null, null), OFFERING); + registration.addRecipes(manager.getRecipes(ModRecipes.ANIMAL_SPAWNER_TYPE, null, null), SPAWNER); } } diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/OfferingCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/OfferingCategory.java index 7a2942b4..f5a2e11c 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/OfferingCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/OfferingCategory.java @@ -2,7 +2,7 @@ package de.ellpeck.naturesaura.compat.jei; import com.google.common.collect.ImmutableList; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.recipes.OfferingRecipe; +import de.ellpeck.naturesaura.recipes.OfferingRecipe; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.drawable.IDrawable; diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java index a6d1c476..a3dd494f 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java @@ -2,7 +2,7 @@ package de.ellpeck.naturesaura.compat.jei; import com.google.common.collect.ImmutableList; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; +import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.drawable.IDrawable; diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java index 4bf2c7cd..01822e62 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java @@ -8,12 +8,20 @@ import de.ellpeck.naturesaura.api.multiblock.Matcher; import de.ellpeck.naturesaura.compat.ICompat; import de.ellpeck.naturesaura.data.ItemTagProvider; import de.ellpeck.naturesaura.events.ClientEvents; +import de.ellpeck.naturesaura.recipes.ModRecipe; +import de.ellpeck.naturesaura.recipes.ModRecipes; import de.ellpeck.naturesaura.renderers.SupporterFancyHandler; import de.ellpeck.naturesaura.renderers.SupporterFancyHandler.FancyInfo; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.AbstractGui; import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.item.crafting.RecipeManager; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; @@ -26,7 +34,9 @@ import vazkii.patchouli.api.PatchouliAPI; import java.time.LocalDateTime; import java.time.Month; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.Optional; public class PatchouliCompat implements ICompat { @@ -47,12 +57,11 @@ public class PatchouliCompat implements ICompat { DeferredWorkQueue.runLater(() -> PatchouliAPI.instance.registerMultiblock(name, PatchouliAPI.instance.makeMultiblock(pattern, rawMatchers))); } - public static T getRecipe(Map recipes, String name) { + public static > T getRecipe(String type, String name) { + RecipeManager manager = Minecraft.getInstance().world.getRecipeManager(); ResourceLocation res = new ResourceLocation(name); - T recipe = recipes.get(res); - if (recipe == null) - recipe = recipes.get(new ResourceLocation("crafttweaker", res.getPath())); - return recipe; + ResourceLocation pre = new ResourceLocation(res.getNamespace(), type + "/" + res.getPath()); + return (T) manager.getRecipe(pre).orElse(null); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java index 7e3eb515..5bf9affd 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java @@ -1,7 +1,7 @@ package de.ellpeck.naturesaura.compat.patchouli; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.AltarRecipe; +import de.ellpeck.naturesaura.recipes.AltarRecipe; import de.ellpeck.naturesaura.items.ItemAuraBottle; import de.ellpeck.naturesaura.items.ModItems; import net.minecraft.item.ItemStack; @@ -16,7 +16,7 @@ public class ProcessorAltar implements IComponentProcessor { @Override public void setup(IVariableProvider provider) { - this.recipe = PatchouliCompat.getRecipe(NaturesAuraAPI.ALTAR_RECIPES, provider.get("recipe")); + this.recipe = PatchouliCompat.getRecipe("altar", provider.get("recipe")); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAnimalSpawner.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAnimalSpawner.java index 8c52ca66..81a738dc 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAnimalSpawner.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAnimalSpawner.java @@ -1,7 +1,7 @@ package de.ellpeck.naturesaura.compat.patchouli; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.AnimalSpawnerRecipe; +import de.ellpeck.naturesaura.recipes.AnimalSpawnerRecipe; import net.minecraft.item.ItemStack; import net.minecraft.item.SpawnEggItem; import vazkii.patchouli.api.IComponentProcessor; @@ -14,7 +14,7 @@ public class ProcessorAnimalSpawner implements IComponentProcessor { @Override public void setup(IVariableProvider provider) { - this.recipe = PatchouliCompat.getRecipe(NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES, provider.get("recipe")); + this.recipe = PatchouliCompat.getRecipe("animal_spawner", provider.get("recipe")); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorOffering.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorOffering.java index a7fe4ae6..45ee9fe8 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorOffering.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorOffering.java @@ -1,7 +1,7 @@ package de.ellpeck.naturesaura.compat.patchouli; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.OfferingRecipe; +import de.ellpeck.naturesaura.recipes.OfferingRecipe; import vazkii.patchouli.api.IComponentProcessor; import vazkii.patchouli.api.IVariableProvider; import vazkii.patchouli.api.PatchouliAPI; @@ -12,7 +12,7 @@ public class ProcessorOffering implements IComponentProcessor { @Override public void setup(IVariableProvider provider) { - this.recipe = PatchouliCompat.getRecipe(NaturesAuraAPI.OFFERING_RECIPES, provider.get("recipe")); + this.recipe = PatchouliCompat.getRecipe("offering", provider.get("recipe")); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java index 9276c6d2..a658f273 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java @@ -1,7 +1,7 @@ package de.ellpeck.naturesaura.compat.patchouli; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; +import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import vazkii.patchouli.api.IComponentProcessor; import vazkii.patchouli.api.IVariableProvider; import vazkii.patchouli.api.PatchouliAPI; @@ -12,7 +12,7 @@ public class ProcessorTreeRitual implements IComponentProcessor { @Override public void setup(IVariableProvider provider) { - this.recipe = PatchouliCompat.getRecipe(NaturesAuraAPI.TREE_RITUAL_RECIPES, provider.get("recipe")); + this.recipe = PatchouliCompat.getRecipe("tree_ritual", provider.get("recipe")); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java b/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java index f81fdd5a..9931b957 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java @@ -136,9 +136,4 @@ public class CommonEvents { public void onServerStarting(FMLServerStartingEvent event) { CommandAura.register(event.getCommandDispatcher()); } - - @SubscribeEvent - public void onServerAboutToStart(FMLServerAboutToStartEvent event) { - event.getServer().getResourceManager().addReloadListener(new ModRecipes()); - } } diff --git a/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java b/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java index 53a337a6..37015431 100644 --- a/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java @@ -45,9 +45,6 @@ public class ClientProxy implements IProxy { Compat.setupClient(); ScreenManager.registerFactory(ModContainers.ENDER_CRATE, GuiEnderCrate::new); ScreenManager.registerFactory(ModContainers.ENDER_ACCESS, GuiEnderCrate::new); - - IResourceManager manager = Minecraft.getInstance().getResourceManager(); - ((IReloadableResourceManager) manager).addReloadListener(new ModRecipes()); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java new file mode 100644 index 00000000..403be484 --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java @@ -0,0 +1,89 @@ +package de.ellpeck.naturesaura.recipes; + +import com.google.gson.JsonObject; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; +import net.minecraft.data.IFinishedRecipe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.crafting.CraftingHelper; +import net.minecraftforge.registries.ForgeRegistryEntry; + +import javax.annotation.Nullable; + +public class AltarRecipe extends ModRecipe { + + public final Ingredient input; + public final ItemStack output; + public final IAuraType requiredType; + public final Ingredient catalyst; + public final int aura; + public final int time; + + public AltarRecipe(ResourceLocation name, Ingredient input, ItemStack output, IAuraType requiredType, Ingredient catalyst, int aura, int time) { + super(name); + this.input = input; + this.output = output; + this.requiredType = requiredType; + this.catalyst = catalyst; + this.aura = aura; + this.time = time; + } + + @Override + public ItemStack getRecipeOutput() { + return this.output; + } + + @Override + public IRecipeSerializer getSerializer() { + return ModRecipes.ALTAR_SERIAIZER; + } + + @Override + public IRecipeType getType() { + return ModRecipes.ALTAR_TYPE; + } + + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { + + @Override + public AltarRecipe read(ResourceLocation recipeId, JsonObject json) { + return new AltarRecipe( + recipeId, + Ingredient.deserialize(json.getAsJsonObject("input")), + CraftingHelper.getItemStack(json.getAsJsonObject("output"), true), + NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(json.get("aura_type").getAsString())), + json.has("catalyst") ? Ingredient.deserialize(json.getAsJsonObject("catalyst")) : Ingredient.EMPTY, + json.get("aura").getAsInt(), + json.get("time").getAsInt()); + } + + @Nullable + @Override + public AltarRecipe read(ResourceLocation recipeId, PacketBuffer buffer) { + return new AltarRecipe( + recipeId, + Ingredient.read(buffer), + buffer.readItemStack(), + NaturesAuraAPI.AURA_TYPES.get(buffer.readResourceLocation()), + Ingredient.read(buffer), + buffer.readInt(), + buffer.readInt()); + } + + @Override + public void write(PacketBuffer buffer, AltarRecipe recipe) { + recipe.input.write(buffer); + buffer.writeItemStack(recipe.output); + buffer.writeResourceLocation(recipe.requiredType.getName()); + recipe.catalyst.write(buffer); + buffer.writeInt(recipe.aura); + buffer.writeInt(recipe.time); + } + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/AnimalSpawnerRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/AnimalSpawnerRecipe.java new file mode 100644 index 00000000..e8b35d3e --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/recipes/AnimalSpawnerRecipe.java @@ -0,0 +1,106 @@ +package de.ellpeck.naturesaura.recipes; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.ForgeRegistryEntry; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +public class AnimalSpawnerRecipe extends ModRecipe { + + public final Ingredient[] ingredients; + public final EntityType entity; + public final int aura; + public final int time; + + public AnimalSpawnerRecipe(ResourceLocation name, EntityType entity, int aura, int time, Ingredient... ingredients) { + super(name); + this.ingredients = ingredients; + this.entity = entity; + this.aura = aura; + this.time = time; + } + + public Entity makeEntity(World world, double x, double y, double z) { + Entity entity = this.entity.create(world); + if (x == 0 && y == 0 && z == 0) + return entity; + entity.setLocationAndAngles(x, y, z, MathHelper.wrapDegrees(world.rand.nextFloat() * 360F), 0F); + if (entity instanceof MobEntity) { + MobEntity living = (MobEntity) entity; + living.rotationYawHead = entity.rotationYaw; + living.renderYawOffset = entity.rotationYaw; + living.onInitialSpawn(world, world.getDifficultyForLocation(living.getPosition()), SpawnReason.SPAWNER, null, null); + } + return entity; + } + + @Override + public ItemStack getRecipeOutput() { + return ItemStack.EMPTY; + } + + @Override + public IRecipeSerializer getSerializer() { + return ModRecipes.ANIMAL_SPAWNER_SERIALIZER; + } + + @Override + public IRecipeType getType() { + return ModRecipes.ANIMAL_SPAWNER_TYPE; + } + + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { + @Override + public AnimalSpawnerRecipe read(ResourceLocation recipeId, JsonObject json) { + List ingredients = new ArrayList<>(); + for (JsonElement e : json.getAsJsonArray("ingredients")) + ingredients.add(Ingredient.deserialize(e)); + return new AnimalSpawnerRecipe(recipeId, + ForgeRegistries.ENTITIES.getValue(new ResourceLocation(json.get("entity").getAsString())), + json.get("aura").getAsInt(), + json.get("time").getAsInt(), + ingredients.toArray(new Ingredient[0])); + } + + @Nullable + @Override + public AnimalSpawnerRecipe read(ResourceLocation recipeId, PacketBuffer buffer) { + Ingredient[] ings = new Ingredient[buffer.readInt()]; + for (int i = 0; i < ings.length; i++) + ings[i] = Ingredient.read(buffer); + return new AnimalSpawnerRecipe( + recipeId, + ForgeRegistries.ENTITIES.getValue(buffer.readResourceLocation()), + buffer.readInt(), + buffer.readInt(), + ings); + } + + @Override + public void write(PacketBuffer buffer, AnimalSpawnerRecipe recipe) { + buffer.writeInt(recipe.ingredients.length); + for (Ingredient ing : recipe.ingredients) + ing.write(buffer); + buffer.writeResourceLocation(recipe.entity.getRegistryName()); + buffer.writeInt(recipe.aura); + buffer.writeInt(recipe.time); + } + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipe.java new file mode 100644 index 00000000..4b1a0b3c --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipe.java @@ -0,0 +1,40 @@ +package de.ellpeck.naturesaura.recipes; + +import com.google.gson.JsonObject; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.items.wrapper.RecipeWrapper; + +public abstract class ModRecipe implements IRecipe { + + public final ResourceLocation name; + + public ModRecipe(ResourceLocation name) { + this.name = name; + } + + @Override + public boolean matches(RecipeWrapper inv, World worldIn) { + // return true here so that we can easily get all recipes of a type from the recipe manager + return true; + } + + @Override + public ItemStack getCraftingResult(RecipeWrapper inv) { + return ItemStack.EMPTY; + } + + @Override + public boolean canFit(int width, int height) { + return false; + } + + @Override + public ResourceLocation getId() { + return this.name; + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java index 632fa018..ecdce979 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java @@ -1,241 +1,52 @@ package de.ellpeck.naturesaura.recipes; +import com.google.gson.JsonObject; +import com.mojang.datafixers.Dynamic; +import com.mojang.datafixers.types.JsonOps; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.recipes.*; -import de.ellpeck.naturesaura.api.recipes.ing.AmountIngredient; -import de.ellpeck.naturesaura.api.recipes.ing.NBTIngredient; -import de.ellpeck.naturesaura.blocks.ModBlocks; -import de.ellpeck.naturesaura.chunk.effect.*; -import de.ellpeck.naturesaura.items.ItemAuraBottle; -import de.ellpeck.naturesaura.items.ItemEffectPowder; -import de.ellpeck.naturesaura.items.ModItems; -import de.ellpeck.naturesaura.misc.ColoredBlockHelper; -import net.minecraft.block.Block; +import de.ellpeck.naturesaura.api.misc.WeightedOre; import net.minecraft.block.Blocks; -import net.minecraft.block.FlowerBlock; import net.minecraft.client.resources.ReloadListener; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; -import net.minecraft.entity.passive.SheepEntity; -import net.minecraft.item.DyeColor; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.potion.PotionUtils; -import net.minecraft.potion.Potions; -import net.minecraft.profiler.IProfiler; -import net.minecraft.resources.IResourceManager; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.INBT; +import net.minecraft.nbt.NBTDynamicOps; import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; +import net.minecraft.util.registry.Registry; import net.minecraftforge.common.Tags; -import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.registries.IForgeRegistry; import java.util.Arrays; import java.util.List; -public class ModRecipes extends ReloadListener { +public final class ModRecipes { - private void init() { - // Clear all registries first - NaturesAuraAPI.TREE_RITUAL_RECIPES.clear(); - NaturesAuraAPI.ALTAR_RECIPES.clear(); - NaturesAuraAPI.OFFERING_RECIPES.clear(); - NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.clear(); - NaturesAuraAPI.FLOWERS.clear(); - NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES.clear(); - NaturesAuraAPI.OVERWORLD_ORES.clear(); - NaturesAuraAPI.NETHER_ORES.clear(); - NaturesAuraAPI.PROJECTILE_GENERATIONS.clear(); + public static final IRecipeType ALTAR_TYPE = new RecipeType<>(); + public static final IRecipeSerializer ALTAR_SERIAIZER = new AltarRecipe.Serializer(); - new TreeRitualRecipe(res("eye"), - ing(new ItemStack(Blocks.OAK_SAPLING)), new ItemStack(ModItems.EYE), 250, - ing(Items.SPIDER_EYE), - ing(Items.GOLD_INGOT), - ing(ModItems.GOLD_LEAF), - ing(ModItems.GOLD_LEAF)).register(); - new TreeRitualRecipe(res("eye_improved"), - ing(new ItemStack(Blocks.OAK_SAPLING)), new ItemStack(ModItems.EYE_IMPROVED), 500, - ing(ModItems.EYE), - ing(ModItems.SKY_INGOT), - ing(ModItems.SKY_INGOT), - ing(ModBlocks.END_FLOWER), - ing(ModItems.GOLD_LEAF), - ing(ModItems.GOLD_LEAF)).register(); - new TreeRitualRecipe(res("nature_altar"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModBlocks.NATURE_ALTAR), 500, - ing(Blocks.STONE), - ing(Blocks.STONE), - ing(Blocks.STONE), - ing(ModItems.GOLD_LEAF), - ing(Items.GOLD_INGOT), - ing(ModItems.TOKEN_JOY)).register(); - new TreeRitualRecipe(res("ancient_sapling"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModBlocks.ANCIENT_SAPLING), 200, - ing(Blocks.OAK_SAPLING), - ing(Blocks.DANDELION), - ing(Blocks.POPPY), - ing(Items.WHEAT_SEEDS), - ing(Items.SUGAR_CANE), - ing(ModItems.GOLD_LEAF)).register(); - new TreeRitualRecipe(res("furnace_heater"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModBlocks.FURNACE_HEATER), 600, - ing(ModBlocks.INFUSED_STONE), - ing(ModBlocks.INFUSED_STONE), - ing(ModItems.TAINTED_GOLD), - ing(ModItems.INFUSED_IRON), - ing(Items.FIRE_CHARGE), - ing(Items.FLINT), - ing(Blocks.MAGMA_BLOCK), - ing(ModItems.TOKEN_FEAR)).register(); - new TreeRitualRecipe(res("conversion_catalyst"), - ing(Blocks.JUNGLE_SAPLING), new ItemStack(ModBlocks.CONVERSION_CATALYST), 600, - ing(ModBlocks.GOLD_BRICK), - ing(ModBlocks.INFUSED_STONE), - ing(Items.BREWING_STAND), - ing(ModItems.SKY_INGOT), - ing(ModItems.GOLD_LEAF), - ing(Blocks.GLOWSTONE)).register(); - new TreeRitualRecipe(res("crushing_catalyst"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModBlocks.CRUSHING_CATALYST), 600, - ing(ModBlocks.GOLD_BRICK), - ing(ModBlocks.INFUSED_STONE), - ing(Blocks.PISTON), - ing(Items.FLINT), - ing(ModItems.TOKEN_ANGER)).register(); - new TreeRitualRecipe(res("plant_powder"), - ing(new ItemStack(Blocks.OAK_SAPLING)), - ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 24), PlantBoostEffect.NAME), 400, - ing(ModBlocks.GOLD_POWDER), - ing(ModBlocks.GOLD_POWDER), - ing(ModItems.SKY_INGOT), - ing(Items.WHEAT)).register(); - new TreeRitualRecipe(res("cache_powder"), - ing(new ItemStack(Blocks.OAK_SAPLING)), - ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 32), CacheRechargeEffect.NAME), 400, - ing(ModBlocks.GOLD_POWDER), - ing(ModBlocks.GOLD_POWDER), - ing(ModItems.SKY_INGOT), - ing(ModItems.AURA_CACHE)).register(); - new TreeRitualRecipe(res("animal_powder"), - ing(Blocks.JUNGLE_SAPLING), - ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 8), AnimalEffect.NAME), 400, - ing(ModBlocks.GOLD_POWDER), - ing(ModBlocks.GOLD_POWDER), - ing(ModItems.SKY_INGOT), - ing(Items.EGG)).register(); - new TreeRitualRecipe(res("ore_spawn_powder"), - ing(Blocks.OAK_SAPLING), - ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 4), OreSpawnEffect.NAME), 400, - ing(ModBlocks.GOLD_POWDER), - ing(ModBlocks.GOLD_POWDER), - ing(Blocks.DIAMOND_ORE), - ing(Blocks.REDSTONE_ORE)).register(); - new TreeRitualRecipe(res("nether_grass_powder"), - ing(Blocks.OAK_SAPLING), - ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 24), NetherGrassEffect.NAME), 400, - ing(ModBlocks.GOLD_POWDER), - ing(ModBlocks.GOLD_POWDER), - ing(Blocks.NETHERRACK), - ing(Blocks.GRASS)).register(); - new TreeRitualRecipe(res("token_joy"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModItems.TOKEN_JOY, 2), 200, - nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)), - ing(ModItems.GOLD_LEAF), - ing(ItemTags.SMALL_FLOWERS), - ing(Items.APPLE), - ing(Blocks.TORCH), - ing(Items.IRON_INGOT)).register(); - new TreeRitualRecipe(res("token_anger"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModItems.TOKEN_ANGER, 2), 200, - nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)), - ing(ModItems.GOLD_LEAF), - ing(Blocks.MAGMA_BLOCK), - ing(Items.BLAZE_POWDER), - ing(Items.GUNPOWDER), - ing(Items.ENDER_PEARL)).register(); - new TreeRitualRecipe(res("token_sorrow"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModItems.TOKEN_SORROW, 2), 200, - nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)), - ing(ModItems.GOLD_LEAF), - ing(Items.GHAST_TEAR), - ing(Items.BEEF, Items.MUTTON, Items.CHICKEN, Items.PORKCHOP), - ing(Blocks.GLASS), - ing(ItemTags.FISHES)).register(); - new TreeRitualRecipe(res("token_fear"), - ing(Blocks.OAK_SAPLING), new ItemStack(ModItems.TOKEN_FEAR, 2), 200, - nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)), - ing(ModItems.GOLD_LEAF), - ing(Items.ROTTEN_FLESH), - ing(Items.FEATHER), - ing(Items.BONE), - ing(Blocks.SOUL_SAND)).register(); + public static final IRecipeType ANIMAL_SPAWNER_TYPE = new RecipeType<>(); + public static final IRecipeSerializer ANIMAL_SPAWNER_SERIALIZER = new AnimalSpawnerRecipe.Serializer(); - new AltarRecipe(res("infused_iron"), - ing(Items.IRON_INGOT), new ItemStack(ModItems.INFUSED_IRON), - NaturesAuraAPI.TYPE_OVERWORLD, Ingredient.EMPTY, 15000, 80).register(); - new AltarRecipe(res("infused_iron_block"), - ing(Blocks.IRON_BLOCK), new ItemStack(ModBlocks.INFUSED_IRON_BLOCK), - NaturesAuraAPI.TYPE_OVERWORLD, Ingredient.EMPTY, 135000, 700).register(); - new AltarRecipe(res("tainted_gold"), - ing(Items.GOLD_INGOT), new ItemStack(ModItems.TAINTED_GOLD), - NaturesAuraAPI.TYPE_NETHER, Ingredient.EMPTY, 15000, 80).register(); - new AltarRecipe(res("tainted_gold_block"), - ing(Blocks.GOLD_BLOCK), new ItemStack(ModBlocks.TAINTED_GOLD_BLOCK), - NaturesAuraAPI.TYPE_NETHER, Ingredient.EMPTY, 135000, 700).register(); - new AltarRecipe(res("infused_stone"), - ing(Blocks.STONE), new ItemStack(ModBlocks.INFUSED_STONE), - NaturesAuraAPI.TYPE_OVERWORLD, Ingredient.EMPTY, 7500, 40).register(); + public static final IRecipeType OFFERING_TYPE = new RecipeType<>(); + public static final IRecipeSerializer OFFERING_SERIALIZER = new OfferingRecipe.Serializer(); - Ingredient conversion = ing(ModBlocks.CONVERSION_CATALYST); - new AltarRecipe(res("breath"), nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_END)), new ItemStack(Items.DRAGON_BREATH), NaturesAuraAPI.TYPE_NETHER, conversion, 20000, 80).register(); - new AltarRecipe(res("leather"), ing(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), NaturesAuraAPI.TYPE_OVERWORLD, conversion, 10000, 50).register(); - new AltarRecipe(res("soul_sand"), ing(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), NaturesAuraAPI.TYPE_NETHER, conversion, 5000, 100).register(); - new AltarRecipe(res("nether_wart"), ing(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), NaturesAuraAPI.TYPE_NETHER, conversion, 30000, 250).register(); - new AltarRecipe(res("prismarine"), ing(Items.QUARTZ), new ItemStack(Items.PRISMARINE_SHARD), NaturesAuraAPI.TYPE_NETHER, conversion, 55000, 200).register(); - new AltarRecipe(res("water"), ing(Items.GLASS_BOTTLE), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER), NaturesAuraAPI.TYPE_OVERWORLD, conversion, 25000, 200).register(); - new AltarRecipe(res("coal"), ing(Items.CHARCOAL), new ItemStack(Items.COAL), NaturesAuraAPI.TYPE_OVERWORLD, conversion, 30000, 250).register(); + public static final IRecipeType TREE_RITUAL_TYPE = new RecipeType<>(); + public static final IRecipeSerializer TREE_RITUAL_SERIALIZER = new TreeRitualRecipe.Serializer(); - Ingredient crushing = ing(ModBlocks.CRUSHING_CATALYST); - new AltarRecipe(res("bone"), ing(Items.BONE), new ItemStack(Items.BONE_MEAL, 6), NaturesAuraAPI.TYPE_OVERWORLD, crushing, 3000, 40).register(); - new AltarRecipe(res("sugar"), ing(Items.SUGAR_CANE), new ItemStack(Items.SUGAR, 3), NaturesAuraAPI.TYPE_OVERWORLD, crushing, 3000, 40).register(); - new AltarRecipe(res("blaze"), ing(Items.BLAZE_ROD), new ItemStack(Items.BLAZE_POWDER, 4), NaturesAuraAPI.TYPE_NETHER, crushing, 5000, 60).register(); - new AltarRecipe(res("glowstone"), ing(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4), NaturesAuraAPI.TYPE_NETHER, crushing, 3000, 40).register(); - new AltarRecipe(res("sand"), ing(Blocks.COBBLESTONE), new ItemStack(Blocks.SAND), NaturesAuraAPI.TYPE_OVERWORLD, crushing, 3000, 40).register(); - - new OfferingRecipe(res("sky_ingot"), - amountIng(new ItemStack(ModItems.INFUSED_IRON, 3)), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.SKY_INGOT)).register(); - new OfferingRecipe(res("sky_ingot_from_gold"), - ing(ModItems.TAINTED_GOLD), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.SKY_INGOT)).register(); - new OfferingRecipe(res("clock_hand"), - ing(Items.NETHER_STAR), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.CLOCK_HAND)).register(); - new OfferingRecipe(res("token_euphoria"), - ing(ModItems.TOKEN_JOY), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.TOKEN_EUPHORIA)).register(); - new OfferingRecipe(res("token_rage"), - ing(ModItems.TOKEN_ANGER), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.TOKEN_RAGE)).register(); - new OfferingRecipe(res("token_grief"), - ing(ModItems.TOKEN_SORROW), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.TOKEN_GRIEF)).register(); - new OfferingRecipe(res("token_terror"), - ing(ModItems.TOKEN_FEAR), - ing(ModItems.CALLING_SPIRIT), - new ItemStack(ModItems.TOKEN_TERROR)).register(); + public static void register(IForgeRegistry> registry) { + register(registry, "altar", ALTAR_TYPE, ALTAR_SERIAIZER); + register(registry, "animal_spawner", ANIMAL_SPAWNER_TYPE, ANIMAL_SPAWNER_SERIALIZER); + register(registry, "offering", OFFERING_TYPE, OFFERING_SERIALIZER); + register(registry, "tree_ritual", TREE_RITUAL_TYPE, TREE_RITUAL_SERIALIZER); + } + public static void init() { NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.put( Blocks.COBBLESTONE.getDefaultState(), Blocks.MOSSY_COBBLESTONE.getDefaultState()); @@ -249,106 +60,49 @@ public class ModRecipes extends ReloadListener { Blocks.STONE_BRICK_WALL.getDefaultState(), Blocks.MOSSY_STONE_BRICK_WALL.getDefaultState()); - for (Block block : ForgeRegistries.BLOCKS) - if (block instanceof FlowerBlock) - NaturesAuraAPI.FLOWERS.addAll(block.getStateContainer().getValidStates()); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/coal", 5000); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/iron", 3000); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/gold", 500); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/diamond", 50); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/lapis", 250); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/redstone", 200); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/emerald", 30); + ore(NaturesAuraAPI.NETHER_ORES, "ores/quartz", 3000); - for (DyeColor color : DyeColor.values()) - new AnimalSpawnerRecipe(res("sheep_" + color.getName()), EntityType.SHEEP, - 500, 60, ing(ModItems.BIRTH_SPIRIT), ing(Items.MUTTON), - ing(ColoredBlockHelper.WOOL.get(color.getId()))) { - @Override - public Entity makeEntity(World world, double x, double y, double z) { - SheepEntity sheep = (SheepEntity) super.makeEntity(world, x, y, z); - sheep.setFleeceColor(color); - return sheep; - } - }.register(); - spawner("cow", EntityType.COW, 50000, 60, ing(Items.BEEF), ing(Items.LEATHER)); - spawner("chicken", EntityType.CHICKEN, 30000, 40, ing(Items.FEATHER), ing(Items.EGG)); - spawner("pig", EntityType.PIG, 50000, 60, ing(Items.PORKCHOP)); - spawner("blaze", EntityType.BLAZE, 150000, 120, ing(Items.BLAZE_ROD), ing(Items.BLAZE_POWDER)); - spawner("ghast", EntityType.GHAST, 120000, 150, ing(Items.GUNPOWDER), ing(Items.GHAST_TEAR)); - spawner("ocelot", EntityType.OCELOT, 80000, 60, ing(ItemTags.FISHES), ing(ItemTags.WOOL)); - spawner("mule", EntityType.MULE, 100000, 100, ing(Items.LEATHER), ing(Blocks.CHEST), ing(Items.APPLE)); - spawner("bat", EntityType.BAT, 30000, 40, ing(Items.FEATHER)); - spawner("endermite", EntityType.ENDERMITE, 30000, 40, ing(Items.ENDER_PEARL), ing(Blocks.STONE)); - spawner("parrot", EntityType.PARROT, 50000, 60, ing(Items.FEATHER), ing(Items.COOKIE)); - spawner("slime", EntityType.SLIME, 30000, 40, ing(Items.SLIME_BALL)); - spawner("spider", EntityType.SPIDER, 100000, 120, ing(Items.STRING), ing(Items.SPIDER_EYE)); - spawner("skeleton", EntityType.SKELETON, 100000, 120, ing(Items.BONE), ing(Items.ARROW)); - spawner("enderman", EntityType.ENDERMAN, 120000, 120, ing(Items.ENDER_PEARL)); - spawner("silverfish", EntityType.SILVERFISH, 30000, 40, ing(Blocks.STONE)); - spawner("squid", EntityType.SQUID, 50000, 40, ing(Items.INK_SAC)); - spawner("stray", EntityType.STRAY, 100000, 120, ing(Items.BONE), ing(Blocks.ICE)); - spawner("shulker", EntityType.SHULKER, 150000, 100, ing(Items.SHULKER_SHELL)); - spawner("husk", EntityType.HUSK, 100000, 120, ing(Items.ROTTEN_FLESH), ing(Blocks.SAND)); - spawner("llama", EntityType.LLAMA, 60000, 80, ing(ItemTags.WOOL)); - spawner("rabbit", EntityType.RABBIT, 30000, 40, ing(Items.RABBIT_HIDE)); - spawner("magma_cube", EntityType.MAGMA_CUBE, 100000, 100, ing(Items.MAGMA_CREAM)); - spawner("zombie_pigman", EntityType.ZOMBIE_PIGMAN, 120000, 150, ing(Items.ROTTEN_FLESH), ing(Items.GOLD_NUGGET)); - spawner("polar_bear", EntityType.POLAR_BEAR, 50000, 60, ing(Items.COD), ing(Blocks.ICE)); - spawner("mooshroom", EntityType.MOOSHROOM, 40000, 60, ing(Items.LEATHER), ing(Blocks.RED_MUSHROOM)); - spawner("guardian", EntityType.GUARDIAN, 150000, 150, ing(Items.PRISMARINE_SHARD), ing(Items.PRISMARINE_CRYSTALS)); - spawner("horse", EntityType.HORSE, 100000, 100, ing(Items.LEATHER)); - spawner("donkey", EntityType.DONKEY, 100000, 100, ing(Items.LEATHER), ing(Blocks.CHEST)); - spawner("cave_spider", EntityType.CAVE_SPIDER, 100000, 120, ing(Items.STRING), ing(Items.FERMENTED_SPIDER_EYE)); - spawner("creeper", EntityType.CREEPER, 100000, 120, ing(Items.GUNPOWDER)); - spawner("witch", EntityType.WITCH, 150000, 150, ing(Items.GLASS_BOTTLE), ing(Items.GLOWSTONE_DUST)); - spawner("wither_skeleton", EntityType.WITHER_SKELETON, 150000, 150, ing(Items.BONE), ing(Blocks.OBSIDIAN)); - spawner("wolf", EntityType.WOLF, 50000, 60, ing(Items.LEATHER), ing(Items.BONE)); - spawner("zombie", EntityType.ZOMBIE, 100000, 100, ing(Items.ROTTEN_FLESH)); - spawner("bee", EntityType.BEE, 50000, 100, ing(Items.HONEYCOMB), ing(Items.HONEY_BLOCK)); - spawner("dolphin", EntityType.DOLPHIN, 100000, 150, ing(ItemTags.FISHES), ing(Items.MAP)); - spawner("fox", EntityType.FOX, 30000, 100, ing(Items.SWEET_BERRIES), ing(Items.FEATHER)); - spawner("panda", EntityType.PANDA, 100000, 100, ing(Items.BAMBOO), ing(Blocks.BAMBOO_SAPLING)); - spawner("turtle", EntityType.TURTLE, 100000, 150, ing(Items.SCUTE), ing(Items.SEAGRASS)); - spawner("phantom", EntityType.PHANTOM, 200000, 200, ing(Items.PHANTOM_MEMBRANE)); - spawner("cat", EntityType.CAT, 50000, 100, ing(Items.STRING), ing(ItemTags.WOOL)); - - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_COAL, 5000)); - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_IRON, 3000)); - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_GOLD, 500)); - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_DIAMOND, 50)); - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_LAPIS, 250)); - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_REDSTONE, 200)); - NaturesAuraAPI.OVERWORLD_ORES.add(new WeightedOre(Tags.Blocks.ORES_EMERALD, 30)); - NaturesAuraAPI.NETHER_ORES.add(new WeightedOre(Tags.Blocks.ORES_QUARTZ, 3000)); - - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/copper", 2000); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/nether/copper", 2000); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/tin", 1800); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/nether/tin", 1800); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/lead", 1500); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/nether/lead", 1500); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/silver", 1000); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/nether/silver", 1000); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/nickel", 100); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/nether/nickel", 100); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/platinum", 20); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/nether/platinum", 20); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/aluminum", 1200); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/aluminium", 1200); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/osmium", 1500); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/zinc", 1000); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/yellorite", 1200); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/uranium", 400); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/apatite", 700); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/ruby", 40); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/peridot", 40); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/topaz", 40); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/tanzanite", 40); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/malachite", 40); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/sapphire", 40); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/amber", 150); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/resonating", 50); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/sulfur", 3000); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/saltpeter", 250); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/firestone", 30); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/salt", 2900); - foreignOre(NaturesAuraAPI.OVERWORLD_ORES, "ores/draconium", 5); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/cobalt", 50); - foreignOre(NaturesAuraAPI.NETHER_ORES, "ores/ardite", 50); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/copper", 2000); + ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/copper", 2000); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/tin", 1800); + ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/tin", 1800); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/lead", 1500); + ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/lead", 1500); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/silver", 1000); + ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/silver", 1000); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/nickel", 100); + ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/nickel", 100); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/platinum", 20); + ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/platinum", 20); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/aluminum", 1200); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/aluminium", 1200); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/osmium", 1500); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/zinc", 1000); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/yellorite", 1200); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/uranium", 400); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/apatite", 700); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/ruby", 40); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/peridot", 40); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/topaz", 40); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/tanzanite", 40); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/malachite", 40); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/sapphire", 40); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/amber", 150); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/resonating", 50); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/sulfur", 3000); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/saltpeter", 250); + ore(NaturesAuraAPI.NETHER_ORES, "ores/firestone", 30); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/salt", 2900); + ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/draconium", 5); + ore(NaturesAuraAPI.NETHER_ORES, "ores/cobalt", 50); + ore(NaturesAuraAPI.NETHER_ORES, "ores/ardite", 50); NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.EGG, 2500); NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.SNOWBALL, 3500); @@ -362,57 +116,42 @@ public class ModRecipes extends ReloadListener { NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.TRIDENT, 3000000); } - private static void spawner(String name, EntityType entity, int aura, int time, Ingredient... ings) { - Ingredient[] actualIngs = new Ingredient[ings.length + 1]; - actualIngs[0] = ing(ModItems.BIRTH_SPIRIT); - System.arraycopy(ings, 0, actualIngs, 1, ings.length); - new AnimalSpawnerRecipe(res(name), entity, aura, time, actualIngs).register(); - } - - private static void foreignOre(List list, String name, int weight) { + private static void ore(List list, String name, int weight) { ResourceLocation res = new ResourceLocation("forge", name); - Tag tag = BlockTags.getCollection().get(res); - if (tag == null) - return; - list.add(new WeightedOre(tag, weight)); + list.add(new WeightedOre(res, weight)); } - private static Ingredient ing(Block... blocks) { - return ing(Arrays.stream(blocks).map(ItemStack::new).toArray(ItemStack[]::new)); + private static void register(IForgeRegistry> registry, String name, IRecipeType type, IRecipeSerializer serializer) { + ResourceLocation res = new ResourceLocation(NaturesAura.MOD_ID, name); + Registry.register(Registry.RECIPE_TYPE, res, type); + registry.register(serializer.setRegistryName(res)); } - private static Ingredient ing(Item... items) { - return ing(Arrays.stream(items).map(ItemStack::new).toArray(ItemStack[]::new)); + public static JsonObject serializeStack(ItemStack stack) { + CompoundNBT nbt = stack.write(new CompoundNBT()); + byte c = nbt.getByte("Count"); + if (c != 1) { + nbt.putByte("count", c); + } + nbt.remove("Count"); + renameTag(nbt, "id", "item"); + renameTag(nbt, "tag", "nbt"); + Dynamic dyn = new Dynamic<>(NBTDynamicOps.INSTANCE, nbt); + return dyn.convert(JsonOps.INSTANCE).getValue().getAsJsonObject(); } - private static Ingredient ing(ItemStack... stacks) { - return Ingredient.fromStacks(stacks); + private static void renameTag(CompoundNBT nbt, String oldName, String newName) { + INBT tag = nbt.get(oldName); + if (tag != null) { + nbt.remove(oldName); + nbt.put(newName, tag); + } } - private static Ingredient ing(Tag tag) { - return Ingredient.fromTag(tag); - } - - private static Ingredient nbtIng(ItemStack stack) { - return new NBTIngredient(stack); - } - - private static Ingredient amountIng(ItemStack stack) { - return new AmountIngredient(stack); - } - - private static ResourceLocation res(String name) { - return new ResourceLocation(NaturesAura.MOD_ID, name); - } - - @Override - protected Object prepare(IResourceManager resourceManagerIn, IProfiler profilerIn) { - return null; - } - - @Override - protected void apply(Object splashList, IResourceManager resourceManagerIn, IProfiler profilerIn) { - NaturesAura.LOGGER.info("Loading recipes"); - this.init(); + private static class RecipeType> implements IRecipeType { + @Override + public String toString() { + return Registry.RECIPE_TYPE.getKey(this).toString(); + } } } diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java new file mode 100644 index 00000000..059245b2 --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java @@ -0,0 +1,70 @@ +package de.ellpeck.naturesaura.recipes; + +import com.google.gson.JsonObject; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.crafting.CraftingHelper; +import net.minecraftforge.registries.ForgeRegistryEntry; + +import javax.annotation.Nullable; + +public class OfferingRecipe extends ModRecipe { + + public final Ingredient input; + public final Ingredient startItem; + public final ItemStack output; + + public OfferingRecipe(ResourceLocation name, Ingredient input, Ingredient startItem, ItemStack output) { + super(name); + this.input = input; + this.startItem = startItem; + this.output = output; + } + + @Override + public ItemStack getRecipeOutput() { + return this.output; + } + + @Override + public IRecipeSerializer getSerializer() { + return ModRecipes.OFFERING_SERIALIZER; + } + + @Override + public IRecipeType getType() { + return ModRecipes.OFFERING_TYPE; + } + + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { + @Override + public OfferingRecipe read(ResourceLocation recipeId, JsonObject json) { + return new OfferingRecipe( + recipeId, + Ingredient.deserialize(json.get("input")), + Ingredient.deserialize(json.get("start_item")), + CraftingHelper.getItemStack(json.getAsJsonObject("output"), true)); + } + + @Nullable + @Override + public OfferingRecipe read(ResourceLocation recipeId, PacketBuffer buffer) { + return new OfferingRecipe( + recipeId, + Ingredient.read(buffer), + Ingredient.read(buffer), + buffer.readItemStack()); + } + + @Override + public void write(PacketBuffer buffer, OfferingRecipe recipe) { + recipe.input.write(buffer); + recipe.startItem.write(buffer); + buffer.writeItemStack(recipe.output); + } + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java new file mode 100644 index 00000000..0583e808 --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java @@ -0,0 +1,87 @@ +package de.ellpeck.naturesaura.recipes; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.IRecipeType; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.crafting.CraftingHelper; +import net.minecraftforge.registries.ForgeRegistryEntry; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +public class TreeRitualRecipe extends ModRecipe { + + public final Ingredient saplingType; + public final Ingredient[] ingredients; + public final ItemStack result; + public final int time; + + public TreeRitualRecipe(ResourceLocation name, Ingredient saplingType, ItemStack result, int time, Ingredient... ingredients) { + super(name); + this.saplingType = saplingType; + this.ingredients = ingredients; + this.result = result; + this.time = time; + } + + @Override + public ItemStack getRecipeOutput() { + return this.result; + } + + @Override + public IRecipeSerializer getSerializer() { + return ModRecipes.TREE_RITUAL_SERIALIZER; + } + + @Override + public IRecipeType getType() { + return ModRecipes.TREE_RITUAL_TYPE; + } + + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { + @Override + public TreeRitualRecipe read(ResourceLocation recipeId, JsonObject json) { + List ings = new ArrayList<>(); + for (JsonElement element : json.getAsJsonArray("ingredients")) + ings.add(Ingredient.deserialize(element)); + return new TreeRitualRecipe( + recipeId, + Ingredient.deserialize(json.getAsJsonObject("sapling")), + CraftingHelper.getItemStack(json.getAsJsonObject("output"), true), + json.get("time").getAsInt(), + ings.toArray(new Ingredient[0])); + } + + @Nullable + @Override + public TreeRitualRecipe read(ResourceLocation recipeId, PacketBuffer buffer) { + Ingredient[] ings = new Ingredient[buffer.readInt()]; + for (int i = 0; i < ings.length; i++) + ings[i] = Ingredient.read(buffer); + return new TreeRitualRecipe( + recipeId, + Ingredient.read(buffer), + buffer.readItemStack(), + buffer.readInt(), + ings); + } + + @Override + public void write(PacketBuffer buffer, TreeRitualRecipe recipe) { + buffer.writeInt(recipe.ingredients.length); + for (Ingredient ing : recipe.ingredients) + ing.write(buffer); + recipe.saplingType.write(buffer); + buffer.writeItemStack(recipe.result); + buffer.writeInt(recipe.time); + } + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java index 418759cd..c2c642bf 100644 --- a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java +++ b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java @@ -28,6 +28,7 @@ import de.ellpeck.naturesaura.items.*; import de.ellpeck.naturesaura.items.tools.*; import de.ellpeck.naturesaura.potion.ModPotions; import de.ellpeck.naturesaura.potion.PotionBreathless; +import de.ellpeck.naturesaura.recipes.ModRecipes; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.block.FlowerPotBlock; @@ -40,6 +41,7 @@ import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.inventory.container.ContainerType; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; +import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraft.potion.Effect; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; @@ -282,6 +284,11 @@ public final class ModRegistry { Helper.populateObjectHolders(ModFeatures.class, event.getRegistry()); } + @SubscribeEvent + public static void registerRecipes(RegistryEvent.Register> event) { + ModRecipes.register(event.getRegistry()); + } + public static void init() { for (IModItem item : ALL_ITEMS) { if (item instanceof IColorProvidingBlock) diff --git a/src/main/resources/data/naturesaura/recipes/altar/blaze.json b/src/main/resources/data/naturesaura/recipes/altar/blaze.json new file mode 100644 index 00000000..875e1865 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/blaze.json @@ -0,0 +1,16 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:blaze_rod" + }, + "output": { + "item": "minecraft:blaze_powder", + "count": 4 + }, + "aura_type": "naturesaura:nether", + "catalyst": { + "item": "naturesaura:crushing_catalyst" + }, + "aura": 5000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/bone.json b/src/main/resources/data/naturesaura/recipes/altar/bone.json new file mode 100644 index 00000000..fbee9f50 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/bone.json @@ -0,0 +1,16 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:bone" + }, + "output": { + "item": "minecraft:bone_meal", + "count": 6 + }, + "aura_type": "naturesaura:overworld", + "catalyst": { + "item": "naturesaura:crushing_catalyst" + }, + "aura": 3000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/breath.json b/src/main/resources/data/naturesaura/recipes/altar/breath.json new file mode 100644 index 00000000..c682328d --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/breath.json @@ -0,0 +1,18 @@ +{ + "type": "naturesaura:altar", + "input": { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "count": 1, + "nbt": "{stored_type:\"naturesaura:end\"}" + }, + "output": { + "item": "minecraft:dragon_breath" + }, + "aura_type": "naturesaura:nether", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 20000, + "time": 80 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/coal.json b/src/main/resources/data/naturesaura/recipes/altar/coal.json new file mode 100644 index 00000000..d1437131 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/coal.json @@ -0,0 +1,15 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:charcoal" + }, + "output": { + "item": "minecraft:coal" + }, + "aura_type": "naturesaura:overworld", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 30000, + "time": 250 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/glowstone.json b/src/main/resources/data/naturesaura/recipes/altar/glowstone.json new file mode 100644 index 00000000..8b11fc99 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/glowstone.json @@ -0,0 +1,16 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:glowstone" + }, + "output": { + "item": "minecraft:glowstone_dust", + "count": 4 + }, + "aura_type": "naturesaura:nether", + "catalyst": { + "item": "naturesaura:crushing_catalyst" + }, + "aura": 3000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/infused_iron.json b/src/main/resources/data/naturesaura/recipes/altar/infused_iron.json new file mode 100644 index 00000000..93b15aa7 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/infused_iron.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:iron_ingot" + }, + "output": { + "item": "naturesaura:infused_iron" + }, + "aura_type": "naturesaura:overworld", + "aura": 15000, + "time": 80 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/infused_iron_block.json b/src/main/resources/data/naturesaura/recipes/altar/infused_iron_block.json new file mode 100644 index 00000000..04a99447 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/infused_iron_block.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:iron_block" + }, + "output": { + "item": "naturesaura:infused_iron_block" + }, + "aura_type": "naturesaura:overworld", + "aura": 135000, + "time": 700 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/infused_stone.json b/src/main/resources/data/naturesaura/recipes/altar/infused_stone.json new file mode 100644 index 00000000..5d29ce9b --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/infused_stone.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:stone" + }, + "output": { + "item": "naturesaura:infused_stone" + }, + "aura_type": "naturesaura:overworld", + "aura": 7500, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/leather.json b/src/main/resources/data/naturesaura/recipes/altar/leather.json new file mode 100644 index 00000000..aaf9ecdb --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/leather.json @@ -0,0 +1,15 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:rotten_flesh" + }, + "output": { + "item": "minecraft:leather" + }, + "aura_type": "naturesaura:overworld", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 10000, + "time": 50 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/nether_wart.json b/src/main/resources/data/naturesaura/recipes/altar/nether_wart.json new file mode 100644 index 00000000..12d91b98 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/nether_wart.json @@ -0,0 +1,15 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:red_mushroom" + }, + "output": { + "item": "minecraft:nether_wart" + }, + "aura_type": "naturesaura:nether", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 30000, + "time": 250 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/prismarine.json b/src/main/resources/data/naturesaura/recipes/altar/prismarine.json new file mode 100644 index 00000000..17240238 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/prismarine.json @@ -0,0 +1,15 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:quartz" + }, + "output": { + "item": "minecraft:prismarine_shard" + }, + "aura_type": "naturesaura:nether", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 55000, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/sand.json b/src/main/resources/data/naturesaura/recipes/altar/sand.json new file mode 100644 index 00000000..dfd946b5 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/sand.json @@ -0,0 +1,15 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:cobblestone" + }, + "output": { + "item": "minecraft:sand" + }, + "aura_type": "naturesaura:overworld", + "catalyst": { + "item": "naturesaura:crushing_catalyst" + }, + "aura": 3000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/soul_sand.json b/src/main/resources/data/naturesaura/recipes/altar/soul_sand.json new file mode 100644 index 00000000..ad05a499 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/soul_sand.json @@ -0,0 +1,15 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:sand" + }, + "output": { + "item": "minecraft:soul_sand" + }, + "aura_type": "naturesaura:nether", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 5000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/sugar.json b/src/main/resources/data/naturesaura/recipes/altar/sugar.json new file mode 100644 index 00000000..b2598cd8 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/sugar.json @@ -0,0 +1,16 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:sugar_cane" + }, + "output": { + "item": "minecraft:sugar", + "count": 3 + }, + "aura_type": "naturesaura:overworld", + "catalyst": { + "item": "naturesaura:crushing_catalyst" + }, + "aura": 3000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/tainted_gold.json b/src/main/resources/data/naturesaura/recipes/altar/tainted_gold.json new file mode 100644 index 00000000..badc65d1 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/tainted_gold.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:gold_ingot" + }, + "output": { + "item": "naturesaura:tainted_gold" + }, + "aura_type": "naturesaura:nether", + "aura": 15000, + "time": 80 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/tainted_gold_block.json b/src/main/resources/data/naturesaura/recipes/altar/tainted_gold_block.json new file mode 100644 index 00000000..ab019ce5 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/tainted_gold_block.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:gold_block" + }, + "output": { + "item": "naturesaura:tainted_gold_block" + }, + "aura_type": "naturesaura:nether", + "aura": 135000, + "time": 700 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/altar/water.json b/src/main/resources/data/naturesaura/recipes/altar/water.json new file mode 100644 index 00000000..95c1848a --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/altar/water.json @@ -0,0 +1,18 @@ +{ + "type": "naturesaura:altar", + "input": { + "item": "minecraft:glass_bottle" + }, + "output": { + "nbt": { + "Potion": "minecraft:water" + }, + "item": "minecraft:potion" + }, + "aura_type": "naturesaura:overworld", + "catalyst": { + "item": "naturesaura:conversion_catalyst" + }, + "aura": 25000, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/bat.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/bat.json new file mode 100644 index 00000000..9bd1648c --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/bat.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:feather" + } + ], + "entity": "minecraft:bat", + "aura": 30000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/bee.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/bee.json new file mode 100644 index 00000000..96d7619c --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/bee.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:honeycomb" + }, + { + "item": "minecraft:honey_block" + } + ], + "entity": "minecraft:bee", + "aura": 50000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/blaze.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/blaze.json new file mode 100644 index 00000000..bac457b3 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/blaze.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:blaze_rod" + }, + { + "item": "minecraft:blaze_powder" + } + ], + "entity": "minecraft:blaze", + "aura": 150000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/cat.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/cat.json new file mode 100644 index 00000000..ef7507f9 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/cat.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:string" + }, + { + "tag": "minecraft:wool" + } + ], + "entity": "minecraft:cat", + "aura": 50000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/cave_spider.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/cave_spider.json new file mode 100644 index 00000000..6aef7455 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/cave_spider.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:string" + }, + { + "item": "minecraft:fermented_spider_eye" + } + ], + "entity": "minecraft:cave_spider", + "aura": 100000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/chicken.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/chicken.json new file mode 100644 index 00000000..5a27ccf8 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/chicken.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:feather" + }, + { + "item": "minecraft:egg" + } + ], + "entity": "minecraft:chicken", + "aura": 30000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/cow.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/cow.json new file mode 100644 index 00000000..7fa7abfe --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/cow.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:beef" + }, + { + "item": "minecraft:leather" + } + ], + "entity": "minecraft:cow", + "aura": 50000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/creeper.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/creeper.json new file mode 100644 index 00000000..203826a0 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/creeper.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:gunpowder" + } + ], + "entity": "minecraft:creeper", + "aura": 100000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/dolphin.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/dolphin.json new file mode 100644 index 00000000..0747f690 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/dolphin.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "tag": "minecraft:fishes" + }, + { + "item": "minecraft:map" + } + ], + "entity": "minecraft:dolphin", + "aura": 100000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/donkey.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/donkey.json new file mode 100644 index 00000000..be69e748 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/donkey.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:leather" + }, + { + "item": "minecraft:chest" + } + ], + "entity": "minecraft:donkey", + "aura": 100000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/enderman.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/enderman.json new file mode 100644 index 00000000..55d89532 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/enderman.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:ender_pearl" + } + ], + "entity": "minecraft:enderman", + "aura": 120000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/endermite.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/endermite.json new file mode 100644 index 00000000..80ba3ba3 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/endermite.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:ender_pearl" + }, + { + "item": "minecraft:stone" + } + ], + "entity": "minecraft:endermite", + "aura": 30000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/fox.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/fox.json new file mode 100644 index 00000000..44b241a6 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/fox.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:sweet_berries" + }, + { + "item": "minecraft:feather" + } + ], + "entity": "minecraft:fox", + "aura": 30000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/ghast.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/ghast.json new file mode 100644 index 00000000..58877a2b --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/ghast.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:gunpowder" + }, + { + "item": "minecraft:ghast_tear" + } + ], + "entity": "minecraft:ghast", + "aura": 120000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/guardian.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/guardian.json new file mode 100644 index 00000000..3d175334 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/guardian.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:prismarine_shard" + }, + { + "item": "minecraft:prismarine_crystals" + } + ], + "entity": "minecraft:guardian", + "aura": 150000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/horse.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/horse.json new file mode 100644 index 00000000..2fd8d4c1 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/horse.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:leather" + } + ], + "entity": "minecraft:horse", + "aura": 100000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/husk.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/husk.json new file mode 100644 index 00000000..a13b94b1 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/husk.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:rotten_flesh" + }, + { + "item": "minecraft:sand" + } + ], + "entity": "minecraft:husk", + "aura": 100000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/llama.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/llama.json new file mode 100644 index 00000000..c3457328 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/llama.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "tag": "minecraft:wool" + } + ], + "entity": "minecraft:llama", + "aura": 60000, + "time": 80 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/magma_cube.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/magma_cube.json new file mode 100644 index 00000000..8a128124 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/magma_cube.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:magma_cream" + } + ], + "entity": "minecraft:magma_cube", + "aura": 100000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/mooshroom.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/mooshroom.json new file mode 100644 index 00000000..ff975333 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/mooshroom.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:leather" + }, + { + "item": "minecraft:red_mushroom" + } + ], + "entity": "minecraft:mooshroom", + "aura": 40000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/mule.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/mule.json new file mode 100644 index 00000000..33348e47 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/mule.json @@ -0,0 +1,20 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:leather" + }, + { + "item": "minecraft:chest" + }, + { + "item": "minecraft:apple" + } + ], + "entity": "minecraft:mule", + "aura": 100000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/ocelot.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/ocelot.json new file mode 100644 index 00000000..1c9ae541 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/ocelot.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "tag": "minecraft:fishes" + }, + { + "tag": "minecraft:wool" + } + ], + "entity": "minecraft:ocelot", + "aura": 80000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/panda.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/panda.json new file mode 100644 index 00000000..643e74b4 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/panda.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:bamboo" + }, + { + "item": "minecraft:jungle_sapling" + } + ], + "entity": "minecraft:panda", + "aura": 100000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/parrot.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/parrot.json new file mode 100644 index 00000000..2bf52d2c --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/parrot.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:feather" + }, + { + "item": "minecraft:cookie" + } + ], + "entity": "minecraft:parrot", + "aura": 50000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/phantom.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/phantom.json new file mode 100644 index 00000000..07aa0529 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/phantom.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:phantom_membrane" + } + ], + "entity": "minecraft:phantom", + "aura": 200000, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/pig.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/pig.json new file mode 100644 index 00000000..c4632aec --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/pig.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:porkchop" + } + ], + "entity": "minecraft:pig", + "aura": 50000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/polar_bear.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/polar_bear.json new file mode 100644 index 00000000..36ac2826 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/polar_bear.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:cod" + }, + { + "item": "minecraft:ice" + } + ], + "entity": "minecraft:polar_bear", + "aura": 50000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/rabbit.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/rabbit.json new file mode 100644 index 00000000..3a69fd58 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/rabbit.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:rabbit_hide" + } + ], + "entity": "minecraft:rabbit", + "aura": 30000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_black.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_black.json new file mode 100644 index 00000000..f9d3f7db --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_black.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:black_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_blue.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_blue.json new file mode 100644 index 00000000..016ae064 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_blue.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:blue_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_brown.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_brown.json new file mode 100644 index 00000000..8dbac0c6 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_brown.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:brown_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_cyan.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_cyan.json new file mode 100644 index 00000000..09fc2ec9 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_cyan.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:cyan_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_gray.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_gray.json new file mode 100644 index 00000000..52091436 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_gray.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:gray_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_green.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_green.json new file mode 100644 index 00000000..6ac3b256 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_green.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:green_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_light_blue.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_light_blue.json new file mode 100644 index 00000000..0ed5065d --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_light_blue.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:light_blue_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_light_gray.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_light_gray.json new file mode 100644 index 00000000..5c5593c2 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_light_gray.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:light_gray_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_lime.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_lime.json new file mode 100644 index 00000000..5892bfaa --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_lime.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:lime_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_magenta.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_magenta.json new file mode 100644 index 00000000..2b74dbbc --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_magenta.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:magenta_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_orange.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_orange.json new file mode 100644 index 00000000..76dc9326 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_orange.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:orange_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_pink.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_pink.json new file mode 100644 index 00000000..4ccd01b1 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_pink.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:pink_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_purple.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_purple.json new file mode 100644 index 00000000..ee37fe0c --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_purple.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:purple_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_red.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_red.json new file mode 100644 index 00000000..be574019 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_red.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:red_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_white.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_white.json new file mode 100644 index 00000000..f2194095 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_white.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:white_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_yellow.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_yellow.json new file mode 100644 index 00000000..e204e3ab --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/sheep_yellow.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:yellow_wool" + } + ], + "entity": "minecraft:sheep", + "aura": 500, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/shulker.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/shulker.json new file mode 100644 index 00000000..646df220 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/shulker.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:shulker_shell" + } + ], + "entity": "minecraft:shulker", + "aura": 150000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/silverfish.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/silverfish.json new file mode 100644 index 00000000..0a8ffe5e --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/silverfish.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:stone" + } + ], + "entity": "minecraft:silverfish", + "aura": 30000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/skeleton.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/skeleton.json new file mode 100644 index 00000000..b08093d4 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/skeleton.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:bone" + }, + { + "item": "minecraft:arrow" + } + ], + "entity": "minecraft:skeleton", + "aura": 100000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/slime.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/slime.json new file mode 100644 index 00000000..3e6c05f2 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/slime.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:slime_ball" + } + ], + "entity": "minecraft:slime", + "aura": 30000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/spider.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/spider.json new file mode 100644 index 00000000..e6091984 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/spider.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:string" + }, + { + "item": "minecraft:spider_eye" + } + ], + "entity": "minecraft:spider", + "aura": 100000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/squid.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/squid.json new file mode 100644 index 00000000..c189956a --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/squid.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:ink_sac" + } + ], + "entity": "minecraft:squid", + "aura": 50000, + "time": 40 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/stray.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/stray.json new file mode 100644 index 00000000..a91bae41 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/stray.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:bone" + }, + { + "item": "minecraft:ice" + } + ], + "entity": "minecraft:stray", + "aura": 100000, + "time": 120 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/turtle.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/turtle.json new file mode 100644 index 00000000..49584983 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/turtle.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:scute" + }, + { + "item": "minecraft:seagrass" + } + ], + "entity": "minecraft:turtle", + "aura": 100000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/witch.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/witch.json new file mode 100644 index 00000000..86a7aa75 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/witch.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:glass_bottle" + }, + { + "item": "minecraft:glowstone_dust" + } + ], + "entity": "minecraft:witch", + "aura": 150000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/wither_skeleton.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/wither_skeleton.json new file mode 100644 index 00000000..fbba1566 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/wither_skeleton.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:bone" + }, + { + "item": "minecraft:obsidian" + } + ], + "entity": "minecraft:wither_skeleton", + "aura": 150000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/wolf.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/wolf.json new file mode 100644 index 00000000..c5cca3d6 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/wolf.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:leather" + }, + { + "item": "minecraft:bone" + } + ], + "entity": "minecraft:wolf", + "aura": 50000, + "time": 60 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/zombie.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/zombie.json new file mode 100644 index 00000000..661d1de8 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/zombie.json @@ -0,0 +1,14 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:rotten_flesh" + } + ], + "entity": "minecraft:zombie", + "aura": 100000, + "time": 100 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/animal_spawner/zombie_pigman.json b/src/main/resources/data/naturesaura/recipes/animal_spawner/zombie_pigman.json new file mode 100644 index 00000000..fec7b9f7 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/animal_spawner/zombie_pigman.json @@ -0,0 +1,17 @@ +{ + "type": "naturesaura:animal_spawner", + "ingredients": [ + { + "item": "naturesaura:birth_spirit" + }, + { + "item": "minecraft:rotten_flesh" + }, + { + "item": "minecraft:gold_nugget" + } + ], + "entity": "minecraft:zombie_pigman", + "aura": 120000, + "time": 150 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/clock_hand.json b/src/main/resources/data/naturesaura/recipes/offering/clock_hand.json new file mode 100644 index 00000000..e642d819 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/clock_hand.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "minecraft:nether_star" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:clock_hand" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/sky_ingot.json b/src/main/resources/data/naturesaura/recipes/offering/sky_ingot.json new file mode 100644 index 00000000..02a6e9c1 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/sky_ingot.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "naturesaura:infused_iron" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:sky_ingot" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/sky_ingot_from_gold.json b/src/main/resources/data/naturesaura/recipes/offering/sky_ingot_from_gold.json new file mode 100644 index 00000000..2651b8ea --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/sky_ingot_from_gold.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "naturesaura:tainted_gold" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:sky_ingot" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/token_euphoria.json b/src/main/resources/data/naturesaura/recipes/offering/token_euphoria.json new file mode 100644 index 00000000..743449bf --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/token_euphoria.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "naturesaura:token_joy" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:token_euphoria" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/token_grief.json b/src/main/resources/data/naturesaura/recipes/offering/token_grief.json new file mode 100644 index 00000000..b89f145e --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/token_grief.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "naturesaura:token_sorrow" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:token_grief" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/token_rage.json b/src/main/resources/data/naturesaura/recipes/offering/token_rage.json new file mode 100644 index 00000000..95591518 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/token_rage.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "naturesaura:token_anger" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:token_rage" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/offering/token_terror.json b/src/main/resources/data/naturesaura/recipes/offering/token_terror.json new file mode 100644 index 00000000..88049bac --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/offering/token_terror.json @@ -0,0 +1,12 @@ +{ + "type": "naturesaura:offering", + "input": { + "item": "naturesaura:token_fear" + }, + "start_item": { + "item": "naturesaura:calling_spirit" + }, + "output": { + "item": "naturesaura:token_terror" + } +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json new file mode 100644 index 00000000..6b79b036 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/ancient_sapling.json @@ -0,0 +1,30 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "minecraft:oak_sapling" + }, + { + "item": "minecraft:dandelion" + }, + { + "item": "minecraft:poppy" + }, + { + "item": "minecraft:wheat_seeds" + }, + { + "item": "minecraft:sugar_cane" + }, + { + "item": "naturesaura:gold_leaf" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:ancient_sapling" + }, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/animal_powder.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/animal_powder.json new file mode 100644 index 00000000..4ea1626c --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/animal_powder.json @@ -0,0 +1,28 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:sky_ingot" + }, + { + "item": "minecraft:egg" + } + ], + "sapling": { + "item": "minecraft:jungle_sapling" + }, + "output": { + "nbt": { + "effect": "naturesaura:animal" + }, + "item": "naturesaura:effect_powder", + "count": 8 + }, + "time": 400 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/cache_powder.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/cache_powder.json new file mode 100644 index 00000000..d646c24f --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/cache_powder.json @@ -0,0 +1,28 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:sky_ingot" + }, + { + "item": "naturesaura:aura_cache" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "nbt": { + "effect": "naturesaura:cache_recharge" + }, + "item": "naturesaura:effect_powder", + "count": 32 + }, + "time": 400 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/conversion_catalyst.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/conversion_catalyst.json new file mode 100644 index 00000000..f1c04e13 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/conversion_catalyst.json @@ -0,0 +1,30 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_brick" + }, + { + "item": "naturesaura:infused_stone" + }, + { + "item": "minecraft:brewing_stand" + }, + { + "item": "naturesaura:sky_ingot" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "minecraft:glowstone" + } + ], + "sapling": { + "item": "minecraft:jungle_sapling" + }, + "output": { + "item": "naturesaura:conversion_catalyst" + }, + "time": 600 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/crushing_catalyst.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/crushing_catalyst.json new file mode 100644 index 00000000..1c446471 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/crushing_catalyst.json @@ -0,0 +1,27 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_brick" + }, + { + "item": "naturesaura:infused_stone" + }, + { + "item": "minecraft:piston" + }, + { + "item": "minecraft:flint" + }, + { + "item": "naturesaura:token_anger" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:crushing_catalyst" + }, + "time": 600 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/eye.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/eye.json new file mode 100644 index 00000000..b3fd2ba6 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/eye.json @@ -0,0 +1,24 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "minecraft:spider_eye" + }, + { + "item": "minecraft:gold_ingot" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "naturesaura:gold_leaf" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:eye" + }, + "time": 250 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/eye_improved.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/eye_improved.json new file mode 100644 index 00000000..628ec28d --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/eye_improved.json @@ -0,0 +1,30 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:eye" + }, + { + "item": "naturesaura:sky_ingot" + }, + { + "item": "naturesaura:sky_ingot" + }, + { + "item": "naturesaura:end_flower" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "naturesaura:gold_leaf" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:eye_improved" + }, + "time": 500 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/furnace_heater.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/furnace_heater.json new file mode 100644 index 00000000..b426ba32 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/furnace_heater.json @@ -0,0 +1,36 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:infused_stone" + }, + { + "item": "naturesaura:infused_stone" + }, + { + "item": "naturesaura:tainted_gold" + }, + { + "item": "naturesaura:infused_iron" + }, + { + "item": "minecraft:fire_charge" + }, + { + "item": "minecraft:flint" + }, + { + "item": "minecraft:magma_block" + }, + { + "item": "naturesaura:token_fear" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:furnace_heater" + }, + "time": 600 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/nature_altar.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/nature_altar.json new file mode 100644 index 00000000..8f7bbc38 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/nature_altar.json @@ -0,0 +1,30 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "minecraft:stone" + }, + { + "item": "minecraft:stone" + }, + { + "item": "minecraft:stone" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "minecraft:gold_ingot" + }, + { + "item": "naturesaura:token_joy" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:nature_altar" + }, + "time": 500 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/nether_grass_powder.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/nether_grass_powder.json new file mode 100644 index 00000000..20601df2 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/nether_grass_powder.json @@ -0,0 +1,28 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:gold_powder" + }, + { + "item": "minecraft:netherrack" + }, + { + "item": "minecraft:grass" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "nbt": { + "effect": "naturesaura:nether_grass" + }, + "item": "naturesaura:effect_powder", + "count": 24 + }, + "time": 400 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/ore_spawn_powder.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/ore_spawn_powder.json new file mode 100644 index 00000000..baa58255 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/ore_spawn_powder.json @@ -0,0 +1,28 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:gold_powder" + }, + { + "item": "minecraft:diamond_ore" + }, + { + "item": "minecraft:redstone_ore" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "nbt": { + "effect": "naturesaura:ore_spawn" + }, + "item": "naturesaura:effect_powder", + "count": 4 + }, + "time": 400 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/plant_powder.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/plant_powder.json new file mode 100644 index 00000000..d4312422 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/plant_powder.json @@ -0,0 +1,28 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:gold_powder" + }, + { + "item": "naturesaura:sky_ingot" + }, + { + "item": "minecraft:wheat" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "nbt": { + "effect": "naturesaura:plant_boost" + }, + "item": "naturesaura:effect_powder", + "count": 24 + }, + "time": 400 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/token_anger.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_anger.json new file mode 100644 index 00000000..91e5df49 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_anger.json @@ -0,0 +1,34 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "count": 1, + "nbt": "{stored_type:\"naturesaura:nether\"}" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "minecraft:magma_block" + }, + { + "item": "minecraft:blaze_powder" + }, + { + "item": "minecraft:gunpowder" + }, + { + "item": "minecraft:ender_pearl" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:token_anger", + "count": 2 + }, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/token_fear.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_fear.json new file mode 100644 index 00000000..0ee5fe1f --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_fear.json @@ -0,0 +1,34 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "count": 1, + "nbt": "{stored_type:\"naturesaura:nether\"}" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "minecraft:rotten_flesh" + }, + { + "item": "minecraft:feather" + }, + { + "item": "minecraft:bone" + }, + { + "item": "minecraft:soul_sand" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:token_fear", + "count": 2 + }, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/token_joy.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_joy.json new file mode 100644 index 00000000..5707f318 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_joy.json @@ -0,0 +1,34 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "count": 1, + "nbt": "{stored_type:\"naturesaura:overworld\"}" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "tag": "minecraft:small_flowers" + }, + { + "item": "minecraft:apple" + }, + { + "item": "minecraft:torch" + }, + { + "item": "minecraft:iron_ingot" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:token_joy", + "count": 2 + }, + "time": 200 +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/tree_ritual/token_sorrow.json b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_sorrow.json new file mode 100644 index 00000000..5d2160f1 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/tree_ritual/token_sorrow.json @@ -0,0 +1,45 @@ +{ + "type": "naturesaura:tree_ritual", + "ingredients": [ + { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "count": 1, + "nbt": "{stored_type:\"naturesaura:overworld\"}" + }, + { + "item": "naturesaura:gold_leaf" + }, + { + "item": "minecraft:ghast_tear" + }, + [ + { + "item": "minecraft:beef" + }, + { + "item": "minecraft:mutton" + }, + { + "item": "minecraft:chicken" + }, + { + "item": "minecraft:porkchop" + } + ], + { + "item": "minecraft:glass" + }, + { + "tag": "minecraft:fishes" + } + ], + "sapling": { + "item": "minecraft:oak_sapling" + }, + "output": { + "item": "naturesaura:token_sorrow", + "count": 2 + }, + "time": 200 +} \ No newline at end of file