From 5cfbb0f372949114e19cef08fe9080e7e2fd09ac Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 28 Sep 2020 01:50:17 +0200 Subject: [PATCH] clarify what the aura bottles in altar recipes mean --- .../ellpeck/naturesaura/compat/jei/AltarCategory.java | 4 ++-- .../naturesaura/compat/patchouli/ProcessorAltar.java | 2 +- .../de/ellpeck/naturesaura/recipes/AltarRecipe.java | 11 +++++++++++ src/main/resources/assets/naturesaura/lang/en_us.json | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) 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 53a870a3..946f6225 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/AltarCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/AltarCategory.java @@ -62,7 +62,7 @@ public class AltarCategory implements IRecipeCategory { if (altarRecipe.catalyst != Ingredient.EMPTY) builder.add(altarRecipe.catalyst.getMatchingStacks()); if (altarRecipe.requiredType != null) - builder.add(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), altarRecipe.requiredType)); + builder.add(altarRecipe.getDimensionBottle()); iIngredients.setInputs(VanillaTypes.ITEM, builder.build()); iIngredients.setOutput(VanillaTypes.ITEM, altarRecipe.output); } @@ -79,6 +79,6 @@ public class AltarCategory implements IRecipeCategory { Collections.singletonList(this.altar) : Arrays.asList(recipe.catalyst.getMatchingStacks())); group.init(3, true, 51, 18); if (recipe.requiredType != null) - group.set(3, ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), recipe.requiredType)); + group.set(3, recipe.getDimensionBottle()); } } 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 3be2f7a2..c084dbfa 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java @@ -35,7 +35,7 @@ public class ProcessorAltar implements IComponentProcessor { return null; case "type": if (this.recipe.requiredType != null) - return IVariable.from(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), this.recipe.requiredType)); + return IVariable.from(this.recipe.getDimensionBottle()); else return null; case "name": diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java index 403be484..65464ded 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java @@ -1,8 +1,11 @@ package de.ellpeck.naturesaura.recipes; import com.google.gson.JsonObject; +import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.type.IAuraType; +import de.ellpeck.naturesaura.items.ItemAuraBottle; +import de.ellpeck.naturesaura.items.ModItems; import net.minecraft.data.IFinishedRecipe; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipeSerializer; @@ -10,6 +13,8 @@ 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.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.registries.ForgeRegistryEntry; @@ -49,6 +54,12 @@ public class AltarRecipe extends ModRecipe { return ModRecipes.ALTAR_TYPE; } + public ItemStack getDimensionBottle() { + ItemStack bottle = ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), this.requiredType); + bottle.setDisplayName(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".required_aura_type." + this.requiredType.getName())); + return bottle; + } + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { @Override diff --git a/src/main/resources/assets/naturesaura/lang/en_us.json b/src/main/resources/assets/naturesaura/lang/en_us.json index ad2571ee..2ff9ed90 100644 --- a/src/main/resources/assets/naturesaura/lang/en_us.json +++ b/src/main/resources/assets/naturesaura/lang/en_us.json @@ -153,6 +153,8 @@ "info.naturesaura.remaining": "%s remaining", "info.naturesaura.break_prevention": "Eir's Token applied", "info.naturesaura.broken": " (Broken)", + "info.naturesaura.required_aura_type.naturesaura:overworld": "Requires Natural Altar", + "info.naturesaura.required_aura_type.naturesaura:nether": "Requires Crimson Altar", "advancement.naturesaura.root": "Nature's Aura", "advancement.naturesaura.root.desc": "Becoming a magical botanist", "advancement.naturesaura.get_book": "Pages of Discovery",