aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gregtech/api/enums/TAE.java54
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java6
6 files changed, 67 insertions, 9 deletions
diff --git a/src/Java/gregtech/api/enums/TAE.java b/src/Java/gregtech/api/enums/TAE.java
new file mode 100644
index 0000000000..40811a141c
--- /dev/null
+++ b/src/Java/gregtech/api/enums/TAE.java
@@ -0,0 +1,54 @@
+package gregtech.api.enums;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+
+public class TAE {
+
+ //TAE stands for Texture Array Expansion.
+
+ public static int gtTexturesArrayStartOrigin;
+ public static int gtPPLastUsedIndex = 512;
+ public static boolean hasArrayBeenExpanded = false;
+
+ public static boolean hookGtTextures() {
+ ITexture[] textureArrayDump = Textures.BlockIcons.CASING_BLOCKS;
+ GT_RenderedTexture[] newTextureArray = new GT_RenderedTexture[1024];
+ 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;
+ }
+ else {
+ hasArrayBeenExpanded = false;
+ }
+ return hasArrayBeenExpanded;
+ }
+
+ 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) {
+ Textures.BlockIcons.CASING_BLOCKS[gtPPLastUsedIndex++] = gt_CopiedBlockTexture;
+ //Just so I know registration is done.
+ return true;
+ }
+
+ public static ITexture getTexture(int index){
+ if (!hasArrayBeenExpanded){
+ return null;
+ }
+ else {
+ return Textures.BlockIcons.CASING_BLOCKS[(512+index)];
+ }
+ }
+
+ public static int GTPP_INDEX(int ID){
+ return (512+ID);
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
index 4abe771f9c..c05df6ade3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.TAE;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Material_Casings;
@@ -15,14 +16,12 @@ import net.minecraft.world.IBlockAccess;
public class GregtechMetaCasingBlocks
extends GregtechMetaCasingBlocksAbstract {
- public final static int GTID = 0;
-
CasingTextureHandler TextureHandler = new CasingTextureHandler();
public GregtechMetaCasingBlocks() {
super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE);
for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- TexturesGtBlock.CASING_BLOCKS_GTPP[GTID + i] = new GT_CopiedBlockTexture(this, 6, i);
+ TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
}
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
index 014735f29b..e7ab9acc9a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
+import gregtech.api.enums.TAE;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Material_Casings;
@@ -12,14 +13,12 @@ import net.minecraft.util.IIcon;
public class GregtechMetaCasingBlocks2
extends GregtechMetaCasingBlocksAbstract {
- public final static int GTID = 16;
-
CasingTextureHandler2 TextureHandler = new CasingTextureHandler2();
public GregtechMetaCasingBlocks2() {
super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE);
for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- TexturesGtBlock.CASING_BLOCKS_GTPP[GTID + i] = new GT_CopiedBlockTexture(this, 6, i);
+ TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i));
}
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Structural Glass Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block");
@@ -56,7 +55,7 @@ extends GregtechMetaCasingBlocksAbstract {
}
@Override
- public IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57]
+ public IIcon getIcon(final int aSide, final int aMeta) {
return CasingTextureHandler2.getIcon(aSide, aMeta);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
index 9ccae92bae..2e0687a6a2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
@@ -12,7 +12,7 @@ import net.minecraft.util.ResourceLocation;
public class TexturesGtBlock {
- public static ITexture[] CASING_BLOCKS_GTPP = new ITexture[256];
+ //public static ITexture[] CASING_BLOCKS_GTPP = new ITexture[256];
/*
* Handles Custom Textures.
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java
index 8d02f48be9..a014b35c15 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java
@@ -43,7 +43,7 @@ extends GregtechMeta_MultiBlockBase {
public String[] getDescription() {
return new String[]{
"Controller Block for the Industrial Sifter",
- "Size[WxHxL]: 5x3x5 (Hollow)",
+ "Size[WxHxL]: 5x3x5",
"Controller (Center Bottom)",
"1x Input Bus (Any top or bottom edge casing)",
"4x Output Bus (Any top or bottom edge casing)",
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
index 3dd3c88dc4..1f8bb5e86e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.gregtech.loaders;
+import gregtech.api.enums.TAE;
import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2;
@@ -8,6 +10,10 @@ public class Gregtech_Blocks {
public static void run(){
+ Utils.LOG_INFO("Expanding Gregtech Texture Array from 128 -> 1024.");
+ boolean didExpand = TAE.hookGtTextures();
+ Utils.LOG_INFO("Did Texture Array expand correctly? "+didExpand);
+
//Casing Blocks
ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2();