diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2018-02-04 20:25:22 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2018-02-04 20:25:22 +1000 |
commit | df07c3247fe4c44c7c3539eecbc2af69bc305b49 (patch) | |
tree | abf68870cc92bb61514e5e2e8de942ae413e2c60 /src/Java/gregtech/api/enums | |
parent | d10ed0cdab2df584b867177de85f897f83bad187 (diff) | |
download | GT5-Unofficial-df07c3247fe4c44c7c3539eecbc2af69bc305b49.tar.gz GT5-Unofficial-df07c3247fe4c44c7c3539eecbc2af69bc305b49.tar.bz2 GT5-Unofficial-df07c3247fe4c44c7c3539eecbc2af69bc305b49.zip |
+ Added more casings for multiblocks.
+ Added the Fish Pond.
$ Added support for more textures in TAE.java.
- Disabled GT ASM.
Diffstat (limited to 'src/Java/gregtech/api/enums')
-rw-r--r-- | src/Java/gregtech/api/enums/TAE.java | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/src/Java/gregtech/api/enums/TAE.java b/src/Java/gregtech/api/enums/TAE.java index c6fc8c7790..fbc9e9e583 100644 --- a/src/Java/gregtech/api/enums/TAE.java +++ b/src/Java/gregtech/api/enums/TAE.java @@ -1,16 +1,22 @@ package gregtech.api.enums; +import java.lang.reflect.Field; + +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; public class TAE { //TAE stands for Texture Array Expansion. - + public static int gtTexturesArrayStartOrigin; - public static int gtPPLastUsedIndex = 96; + public static int gtPPLastUsedIndex = 64; + public static int secondaryIndex = 0; public static boolean hasArrayBeenExpanded = false; public static boolean hookGtTextures() { @@ -42,12 +48,36 @@ public class TAE { }*/ public static boolean registerTextures(GT_CopiedBlockTexture gt_CopiedBlockTexture) { - Textures.BlockIcons.CASING_BLOCKS[gtPPLastUsedIndex] = gt_CopiedBlockTexture; - gtPPLastUsedIndex++; - //Just so I know registration is done. - return true; + try { + + //Handle page 2. + if (gtPPLastUsedIndex >= 128) { + if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechSubVersion() > 30) { + Field x = ReflectionUtils.getField(Textures.BlockIcons.class, "casingTexturePages"); + if (x != null) { + ITexture[][] h = (ITexture[][]) x.get(null); + if (h != null) { + h[64][secondaryIndex++] = gt_CopiedBlockTexture; + x.set(null, h); + return true; + } + } + } + } + + //set to page 1. + else { + Textures.BlockIcons.CASING_BLOCKS[gtPPLastUsedIndex] = gt_CopiedBlockTexture; + gtPPLastUsedIndex++; + return true; + } + } + catch (Throwable t) { + t.printStackTrace(); + } + return false; } - + public static ITexture getTexture(int index){ if (!hasArrayBeenExpanded){ return null; @@ -56,7 +86,7 @@ public class TAE { return Textures.BlockIcons.CASING_BLOCKS[(96+index)]; } } - + public static int GTPP_INDEX(int ID){ return (96+ID); } |