diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-08-19 00:18:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 18:18:26 +0200 |
commit | 6c82842b56e9f613760c6b0cff6480af2e2ddb07 (patch) | |
tree | a3ac74162d8057960032403d2a354bccf0e345c3 /src/main/java/gregtech/api/util/GT_Utility.java | |
parent | 27a68fdf779e6ab8aa6ff5b48c0977855709c3ad (diff) | |
download | GT5-Unofficial-6c82842b56e9f613760c6b0cff6480af2e2ddb07.tar.gz GT5-Unofficial-6c82842b56e9f613760c6b0cff6480af2e2ddb07.tar.bz2 GT5-Unofficial-6c82842b56e9f613760c6b0cff6480af2e2ddb07.zip |
no more magical texture index (#1249)
* no more magical texture index
* add a reverse map for fxxk sake
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_Utility.java')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index a1ad2e317c..b03c3ab13e 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -18,6 +18,7 @@ import gregtech.api.enums.*; import gregtech.api.events.BlockScanningEvent; import gregtech.api.interfaces.IBlockContainer; import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.IHasIndexedTexture; import gregtech.api.interfaces.IProjectileItem; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IBasicEnergyContainer; @@ -3246,6 +3247,12 @@ public class GT_Utility { return base; } + public static int getCasingTextureIndex(Block block, int meta) { + if (block instanceof IHasIndexedTexture) + return ((IHasIndexedTexture) block).getTextureIndex(meta); + return Textures.BlockIcons.ERROR_TEXTURE_INDEX; + } + @AutoValue public abstract static class ItemId { /** This method copies NBT, as it is mutable. */ |