aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2021-05-20 22:57:12 +0200
committerLéa Gris <lea.gris@noiraude.net>2021-05-21 13:41:21 +0200
commit678c9a6e1e7a3a1127c40ae5c3dda7ef4519bfb7 (patch)
treef275c84399e59b714bcd9a70f0ffa6d6020f5ffe /src/main/java/gregtech/api
parent04468545985a4fed401d9b6626670e8af5938920 (diff)
downloadGT5-Unofficial-678c9a6e1e7a3a1127c40ae5c3dda7ef4519bfb7.tar.gz
GT5-Unofficial-678c9a6e1e7a3a1127c40ae5c3dda7ef4519bfb7.tar.bz2
GT5-Unofficial-678c9a6e1e7a3a1127c40ae5c3dda7ef4519bfb7.zip
feat(render): implementation-free api texture factory
Provides an implementation-free API Texture factory an builder. Deprecates gregtech.api.objects.GT_*Texture.java classes Once all GregTech add-on will be migrated to the new implemnetation-free API, changes to the implementation will not affect the add-on. For now, this API allow rendering of in-world glow textures. In-inventory/hand rendering of glow texture require implementation changes that are postponed until no add-on uses the deprecated embedded implementation API.
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java273
-rw-r--r--src/main/java/gregtech/api/interfaces/IBlockContainer.java8
-rw-r--r--src/main/java/gregtech/api/interfaces/ITexture.java7
-rw-r--r--src/main/java/gregtech/api/interfaces/ITextureBuilder.java72
-rw-r--r--src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java41
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java391
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java155
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java43
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java38
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java52
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java45
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java30
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java18
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java17
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java8
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java17
-rw-r--r--src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java7
-rw-r--r--src/main/java/gregtech/api/objects/GT_MultiTexture.java8
-rw-r--r--src/main/java/gregtech/api/objects/GT_RenderedTexture.java3
-rw-r--r--src/main/java/gregtech/api/objects/GT_SidedTexture.java4
-rw-r--r--src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java2
-rw-r--r--src/main/java/gregtech/api/render/GT_CopiedBlockTexture.java128
-rw-r--r--src/main/java/gregtech/api/render/GT_MultiTexture.java59
-rw-r--r--src/main/java/gregtech/api/render/GT_RenderedGlowTexture.java208
-rw-r--r--src/main/java/gregtech/api/render/GT_RenderedTexture.java219
-rw-r--r--src/main/java/gregtech/api/render/GT_SidedTexture.java91
-rw-r--r--src/main/java/gregtech/api/render/GT_StdRenderedTexture.java45
-rw-r--r--src/main/java/gregtech/api/render/TextureFactory.java147
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java42
34 files changed, 912 insertions, 1321 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index f9a70e2b6c..8cb3547768 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -3,9 +3,7 @@ package gregtech.api.enums;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.render.GT_RenderedTexture;
-import gregtech.api.render.GT_SidedTexture;
-import gregtech.api.render.GT_StdRenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
@@ -1009,30 +1007,30 @@ public class Textures {
/**
* Icon for Fresh CFoam
*/
- public static final ITexture[] FRESHFOAM = {new GT_RenderedTexture(CFOAM_FRESH)};
+ public static final ITexture[] FRESHFOAM = {TextureFactory.of(CFOAM_FRESH)};
/**
* Icons for Hardened CFoam
* 0 = No Color
* 1 - 16 = Colors
*/
public static final ITexture[][] HARDENEDFOAMS = {
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
};
/**
* Machine Casings by Tier
@@ -1451,135 +1449,135 @@ public class Textures {
BLOCK_BLAZE
};
public static ITexture[] HIDDEN_TEXTURE = {
- new GT_StdRenderedTexture(HIDDEN_FACE)
+ TextureFactory.builder().addIcon(HIDDEN_FACE).stdOrient().build()
};
public static ITexture[]
ERROR_RENDERING = {
- new GT_RenderedTexture(RENDERING_ERROR)
+ TextureFactory.of(RENDERING_ERROR)
};
public static ITexture[] OVERLAYS_ENERGY_IN = {
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
};
public static ITexture[] OVERLAYS_ENERGY_OUT = {
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
};
public static ITexture[] OVERLAYS_ENERGY_IN_MULTI = {
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
};
public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI = {
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
};
public static ITexture[] OVERLAYS_ENERGY_IN_POWER = {
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
};
public static ITexture[] OVERLAYS_ENERGY_OUT_POWER = {
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
};
public static ITexture[] LOCKERS = {
- new GT_RenderedTexture(OVERLAY_LOCKER_000),
- new GT_RenderedTexture(OVERLAY_LOCKER_001),
- new GT_RenderedTexture(OVERLAY_LOCKER_002),
- new GT_RenderedTexture(OVERLAY_LOCKER_003),
- new GT_RenderedTexture(OVERLAY_LOCKER_004),
- new GT_RenderedTexture(OVERLAY_LOCKER_005),
- new GT_RenderedTexture(OVERLAY_LOCKER_006),
- new GT_RenderedTexture(OVERLAY_LOCKER_007),
- new GT_RenderedTexture(OVERLAY_LOCKER_008),
- new GT_RenderedTexture(OVERLAY_LOCKER_009),
- new GT_RenderedTexture(OVERLAY_LOCKER_010),
- new GT_RenderedTexture(OVERLAY_LOCKER_011),
- new GT_RenderedTexture(OVERLAY_LOCKER_012),
- new GT_RenderedTexture(OVERLAY_LOCKER_013),
+ TextureFactory.of(OVERLAY_LOCKER_000),
+ TextureFactory.of(OVERLAY_LOCKER_001),
+ TextureFactory.of(OVERLAY_LOCKER_002),
+ TextureFactory.of(OVERLAY_LOCKER_003),
+ TextureFactory.of(OVERLAY_LOCKER_004),
+ TextureFactory.of(OVERLAY_LOCKER_005),
+ TextureFactory.of(OVERLAY_LOCKER_006),
+ TextureFactory.of(OVERLAY_LOCKER_007),
+ TextureFactory.of(OVERLAY_LOCKER_008),
+ TextureFactory.of(OVERLAY_LOCKER_009),
+ TextureFactory.of(OVERLAY_LOCKER_010),
+ TextureFactory.of(OVERLAY_LOCKER_011),
+ TextureFactory.of(OVERLAY_LOCKER_012),
+ TextureFactory.of(OVERLAY_LOCKER_013),
};
/**
* USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0]
@@ -1595,8 +1593,11 @@ public class Textures {
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;
+ MACHINE_CASINGS[i][j] = TextureFactory.of(
+ MACHINECASINGS_BOTTOM[i],
+ MACHINECASINGS_TOP[i],
+ MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
+ casingTexturePages[0] = new ITexture[128];
//adds some known pages, modders also can do it...
GT_Utility.addTexturePage((byte) 1);
GT_Utility.addTexturePage((byte) 8);
@@ -1743,7 +1744,7 @@ public class Textures {
ENERGY_BAR_8,
};
- public static final ITexture[] ERROR_RENDERING = {new GT_RenderedTexture(RENDERING_ERROR)};
+ public static final ITexture[] ERROR_RENDERING = {TextureFactory.of(RENDERING_ERROR)};
protected IIcon mIcon, mOverlay;
diff --git a/src/main/java/gregtech/api/interfaces/IBlockContainer.java b/src/main/java/gregtech/api/interfaces/IBlockContainer.java
new file mode 100644
index 0000000000..7949ae90ce
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/IBlockContainer.java
@@ -0,0 +1,8 @@
+package gregtech.api.interfaces;
+
+import net.minecraft.block.Block;
+
+public interface IBlockContainer {
+ Block getBlock();
+ byte getMeta();
+}
diff --git a/src/main/java/gregtech/api/interfaces/ITexture.java b/src/main/java/gregtech/api/interfaces/ITexture.java
index 61244a10ae..4c0b1984ca 100644
--- a/src/main/java/gregtech/api/interfaces/ITexture.java
+++ b/src/main/java/gregtech/api/interfaces/ITexture.java
@@ -20,6 +20,13 @@ public interface ITexture {
boolean isValidTexture();
/**
+ * @return {@code true} if this texture is from the old package
+ */
+ default boolean isOldTexture() {
+ return getClass().toString().startsWith("gregtech.api.objects");
+ }
+
+ /**
* Will initialize the {@link Tessellator} if rendering off-world (Inventory)
* @param aRenderer The {@link RenderBlocks} Renderer
* @param aNormalX The X Normal for current Quad Face
diff --git a/src/main/java/gregtech/api/interfaces/ITextureBuilder.java b/src/main/java/gregtech/api/interfaces/ITextureBuilder.java
new file mode 100644
index 0000000000..fde7f2e27b
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/ITextureBuilder.java
@@ -0,0 +1,72 @@
+package gregtech.api.interfaces;
+
+import gregtech.api.render.TextureFactory;
+import net.minecraft.block.Block;
+import net.minecraftforge.common.util.ForgeDirection;
+
+/**
+ * <p>This Interface defines operations to configure and build instances of the {@link ITexture} implementations</p>
+ * <p>Use the {@link TextureFactory#builder()} method to get an instance of the {@link ITextureBuilder} implementation.</p>
+ */
+public interface ITextureBuilder {
+ /**
+ * Build the {@link ITexture}
+ *
+ * @return The built {@link ITexture}
+ */
+ ITexture build();
+
+ /**
+ * @param block The {@link Block}
+ * @param meta The meta value for the Block
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setFromBlock(Block block, int meta);
+
+ /**
+ * @param side <p>The {@link ForgeDirection} side providing the texture</p>
+ * <p>Default is {@link ForgeDirection#UNKNOWN} to use same side as rendered</p>
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setFromSide(ForgeDirection side);
+
+ /**
+ * @param iconContainers The {@link IIconContainer}s to add
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder addIcon(IIconContainer... iconContainers);
+
+ /**
+ * @param rgba The RGBA tint for this {@link ITexture}
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setRGBA(short[] rgba);
+
+ /**
+ * @param iTextures The {@link ITexture} layers to add
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder addLayer(ITexture... iTextures);
+
+ /**
+ * Set alpha blending
+ * @param allowAlpha to set
+ *
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setAllowAlpha(boolean allowAlpha);
+
+ /**
+ * Texture will render with same orientation as with vanilla blocks
+ *
+ * @return {@link IT