aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks
diff options
context:
space:
mode:
authorMaxim <maxim235@gmx.de>2023-04-10 15:23:27 +0200
committerGitHub <noreply@github.com>2023-04-10 15:23:27 +0200
commitdeb860c73432cfa0796645c3893b0128f77d0217 (patch)
treed1f711b6ade0fbe5b8ef9f9004e51a6c9ad238e1 /src/main/java/gregtech/common/blocks
parent3f0c9a372321eda5147cd9a0e449b6ebc15a3277 (diff)
downloadGT5-Unofficial-deb860c73432cfa0796645c3893b0128f77d0217.tar.gz
GT5-Unofficial-deb860c73432cfa0796645c3893b0128f77d0217.tar.bz2
GT5-Unofficial-deb860c73432cfa0796645c3893b0128f77d0217.zip
Added tooltip line which displays the machine color, if any (#1868)
* Added tooltip line which displays the machine color, if any * Added chat formatting color to dyes enum * Minor cleanup
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Item_Machines.java12
1 files changed, 12 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 c947c50091..3e946633b3 100644
--- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
+++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
@@ -23,6 +23,7 @@ import net.minecraftforge.fluids.IFluidContainerItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Dyes;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.ISecondaryDescribable;
import gregtech.api.interfaces.metatileentity.IConnectable;
@@ -158,6 +159,17 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem {
}
CoverableTileEntity.addInstalledCoversInformation(aNBT, aList);
+ if (aNBT.hasKey("mColor") && aNBT.getByte("mColor") != -1) {
+ aList.add(
+ GT_LanguageManager.addStringLocalization(
+ "GT_TileEntity_COLORED",
+ "Colored",
+ !GregTech_API.sPostloadFinished) + " ("
+ + Dyes.get(aNBT.getByte("mColor") - 1).formatting
+ + Dyes.get(aNBT.getByte("mColor") - 1).mName
+ + EnumChatFormatting.GRAY
+ + ")");
+ }
}
} catch (Throwable e) {
GT_FML_LOGGER.error("addInformation", e);