clarify what the aura bottles in altar recipes mean

This commit is contained in:
Ell 2020-09-28 01:50:17 +02:00
parent b280ede21e
commit 5cfbb0f372
4 changed files with 16 additions and 3 deletions

View file

@ -62,7 +62,7 @@ public class AltarCategory implements IRecipeCategory<AltarRecipe> {
if (altarRecipe.catalyst != Ingredient.EMPTY) if (altarRecipe.catalyst != Ingredient.EMPTY)
builder.add(altarRecipe.catalyst.getMatchingStacks()); builder.add(altarRecipe.catalyst.getMatchingStacks());
if (altarRecipe.requiredType != null) 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.setInputs(VanillaTypes.ITEM, builder.build());
iIngredients.setOutput(VanillaTypes.ITEM, altarRecipe.output); iIngredients.setOutput(VanillaTypes.ITEM, altarRecipe.output);
} }
@ -79,6 +79,6 @@ public class AltarCategory implements IRecipeCategory<AltarRecipe> {
Collections.singletonList(this.altar) : Arrays.asList(recipe.catalyst.getMatchingStacks())); Collections.singletonList(this.altar) : Arrays.asList(recipe.catalyst.getMatchingStacks()));
group.init(3, true, 51, 18); group.init(3, true, 51, 18);
if (recipe.requiredType != null) if (recipe.requiredType != null)
group.set(3, ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), recipe.requiredType)); group.set(3, recipe.getDimensionBottle());
} }
} }

View file

@ -35,7 +35,7 @@ public class ProcessorAltar implements IComponentProcessor {
return null; return null;
case "type": case "type":
if (this.recipe.requiredType != null) 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 else
return null; return null;
case "name": case "name":

View file

@ -1,8 +1,11 @@
package de.ellpeck.naturesaura.recipes; package de.ellpeck.naturesaura.recipes;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import de.ellpeck.naturesaura.NaturesAura;
import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.NaturesAuraAPI;
import de.ellpeck.naturesaura.api.aura.type.IAuraType; 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.data.IFinishedRecipe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipeSerializer; 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.item.crafting.Ingredient;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ResourceLocation; 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.common.crafting.CraftingHelper;
import net.minecraftforge.registries.ForgeRegistryEntry; import net.minecraftforge.registries.ForgeRegistryEntry;
@ -49,6 +54,12 @@ public class AltarRecipe extends ModRecipe {
return ModRecipes.ALTAR_TYPE; 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<IRecipeSerializer<?>> implements IRecipeSerializer<AltarRecipe> { public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<AltarRecipe> {
@Override @Override

View file

@ -153,6 +153,8 @@
"info.naturesaura.remaining": "%s remaining", "info.naturesaura.remaining": "%s remaining",
"info.naturesaura.break_prevention": "Eir's Token applied", "info.naturesaura.break_prevention": "Eir's Token applied",
"info.naturesaura.broken": " (Broken)", "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": "Nature's Aura",
"advancement.naturesaura.root.desc": "Becoming a magical botanist", "advancement.naturesaura.root.desc": "Becoming a magical botanist",
"advancement.naturesaura.get_book": "Pages of Discovery", "advancement.naturesaura.get_book": "Pages of Discovery",