aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/enums/Textures.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/enums/Textures.java')
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index f02a8c5d7f..6468f63a2e 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -5,6 +5,7 @@ import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.GT_SidedTexture;
+import gregtech.api.util.GT_Utility;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
@@ -1457,18 +1458,35 @@ public class Textures {
new GT_RenderedTexture(OVERLAY_LOCKER_012),
new GT_RenderedTexture(OVERLAY_LOCKER_013),
};
+ /**
+ * USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0]
+ */
+ @Deprecated
public static ITexture[] CASING_BLOCKS = new ITexture[128];//original variable still limited to 128
- public static ITexture[][]
- MACHINE_CASINGS = new ITexture[16][17],
- casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
+ public static ITexture[][] MACHINE_CASINGS = new ITexture[16][17];
+ /**
+ * by Default pages are null
+ */
+ public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
+
+ public static ITexture getCasingTextureForId(int id){
+ return casingTexturePages[(id>>7)&0x7f][id&0x7f];
+ }
+ public static void setCasingTextureForId(int id,ITexture iTexture){
+ casingTexturePages[(id>>7)&0x7f][id&0x7f]=iTexture;
+ }
+ public static void setCasingTexture(byte page,byte index,ITexture iTexture){
+ casingTexturePages[page][index]=iTexture;
+ }
static {
for (byte i = 0; i < MACHINE_CASINGS.length; i++)
for (byte j = 0; j < MACHINE_CASINGS[i].length; j++)
MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
casingTexturePages[0] = CASING_BLOCKS;
- if (casingTexturePages[8] == null)
- casingTexturePages[8] = new ITexture[128];
+ //adds some known pages, modders also can do it...
+ GT_Utility.addTexturePage((byte)1);
+ GT_Utility.addTexturePage((byte)8);
}
protected IIcon mIcon;
@@ -1660,4 +1678,4 @@ public class Textures {
}
}
}
-} \ No newline at end of file
+}