aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorBass <tudurap.com@gmail.com>2019-07-24 02:54:34 +0100
committerBass <tudurap.com@gmail.com>2019-07-24 02:54:34 +0100
commit5f14653c028191c89a62a3c6a7f18f898752a8d2 (patch)
treeee0089c82ae2aff83ddfc2bf376b9e9b50fa712a /src/main/java
parent52ad4cda52bdf86235d35efc02a523adbf6a2cb4 (diff)
downloadGT5-Unofficial-5f14653c028191c89a62a3c6a7f18f898752a8d2.tar.gz
GT5-Unofficial-5f14653c028191c89a62a3c6a7f18f898752a8d2.tar.bz2
GT5-Unofficial-5f14653c028191c89a62a3c6a7f18f898752a8d2.zip
Proper Texture implementation
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java14
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java29
3 files changed, 37 insertions, 14 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
index 067cb0f4a0..e87ac69f2a 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
@@ -6,16 +6,20 @@ import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
import com.github.technus.tectech.thing.item.TeslaCoilCover;
import com.github.technus.tectech.thing.item.TeslaCoilCoverUltimate;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.item.ItemStack;
-import static com.github.technus.tectech.thing.metaTileEntity.Textures.TESLA_COVER_TEXTURES;
+
public class CoverLoader implements Runnable {
public void run(){
- //GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_TM_TeslaCoil());
- //GregTech_API.registerCover(new ItemStack(TeslaCoilCoverUltimate.INSTANCE, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), new GT_Cover_TM_TeslaCoil_Ultimate());
- GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1), TESLA_COVER_TEXTURES[0], new GT_Cover_TM_TeslaCoil());
- GregTech_API.registerCover(new ItemStack(TeslaCoilCoverUltimate.INSTANCE, 1), TESLA_COVER_TEXTURES[1], new GT_Cover_TM_TeslaCoil_Ultimate());
+ final IIconContainer TESLA_OVERLAY = new Textures.BlockIcons.CustomIcon("iconsets/TESLA_OVERLAY");
+ final IIconContainer TESLA_OVERLAY_ULTIMATE = new Textures.BlockIcons.CustomIcon("iconsets/TESLA_OVERLAY_ULTIMATE");
+
+ GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1), new GT_RenderedTexture(TESLA_OVERLAY), new GT_Cover_TM_TeslaCoil());
+ GregTech_API.registerCover(new ItemStack(TeslaCoilCoverUltimate.INSTANCE, 1), new GT_RenderedTexture(TESLA_OVERLAY_ULTIMATE), new GT_Cover_TM_TeslaCoil_Ultimate());
TecTech.LOGGER.info("Cover functionality registered");
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java
index be94940990..69ff06e9e7 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java
@@ -33,8 +33,7 @@ public class Textures {
private static final IIconContainer MACHINE_OPV_BOTTOM = new CustomIcon("iconsets/MACHINE_OPV_BOTTOM");
private static final IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM");
- private static final IIconContainer TESLA_COVER_ICON = new CustomIcon("iconsets/TESLA_COVER");
- private static final IIconContainer TESLA_COVER_ULTIMATE_ICON = new CustomIcon("iconsets/TESLA_COVER_ULTIMATE");
+ private static final IIconContainer TESLA_TRANSCEIVER_TOP = new CustomIcon("iconsets/TESLA_TRANSCEIVER_TOP");
public static IIconContainer[] MACHINECASINGS_SIDE_TT = new IIconContainer[]{
MACHINE_8V_SIDE, MACHINE_LV_SIDE, MACHINE_MV_SIDE, MACHINE_HV_SIDE,
@@ -192,10 +191,7 @@ public class Textures {
public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[16][17];
- public static ITexture[] TESLA_COVER_TEXTURES = new ITexture[]{
- new GT_RenderedTexture(TESLA_COVER_ICON),
- new GT_RenderedTexture(TESLA_COVER_ULTIMATE_ICON)
- };
+ public static ITexture TESLA_TRANSCEIVER_TOP_BA = new GT_RenderedTexture(TESLA_TRANSCEIVER_TOP);
public Textures(){
for (byte i = 0; i < MACHINE_CASINGS_TT.length; i++) {
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
index d0073acb48..81418f0c4f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
@@ -5,6 +5,7 @@ import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_TM_teslaCoil;
import eu.usrv.yamcore.auxiliary.PlayerChatHelper;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,16 +13,17 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer;
import net.minecraft.entity.player.EntityPlayer;
-
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
import static com.github.technus.tectech.CommonValues.V;
import static com.github.technus.tectech.Util.entriesSortedByValues;
+import static com.github.technus.tectech.thing.metaTileEntity.Textures.TESLA_TRANSCEIVER_TOP_BA;
import static java.lang.Math.round;
public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryBuffer {
- private int maxTier = 3; //Max tier of transceiver
+ private int maxTier = 4; //Max tier of transceiver
private int minTier = 0; //Min tier of transceiver
public Map<IGregTechTileEntity, Integer> eTeslaMap = new HashMap();//Tesla Map to map them tesla bois!
@@ -143,6 +145,27 @@ public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryB
}
@Override
+ public boolean isFacingValid(byte aSide) {return aSide != 1;}//Prevents output at the top side
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+
+ for(byte i = -1; i < 16; ++i) {
+ rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1]};
+ rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], TESLA_TRANSCEIVER_TOP_BA};
+ rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], this.mInventory.length == 16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[this.mTier] : (this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier])};
+ }
+
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return this.mTextures[aSide == aFacing ? 2 : aSide == 1 ? 1 : 0][aColorIndex + 1];
+ }
+
+ @Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_TeslaCoil(mName, mTier, mDescription, mTextures, mInventory.length);
}