diff options
Diffstat (limited to 'src/Java')
13 files changed, 240 insertions, 135 deletions
diff --git a/src/Java/gregtech/api/enums/TAE.java b/src/Java/gregtech/api/enums/TAE.java index e3c59f209f..787ef1fe7d 100644 --- a/src/Java/gregtech/api/enums/TAE.java +++ b/src/Java/gregtech/api/enums/TAE.java @@ -3,18 +3,25 @@ package gregtech.api.enums; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.core.util.Utils; public class TAE { //TAE stands for Texture Array Expansion. public static int gtTexturesArrayStartOrigin; - public static int gtPPLastUsedIndex = 512; + public static int gtPPLastUsedIndex = 96; public static boolean hasArrayBeenExpanded = false; public static boolean hookGtTextures() { ITexture[] textureArrayDump = Textures.BlockIcons.CASING_BLOCKS; ITexture[] newTextureArray = new ITexture[1024]; + Utils.LOG_INFO("|======| Texture Array Start Length: "+textureArrayDump.length+" |======|"); + for (int r=0;r<textureArrayDump.length;r++){ + if (textureArrayDump[r] == null){ + Utils.LOG_WARNING("Texture slot "+r+" is empty."); + } + } gtTexturesArrayStartOrigin = textureArrayDump.length; System.arraycopy(textureArrayDump, 0, newTextureArray, 0, textureArrayDump.length); Textures.BlockIcons.CASING_BLOCKS = newTextureArray; @@ -44,11 +51,11 @@ public class TAE { return null; } else { - return Textures.BlockIcons.CASING_BLOCKS[(512+index)]; + return Textures.BlockIcons.CASING_BLOCKS[(96+index)]; } } public static int GTPP_INDEX(int ID){ - return (512+ID); + return (96+ID); } } diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index dd3adac3bc..c789871b6f 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -145,19 +145,21 @@ public class ReflectionUtils { } - public static void setByte(Class clazz, String fieldName, byte newValue) throws Exception { - /*Field nameField = getField(clazz, fieldName); + public static void setByte(Object clazz, String fieldName, byte newValue) throws Exception { + Field nameField = getField(clazz.getClass(), fieldName); nameField.setAccessible(true); int modifiers = nameField.getModifiers(); Field modifierField = nameField.getClass().getDeclaredField("modifiers"); modifiers = modifiers & ~Modifier.FINAL; modifierField.setAccessible(true); - modifierField.set(nameField, modifiers); - nameField.set(clazz, newValue);*/ + modifierField.setInt(nameField, modifiers); + //Utils.LOG_INFO("O-"+(byte) nameField.get(clazz) + " | "+newValue); + nameField.setByte(clazz, newValue); + //Utils.LOG_INFO("N-"+(byte) nameField.get(clazz)); - final Field fieldA = clazz.getDeclaredField(fieldName); - fieldA.setAccessible( true ); - fieldA.setByte(clazz, newValue ); + /*final Field fieldA = getField(clazz.getClass(), fieldName); + fieldA.setAccessible(true); + fieldA.setByte(clazz, newValue);*/ } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 447d0c7dc3..e50e44b3c8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -27,6 +27,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator private GT_Recipe mCurrentRecipe; private int mDaysRemaining = 0; private int mDayTick = 0; + private byte mNewTier = 0; public int removeDayOfTime(){ if (this.mDaysRemaining > 0){ @@ -53,6 +54,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator aNBT.setInteger("mVoltage", this.mVoltage); aNBT.setInteger("mDaysRemaining", this.mDaysRemaining); aNBT.setInteger("mDayTick", this.mDayTick); + aNBT.setByte("mNewTier", this.mNewTier); if (this.mCurrentRecipe != null){ @@ -76,6 +78,19 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mVoltage = aNBT.getInteger("mVoltage"); this.mDaysRemaining = aNBT.getInteger("mDaysRemaining"); this.mDayTick = aNBT.getInteger("mDayTick"); + this.mNewTier = aNBT.getByte("mNewTier"); + + try { + ReflectionUtils.setByte(this, "mTier", this.mNewTier); + } + catch (Exception e) { + if (this.getBaseMetaTileEntity() != null){ + IGregTechTileEntity thisTile = this.getBaseMetaTileEntity(); + if (thisTile.isAllowedToWork() || thisTile.isActive()){ + thisTile.setActive(false); + } + } + } final NBTTagList list = aNBT.getTagList("mRecipeItem", 10); @@ -296,41 +311,45 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator //this.mDaysRemaining = tFuel.mSpecialValue*365; //Do some voodoo. - byte mTier2 = 0; + byte mTier2; //mTier2 = ReflectionUtils.getField(this.getClass(), "mTier"); try { - if (this.mCurrentRecipe.mInputs[0] == GregtechItemList.Pellet_RTG_AM241.get(1)){ + if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_AM241.get(1))){ mTier2 = 1; } - else if (this.mCurrentRecipe.mInputs[0] == GregtechItemList.Pellet_RTG_PO210.get(1)){ + else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PO210.get(1))){ mTier2 = 3; } - else if (this.mCurrentRecipe.mInputs[0] == GregtechItemList.Pellet_RTG_PU238.get(1)){ + else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1))){ mTier2 = 2; } - else if (this.mCurrentRecipe.mInputs[0] == GregtechItemList.Pellet_RTG_SR90.get(1)){ + else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_SR90.get(1))){ mTier2 = 1; } else { + //Utils.LOG_INFO("test:"+tFuel.mInputs[0].getDisplayName() + " | " + (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1)))); mTier2 = 0; } - ReflectionUtils.setByte(super.getClass(), "mTier", mTier2); + ReflectionUtils.setByte(this, "mTier", mTier2); + this.mNewTier = mTier2; //ReflectionUtils.setFinalStatic(mTier2, GT_Values.V[0]); } catch (Exception e) { Utils.LOG_INFO("Failed setting mTier."); e.printStackTrace(); } - this.mTicksToBurnFor = getTotalEUGenerated(convertDaysToTicks(tFuel.mSpecialValue*365), voltage); + this.mTicksToBurnFor = getTotalEUGenerated(convertDaysToTicks(tFuel.mSpecialValue), voltage); if (mTicksToBurnFor >= Integer.MAX_VALUE){ mTicksToBurnFor = Integer.MAX_VALUE; Utils.LOG_INFO("Fuel went over Int limit, setting to MAX_VALUE."); } this.mDaysRemaining = MathUtils.roundToClosestInt(mTicksToBurnFor/20/60/3); + Utils.LOG_INFO("step | "+(int) (mTicksToBurnFor * getEfficiency() / 100L)); return (int) (mTicksToBurnFor * getEfficiency() / 100L); //return (int) (tFuel.mSpecialValue * 365L * getEfficiency() / 100L); //return tFuel.mEUt; } + Utils.LOG_INFO("Not sure"); return 0; } @@ -354,9 +373,11 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public String[] getInfoData() { - return new String[] { "RTG", "Active:"+this.getBaseMetaTileEntity().isActive(), "Current Output: " + this.mVoltage + " EU/t", + return new String[] { "RTG - Running at tier "+this.mTier, + "Active: "+this.getBaseMetaTileEntity().isActive(), "Current Output: " + this.mVoltage + " EU/t", "Days of Fuel remaining: "+(mTicksToBurnFor/20/60/20), "Hours of Fuel remaining: "+(mTicksToBurnFor/20/60/60), + "Ticks of "+this.mVoltage+"v remaining: "+(mTicksToBurnFor), "Current Recipe input: "+ this.mCurrentRecipe != null ? this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" : "NUll" }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java index 4c9df81a5a..acf01855f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java @@ -1,10 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +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_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.core.lib.CORE; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -93,9 +96,12 @@ extends GT_MetaTileEntity_MultiBlockBase } @Override - public ITexture[] getTexture(IGregTechTileEntity p0, byte p1, byte p2, byte p3, boolean p4, boolean p5) { - // TODO Auto-generated method stub - return null; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(12)], + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(12)]}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java index b681afd22f..9f261178b5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java @@ -3,13 +3,15 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; import java.util.Collection; import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; +import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -122,15 +124,26 @@ extends GT_MetaTileEntity_MultiBlockBase @Override public String[] getDescription() { - return new String[]{"Converts Heat into Steam", - CORE.GT_Tooltip}; + return new String[]{ + "Thermal Boiler Controller", + "Converts Heat into Steam", + "Size: 3x3x3 (Hollow)", + "Controller (front middle)", + "1x Input Hatch (Centre of back)", + "2x Output Hatch (Centre of sides)", + "1x Maintenance Hatch (Centre of top)", + "20x Blast Smelter Heat Containment Coils", + CORE.GT_Tooltip}; } @Override - public ITexture[] getTexture(IGregTechTileEntity arg0, byte arg1, byte arg2, byte arg3, boolean arg4, boolean arg5) { - // TODO Auto-generated method stub - return null; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)], + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)]}; } @Override @@ -139,8 +152,10 @@ extends GT_MetaTileEntity_MultiBlockBase if (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) { int META = 0; + int CASING = TAE.GTPP_INDEX(1); if (((getBaseMetaTileEntity().getBlockAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) != META)) && - (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2), 1))) { + (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2), CASING))) { + Utils.LOG_INFO("false 1"); return false; } int tX = getBaseMetaTileEntity().getXCoord();int tY = getBaseMetaTileEntity().getYCoord();int tZ = getBaseMetaTileEntity().getZCoord(); @@ -154,7 +169,8 @@ extends GT_MetaTileEntity_MultiBlockBase { if (getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == META) {} } - else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)), 1)) { + else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)), CASING)) { + Utils.LOG_INFO("false 2"); return false; } } @@ -163,6 +179,7 @@ extends GT_MetaTileEntity_MultiBlockBase if (getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == META) {} } else { + Utils.LOG_INFO("false 3"); return false; } } @@ -172,8 +189,10 @@ extends GT_MetaTileEntity_MultiBlockBase } else { + Utils.LOG_INFO("false 4"); return false; } + Utils.LOG_INFO("true 1"); return true; } } 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 658d458d6e..d435ad2b8b 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 @@ -1,10 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; 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_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import net.minecraft.entity.item.EntityItem; @@ -12,15 +13,19 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT4Entity_Shelf extends MetaTileEntity { +public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { public byte mType = 0; - public GT4Entity_Shelf(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, 1); + public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) { + super(aID, aName, aNameRegional, 0, aDescription); } - public GT4Entity_Shelf(String aName) { - super(aName, 1); + public GT4Entity_Shelf(final String aName, final String aDescription, final ITexture[][][] aTextures) { + super(aName, 0, aDescription, aTextures); + } + + public GT4Entity_Shelf(final String aName, final String[] aDescription, final ITexture[][][] aTextures) { + super(aName, 0, aDescription, aTextures); } @Override @@ -120,7 +125,7 @@ public class GT4Entity_Shelf extends MetaTileEntity { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf(this.mName); + return new GT4Entity_Shelf(this.mName, this.mDescriptionArray, this.mTextures); } @Override @@ -147,13 +152,6 @@ public class GT4Entity_Shelf extends MetaTileEntity { return aSide != getBaseMetaTileEntity().getFrontFacing(); } - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return 208 + this.mType; - } - return 10; - } - @Override public String[] getDescription() { return new String[] { "Decorative Item Storage", CORE.GT_Tooltip }; @@ -175,8 +173,24 @@ public class GT4Entity_Shelf extends MetaTileEntity { } @Override - public ITexture[] getTexture(IGregTechTileEntity p0, byte p1, byte p2, byte p3, boolean p4, boolean p5) { - // TODO Auto-generated method stub - return null; + 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]; + } + + @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; + } + return rTextures; } } 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 34c6e99358..be9bba7097 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 @@ -2,8 +2,12 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +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 gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import net.minecraft.client.renderer.texture.IIconRegister; @@ -15,28 +19,17 @@ import net.minecraft.util.IIcon; public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { public static IIcon[] sIconList = new IIcon['?']; - public GT4Entity_Shelf_Compartment(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); + public GT4Entity_Shelf_Compartment(final int aID, final String aName, final String aNameRegional, final String aDescription) { + super(aID, aName, aNameRegional, aDescription); } - - public GT4Entity_Shelf_Compartment(String mName) { - super(mName); + + public GT4Entity_Shelf_Compartment(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { + super(mName, mDescriptionArray, mTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Compartment(this.mName); - } - - @Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == 0) { - return 32; - } - if (aSide == 1) { - return 29; - } - return 40; + return new GT4Entity_Shelf_Compartment(this.mName, this.mDescriptionArray, this.mTextures); } @Override @@ -100,4 +93,21 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { public boolean allowPullStack(int aIndex, byte aSide, ItemStack aStack) { return aIndex == 0; } + + @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; + } } 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 4a5d6be813..b1edf6d0f3 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 @@ -1,36 +1,27 @@ 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; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { - public GT4Entity_Shelf_Desk(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - public GT4Entity_Shelf_Desk(String mName) { - super(mName); + public GT4Entity_Shelf_Desk(final int aID, final String aName, final String aNameRegional, final String aDescription) { + super(aID, aName, aNameRegional, aDescription); } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Desk(this.mName); + + public GT4Entity_Shelf_Desk(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { + super(mName, mDescriptionArray, mTextures); } @Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return 222; - } - if (aSide == 0) { - return 32; - } - if (aSide == 1) { - return 29; - } - return 40; + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT4Entity_Shelf_Desk(this.mName, this.mDescriptionArray, this.mTextures); } @Override @@ -48,4 +39,21 @@ public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { getBaseMetaTileEntity().setInventorySlotContents(0, tStack); } } + + @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; + } } 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 b934f615e5..0e29c0181b 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,33 +1,41 @@ 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_FileCabinet extends GT4Entity_Shelf { - public GT4Entity_Shelf_FileCabinet(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - public GT4Entity_Shelf_FileCabinet(String mName) { - super(mName); + public GT4Entity_Shelf_FileCabinet(final int aID, final String aName, final String aNameRegional, final String aDescription) { + super(aID, aName, aNameRegional, aDescription); + } + + public GT4Entity_Shelf_FileCabinet(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { + super(mName, mDescriptionArray, mTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_FileCabinet(this.mName); + return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescriptionArray, this.mTextures); } @Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return 223; - } - if (aSide == 0) { - return 32; - } - if (aSide == 1) { - return 29; + 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 40; + return rTextures; } } 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 e71b6de52c..a8a53aeb12 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,33 +1,41 @@ 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 { - public GT4Entity_Shelf_Iron(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - public GT4Entity_Shelf_Iron(String mName) { - super(mName); + public GT4Entity_Shelf_Iron(final int aID, final String aName, final String aNameRegional, final String aDescription) { + super(aID, aName, aNameRegional, aDescription); + } + + public GT4Entity_Shelf_Iron(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { + super(mName, mDescriptionArray, mTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Iron(this.mName); + return new GT4Entity_Shelf_Iron(this.mName, this.mDescriptionArray, this.mTextures); } @Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return 216 + this.mType; - } - if (aSide == 0) { - return 32; - } - if (aSide == 1) { - return 29; + 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 40; + return rTextures; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java index 1f8bb5e86e..aff10c9b37 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java @@ -1,6 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; @@ -13,6 +14,7 @@ public class Gregtech_Blocks { Utils.LOG_INFO("Expanding Gregtech Texture Array from 128 -> 1024."); boolean didExpand = TAE.hookGtTextures(); Utils.LOG_INFO("Did Texture Array expand correctly? "+didExpand); + Utils.LOG_INFO("|======| Texture Array New Length: "+Textures.BlockIcons.CASING_BLOCKS.length+" |======|"); //Casing Blocks ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java index 95c1f6c73f..dec1d3f746 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java @@ -32,33 +32,33 @@ public class Gregtech4Content //Free //GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced", "Advanced Workbench", 1).getStackForm(1L)); } - private static void thermalBoiler(){ - //Gregtech 4 Workbenches - Utils.LOG_INFO("Gregtech 4 Content | Registering Thermal Boiler."); - GregtechItemList.GT4_Thermal_Boiler.set(new GT4Entity_ThermalBoiler(810, "gtplusplus.thermal.boiler", "Thermal Boiler").getStackForm(1L)); - } - - private static void multiCrafter(){ - //Gregtech 4 Workbenches - Utils.LOG_INFO("Gregtech 4 Content | Registering Multiblock Crafter."); - GregtechItemList.GT4_Multi_Crafter.set(new GT4Entity_AutoCrafter(811, "gtplusplus.autocrafter.multi", "Large Autocrafter").getStackForm(1L)); - } private static void tesseracts(){ - //Gregtech 4 Workbenches + //Gregtech 4 Tesseracts Utils.LOG_INFO("Gregtech 4 Content | Registering Tesseracts."); GregtechItemList.GT4_Tesseract_Generator.set(new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4).getStackForm(1L)); GregtechItemList.GT4_Tesseract_Terminal.set(new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4).getStackForm(1L)); } private static void shelves(){ - //Gregtech 4 Workbenches + //Gregtech 4 Shelves Utils.LOG_INFO("Gregtech 4 Content | Registering Shelves."); - GregtechItemList.GT4_Shelf.set(new GT4Entity_Shelf(870, "gtplusplus.shelf.wooden", "Wood encased Shelf").getStackForm(1L)); - GregtechItemList.GT4_Shelf_Iron.set(new GT4Entity_Shelf_Iron(871, "gtplusplus.shelf.iron", "Metal encased Shelf").getStackForm(1L)); - GregtechItemList.GT4_Shelf_FileCabinet.set(new GT4Entity_Shelf_FileCabinet(872, "gtplusplus.shelf.filecabinet", "File Cabinet").getStackForm(1L)); - GregtechItemList.GT4_Shelf_Desk.set(new GT4Entity_Shelf_Desk(873, "gtplusplus.shelf.desk", "Metal encased Desk").getStackForm(1L)); - GregtechItemList.GT4_Shelf_Compartment.set(new GT4Entity_Shelf_Compartment(874, "gtplusplus.shelf.compartment", "Compartment").getStackForm(1L)); + GregtechItemList.GT4_Shelf.set(new GT4Entity_Shelf(870, "gtplusplus.shelf.wooden", "Wood encased Shelf", "Stores Books & Things").getStackForm(1L)); + GregtechItemList.GT4_Shelf_Iron.set(new GT4Entity_Shelf_Iron(871, "gtplusplus.shelf.iron", "Metal encased Shelf", "Stores Books & Things").getStackForm(1L)); + GregtechItemList.GT4_Shelf_FileCabinet.set(new GT4Entity_Shelf_FileCabinet(872, "gtplusplus.shelf.filecabinet", "File Cabinet", "Stores Books & Things").getStackForm(1L)); + GregtechItemList.GT4_Shelf_Desk.set(new GT4Entity_Shelf_Desk(873, "gtplusplus.shelf.desk", "Metal encased Desk", "Stores Books & Things").getStackForm(1L)); + GregtechItemList.GT4_Shelf_Compartment.set(new GT4Entity_Shelf_Compartment(874, "gtplusplus.shelf.compartment", "Compartment", "Stores Books & Things").getStackForm(1L)); } + + private static void thermalBoiler(){ + //Gregtech 4 Thermal Boiler + Utils.LOG_INFO("Gregtech 4 Content | Registering Thermal Boiler."); + GregtechItemList.GT4_Thermal_Boiler.set(new GT4Entity_ThermalBoiler(875, "gtplusplus.thermal.boiler", "Thermal Boiler").getStackForm(1L)); + } + private static void multiCrafter(){ + //Gregtech 4 Multiblock Auto-Crafter + Utils.LOG_INFO("Gregtech 4 Content | Registering Multiblock Crafter."); + GregtechItemList.GT4_Multi_Crafter.set(new GT4Entity_AutoCrafter(876, "gtplusplus.autocrafter.multi", "Large Autocrafter").getStackForm(1L)); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java index f3e2a2c5f4..356975bc44 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java @@ -14,7 +14,7 @@ public class GregtechRTG { } private static void run1(){ - GregtechItemList.RTG.set(new GregtechMetaTileEntity_RTG(800, "rtg.01.tier.single", "Radioisotope Thermoelectric Generator", 3).getStackForm(1L)); + GregtechItemList.RTG.set(new GregtechMetaTileEntity_RTG(869, "rtg.01.tier.single", "Radioisotope Thermoelectric Generator", 3).getStackForm(1L)); } } |