From 20be14576839a669007d2e7186d69f9527320479 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 22 Oct 2018 00:14:52 +0200 Subject: [PATCH] some more documentation work --- .../blocks/tiles/TileEntityNatureAltar.java | 5 +- .../de/ellpeck/naturesaura/compat/Compat.java | 7 +++ .../jei/JEINaturesAuraPlugin.java | 14 ++--- .../{ => compat}/jei/altar/AltarCategory.java | 6 +-- .../{ => compat}/jei/altar/AltarWrapper.java | 2 +- .../jei/treeritual/TreeRitualCategory.java | 6 +-- .../jei/treeritual/TreeRitualWrapper.java | 2 +- .../compat/patchouli/PageAltar.java | 47 +++++++++++++++++ .../compat/patchouli/PageTreeRitual.java | 49 ++++++++++++++++++ .../compat/patchouli/PatchouliCompat.java | 20 +++++++ .../naturesaura/events/TerrainGenEvents.java | 2 +- .../naturesaura/recipes/AltarRecipe.java | 15 +++--- .../naturesaura/recipes/ModRecipes.java | 17 ++++-- .../naturesaura/recipes/TreeRitualRecipe.java | 12 +++-- .../assets/naturesaura/lang/en_US.lang | 4 +- .../en_us/categories/collecting.json | 2 +- .../en_us/categories/practices.json | 2 +- .../en_us/categories/using.json | 2 +- .../en_us/entries/collecting/altar.json | 17 ++++++ .../en_us/entries/items/infused_iron.json | 11 ---- .../en_us/entries/using/altar.json | 18 +++++++ .../textures/gui/{ => jei}/altar.png | Bin .../textures/gui/{ => jei}/tree_ritual.png | Bin .../textures/gui/patchouli/elements.png | Bin 0 -> 3453 bytes 24 files changed, 211 insertions(+), 49 deletions(-) rename src/main/java/de/ellpeck/naturesaura/{ => compat}/jei/JEINaturesAuraPlugin.java (76%) rename src/main/java/de/ellpeck/naturesaura/{ => compat}/jei/altar/AltarCategory.java (90%) rename src/main/java/de/ellpeck/naturesaura/{ => compat}/jei/altar/AltarWrapper.java (92%) rename src/main/java/de/ellpeck/naturesaura/{ => compat}/jei/treeritual/TreeRitualCategory.java (90%) rename src/main/java/de/ellpeck/naturesaura/{ => compat}/jei/treeritual/TreeRitualWrapper.java (93%) create mode 100644 src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageAltar.java create mode 100644 src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageTreeRitual.java create mode 100644 src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java create mode 100644 src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/collecting/altar.json delete mode 100644 src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/items/infused_iron.json create mode 100644 src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/using/altar.json rename src/main/resources/assets/naturesaura/textures/gui/{ => jei}/altar.png (100%) rename src/main/resources/assets/naturesaura/textures/gui/{ => jei}/tree_ritual.png (100%) create mode 100644 src/main/resources/assets/naturesaura/textures/gui/patchouli/elements.png 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 644aeba0..620c1ac0 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java @@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; @@ -244,7 +245,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable { if (!syncing) { if (this.currentRecipe != null) { - compound.setTag("recipe_input", this.currentRecipe.input.serializeNBT()); + compound.setString("recipe", this.currentRecipe.name.toString()); compound.setInteger("timer", this.timer); } } @@ -259,7 +260,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable { if (!syncing) { if (compound.hasKey("recipe_input")) { - this.currentRecipe = AltarRecipe.forInput(new ItemStack(compound.getCompoundTag("recipe_input"))); + this.currentRecipe = AltarRecipe.RECIPES.get(new ResourceLocation(compound.getString("recipe"))); this.timer = compound.getInteger("timer"); } } diff --git a/src/main/java/de/ellpeck/naturesaura/compat/Compat.java b/src/main/java/de/ellpeck/naturesaura/compat/Compat.java index 0d242859..e9fc92e7 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/Compat.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/Compat.java @@ -1,10 +1,12 @@ package de.ellpeck.naturesaura.compat; +import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Loader; public final class Compat { + public static boolean patchouli; public static boolean baubles; public static void init() { @@ -12,5 +14,10 @@ public final class Compat { if (baubles) { MinecraftForge.EVENT_BUS.register(new BaublesCompat()); } + + patchouli = Loader.isModLoaded("patchouli"); + if (patchouli) { + PatchouliCompat.init(); + } } } diff --git a/src/main/java/de/ellpeck/naturesaura/jei/JEINaturesAuraPlugin.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java similarity index 76% rename from src/main/java/de/ellpeck/naturesaura/jei/JEINaturesAuraPlugin.java rename to src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java index 4935929a..000a2951 100644 --- a/src/main/java/de/ellpeck/naturesaura/jei/JEINaturesAuraPlugin.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/JEINaturesAuraPlugin.java @@ -1,11 +1,11 @@ -package de.ellpeck.naturesaura.jei; +package de.ellpeck.naturesaura.compat.jei; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.blocks.ModBlocks; -import de.ellpeck.naturesaura.jei.altar.AltarCategory; -import de.ellpeck.naturesaura.jei.altar.AltarWrapper; -import de.ellpeck.naturesaura.jei.treeritual.TreeRitualCategory; -import de.ellpeck.naturesaura.jei.treeritual.TreeRitualWrapper; +import de.ellpeck.naturesaura.compat.jei.altar.AltarCategory; +import de.ellpeck.naturesaura.compat.jei.altar.AltarWrapper; +import de.ellpeck.naturesaura.compat.jei.treeritual.TreeRitualCategory; +import de.ellpeck.naturesaura.compat.jei.treeritual.TreeRitualWrapper; import de.ellpeck.naturesaura.recipes.AltarRecipe; import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import mezz.jei.api.IGuiHelper; @@ -35,8 +35,8 @@ public class JEINaturesAuraPlugin implements IModPlugin { registry.handleRecipes(TreeRitualRecipe.class, TreeRitualWrapper::new, TREE_RITUAL); registry.handleRecipes(AltarRecipe.class, AltarWrapper::new, ALTAR); - registry.addRecipes(TreeRitualRecipe.RECIPES, TREE_RITUAL); - registry.addRecipes(AltarRecipe.RECIPES, ALTAR); + registry.addRecipes(TreeRitualRecipe.RECIPES.values(), TREE_RITUAL); + registry.addRecipes(AltarRecipe.RECIPES.values(), ALTAR); registry.addRecipeCatalyst(new ItemStack(ModBlocks.GOLD_POWDER), TREE_RITUAL); registry.addRecipeCatalyst(new ItemStack(ModBlocks.WOOD_STAND), TREE_RITUAL); diff --git a/src/main/java/de/ellpeck/naturesaura/jei/altar/AltarCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/altar/AltarCategory.java similarity index 90% rename from src/main/java/de/ellpeck/naturesaura/jei/altar/AltarCategory.java rename to src/main/java/de/ellpeck/naturesaura/compat/jei/altar/AltarCategory.java index 35a2ec85..93627a61 100644 --- a/src/main/java/de/ellpeck/naturesaura/jei/altar/AltarCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/altar/AltarCategory.java @@ -1,9 +1,9 @@ -package de.ellpeck.naturesaura.jei.altar; +package de.ellpeck.naturesaura.compat.jei.altar; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.blocks.ModBlocks; -import de.ellpeck.naturesaura.jei.JEINaturesAuraPlugin; +import de.ellpeck.naturesaura.compat.jei.JEINaturesAuraPlugin; import de.ellpeck.naturesaura.recipes.AltarRecipe; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -22,7 +22,7 @@ public class AltarCategory implements IRecipeCategory { private final ItemStack altar = new ItemStack(ModBlocks.NATURE_ALTAR); public AltarCategory(IGuiHelper helper) { - this.background = helper.createDrawable(new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/altar.png"), 0, 0, 78, 57); + this.background = helper.createDrawable(new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/jei/altar.png"), 0, 0, 78, 57); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/jei/altar/AltarWrapper.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/altar/AltarWrapper.java similarity index 92% rename from src/main/java/de/ellpeck/naturesaura/jei/altar/AltarWrapper.java rename to src/main/java/de/ellpeck/naturesaura/compat/jei/altar/AltarWrapper.java index 257c45ac..65d1d658 100644 --- a/src/main/java/de/ellpeck/naturesaura/jei/altar/AltarWrapper.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/altar/AltarWrapper.java @@ -1,4 +1,4 @@ -package de.ellpeck.naturesaura.jei.altar; +package de.ellpeck.naturesaura.compat.jei.altar; import de.ellpeck.naturesaura.recipes.AltarRecipe; import mezz.jei.api.ingredients.IIngredients; diff --git a/src/main/java/de/ellpeck/naturesaura/jei/treeritual/TreeRitualCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/treeritual/TreeRitualCategory.java similarity index 90% rename from src/main/java/de/ellpeck/naturesaura/jei/treeritual/TreeRitualCategory.java rename to src/main/java/de/ellpeck/naturesaura/compat/jei/treeritual/TreeRitualCategory.java index b483036a..38e00f3d 100644 --- a/src/main/java/de/ellpeck/naturesaura/jei/treeritual/TreeRitualCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/treeritual/TreeRitualCategory.java @@ -1,7 +1,7 @@ -package de.ellpeck.naturesaura.jei.treeritual; +package de.ellpeck.naturesaura.compat.jei.treeritual; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.jei.JEINaturesAuraPlugin; +import de.ellpeck.naturesaura.compat.jei.JEINaturesAuraPlugin; import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -17,7 +17,7 @@ public class TreeRitualCategory implements IRecipeCategory { private final IDrawable background; public TreeRitualCategory(IGuiHelper helper) { - this.background = helper.createDrawable(new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/tree_ritual.png"), 0, 0, 146, 86); + this.background = helper.createDrawable(new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/jei/tree_ritual.png"), 0, 0, 146, 86); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/jei/treeritual/TreeRitualWrapper.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/treeritual/TreeRitualWrapper.java similarity index 93% rename from src/main/java/de/ellpeck/naturesaura/jei/treeritual/TreeRitualWrapper.java rename to src/main/java/de/ellpeck/naturesaura/compat/jei/treeritual/TreeRitualWrapper.java index 83f9b174..d75469b6 100644 --- a/src/main/java/de/ellpeck/naturesaura/jei/treeritual/TreeRitualWrapper.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/treeritual/TreeRitualWrapper.java @@ -1,4 +1,4 @@ -package de.ellpeck.naturesaura.jei.treeritual; +package de.ellpeck.naturesaura.compat.jei.treeritual; import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; import mezz.jei.api.ingredients.IIngredients; diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageAltar.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageAltar.java new file mode 100644 index 00000000..54acc03d --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageAltar.java @@ -0,0 +1,47 @@ +package de.ellpeck.naturesaura.compat.patchouli; + +import de.ellpeck.naturesaura.blocks.ModBlocks; +import de.ellpeck.naturesaura.recipes.AltarRecipe; +import net.minecraft.client.gui.Gui; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import vazkii.patchouli.client.book.BookEntry; +import vazkii.patchouli.client.book.gui.GuiBook; +import vazkii.patchouli.client.book.page.abstr.PageDoubleRecipe; + +public class PageAltar extends PageDoubleRecipe { + + private static final ItemStack ALTAR = new ItemStack(ModBlocks.NATURE_ALTAR); + + @Override + protected void drawRecipe(AltarRecipe recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { + this.mc.getTextureManager().bindTexture(PatchouliCompat.GUI_ELEMENTS); + Gui.drawModalRectWithCustomSizedTexture(recipeX + 12, recipeY, 0, 0, 75, 44, 256, 256); + + this.parent.drawCenteredStringNoShadow(this.getTitle(second), GuiBook.PAGE_WIDTH / 2, recipeY - 10, 0x333333); + this.renderItem(recipeX + 12 + 30, recipeY + 13, mouseX, mouseY, ALTAR); + + this.renderItem(recipeX + 12 + 4, recipeY + 13, mouseX, mouseY, recipe.input); + this.renderItem(recipeX + 12 + 56, recipeY + 13, mouseX, mouseY, recipe.output); + } + + @Override + protected AltarRecipe loadRecipe(BookEntry entry, String loc) { + if (loc != null) { + AltarRecipe recipe = AltarRecipe.RECIPES.get(new ResourceLocation(loc)); + entry.addRelevantStack(recipe.output, this.pageNum); + return recipe; + } + return null; + } + + @Override + protected ItemStack getRecipeOutput(AltarRecipe recipe) { + return recipe.output; + } + + @Override + protected int getRecipeHeight() { + return 60; + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageTreeRitual.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageTreeRitual.java new file mode 100644 index 00000000..ea3026ba --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PageTreeRitual.java @@ -0,0 +1,49 @@ +package de.ellpeck.naturesaura.compat.patchouli; + +import de.ellpeck.naturesaura.recipes.TreeRitualRecipe; +import net.minecraft.client.gui.Gui; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import vazkii.patchouli.client.book.BookEntry; +import vazkii.patchouli.client.book.gui.GuiBook; +import vazkii.patchouli.client.book.page.abstr.PageDoubleRecipe; + +public class PageTreeRitual extends PageDoubleRecipe { + + @Override + protected void drawRecipe(TreeRitualRecipe recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { + this.mc.getTextureManager().bindTexture(PatchouliCompat.GUI_ELEMENTS); + Gui.drawModalRectWithCustomSizedTexture(recipeX - 13, recipeY, 0, 44, 122, 88, 256, 256); + + this.parent.drawCenteredStringNoShadow(this.getTitle(second), GuiBook.PAGE_WIDTH / 2, recipeY - 10, 0x333333); + + int[][] positions = new int[][]{{38, 4}, {38, 68}, {6, 36}, {70, 36}, {13, 11}, {63, 61}, {63, 11}, {13, 61}}; + for (int i = 0; i < recipe.items.length; i++) { + ItemStack input = recipe.items[i]; + this.renderItem(recipeX - 13 + positions[i][0], recipeY + positions[i][1], mouseX, mouseY, input); + } + + this.renderItem(recipeX - 13 + 38, recipeY + 36, mouseX, mouseY, recipe.saplingType); + this.renderItem(recipeX - 13 + 102, recipeY + 36, mouseX, mouseY, recipe.result); + } + + @Override + protected TreeRitualRecipe loadRecipe(BookEntry entry, String loc) { + if (loc != null) { + TreeRitualRecipe recipe = TreeRitualRecipe.RECIPES.get(new ResourceLocation(loc)); + entry.addRelevantStack(recipe.result, this.pageNum); + return recipe; + } + return null; + } + + @Override + protected ItemStack getRecipeOutput(TreeRitualRecipe recipe) { + return recipe.result; + } + + @Override + protected int getRecipeHeight() { + return 105; + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java new file mode 100644 index 00000000..0b95d901 --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/PatchouliCompat.java @@ -0,0 +1,20 @@ +package de.ellpeck.naturesaura.compat.patchouli; + +import de.ellpeck.naturesaura.NaturesAura; +import net.minecraft.util.ResourceLocation; +import vazkii.patchouli.client.book.BookPage; +import vazkii.patchouli.client.book.BookRegistry; + +public final class PatchouliCompat { + + public static final ResourceLocation GUI_ELEMENTS = new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/patchouli/elements.png"); + + public static void init() { + addPatchouliPage("altar", PageAltar.class); + addPatchouliPage("tree_ritual", PageTreeRitual.class); + } + + private static void addPatchouliPage(String name, Class page) { + BookRegistry.INSTANCE.pageTypes.put(NaturesAura.MOD_ID + ":" + name, page); + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/events/TerrainGenEvents.java b/src/main/java/de/ellpeck/naturesaura/events/TerrainGenEvents.java index b200c700..3265daa6 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/TerrainGenEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/TerrainGenEvents.java @@ -37,7 +37,7 @@ public class TerrainGenEvents { IBlockState sapling = world.getBlockState(pos); ItemStack saplingStack = sapling.getBlock().getItem(world, pos, sapling); if (!saplingStack.isEmpty()) { - for (TreeRitualRecipe recipe : TreeRitualRecipe.RECIPES) { + for (TreeRitualRecipe recipe : TreeRitualRecipe.RECIPES.values()) { if (recipe.matchesItems(saplingStack, usableItems)) { Map actuallyInvolved = new HashMap<>(); List stillRequired = new ArrayList<>(Arrays.asList(recipe.items)); diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java index 55d7f492..9c54cefb 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java @@ -1,20 +1,23 @@ package de.ellpeck.naturesaura.recipes; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; public class AltarRecipe { - public static final List RECIPES = new ArrayList<>(); + public static final Map RECIPES = new HashMap<>(); + public final ResourceLocation name; public final ItemStack input; public final ItemStack output; public final int aura; public final int time; - public AltarRecipe(ItemStack input, ItemStack output, int aura, int time) { + public AltarRecipe(ResourceLocation name, ItemStack input, ItemStack output, int aura, int time) { + this.name = name; this.input = input; this.output = output; this.aura = aura; @@ -22,7 +25,7 @@ public class AltarRecipe { } public static AltarRecipe forInput(ItemStack input) { - for (AltarRecipe recipe : RECIPES) { + for (AltarRecipe recipe : RECIPES.values()) { if (recipe.input.isItemEqual(input)) { return recipe; } @@ -31,7 +34,7 @@ public class AltarRecipe { } public AltarRecipe add() { - RECIPES.add(this); + RECIPES.put(this.name, this); return this; } } diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java index 93a5b1fd..a5ea6337 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java @@ -1,26 +1,31 @@ package de.ellpeck.naturesaura.recipes; +import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.blocks.ModBlocks; import de.ellpeck.naturesaura.items.ModItems; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; public final class ModRecipes { public static void init() { - new TreeRitualRecipe(new ItemStack(Blocks.SAPLING), new ItemStack(ModItems.EYE), 250, + new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "eye"), + new ItemStack(Blocks.SAPLING), new ItemStack(ModItems.EYE), 250, new ItemStack(Items.SPIDER_EYE), new ItemStack(Items.GOLD_INGOT), new ItemStack(ModItems.GOLD_LEAF), new ItemStack(ModItems.GOLD_LEAF)).add(); - new TreeRitualRecipe(new ItemStack(Blocks.SAPLING), new ItemStack(ModBlocks.NATURE_ALTAR), 500, + new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "nature_altar"), + new ItemStack(Blocks.SAPLING), new ItemStack(ModBlocks.NATURE_ALTAR), 500, new ItemStack(Blocks.STONE), new ItemStack(Blocks.STONE), new ItemStack(Blocks.STONE), new ItemStack(ModItems.GOLD_LEAF), new ItemStack(Items.DIAMOND)).add(); - new TreeRitualRecipe(new ItemStack(Blocks.SAPLING), new ItemStack(ModBlocks.ANCIENT_SAPLING), 200, + new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "ancient_sapling"), + new ItemStack(Blocks.SAPLING), new ItemStack(ModBlocks.ANCIENT_SAPLING), 200, new ItemStack(Blocks.SAPLING), new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Blocks.RED_FLOWER), @@ -28,7 +33,9 @@ public final class ModRecipes { new ItemStack(Items.REEDS), new ItemStack(ModItems.GOLD_LEAF)).add(); - new AltarRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(ModItems.INFUSED_IRON), 300, 80).add(); - new AltarRecipe(new ItemStack(Blocks.STONE), new ItemStack(ModBlocks.INFUSED_STONE), 150, 40).add(); + new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "infused_iron"), + new ItemStack(Items.IRON_INGOT), new ItemStack(ModItems.INFUSED_IRON), 300, 80).add(); + new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "infused_stone"), + new ItemStack(Blocks.STONE), new ItemStack(ModBlocks.INFUSED_STONE), 150, 40).add(); } } diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java index a044fa41..575a74a7 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java @@ -2,20 +2,24 @@ package de.ellpeck.naturesaura.recipes; import de.ellpeck.naturesaura.Helper; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; -import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class TreeRitualRecipe { - public static final List RECIPES = new ArrayList<>(); + public static final Map RECIPES = new HashMap<>(); + public final ResourceLocation name; public final ItemStack saplingType; public final ItemStack[] items; public final ItemStack result; public final int time; - public TreeRitualRecipe(ItemStack saplingType, ItemStack result, int time, ItemStack... items) { + public TreeRitualRecipe(ResourceLocation name, ItemStack saplingType, ItemStack result, int time, ItemStack... items) { + this.name = name; this.saplingType = saplingType; this.items = items; this.result = result; @@ -36,7 +40,7 @@ public class TreeRitualRecipe { } public TreeRitualRecipe add() { - RECIPES.add(this); + RECIPES.put(this.name, this); return this; } } diff --git a/src/main/resources/assets/naturesaura/lang/en_US.lang b/src/main/resources/assets/naturesaura/lang/en_US.lang index 58fc8d13..faa64c23 100644 --- a/src/main/resources/assets/naturesaura/lang/en_US.lang +++ b/src/main/resources/assets/naturesaura/lang/en_US.lang @@ -24,7 +24,7 @@ item.naturesaura.infused_iron_hoe.name=Botanist's Hoe item.naturesaura.ancient_stick.name=Ancient Wood Rod item.naturesaura.aura_cache.name=Aura Cache -container.naturesaura.tree_ritual.name=Tree Infusion -container.naturesaura.altar.name=Natural Altar +container.naturesaura.tree_ritual.name=Ritual of the Forest +container.naturesaura.altar.name=Natural Altar Infusion info.naturesaura.aura_in_area=Aura Around \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/collecting.json b/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/collecting.json index 70ea82f2..7edb18e5 100644 --- a/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/collecting.json +++ b/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/collecting.json @@ -2,5 +2,5 @@ "name": "Collecting Aura", "description": "To be able to make use of the $(thing)Aura$() in the world, one must first find a way to handle it reasonably. Converting it into a storable form $(italics)(no, not liquids)$() might prove somewhat difficult, but this category will provide guidance.", "icon": "naturesaura:eye", - "sortnum": 5 + "sortnum": 10 } \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/practices.json b/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/practices.json index 5f2fab7d..8306197f 100644 --- a/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/practices.json +++ b/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/practices.json @@ -2,5 +2,5 @@ "name": "Natural Practices", "description": "Related to $(thing)Aura$(), but not necessarily to its collection and storage, can be other practices that might prove beneficial in the long run. This category provides information on what practices exist and how to execute them.", "icon": "naturesaura:gold_powder", - "sortnum": 15 + "sortnum": 5 } \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/using.json b/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/using.json index c719fcd1..f4e5a3da 100644 --- a/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/using.json +++ b/src/main/resources/assets/naturesaura/patchouli_books/en_us/categories/using.json @@ -2,5 +2,5 @@ "name": "Harnessing Aura", "description": "When collecting $(thing)Aura$() from the world, an instinctive question for any human to ask would be $(italic)\"How can one make use of this?\"$() This category houses entries that will explain just that.", "icon": "naturesaura:aura_cache", - "sortnum": 10 + "sortnum": 15 } \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/collecting/altar.json b/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/collecting/altar.json new file mode 100644 index 00000000..79035a9f --- /dev/null +++ b/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/collecting/altar.json @@ -0,0 +1,17 @@ +{ + "name": "The Natural Altar", + "icon": "naturesaura:nature_altar", + "category": "naturesaura:collecting", + "priority": true, + "pages": [ + { + "type": "text", + "text": "A rudimentary, yet effective way of collecting $(thing)Aura$() early on is the $(item)Natural Altar$(). After creating the setup shown on the following page, the altar will start slowly draining $(thing)Aura$() in the vicinity.$(br)The collected $(thing)Aura$() can then be used in several ways, $(l:naturesaura:using/altar)infusing items$() for instance." + }, + { + "type": "naturesaura:tree_ritual", + "text": "Creating the $(item)Natural Altar$() using the $(l:naturesaura:using/tree_ritual)Ritual of the Forest$().", + "recipe": "naturesaura:nature_altar" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/items/infused_iron.json b/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/items/infused_iron.json deleted file mode 100644 index f4783cc2..00000000 --- a/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/items/infused_iron.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Infused Iron", - "icon": "naturesaura:infused_iron", - "category": "naturesaura:items", - "pages": [ - { - "type": "text", - "text": "Hi" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/using/altar.json b/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/using/altar.json new file mode 100644 index 00000000..d3b6c7e9 --- /dev/null +++ b/src/main/resources/assets/naturesaura/patchouli_books/en_us/entries/using/altar.json @@ -0,0 +1,18 @@ +{ + "name": "Natural Altar Infusion", + "icon": "naturesaura:nature_altar", + "category": "naturesaura:using", + "priority": true, + "pages": [ + { + "type": "text", + "text": "When the $(l:naturesaura:collecting/altar)Natural Altar$() has collected a sufficient amount of $(thing)Aura$(), it will be able to infuse items of certain materials, converting them into different, more powerful materials. To do this, simply place any material onto the altar and wait for the infusion to be completed.$(br2)The following pages list some useful materials that a botanist might frequently need." + }, + { + "type": "naturesaura:altar", + "text": "Creating $(item)Infused Iron$() and $(item)Infused Rock$(), important ingredients in the creation of several $(l:naturesaura:items)Natural Items$().", + "recipe": "naturesaura:infused_iron", + "recipe2": "naturesaura:infused_stone" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/textures/gui/altar.png b/src/main/resources/assets/naturesaura/textures/gui/jei/altar.png similarity index 100% rename from src/main/resources/assets/naturesaura/textures/gui/altar.png rename to src/main/resources/assets/naturesaura/textures/gui/jei/altar.png diff --git a/src/main/resources/assets/naturesaura/textures/gui/tree_ritual.png b/src/main/resources/assets/naturesaura/textures/gui/jei/tree_ritual.png similarity index 100% rename from src/main/resources/assets/naturesaura/textures/gui/tree_ritual.png rename to src/main/resources/assets/naturesaura/textures/gui/jei/tree_ritual.png diff --git a/src/main/resources/assets/naturesaura/textures/gui/patchouli/elements.png b/src/main/resources/assets/naturesaura/textures/gui/patchouli/elements.png new file mode 100644 index 0000000000000000000000000000000000000000..38e7bd73e59d06565f5648ef6bab3b125006f6d9 GIT binary patch literal 3453 zcmeHKX;f257JeZLDjnz^T0{ao9A`jjz@;GqnjnL0YD8276-bbF!vsPIf`KfyEuaY4 z3Zj63AWMkICJ+cFC`$xcWl2~fVh*xIK$Nf~Eb{cub?>eE zzIr#09&tcy(B1$50K&=fz%c-TK_U!Trwlb79yV^!z9*FydEB*#;M z0HF42`GIZRc901vwJ3J(l;i&ADZ$?4a{$Tvk{`v??;J(n%ygIOE+3=hLjdrd!s&p` zi4dJd! zz)?yyrv{UZXo<9kiPM|aE@V-u6%$KJ)^}*stlUF6xsNT>c{Af;E|MEMG|i<+ad0M; zz`1oM&GrvsXujKc1waslv*T2Y8Gdf(;uk1wuH_0PQ4GRu`=;|tea{+<6eHBBv>z ztb*i&n*0WF*%OSq_r9thJxm^OQ^j(Dn47v#aw{vZP_wbG4*ng>1l@2cT}Z9DUD{D9 zr8ov6)ptHAHET1km&tZ_^E&MJogNhhSv}!|m)};=I(8=T^v(bT0jQ!9n=ZYqF)x4t z(h~FRwHm@IW#Fl>D_Qff2OJ3$c>UKMPmZa#w*I|YnAf?`XYE^LihLKJ7!|F%h@q#(i^J=R ziU*SI%B?XU{L~vCB8H4|J?05YuN%VyGs#ib1u%UiGA7R>4l3TZUe8Phh;JrXgcmie z?Y1M9D~Rk*84R`8uflz{u|1MKJMMG)OB*oqA*S()Q|*6nQnd0l^;MBEO(t)lrKl7Y z42b&vtb2^lfRswFUxxd*bW*pf`@e^E6%V*S$6v0DPbmAWw8y8q@M58FTV2G}Prs>8 z0$oJ|?kA{IT}tm{hRloCmy`f@H_6z@1aIO+BVIQ-I1}x_(B<*~sBA3AP#Dq;Fc%6Q zYp7mMxUt!_R3g_R!y~_PpM$QY$ERV3ZyxVS>m=BcYQ2Q&Icbem#3o_~t|v+&QGNW) zq~UMFOifMCdM}DBuFicKoREYy)v~U1(uJ|8hhTF{3kcurNmVPFuFpW@Ii39o6vb@Bd>|t1mLK?Ww_2Jq(yEYDgC^^N;1ada zef~^-QF~OFe8_emIi`fvF%%@ZQ(Rmesx7Fkt&P=A;5LaQfN#O$j9c~ndQ+n^sW7%e z*u&_w`-x2u$jqP6m)J&LsHXuzZO*=p0f4!Pblm@4#XqBqe}C*O($N2 zOnwL!D}O#Ip_H*QmvFbVYZ)#D&0lQ%-}XI8tew26=~TQvtlf@?4frCD^SP*nTb=GHJ9*f0+dg+ts(CJUc zb!E*ciExaf2%#2jNXe?vKBVGmIIzaB|AEBqlBAX9Uoq#EO^{|;-_TDTyngT=Dfga# z<0PAc6FcL2@e#+6g|HEkY`rl^(YPRVvgoYeB*fIsO6UYYls$Oe??V9$f{ch&sRLx3 z3ZCfmQme>q3y$L|r}@vNC0P)FYJb2_Bj;aKif%xjv_G1c(Ps|O-l&Lcyx}?4i{!SM zl3?Fl`+k>kZ6gXn**~WVuG{;6}y^#}@(6e1(@ymkLuWqV$9B$L=yw=a3RNX_F zuOJ%tCHe7$4@V7dFBA=AC9ZwD=n2qbczdl~wVn4oQyCA#E?_h4Axg!-kbValmf5Ga zjp3Aid8uOPy{P*68W*uM2-Rm_e6)v;5LpBcW!p=J>%P8zr1G&U{K%3+1AQc$`O#r; zf@>GZjUqTNy@CS}%6eD?&=aOJ8m@SN5T#!u0s%*^EUfi>o*^kx?`&&pi-5F|$g1w{ zZnSO!4FdkubOF}7H%rC~-bry*NN=_SSybFd`~ zqn&IV%lgGDXIk+JSTz!Ui~H`CPz~rJh{PAjSmgd_T