From a3c8210a4318f34cbe46306cb1c829f41650515d Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sat, 28 Mar 2020 20:32:11 +0000 Subject: + Added Materials for the new LNR fuels. + Added a new casing block class for special handled multiblock casings. + Added locale for Naq Fuel Cells. $ Reworked TAE. There are now 19 texture slots free out of the 64 total. $ Fixed a minor bug in the update checker. --- src/Java/gregtech/api/enums/TAE.java | 79 ++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 25 deletions(-) (limited to 'src/Java/gregtech/api') diff --git a/src/Java/gregtech/api/enums/TAE.java b/src/Java/gregtech/api/enums/TAE.java index 2827704f62..d7e16feb09 100644 --- a/src/Java/gregtech/api/enums/TAE.java +++ b/src/Java/gregtech/api/enums/TAE.java @@ -1,10 +1,14 @@ package gregtech.api.enums; import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.HashSet; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -13,40 +17,65 @@ public class TAE { //TAE stands for Texture Array Expansion. - public static int gtTexturesArrayStartOrigin; public static int gtPPLastUsedIndex = 64; public static int secondaryIndex = 0; - public static boolean hasArrayBeenExpanded = false; + + public static HashMap mTAE = new HashMap(); + private static final HashSet mFreeSlots = new HashSet(64); + + static { + for (int i=64;i<128;i++) { + mFreeSlots.add(i); + } + Logger.INFO("Initialising TAE."); + } - public static boolean hookGtTextures() { - /*ITexture[] textureArrayDump = Textures.BlockIcons.CASING_BLOCKS; - ITexture[] newTextureArray = new ITexture[1024]; - Utils.LOG_INFO("|======| Texture Array Start Length: "+textureArrayDump.length+" |======|"); - for (int r=0;r aTemp = new AutoMap(mFreeSlots); + for (int i = 0; i < mFreeSlots.size() ; i++) { + aFreeSpaces += aTemp.get(i); + if (i != (mFreeSlots.size() - 1)) { + aFreeSpaces += ", "; } } - gtTexturesArrayStartOrigin = textureArrayDump.length; - System.arraycopy(textureArrayDump, 0, newTextureArray, 0, textureArrayDump.length); - Textures.BlockIcons.CASING_BLOCKS = newTextureArray; - if (Textures.BlockIcons.CASING_BLOCKS.length == 1024){ - hasArrayBeenExpanded = true; + Logger.INFO("Free Indexes within TAE: "+aFreeSpaces); + Logger.INFO("Filling them with ERROR textures."); + for (int aFreeSlot : aTemp.values()) { + registerTexture(aFreeSlot, new GT_CopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); } - else { - hasArrayBeenExpanded = false; + Logger.INFO("Finalising TAE."); + for (int aKeyTae : mTAE.keySet()) { + Textures.BlockIcons.CASING_BLOCKS[aKeyTae] = mTAE.get(aKeyTae); } - return hasArrayBeenExpanded;*/ - return true; + Logger.INFO("Finalised TAE."); } - /*public static boolean registerTextures(GT_RenderedTexture textureToRegister) { - Textures.BlockIcons.CASING_BLOCKS[gtPPLastUsedIndex] = textureToRegister; - //Just so I know registration is done. - return true; - }*/ - - public static boolean registerTextures(GT_CopiedBlockTexture gt_CopiedBlockTexture) { + private static boolean registerTextures(GT_CopiedBlockTexture gt_CopiedBlockTexture) { try { //Handle page 2. Logger.INFO("[TAE} Registering Texture, Last used casing ID is "+gtPPLastUsedIndex+"."); -- cgit