diff options
author | Johnson <johnssoft@ya.ru> | 2020-03-19 21:09:21 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 09:09:21 -0700 |
commit | feca5739287583eee824512ff61714ae4113a6fc (patch) | |
tree | d6bacba66e32bf44a6a57ed5d2087c65104851c0 /src/main/java/gregtech/common/blocks/GT_Item_Machines.java | |
parent | 67e782284bba73127fa6ff757a504ab386fef60a (diff) | |
download | GT5-Unofficial-feca5739287583eee824512ff61714ae4113a6fc.tar.gz GT5-Unofficial-feca5739287583eee824512ff61714ae4113a6fc.tar.bz2 GT5-Unofficial-feca5739287583eee824512ff61714ae4113a6fc.zip |
Add cover information on the machine item tooltip. (#252)
* Add cover information on the machine item tooltip.
Diffstat (limited to 'src/main/java/gregtech/common/blocks/GT_Item_Machines.java')
-rw-r--r-- | src/main/java/gregtech/common/blocks/GT_Item_Machines.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 773268d424..1424a016e8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -25,6 +25,9 @@ import java.util.List; public class GT_Item_Machines
extends ItemBlock {
+
+ private static final String[] directionNames = {"Bottom", "Top", "North", "South", "West", "East"};
+
public GT_Item_Machines(Block par1) {
super(par1);
setMaxDamage(0);
@@ -85,12 +88,29 @@ public class GT_Item_Machines if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
}
+
+ addInstalledCoversInformation(aNBT, aList);
}
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
}
+ private void addInstalledCoversInformation(NBTTagCompound aNBT, List<String> aList) {
+ if (aNBT.hasKey("mCoverSides")){
+ int[] mCoverSides = aNBT.getIntArray("mCoverSides");
+ if (mCoverSides != null && mCoverSides.length == 6) {
+ for (byte i = 0; i < 6; i++) {
+ int coverId = mCoverSides[i];
+ ItemStack coverStack = GT_Utility.intToStack(coverId);
+ if (coverStack != null) {
+ aList.add(String.format("Cover on %s side: %s", directionNames[i], coverStack.getDisplayName()));
+ }
+ }
+ }
+ }
+ }
+
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
return false;
}
|