From 402200971ed0e9c96360d28c0904acaba3abe267 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:01:09 -0500 Subject: [PATCH] Restore stability waila info for black hole (#3803) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- .../multi/compressor/MTEBlackHoleCompressor.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java index 4fc4ecc99f2..218f70d0ab6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java @@ -442,6 +442,8 @@ public void saveNBTData(NBTTagCompound aNBT) { public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); + tag.setByte("blackHoleStatus", blackHoleStatus); + tag.setFloat("blackHoleStability", blackHoleStability); tag.setInteger("parallels", getMaxParallelRecipes()); } @@ -454,6 +456,18 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat StatCollector.translateToLocal("GT5U.multiblock.parallelism") + ": " + EnumChatFormatting.WHITE + tag.getInteger("parallels")); + if (tag.getByte("blackHoleStatus") != 1) { + if (tag.getFloat("blackHoleStability") > 0) { + currentTip.add(EnumChatFormatting.DARK_PURPLE + "Black Hole Active"); + currentTip.add( + EnumChatFormatting.DARK_PURPLE + "Stability: " + + EnumChatFormatting.BOLD + + Math.round(tag.getFloat("blackHoleStability")) + + "%"); + } else { + currentTip.add(EnumChatFormatting.RED + "BLACK HOLE UNSTABLE"); + } + } else currentTip.add(EnumChatFormatting.DARK_PURPLE + "Black Hole Offline"); } private int getModeFromCircuit(ItemStack[] t) {