From dcefe92cfb20582cd9a6d083ebe35f1bb5f2ee32 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sun, 8 Oct 2017 19:55:35 +1000 Subject: Added documentation to updateTexture in GT_MetaTileEntity_Hatch. Added a function to GT_Utility called addTexturePage(byte page). Added information about who is using which texture page in GT_Block_Casings1. Updated GT_Block_Casings5 & GT_Block_Casings8 to utilise texture page 1. Updated Large Chemical Reactor to reflect this change, now also uses Page 1 Index 48. Moved the Pyrolyse oven casing index from 111 to 22, which is currently unused and within the Gregtech index space. --- .../gregtech/common/blocks/GT_Block_Casings1.java | 18 +- .../gregtech/common/blocks/GT_Block_Casings2.java | 198 +++++++++++---------- .../gregtech/common/blocks/GT_Block_Casings5.java | 4 +- .../gregtech/common/blocks/GT_Block_Casings8.java | 4 +- 4 files changed, 125 insertions(+), 99 deletions(-) (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java index e2984f67a5..77668caaaa 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java @@ -10,12 +10,28 @@ import net.minecraft.world.IBlockAccess; public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { + + /** + * Texture Index Information + * Textures.BlockIcons.casingTexturePages[0][0-63] - Gregtech + * Textures.BlockIcons.casingTexturePages[0][64-127] - GT++ + * Textures.BlockIcons.casingTexturePages[1][0-127] - Gregtech + * Textures.BlockIcons.casingTexturePages[2][0-127] - Free + * Textures.BlockIcons.casingTexturePages[3][0-127] - Free + * Textures.BlockIcons.casingTexturePages[4][0-127] - Free + * Textures.BlockIcons.casingTexturePages[5][0-127] - Free + * Textures.BlockIcons.casingTexturePages[6][0-127] - Free + * Textures.BlockIcons.casingTexturePages[7][0-127] - Free + * Textures.BlockIcons.casingTexturePages[8][0-127] - TecTech + */ + + public GT_Block_Casings1() { super(GT_Item_Casings1.class, "gt.blockcasings", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { Textures.BlockIcons.CASING_BLOCKS[i] = new GT_CopiedBlockTexture(this, 6, i); } - Textures.BlockIcons.CASING_BLOCKS[111] = new GT_CopiedBlockTexture(this, 6, 0); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "ULV Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "LV Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "MV Machine Casing"); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java index 2285d3f2af..f8f54f9604 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java @@ -1,95 +1,103 @@ -package gregtech.common.blocks; - -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Textures; -import gregtech.api.objects.GT_CopiedBlockTexture; -import gregtech.api.util.GT_LanguageManager; -import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -public class GT_Block_Casings2 - extends GT_Block_Casings_Abstract { - public GT_Block_Casings2() { - super(GT_Item_Casings2.class, "gt.blockcasings2", GT_Material_Casings.INSTANCE); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.CASING_BLOCKS[(i + 16)] = new GT_CopiedBlockTexture(this, 6, i); - } - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Solid Steel Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Frost Proof Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Bronze Gear Box Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Steel Gear Box Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Titanium Gear Box Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Assembling Line Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Processor Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Data Drive Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Containment Field Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Assembler Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Pump Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Motor Machine Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Bronze Pipe Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Steel Pipe Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Titanium Pipe Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Tungstensteel Pipe Casing"); - ItemList.Casing_SolidSteel.set(new ItemStack(this, 1, 0)); - ItemList.Casing_FrostProof.set(new ItemStack(this, 1, 1)); - ItemList.Casing_Gearbox_Bronze.set(new ItemStack(this, 1, 2)); - ItemList.Casing_Gearbox_Steel.set(new ItemStack(this, 1, 3)); - ItemList.Casing_Gearbox_Titanium.set(new ItemStack(this, 1, 4)); - ItemList.Casing_Gearbox_TungstenSteel.set(new ItemStack(this, 1, 5)); - ItemList.Casing_Processor.set(new ItemStack(this, 1, 6)); - ItemList.Casing_DataDrive.set(new ItemStack(this, 1, 7)); - ItemList.Casing_ContainmentField.set(new ItemStack(this, 1, 8)); - ItemList.Casing_Assembler.set(new ItemStack(this, 1, 9)); - ItemList.Casing_Pump.set(new ItemStack(this, 1, 10)); - ItemList.Casing_Motor.set(new ItemStack(this, 1, 11)); - ItemList.Casing_Pipe_Bronze.set(new ItemStack(this, 1, 12)); - ItemList.Casing_Pipe_Steel.set(new ItemStack(this, 1, 13)); - ItemList.Casing_Pipe_Titanium.set(new ItemStack(this, 1, 14)); - ItemList.Casing_Pipe_TungstenSteel.set(new ItemStack(this, 1, 15)); - } - - public IIcon getIcon(int aSide, int aMeta) { - switch (aMeta) { - case 0: - return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon(); - case 2: - return Textures.BlockIcons.MACHINE_CASING_GEARBOX_BRONZE.getIcon(); - case 3: - return Textures.BlockIcons.MACHINE_CASING_GEARBOX_STEEL.getIcon(); - case 4: - return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TITANIUM.getIcon(); - case 5: - return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); - case 6: - return Textures.BlockIcons.MACHINE_CASING_PROCESSOR.getIcon(); - case 7: - return Textures.BlockIcons.MACHINE_CASING_DATA_DRIVE.getIcon(); - case 8: - return Textures.BlockIcons.MACHINE_CASING_CONTAINMENT_FIELD.getIcon(); - case 9: - return Textures.BlockIcons.MACHINE_CASING_ASSEMBLER.getIcon(); - case 10: - return Textures.BlockIcons.MACHINE_CASING_PUMP.getIcon(); - case 11: - return Textures.BlockIcons.MACHINE_CASING_MOTOR.getIcon(); - case 12: - return Textures.BlockIcons.MACHINE_CASING_PIPE_BRONZE.getIcon(); - case 13: - return Textures.BlockIcons.MACHINE_CASING_PIPE_STEEL.getIcon(); - case 14: - return Textures.BlockIcons.MACHINE_CASING_PIPE_TITANIUM.getIcon(); - case 15: - return Textures.BlockIcons.MACHINE_CASING_PIPE_TUNGSTENSTEEL.getIcon(); - } - return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); - } - - public float getExplosionResistance(Entity aTNT, World aWorld, int aX, int aY, int aZ, double eX, double eY, double eZ) { - return aWorld.getBlockMetadata(aX, aY, aZ) == 8 ? Blocks.bedrock.getExplosionResistance(aTNT) : super.getExplosionResistance(aTNT, aWorld, aX, aY, aZ, eX, eY, eZ); - } -} +package gregtech.common.blocks; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class GT_Block_Casings2 + extends GT_Block_Casings_Abstract { + public GT_Block_Casings2() { + super(GT_Item_Casings2.class, "gt.blockcasings2", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + if (i != 6){ + Textures.BlockIcons.CASING_BLOCKS[(i + 16)] = new GT_CopiedBlockTexture(this, 6, i); + } + } + + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Solid Steel Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Frost Proof Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Bronze Gear Box Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Steel Gear Box Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Titanium Gear Box Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Assembling Line Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Processor Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Data Drive Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Containment Field Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Assembler Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Pump Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Motor Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Bronze Pipe Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Steel Pipe Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Titanium Pipe Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Tungstensteel Pipe Casing"); + ItemList.Casing_SolidSteel.set(new ItemStack(this, 1, 0)); + ItemList.Casing_FrostProof.set(new ItemStack(this, 1, 1)); + ItemList.Casing_Gearbox_Bronze.set(new ItemStack(this, 1, 2)); + ItemList.Casing_Gearbox_Steel.set(new ItemStack(this, 1, 3)); + ItemList.Casing_Gearbox_Titanium.set(new ItemStack(this, 1, 4)); + ItemList.Casing_Gearbox_TungstenSteel.set(new ItemStack(this, 1, 5)); + ItemList.Casing_Processor.set(new ItemStack(this, 1, 6)); + ItemList.Casing_DataDrive.set(new ItemStack(this, 1, 7)); + ItemList.Casing_ContainmentField.set(new ItemStack(this, 1, 8)); + ItemList.Casing_Assembler.set(new ItemStack(this, 1, 9)); + ItemList.Casing_Pump.set(new ItemStack(this, 1, 10)); + ItemList.Casing_Motor.set(new ItemStack(this, 1, 11)); + ItemList.Casing_Pipe_Bronze.set(new ItemStack(this, 1, 12)); + ItemList.Casing_Pipe_Steel.set(new ItemStack(this, 1, 13)); + ItemList.Casing_Pipe_Titanium.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Pipe_TungstenSteel.set(new ItemStack(this, 1, 15)); + + //Special handler for Pyrolyse Oven Casing + Textures.BlockIcons.CASING_BLOCKS[22] = new GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0,Dyes.MACHINE_METAL.mRGBa); + } + + public IIcon getIcon(int aSide, int aMeta) { + switch (aMeta) { + case 0: + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon(); + case 2: + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_BRONZE.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_STEEL.getIcon(); + case 4: + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TITANIUM.getIcon(); + case 5: + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); + case 6: + return Textures.BlockIcons.MACHINE_CASING_PROCESSOR.getIcon(); + case 7: + return Textures.BlockIcons.MACHINE_CASING_DATA_DRIVE.getIcon(); + case 8: + return Textures.BlockIcons.MACHINE_CASING_CONTAINMENT_FIELD.getIcon(); + case 9: + return Textures.BlockIcons.MACHINE_CASING_ASSEMBLER.getIcon(); + case 10: + return Textures.BlockIcons.MACHINE_CASING_PUMP.getIcon(); + case 11: + return Textures.BlockIcons.MACHINE_CASING_MOTOR.getIcon(); + case 12: + return Textures.BlockIcons.MACHINE_CASING_PIPE_BRONZE.getIcon(); + case 13: + return Textures.BlockIcons.MACHINE_CASING_PIPE_STEEL.getIcon(); + case 14: + return Textures.BlockIcons.MACHINE_CASING_PIPE_TITANIUM.getIcon(); + case 15: + return Textures.BlockIcons.MACHINE_CASING_PIPE_TUNGSTENSTEEL.getIcon(); + } + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } + + public float getExplosionResistance(Entity aTNT, World aWorld, int aX, int aY, int aZ, double eX, double eY, double eZ) { + return aWorld.getBlockMetadata(aX, aY, aZ) == 8 ? Blocks.bedrock.getExplosionResistance(aTNT) : super.getExplosionResistance(aTNT, aWorld, aX, aY, aZ, eX, eY, eZ); + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java index d6c5bfebc9..e97228f5fe 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java @@ -6,6 +6,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -13,8 +14,9 @@ public class GT_Block_Casings5 extends GT_Block_Casings_Abstract { public GT_Block_Casings5() { super(GT_Item_Casings5.class, "gt.blockcasings5", GT_Material_Casings.INSTANCE); + GT_Utility.addTexturePage((byte) 1); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.CASING_BLOCKS[(i + 64)] = new GT_CopiedBlockTexture(this, 6, i); + Textures.BlockIcons.casingTexturePages[1][i] = new GT_CopiedBlockTexture(this, 6, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Cupronickel Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Kanthal Coil Block"); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java index 57d7146a2c..093373bde4 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java @@ -15,8 +15,8 @@ public class GT_Block_Casings8 //WATCH OUT FOR TEXTURE ID's public GT_Block_Casings8() { super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE); - for (int i = 0; i < 2/*16*/; i = (i + 1)) { - Textures.BlockIcons.CASING_BLOCKS[(i + 64 + 14)] = new GT_CopiedBlockTexture(this, 6, i); + for (int i = 0; i < 1; i = (i + 1)) { + Textures.BlockIcons.casingTexturePages[1][i+48] = new GT_CopiedBlockTexture(this, 6, i); } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Chemically Inert Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "PTFE Pipe Casing"); -- cgit