From c7b39a04db6f567b1fe62d03abafbe5a77026721 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Tue, 15 May 2018 19:12:19 +1000 Subject: + Added new textures for the GT Shelves. $ Fixed a bug during ore recipe generation. $ Fixed all GT Shelves using incorrect textures. --- .../creative/GregtechMetaCreativeEnergyBuffer.java | 3 - .../GregtechMetaAtmosphericReconditioner.java | 2 +- .../storage/shelving/GT4Entity_Shelf.java | 163 ++++++++++++++++++--- .../shelving/GT4Entity_Shelf_Compartment.java | 47 +++--- .../storage/shelving/GT4Entity_Shelf_Desk.java | 39 ++--- .../shelving/GT4Entity_Shelf_FileCabinet.java | 55 ++++--- .../storage/shelving/GT4Entity_Shelf_Iron.java | 36 ++--- 7 files changed, 239 insertions(+), 106 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java index 46cb903e0b..d557cbaa7d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java @@ -5,8 +5,6 @@ import static gregtech.api.enums.GT_Values.V; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import org.apache.commons.lang3.reflect.FieldUtils; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -24,7 +22,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 8d2dec0715..8f13c05227 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -268,7 +268,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi double fDam = Math.floor(Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f); damageValue -= fDam; - Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]"); + //Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]"); /*Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]); Materials M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java index 57eeba7025..6a35805a0c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java @@ -10,14 +10,23 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { public byte mType = 0; + public static GT_RenderedTexture texBottom = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_bottom")); + public static GT_RenderedTexture texTop = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_top")); + public static GT_RenderedTexture texSide = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side")); + public static GT_RenderedTexture texSideCabinet = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side_cabinet")); + public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) { super(aID, aName, aNameRegional, 0, aDescription); } @@ -61,8 +70,8 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { } @Override - public boolean isOutputFacing(byte aSide) { - return false; + public boolean isOutputFacing(final byte aSide) { + return aSide != this.getBaseMetaTileEntity().getFrontFacing(); } @Override @@ -70,13 +79,15 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { return false; } - public void onRightclick(EntityPlayer aPlayer) { + @Override + public boolean onRightclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) { ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem); if (tStack == null) { if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]); getBaseMetaTileEntity().setInventorySlotContents(0, null); this.mType = 0; + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); } } else if (this.mInventory[0] == null) { @@ -84,11 +95,13 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null); getBaseMetaTileEntity().setInventorySlotContents(0, tStack); this.mType = 1; + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); } else if (OrePrefixes.book.contains(tStack)) { aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null); getBaseMetaTileEntity().setInventorySlotContents(0, tStack); this.mType = 2; + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); } else if ((ItemList.IC2_Food_Can_Filled.isStackEqual(tStack, true, true)) || (ItemList.IC2_Food_Can_Spoiled.isStackEqual(tStack, true, true)) @@ -96,11 +109,14 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null); getBaseMetaTileEntity().setInventorySlotContents(0, tStack); this.mType = 3; + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); } } + return super.onRightclick(aTile, aPlayer); } - public void onLeftclick(EntityPlayer aPlayer) { + @Override + public void onLeftclick(IGregTechTileEntity aTile,EntityPlayer aPlayer) { if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] }); if (!aPlayer.isSneaking()) { @@ -117,8 +133,10 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity); if (this.mInventory[0] == null) { this.mType = 0; + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); } } + super.onLeftclick(aTile, aPlayer); } @Override @@ -146,10 +164,6 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { return this.mType; } - public boolean allowCoverOnSide(byte aSide, int aCoverID) { - return aSide != getBaseMetaTileEntity().getFrontFacing(); - } - @Override public String[] getDescription() { return new String[] { "Decorative Item Storage", CORE.GT_Tooltip }; @@ -170,25 +184,128 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { return false; } + /*@Override + public ITexture[][][] getTextureSet(final ITexture[] aTextures) { + final ITexture[][][] rTextures = new ITexture[10][17][]; + for (byte i = -1; i < 16; ++i) { + rTextures[0][i + 1] = this.getFront(i); + rTextures[1][i + 1] = this.getBack(i); + rTextures[2][i + 1] = this.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFrontActive(i); + rTextures[6][i + 1] = this.getBackActive(i); + rTextures[7][i + 1] = this.getBottomActive(i); + rTextures[8][i + 1] = this.getTopActive(i); + rTextures[9][i + 1] = this.getSidesActive(i); + } + return rTextures; + }*/ + @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) { - return this.mTextures[Math.min(2, aSide)][aColorIndex + 1]; + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[7][17][]; + for (byte i = -1; i < 16; i = (byte) (i + 1)) { + ITexture[] tmp0 = {this.getBottom((byte) 0)[0]}; + rTextures[0][(i + 1)] = tmp0; + ITexture[] tmp1 = { this.getTop((byte) 0)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[1][(i + 1)] = tmp1; + ITexture[] tmp2 = { this.getSides((byte) 0)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[2][(i + 1)] = tmp2; + ITexture[] tmp4 = {this.getSides((byte) 0)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)}; + rTextures[3][(i + 1)] = tmp4; + ITexture[] tmp5 = {this.getSides((byte) 0)[0], getFront((byte) 0)[0]}; + rTextures[4][(i + 1)] = tmp5; + ITexture[] tmp6 = {this.getSides((byte) 0)[0], getFront((byte) 1)[0]}; + rTextures[5][(i + 1)] = tmp6; + ITexture[] tmp7 = {this.getSides((byte) 0)[0], getFront((byte) 3)[0]}; + rTextures[6][(i + 1)] = tmp7; + } + return rTextures; } @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[3][17][]; - for (byte i = -1; i < 16; ++i) { - final ITexture[] tmp0 = { new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][i + 1] = tmp0; - final ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[1][i + 1] = tmp2; - final ITexture[] tmp3 = { new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][i + 1] = tmp3; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, + final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, + final boolean aRedstone) { + /*return this.mTextures[aSide == aFacing ? 0 : 1][aColorIndex + 1];*/ + + int modeMod = 0; + + ITexture[] tmp = this.mTextures[(aSide >= 2) ? ((aSide != aFacing) ? 2 : ((byte) this.mType == 0 ? 4 : this.mType == 1 ? 5 : this.mType == 3 ? 6 : 0)) : aSide][aColorIndex + 1]; + if (aSide != aFacing && tmp.length == 2) { + tmp = new ITexture[]{tmp[0]}; } - return rTextures; + return tmp; + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return aSide != getBaseMetaTileEntity().getFrontFacing(); } + + private static GT_RenderedTexture x1 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_FRONT); + private static GT_RenderedTexture x2 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_PAPER_FRONT); + private static GT_RenderedTexture x3 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_CANS_FRONT); + + public ITexture[] getFront(final byte aColor) { + GT_RenderedTexture x; + if (aColor == 0) { + x = x1; + } + else if (aColor == 1) { + x = x2; + } + else if (aColor == 3) { + x = x3; + } + else { + x = x1; + } + return new ITexture[]{x}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + } + + public ITexture[] getFrontActive(final byte aColor) { + return this.getFront(aColor); + } + + public ITexture[] getBackActive(final byte aColor) { + return this.getBack(aColor); + } + + public ITexture[] getBottomActive(final byte aColor) { + return this.getBottom(aColor); + } + + public ITexture[] getTopActive(final byte aColor) { + return this.getTop(aColor); + } + + public ITexture[] getSidesActive(final byte aColor) { + return this.getSides(aColor); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + // TODO Auto-generated method stub + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java index 540fb17aa2..42155aa137 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java @@ -14,13 +14,17 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { - public static IIcon[] sIconList = new IIcon['?']; + public static IIcon[] sIconList = new IIcon[32]; + public GT4Entity_Shelf_Compartment(final int aID, final String aName, final String aNameRegional, final String aDescription) { super(aID, aName, aNameRegional, aDescription); @@ -36,7 +40,7 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { } @Override - public boolean allowCoverOnSide(byte aSide, int aCoverID) { + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { return aSide != getBaseMetaTileEntity().getFrontFacing(); } @@ -44,23 +48,26 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { this.mType = ((byte) ((this.mType + 1) % 16)); + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); } } - public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? sIconList[this.mType] : null; - } - + /* @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { for (int i = 0; i < 32; i++) { sIconList[i] = aBlockIconRegister.registerIcon(CORE.MODID + ":" + "TileEntities/Compartment/" + i); } - } + }*/ @Override - public void onLeftclick(EntityPlayer aPlayer) { + public ITexture[] getFront(final byte aColor) { + return new ITexture[]{TexturesGtBlock.OVERLAYS_COMPARTMENT_FRONT[this.mType < 16 ? this.mType : 0]}; + } + + @Override + public void onLeftclick(IGregTechTileEntity aTile,EntityPlayer aPlayer) { if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] }); if (!aPlayer.isSneaking()) { @@ -76,10 +83,11 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { tEntity.motionZ = 0.0D; getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity); } + super.onLeftclick(aTile, aPlayer); } @Override - public void onRightclick(EntityPlayer aPlayer) { + public boolean onRightclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) { ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem); if (tStack == null) { if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { @@ -91,26 +99,11 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null); getBaseMetaTileEntity().setInventorySlotContents(0, tStack); } - } - - public boolean allowPullStack(int aIndex, byte aSide, ItemStack aStack) { - return aIndex == 0; + return super.onRightclick(aTile, aPlayer); } @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[3][17][]; - for (byte i = -1; i < 16; ++i) { - final ITexture[] tmp0 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][i + 1] = tmp0; - final ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[1][i + 1] = tmp2; - final ITexture[] tmp3 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][i + 1] = tmp3; - } - return rTextures; + public boolean allowPullStack(IGregTechTileEntity p0, int p1, byte p2, ItemStack p3) { + return p1 == 0; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java index 5c08379a9f..93c0343a88 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java @@ -3,13 +3,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; + public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { public GT4Entity_Shelf_Desk(final int aID, final String aName, final String aNameRegional, final String aDescription) { @@ -26,7 +26,7 @@ public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { } @Override - public void onRightclick(EntityPlayer aPlayer) { + public boolean onRightclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) { ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem); if (tStack == null) { if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { @@ -39,22 +39,27 @@ public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null); getBaseMetaTileEntity().setInventorySlotContents(0, tStack); } + return super.onRightclick(aTile, aPlayer); } @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[3][17][]; - for (byte i = -1; i < 16; ++i) { - final ITexture[] tmp0 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][i + 1] = tmp0; - final ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[1][i + 1] = tmp2; - final ITexture[] tmp3 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][i + 1] = tmp3; - } - return rTextures; + public ITexture[] getFront(final byte aColor) { + return new ITexture[]{TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java index b707df5a2d..6928285fa5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java @@ -1,11 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; +import net.minecraft.entity.player.EntityPlayer; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.GT_ItemStack; + +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { @@ -17,25 +20,43 @@ public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { super(mName, mDescriptionArray, mTextures); } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return aSide != getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) { + this.mType = ((byte) ((this.mType + 1) % 16)); + PlayerUtils.messagePlayer(aPlayer, "Set type to "+this.mType+"."); + } + } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescription, this.mTextures); } @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[3][17][]; - for (byte i = -1; i < 16; ++i) { - final ITexture[] tmp0 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][i + 1] = tmp0; - final ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[1][i + 1] = tmp2; - final ITexture[] tmp3 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][i + 1] = tmp3; - } - return rTextures; + public ITexture[] getFront(final byte aColor) { + return new ITexture[]{TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[]{texSide}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{texBottom}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{texTop}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{texSide}; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java index b2262cd19b..606496501f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java @@ -1,11 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf { @@ -22,20 +19,23 @@ public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf { return new GT4Entity_Shelf_Iron(this.mName, this.mDescription, this.mTextures); } - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[3][17][]; - for (byte i = -1; i < 16; ++i) { - final ITexture[] tmp0 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][i + 1] = tmp0; - final ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[1][i + 1] = tmp2; - final ITexture[] tmp3 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][i + 1] = tmp3; - } - return rTextures; + public ITexture[] getFront(final byte aColor) { + return new ITexture[]{texSideCabinet}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[]{texSide}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{texBottom}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{texTop}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{texSide}; } } -- cgit