aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-09-01 17:30:49 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-09-01 17:30:49 +1000
commit9f538f72e0274a47da852e8bd67faf2dd4cfdba2 (patch)
tree9362932ed943113d2f0edd79590f68e36eb56447 /src/Java/gtPlusPlus/xmod/gregtech/api
parent4826c5f0b3f05c3265ec3757db5bdc6c8cf0bbf3 (diff)
downloadGT5-Unofficial-9f538f72e0274a47da852e8bd67faf2dd4cfdba2.tar.gz
GT5-Unofficial-9f538f72e0274a47da852e8bd67faf2dd4cfdba2.tar.bz2
GT5-Unofficial-9f538f72e0274a47da852e8bd67faf2dd4cfdba2.zip
% More Texture Tweaks.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java59
1 files changed, 55 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
index 9878df799d..dd930e798c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java
@@ -1,7 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+import java.lang.reflect.Field;
+
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -9,6 +12,7 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
@@ -51,13 +55,11 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In
}
public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture,
- new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE) };
+ return new ITexture[] { aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) };
}
public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture,
- new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT) };
+ return new ITexture[] { aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) };
}
public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
@@ -149,4 +151,53 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In
return mTempMod + mLockedStack.getLocalizedName();
}
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ // TODO Auto-generated method stub
+ return super.getTextureSet(aTextures);
+ }
+
+ private Field F1, F2;
+
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ byte a1 = 0, a2 = 0;
+ try {
+ if (F1 == null) {
+ F1 = ReflectionUtils.getField(getClass(), "actualTexture");
+ }
+ if (F2 == null) {
+ F2 = ReflectionUtils.getField(getClass(), "mTexturePage");
+ }
+
+ if (F1 != null) {
+ a1 = F1.getByte(this);
+ }
+ if (F2 != null) {
+ a2 = F2.getByte(this);
+ }
+ }
+ catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException n) {}
+
+ int textureIndex = a1 | a2 << 7;
+ byte texturePointer = (byte) (a1 & 127);
+
+ if (aSide == 1 || aSide == 0) {
+ ITexture g = textureIndex > 0 ? BlockIcons.casingTexturePages[a2][texturePointer] : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1];
+
+ return new ITexture[] {g, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) };
+ }
+
+ return aSide != aFacing ?
+ (textureIndex > 0 ? new ITexture[] { BlockIcons.casingTexturePages[a2][texturePointer] } : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] })
+ : (textureIndex > 0 ? (aActive ? this.getTexturesActive(BlockIcons.casingTexturePages[a2][texturePointer]) : this.getTexturesInactive(BlockIcons.casingTexturePages[a2][texturePointer]))
+ : (aActive ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1])));
+ }
+
}