aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/generators
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/common/tileentities/generators
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/common/tileentities/generators')
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java37
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java24
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java9
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java43
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java57
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java33
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java33
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java22
8 files changed, 127 insertions, 131 deletions
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java
index a6d72c5814..5733332eda 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java
@@ -4,18 +4,19 @@ import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
+import static gregtech.api.enums.Textures.BlockIcons.*;
+
public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator {
public static final int BASE_POLLUTION = 2;
@@ -67,65 +68,65 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe
if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
long rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3L);
}
- if(rValue> Integer.MAX_VALUE){
+ if (rValue > Integer.MAX_VALUE) {
throw new ArithmeticException("Integer LOOPBACK!");
}
- return (int)rValue;
+ return (int) rValue;
}
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){
- GT_Log.err.println("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord());
+ if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) {
+ GT_Log.err.println("Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord() + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord());
aBaseMetaTileEntity.setToFire();
}
super.onPostTick(aBaseMetaTileEntity, aTick);
}
public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_FRONT), OVERLAYS_ENERGY_OUT[this.mTier]};
}
public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)};
+ return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_BACK)};
}
public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
+ return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_BOTTOM)};
}
public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)};
+ return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_TOP)};
}
public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)};
+ return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_SIDE)};
}
public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), OVERLAYS_ENERGY_OUT[this.mTier]};
}
public ITexture[] getBackActive(byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)};
+ return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE)};
}
public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)};
+ return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE)};
}
public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)};
+ return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE)};
}
public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)};
+ return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE)};
}
@Override
public int getPollution() {
- return (int) (GT_MetaTileEntity_DieselGenerator.BASE_POLLUTION * Math.pow(2, mTier - 1));
+ return (int) (BASE_POLLUTION * Math.pow(2, mTier - 1));
}
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java
index 788095cfbc..730e6e4fdc 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java
@@ -7,7 +7,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerator {
@@ -58,47 +58,47 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat
}
public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
}
public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK)};
+ return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_BACK)};
}
public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM)};
+ return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_BOTTOM)};
}
public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP)};
+ return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_TOP)};
}
public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE)};
+ return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_SIDE)};
}
public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
}
public ITexture[] getBackActive(byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK_ACTIVE)};
+ return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_BACK_ACTIVE)};
}
public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE)};
+ return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE)};
}
public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE)};
+ return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE)};
}
public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)};
+ return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)};
}
@Override
public int getPollution() {
- return (int) (GT_MetaTileEntity_GasTurbine.BASE_POLLUTION * Math.pow(2, mTier - 1));
+ return (int) (BASE_POLLUTION * Math.pow(2, mTier - 1));
}
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java
index 22d4766f0e..11dd1e406e 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java
@@ -6,8 +6,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
-import gregtech.api.render.GT_RenderedGlowTexture;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -39,12 +38,12 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach
}
if (!aActive) return new ITexture[]{
BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
- new GT_RenderedTexture(BlockIcons.MACHINE_CASING_FUSION_GLASS)
+ TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS)
};
return new ITexture[]{
BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
- new GT_RenderedTexture(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW),
- new GT_RenderedGlowTexture(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)
+ TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW),
+ TextureFactory.builder().addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()
};
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
index 9649b22c6d..aceab00a02 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
@@ -6,8 +6,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.GT_RenderedGlowTexture;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_MAGIC;
@@ -72,8 +71,8 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba
public ITexture[] getFront(byte aColor) {
return new ITexture[]{
super.getFront(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW),
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(),
OVERLAYS_ENERGY_OUT[mTier]};
}
@@ -81,40 +80,40 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba
public ITexture[] getBack(byte aColor) {
return new ITexture[]{
super.getBack(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_FRONT),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_FRONT_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_FRONT),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build()};
}
@Override
public ITexture[] getBottom(byte aColor) {
return new ITexture[]{
super.getBottom(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()};
}
@Override
public ITexture[] getTop(byte aColor) {
return new ITexture[]{
super.getTop(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()};
}
@Override
public ITexture[] getSides(byte aColor) {
return new ITexture[]{
super.getSides(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()};
}
@Override
public ITexture[] getFrontActive(byte aColor) {
return new ITexture[]{
super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW),
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(),
OVERLAYS_ENERGY_OUT[mTier]};
}
@@ -122,32 +121,32 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba
public ITexture[] getBackActive(byte aColor) {
return new ITexture[]{
super.getBackActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_FRONT_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getBottomActive(byte aColor) {
return new ITexture[]{
super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getTopActive(byte aColor) {
return new ITexture[]{
super.getTopActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getSidesActive(byte aColor) {
return new ITexture[]{
super.getSidesActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()};
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
index eba992ffd0..5516b355fd 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
@@ -8,8 +8,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.GT_RenderedGlowTexture;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Log;
@@ -65,17 +64,17 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
private static final boolean THAUMCRAFT_LOADED = Loader.isModLoaded(MOD_ID_TC);
private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = new ConcurrentHashMap<>(4);
- private static List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<Aspect>();
+ private static final List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<Aspect>();
private static boolean sAllowMultipleEggs = false;
private static GT_MetaTileEntity_MagicalEnergyAbsorber sActiveSiphon = null;
private static int sEnergyPerEndercrystal = 512;
private static int sEnergyFromVis = 20;
private static int sEnergyPerEssentia = 320;
- private static Map<Aspect, Integer> sAspectsEnergy = new HashMap<>();
+ private static final Map<Aspect, Integer> sAspectsEnergy = new HashMap<>();
private static int sDragonEggEnergyPerTick = 2048;
private int mEfficiency;
private int mMaxVisPerDrain;
- private MagicalEnergyBB mMagicalEnergyBB = new MagicalEnergyBB(this, mTier, mTier + 2);
+ private final MagicalEnergyBB mMagicalEnergyBB = new MagicalEnergyBB(this, mTier, mTier + 2);
private long mNextGenerateTickRate = 1;
private int mNoGenerationTicks = 0;
@@ -206,8 +205,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
public ITexture[] getFront(byte aColor) {
return new ITexture[]{
super.getFront(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW),
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(),
OVERLAYS_ENERGY_OUT[mTier]};
}
@@ -215,39 +214,39 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
public ITexture[] getBack(byte aColor) {
return new ITexture[]{
super.getBack(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_FRONT),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_FRONT_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_FRONT),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build()};
}
@Override
public ITexture[] getBottom(byte aColor) {
return new ITexture[]{
super.getBottom(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()};
}
@Override
public ITexture[] getTop(byte aColor) {
return new ITexture[]{
super.getTop(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_DRAGONEGG)};
+ TextureFactory.of(MACHINE_CASING_DRAGONEGG)};
}
@Override
public ITexture[] getSides(byte aColor) {
return new ITexture[]{
super.getSides(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build()};
}
@Override
public ITexture[] getFrontActive(byte aColor) {
return new ITexture[]{
super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW),
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(),
OVERLAYS_ENERGY_OUT[mTier]};
}
@@ -255,24 +254,24 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
public ITexture[] getBackActive(byte aColor) {
return new ITexture[]{
super.getBackActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_FRONT_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getBottomActive(byte aColor) {
return new ITexture[]{
super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getTopActive(byte aColor) {
return new ITexture[]{
super.getTopActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_DRAGONEGG),
- new GT_RenderedGlowTexture(MACHINE_CASING_DRAGONEGG_GLOW)
+ TextureFactory.of(MACHINE_CASING_DRAGONEGG),
+ TextureFactory.builder().addIcon(MACHINE_CASING_DRAGONEGG_GLOW).glow().build()
};
}
@@ -280,8 +279,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
public ITexture[] getSidesActive(byte aColor) {
return new ITexture[]{
super.getSidesActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_MAGIC_ACTIVE),
- new GT_RenderedGlowTexture(MACHINE_CASING_MAGIC_ACTIVE_GLOW)};
+ TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build()};
}
@Override
@@ -519,12 +518,12 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
* Handles Bounding Box ranged operations for Magic sources
*/
static class MagicalEnergyBB {
- private GT_MetaTileEntity_MagicalEnergyAbsorber mAbsorber;
- private MagicalEnergyBBListener mListener;
- private int mDefaultTier;
+ private final GT_MetaTileEntity_MagicalEnergyAbsorber mAbsorber;
+ private final MagicalEnergyBBListener mListener;
+ private final int mDefaultTier;
private int mTier;
- private int mMaxTier;
- private List<UUID> mLivingCrystalIDs = new ArrayList<>();
+ private final int mMaxTier;
+ private final List<UUID> mLivingCrystalIDs = new ArrayList<>();
private List<Aspect> mAvailableAspects;
/**
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java
index ab0aabf51e..7a716e62b4 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java
@@ -6,8 +6,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.GT_RenderedGlowTexture;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import static gregtech.api.enums.Textures.BlockIcons.*;
@@ -95,67 +94,67 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe
@Override
public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_FRONT)};
+ return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT)};
}
@Override
public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_BACK)};
+ return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK)};
}
@Override
public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_BOTTOM)};
+ return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM)};
}
@Override
public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_TOP)};
+ return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP)};
}
@Override
public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_SIDE)};
+ return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE)};
}
@Override
public ITexture[] getFrontActive(byte aColor) {
return new ITexture[]{
super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE),
- new GT_RenderedGlowTexture(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW)};
+ TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE),
+ TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getBackActive(byte aColor) {
return new ITexture[]{
super.getBackActive(aColor)[0],
- new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE),
- new GT_RenderedGlowTexture(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW)};
+ TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE),
+ TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getBottomActive(byte aColor) {
return new ITexture[]{
super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE),
- new GT_RenderedGlowTexture(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW)};
+ TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE),
+ TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getTopActive(byte aColor) {
return new ITexture[]{
super.getTopActive(aColor)[0],
- new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
- new GT_RenderedGlowTexture(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW)};
+ TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE),
+ TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW).glow().build()};
}
@Override
public ITexture[] getSidesActive(byte aColor) {
return new ITexture[]{
super.getSidesActive(aColor)[0],
- new GT_RenderedTexture(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE),
- new GT_RenderedGlowTexture(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW)};
+ TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE),
+ TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW).glow().build()};
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
index 58fa17a824..4ab048a0f7 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
@@ -6,8 +6,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.GT_RenderedGlowTexture;
-import gregtech.api.render.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS;
@@ -38,36 +37,36 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe
public ITexture[] getFront(byte aColor) {
return new ITexture[]{
super.getFront(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS),
+ TextureFactory.of(MACHINE_CASING_FUSION_GLASS),
OVERLAYS_ENERGY_OUT[mTier]};
}
@Override
public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
}
@Override
public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
}
@Override
public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
}
@Override
public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
}
@Override
public ITexture[] getFrontActive(byte aColor) {
return new ITexture[]{
super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
- new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW),
+ TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build(),
OVERLAYS_ENERGY_OUT[mTier]};
}
@@ -75,32 +74,32 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe
public ITexture[] getBackActive(byte aColor) {
return new ITexture[]{
super.getBackActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
- new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)};
+ TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build()};
}
@Override
public ITexture[] getBottomActive(byte aColor) {
return new ITexture[]{
super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(MACHINE_CASING_FUSION_GLASS_YELLOW),
- new GT_RenderedGlowTexture(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW)};
+ TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW),
+ TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLAS