From 65e0f38db67b21e1a4e6e950ea15431b6f7bfd44 Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Mon, 9 Sep 2024 05:13:37 +0800 Subject: Add astral array amount tooltips to EOH (#3120) Co-authored-by: boubou19 Co-authored-by: Martin Robertz Co-authored-by: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> --- .../metaTileEntity/multi/MTEEyeOfHarmony.java | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java') diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index 0104723c3c..bdbef3048e 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -1690,15 +1690,22 @@ public class MTEEyeOfHarmony extends TTMultiblockBase implements IConstructable, @Override public void addAdditionalTooltipInformation(ItemStack stack, List tooltip) { - if (stack.hasTagCompound() && stack.getTagCompound() - .hasKey(PLANET_BLOCK)) { - tooltip.add( - 1, - GTLanguageManager.addStringLocalization("EOH_Controller_PlanetBlock", "Current Planet Block: ") + AQUA - + new ItemStack( - ModBlocks.getBlock( - stack.getTagCompound() - .getString(PLANET_BLOCK))).getDisplayName()); + if (stack.hasTagCompound()) { + NBTTagCompound nbt = stack.getTagCompound(); + if (nbt.hasKey(PLANET_BLOCK)) { + tooltip.add( + 1, + GTLanguageManager.addStringLocalization("EOH_Controller_PlanetBlock", "Current Planet Block: ") + + AQUA + + new ItemStack(ModBlocks.getBlock(nbt.getString(PLANET_BLOCK))).getDisplayName()); + } + if (nbt.getLong(ASTRAL_ARRAY_AMOUNT_NBT_TAG) > 0) { + tooltip.add( + 1, + GTLanguageManager + .addStringLocalization("EOH_Controller_AstralArrayAmount", "Stored Astral Arrays: ") + AQUA + + formatNumbers(nbt.getLong(ASTRAL_ARRAY_AMOUNT_NBT_TAG))); + } } } -- cgit