From 1b820de08a05070909a267e17f033fcf58ac8710 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 2 Sep 2024 23:17:17 +0200 Subject: The Great Renaming (#3014) * move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names --- .../java/gregtech/common/blocks/BlockCasings1.java | 107 ++++ .../gregtech/common/blocks/BlockCasings10.java | 76 +++ .../gregtech/common/blocks/BlockCasings11.java | 58 ++ .../java/gregtech/common/blocks/BlockCasings2.java | 102 +++ .../java/gregtech/common/blocks/BlockCasings3.java | 82 +++ .../java/gregtech/common/blocks/BlockCasings4.java | 239 +++++++ .../java/gregtech/common/blocks/BlockCasings5.java | 161 +++++ .../java/gregtech/common/blocks/BlockCasings6.java | 94 +++ .../java/gregtech/common/blocks/BlockCasings8.java | 188 ++++++ .../java/gregtech/common/blocks/BlockCasings9.java | 96 +++ .../common/blocks/BlockCasingsAbstract.java | 143 +++++ .../gregtech/common/blocks/BlockConcretes.java | 83 +++ .../common/blocks/BlockCyclotronCoils.java | 131 ++++ .../java/gregtech/common/blocks/BlockDrone.java | 65 ++ .../java/gregtech/common/blocks/BlockFrameBox.java | 446 +++++++++++++ .../java/gregtech/common/blocks/BlockGlass1.java | 107 ++++ .../java/gregtech/common/blocks/BlockGranites.java | 77 +++ .../java/gregtech/common/blocks/BlockLaser.java | 104 +++ .../java/gregtech/common/blocks/BlockMachines.java | 703 +++++++++++++++++++++ .../java/gregtech/common/blocks/BlockMetal.java | 68 ++ .../java/gregtech/common/blocks/BlockOres.java | 154 +++++ .../gregtech/common/blocks/BlockOresAbstract.java | 324 ++++++++++ .../gregtech/common/blocks/BlockReinforced.java | 409 ++++++++++++ .../java/gregtech/common/blocks/BlockStones.java | 62 ++ .../common/blocks/BlockStonesAbstract.java | 250 ++++++++ .../java/gregtech/common/blocks/BlockStorage.java | 103 +++ .../common/blocks/BlockTintedIndustrialGlass.java | 98 +++ .../common/blocks/BlockWormholeRender.java | 75 +++ .../gregtech/common/blocks/GT_Block_Casings1.java | 108 ---- .../gregtech/common/blocks/GT_Block_Casings10.java | 76 --- .../gregtech/common/blocks/GT_Block_Casings11.java | 58 -- .../gregtech/common/blocks/GT_Block_Casings2.java | 102 --- .../gregtech/common/blocks/GT_Block_Casings3.java | 82 --- .../gregtech/common/blocks/GT_Block_Casings4.java | 239 ------- .../gregtech/common/blocks/GT_Block_Casings5.java | 161 ----- .../gregtech/common/blocks/GT_Block_Casings6.java | 94 --- .../gregtech/common/blocks/GT_Block_Casings8.java | 188 ------ .../gregtech/common/blocks/GT_Block_Casings9.java | 96 --- .../common/blocks/GT_Block_Casings_Abstract.java | 144 ----- .../gregtech/common/blocks/GT_Block_Concretes.java | 83 --- .../gregtech/common/blocks/GT_Block_Drone.java | 65 -- .../gregtech/common/blocks/GT_Block_FrameBox.java | 446 ------------- .../gregtech/common/blocks/GT_Block_Glass1.java | 107 ---- .../gregtech/common/blocks/GT_Block_Granites.java | 77 --- .../gregtech/common/blocks/GT_Block_Laser.java | 104 --- .../gregtech/common/blocks/GT_Block_Machines.java | 703 --------------------- .../gregtech/common/blocks/GT_Block_Metal.java | 68 -- .../java/gregtech/common/blocks/GT_Block_Ores.java | 154 ----- .../common/blocks/GT_Block_Ores_Abstract.java | 324 ---------- .../common/blocks/GT_Block_Reinforced.java | 409 ------------ .../gregtech/common/blocks/GT_Block_Stones.java | 62 -- .../common/blocks/GT_Block_Stones_Abstract.java | 250 -------- .../gregtech/common/blocks/GT_Block_Storage.java | 103 --- .../blocks/GT_Block_TintedIndustrialGlass.java | 98 --- .../gregtech/common/blocks/GT_Cyclotron_Coils.java | 131 ---- .../common/blocks/GT_Cyclotron_Item_Casings.java | 10 - .../common/blocks/GT_Item_Block_Laser.java | 24 - .../gregtech/common/blocks/GT_Item_Casings1.java | 14 - .../gregtech/common/blocks/GT_Item_Casings10.java | 14 - .../gregtech/common/blocks/GT_Item_Casings11.java | 14 - .../gregtech/common/blocks/GT_Item_Casings2.java | 26 - .../gregtech/common/blocks/GT_Item_Casings3.java | 14 - .../gregtech/common/blocks/GT_Item_Casings4.java | 14 - .../gregtech/common/blocks/GT_Item_Casings5.java | 36 -- .../gregtech/common/blocks/GT_Item_Casings6.java | 14 - .../gregtech/common/blocks/GT_Item_Casings8.java | 14 - .../gregtech/common/blocks/GT_Item_Casings9.java | 28 - .../common/blocks/GT_Item_Casings_Abstract.java | 63 -- .../gregtech/common/blocks/GT_Item_Concretes.java | 25 - .../gregtech/common/blocks/GT_Item_Frames.java | 60 -- .../gregtech/common/blocks/GT_Item_Glass1.java | 36 -- .../gregtech/common/blocks/GT_Item_Granites.java | 10 - .../common/blocks/GT_Item_LongDistancePipe.java | 43 -- .../gregtech/common/blocks/GT_Item_Machines.java | 430 ------------- .../java/gregtech/common/blocks/GT_Item_Ores.java | 81 --- .../common/blocks/GT_Item_Stones_Abstract.java | 42 -- .../gregtech/common/blocks/GT_Item_Storage.java | 47 -- .../blocks/GT_Item_TintedIndustrialGlass.java | 10 - .../common/blocks/GT_Material_Casings.java | 19 - .../common/blocks/GT_Material_Machines.java | 19 - .../common/blocks/GT_Material_Reinforced.java | 18 - .../gregtech/common/blocks/GT_Packet_Ores.java | 62 -- .../gregtech/common/blocks/GT_TileEntity_Ores.java | 486 -------------- .../common/blocks/GT_WormholeRenderBlock.java | 75 --- .../gregtech/common/blocks/ItemBlockLaser.java | 24 + .../java/gregtech/common/blocks/ItemCasings1.java | 14 + .../java/gregtech/common/blocks/ItemCasings10.java | 14 + .../java/gregtech/common/blocks/ItemCasings11.java | 14 + .../java/gregtech/common/blocks/ItemCasings2.java | 26 + .../java/gregtech/common/blocks/ItemCasings3.java | 14 + .../java/gregtech/common/blocks/ItemCasings4.java | 14 + .../java/gregtech/common/blocks/ItemCasings5.java | 36 ++ .../java/gregtech/common/blocks/ItemCasings6.java | 14 + .../java/gregtech/common/blocks/ItemCasings8.java | 14 + .../java/gregtech/common/blocks/ItemCasings9.java | 28 + .../common/blocks/ItemCasingsAbstract.java | 63 ++ .../java/gregtech/common/blocks/ItemConcretes.java | 25 + .../common/blocks/ItemCyclotronCasings.java | 10 + .../java/gregtech/common/blocks/ItemFrames.java | 60 ++ .../java/gregtech/common/blocks/ItemGlass1.java | 36 ++ .../java/gregtech/common/blocks/ItemGranites.java | 10 + .../common/blocks/ItemLongDistancePipe.java | 43 ++ .../java/gregtech/common/blocks/ItemMachines.java | 430 +++++++++++++ src/main/java/gregtech/common/blocks/ItemOres.java | 81 +++ .../gregtech/common/blocks/ItemStonesAbstract.java | 42 ++ .../java/gregtech/common/blocks/ItemStorage.java | 47 ++ .../common/blocks/ItemTintedIndustrialGlass.java | 10 + .../gregtech/common/blocks/MaterialCasings.java | 19 + .../gregtech/common/blocks/MaterialMachines.java | 19 + .../gregtech/common/blocks/MaterialReinforced.java | 18 + .../java/gregtech/common/blocks/PacketOres.java | 62 ++ .../gregtech/common/blocks/TileEntityOres.java | 482 ++++++++++++++ 112 files changed, 6274 insertions(+), 6280 deletions(-) create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings1.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings10.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings11.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings2.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings3.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings4.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings5.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings6.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings8.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasings9.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCasingsAbstract.java create mode 100644 src/main/java/gregtech/common/blocks/BlockConcretes.java create mode 100644 src/main/java/gregtech/common/blocks/BlockCyclotronCoils.java create mode 100644 src/main/java/gregtech/common/blocks/BlockDrone.java create mode 100644 src/main/java/gregtech/common/blocks/BlockFrameBox.java create mode 100644 src/main/java/gregtech/common/blocks/BlockGlass1.java create mode 100644 src/main/java/gregtech/common/blocks/BlockGranites.java create mode 100644 src/main/java/gregtech/common/blocks/BlockLaser.java create mode 100644 src/main/java/gregtech/common/blocks/BlockMachines.java create mode 100644 src/main/java/gregtech/common/blocks/BlockMetal.java create mode 100644 src/main/java/gregtech/common/blocks/BlockOres.java create mode 100644 src/main/java/gregtech/common/blocks/BlockOresAbstract.java create mode 100644 src/main/java/gregtech/common/blocks/BlockReinforced.java create mode 100644 src/main/java/gregtech/common/blocks/BlockStones.java create mode 100644 src/main/java/gregtech/common/blocks/BlockStonesAbstract.java create mode 100644 src/main/java/gregtech/common/blocks/BlockStorage.java create mode 100644 src/main/java/gregtech/common/blocks/BlockTintedIndustrialGlass.java create mode 100644 src/main/java/gregtech/common/blocks/BlockWormholeRender.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings1.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings10.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings11.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings2.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings3.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings4.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings5.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings6.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings8.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings9.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Concretes.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Drone.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_FrameBox.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Glass1.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Granites.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Laser.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Machines.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Metal.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Ores.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Stones.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Storage.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Block_TintedIndustrialGlass.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Cyclotron_Coils.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Cyclotron_Item_Casings.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Block_Laser.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings1.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings10.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings11.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings2.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings3.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings4.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings5.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings6.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings8.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings9.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Concretes.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Frames.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Glass1.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Granites.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Machines.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Ores.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Storage.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Item_TintedIndustrialGlass.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Material_Casings.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Material_Machines.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_Packet_Ores.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java delete mode 100644 src/main/java/gregtech/common/blocks/GT_WormholeRenderBlock.java create mode 100644 src/main/java/gregtech/common/blocks/ItemBlockLaser.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings1.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings10.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings11.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings2.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings3.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings4.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings5.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings6.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings8.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasings9.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCasingsAbstract.java create mode 100644 src/main/java/gregtech/common/blocks/ItemConcretes.java create mode 100644 src/main/java/gregtech/common/blocks/ItemCyclotronCasings.java create mode 100644 src/main/java/gregtech/common/blocks/ItemFrames.java create mode 100644 src/main/java/gregtech/common/blocks/ItemGlass1.java create mode 100644 src/main/java/gregtech/common/blocks/ItemGranites.java create mode 100644 src/main/java/gregtech/common/blocks/ItemLongDistancePipe.java create mode 100644 src/main/java/gregtech/common/blocks/ItemMachines.java create mode 100644 src/main/java/gregtech/common/blocks/ItemOres.java create mode 100644 src/main/java/gregtech/common/blocks/ItemStonesAbstract.java create mode 100644 src/main/java/gregtech/common/blocks/ItemStorage.java create mode 100644 src/main/java/gregtech/common/blocks/ItemTintedIndustrialGlass.java create mode 100644 src/main/java/gregtech/common/blocks/MaterialCasings.java create mode 100644 src/main/java/gregtech/common/blocks/MaterialMachines.java create mode 100644 src/main/java/gregtech/common/blocks/MaterialReinforced.java create mode 100644 src/main/java/gregtech/common/blocks/PacketOres.java create mode 100644 src/main/java/gregtech/common/blocks/TileEntityOres.java (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/BlockCasings1.java b/src/main/java/gregtech/common/blocks/BlockCasings1.java new file mode 100644 index 0000000000..5410847176 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings1.java @@ -0,0 +1,107 @@ +package gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.util.GTLanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings1 extends BlockCasingsAbstract { + + /** + * 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] - + * TecTech Textures.BlockIcons.casingTexturePages[8][0-127] - TecTech + */ + public BlockCasings1() { + super(ItemCasings1.class, "gt.blockcasings", MaterialCasings.INSTANCE, 16); + + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "ULV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "LV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "MV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "HV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "EV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "IV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "LuV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "ZPM Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "UV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "UHV Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Bronze Plated Bricks"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Heat Proof Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Dimensionally Transcendent Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Dimensional Injection Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Dimensional Bridge"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Superconducting Coil Block"); + ItemList.Casing_ULV.set(new ItemStack(this, 1, 0)); + ItemList.Casing_LV.set(new ItemStack(this, 1, 1)); + ItemList.Casing_MV.set(new ItemStack(this, 1, 2)); + ItemList.Casing_HV.set(new ItemStack(this, 1, 3)); + ItemList.Casing_EV.set(new ItemStack(this, 1, 4)); + ItemList.Casing_IV.set(new ItemStack(this, 1, 5)); + ItemList.Casing_LuV.set(new ItemStack(this, 1, 6)); + ItemList.Casing_ZPM.set(new ItemStack(this, 1, 7)); + ItemList.Casing_UV.set(new ItemStack(this, 1, 8)); + ItemList.Casing_MAX.set(new ItemStack(this, 1, 9)); + ItemList.Casing_BronzePlatedBricks.set(new ItemStack(this, 1, 10)); + ItemList.Casing_HeatProof.set(new ItemStack(this, 1, 11)); + ItemList.Casing_Dim_Trans.set(new ItemStack(this, 1, 12)); + ItemList.Casing_Dim_Injector.set(new ItemStack(this, 1, 13)); + ItemList.Casing_Dim_Bridge.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Coil_Superconductor.set(new ItemStack(this, 1, 15)); + } + + @Override + public int getTextureIndex(int aMeta) { + return aMeta; + } + + @Override + public IIcon getIcon(int ordinalSide, int aMeta) { + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + case 10 -> { + return Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); + } + case 11 -> { + return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon(); + } + case 12 -> { + return Textures.BlockIcons.MACHINE_DIM_TRANS_CASING.getIcon(); + } + case 13 -> { + return Textures.BlockIcons.MACHINE_DIM_INJECTOR.getIcon(); + } + case 14 -> { + return Textures.BlockIcons.MACHINE_DIM_BRIDGE.getIcon(); + } + case 15 -> { + return Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR.getIcon(); + } + } + if (ordinalSide == 0) { + return Textures.BlockIcons.MACHINECASINGS_BOTTOM[aMeta].getIcon(); + } + if (ordinalSide == 1) { + return Textures.BlockIcons.MACHINECASINGS_TOP[aMeta].getIcon(); + } + return Textures.BlockIcons.MACHINECASINGS_SIDE[aMeta].getIcon(); + } + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } + + @Override + public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) { + return aWorld.getBlockMetadata(aX, aY, aZ) > 9 ? super.colorMultiplier(aWorld, aX, aY, aZ) + : gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 + | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2]; + } +} diff --git a/src/main/java/gregtech/common/blocks/BlockCasings10.java b/src/main/java/gregtech/common/blocks/BlockCasings10.java new file mode 100644 index 0000000000..11c3f81f01 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings10.java @@ -0,0 +1,76 @@ +package gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.util.GTLanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings10 extends BlockCasingsAbstract { + + public BlockCasings10() { + super(ItemCasings10.class, "gt.blockcasings10", MaterialCasings.INSTANCE, 16); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "MagTech Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Laser Containment Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Quark Exclusion Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Pressure Containment Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Electric Compressor Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Compression Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Neutronium Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Active Neutronium Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Neutronium Stabilization Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Coolant Duct"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Heating Duct"); + GTLanguageManager + .addStringLocalization(getUnlocalizedName() + ".11.name", "Extreme Density Space-Bending Casing"); + GTLanguageManager + .addStringLocalization(getUnlocalizedName() + ".12.name", "Background Radiation Absorbent Casing"); + + ItemList.Casing_Electromagnetic_Separator.set(new ItemStack(this, 1, 0)); + ItemList.Casing_Laser.set(new ItemStack(this, 1, 1)); + ItemList.BlockQuarkContainmentCasing.set(new ItemStack(this, 1, 2)); + ItemList.Casing_Autoclave.set(new ItemStack(this, 1, 3)); + ItemList.Compressor_Casing.set(new ItemStack(this, 1, 4)); + ItemList.Compressor_Pipe_Casing.set(new ItemStack(this, 1, 5)); + ItemList.Neutronium_Casing.set(new ItemStack(this, 1, 6)); + ItemList.Neutronium_Active_Casing.set(new ItemStack(this, 1, 7)); + ItemList.Neutronium_Stable_Casing.set(new ItemStack(this, 1, 8)); + ItemList.Coolant_Duct_Casing.set(new ItemStack(this, 1, 9)); + ItemList.Heating_Duct_Casing.set(new ItemStack(this, 1, 10)); + ItemList.Extreme_Density_Casing.set(new ItemStack(this, 1, 11)); + ItemList.Background_Radiation_Casing.set(new ItemStack(this, 1, 12)); + } + + @Override + public int getTextureIndex(int aMeta) { + return (16 << 7) | (aMeta + 48); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_CASING_EMS.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_CASING_LASER.getIcon(); + case 2 -> Textures.BlockIcons.BLOCK_QUARK_CONTAINMENT_CASING.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_CASING_AUTOCLAVE.getIcon(); + case 4 -> Textures.BlockIcons.COMPRESSOR_CASING.getIcon(); + case 5 -> Textures.BlockIcons.COMPRESSOR_PIPE_CASING.getIcon(); + case 6 -> Textures.BlockIcons.NEUTRONIUM_CASING.getIcon(); + case 7 -> Textures.BlockIcons.NEUTRONIUM_ACTIVE_CASING.getIcon(); + case 8 -> Textures.BlockIcons.NEUTRONIUM_STABLE_CASING.getIcon(); + case 9 -> Textures.BlockIcons.MACHINE_CASING_PIPE_TUNGSTENSTEEL.getIcon(); + case 10 -> Textures.BlockIcons.MACHINE_CASING_PIPE_BRONZE.getIcon(); + case 11 -> Textures.BlockIcons.EXTREME_DENSITY_CASING.getIcon(); + case 12 -> Textures.BlockIcons.RADIATION_ABSORBENT_CASING.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + }; + } +} diff --git a/src/main/java/gregtech/common/blocks/BlockCasings11.java b/src/main/java/gregtech/common/blocks/BlockCasings11.java new file mode 100644 index 0000000000..a654aae3d7 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings11.java @@ -0,0 +1,58 @@ +package gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.util.GTLanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings11 extends BlockCasingsAbstract { + + public BlockCasings11() { + super(ItemCasings11.class, "gt.blockcasings11", MaterialCasings.INSTANCE, 16); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Tin Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Brass Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Electrum Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Platinum Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Osmium Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Quantium Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Fluxed Electrum Item Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Black Plutonium Item Pipe Casing"); + + ItemList.Casing_Item_Pipe_Tin.set(new ItemStack(this, 1, 0)); + ItemList.Casing_Item_Pipe_Brass.set(new ItemStack(this, 1, 1)); + ItemList.Casing_Item_Pipe_Electrum.set(new ItemStack(this, 1, 2)); + ItemList.Casing_Item_Pipe_Platinum.set(new ItemStack(this, 1, 3)); + ItemList.Casing_Item_Pipe_Osmium.set(new ItemStack(this, 1, 4)); + ItemList.Casing_Item_Pipe_Quantium.set(new ItemStack(this, 1, 5)); + ItemList.Casing_Item_Pipe_Fluxed_Electrum.set(new ItemStack(this, 1, 6)); + ItemList.Casing_Item_Pipe_Black_Plutonium.set(new ItemStack(this, 1, 7)); + } + + @Override + public int getTextureIndex(int aMeta) { + return (16 << 7) | (aMeta + 64); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 1 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_BRASS.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_ELECTRUM.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_PLATINUM.getIcon(); + case 4 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_OSMIUM.getIcon(); + case 5 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_QUANTIUM.getIcon(); + case 6 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_FLUXED_ELECTRUM.getIcon(); + case 7 -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_BLACK_PLUTONIUM.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_ITEM_PIPE_TIN.getIcon(); + }; + } +} diff --git a/src/main/java/gregtech/common/blocks/BlockCasings2.java b/src/main/java/gregtech/common/blocks/BlockCasings2.java new file mode 100644 index 0000000000..441bbd9b82 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings2.java @@ -0,0 +1,102 @@ +package gregtech.common.blocks; + +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; +import net.minecraftforge.common.util.ForgeDirection; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTLanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings2 extends BlockCasingsAbstract { + + public BlockCasings2() { + super(ItemCasings2.class, "gt.blockcasings2", MaterialCasings.INSTANCE, 96); + // Special handler for Pyrolyse Oven Casing on hatches... + Textures.BlockIcons.casingTexturePages[0][22] = TextureFactory.of( + Block.getBlockFromItem( + ItemList.Casing_ULV.get(1) + .getItem()), + 0, + ForgeDirection.UNKNOWN, + Dyes.MACHINE_METAL.mRGBa); + + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Solid Steel Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Frost Proof Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Bronze Gear Box Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Steel Gear Box Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Titanium Gear Box Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Assembling Line Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Processor Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Data Drive Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Containment Field Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Assembler Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Pump Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Motor Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Bronze Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Steel Pipe Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Titanium Pipe Casing"); + GTLanguageManager.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)); + } + + @Override + public int getTextureIndex(int aMeta) { + return aMeta == 6 ? ((1 << 7) + 96) : aMeta + 16; + } + + @Override + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_CASING_GEARBOX_BRONZE.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_CASING_GEARBOX_STEEL.getIcon(); + case 4 -> Textures.BlockIcons.MACHINE_CASING_GEARBOX_TITANIUM.getIcon(); + case 5 -> Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); + case 6 -> Textures.BlockIcons.MACHINE_CASING_PROCESSOR.getIcon(); + case 7 -> Textures.BlockIcons.MACHINE_CASING_DATA_DRIVE.getIcon(); + case 8 -> Textures.BlockIcons.MACHINE_CASING_CONTAINMENT_FIELD.getIcon(); + case 9 -> Textures.BlockIcons.MACHINE_CASING_ASSEMBLER.getIcon(); + case 10 -> Textures.BlockIcons.MACHINE_CASING_PUMP.getIcon(); + case 11 -> Textures.BlockIcons.MACHINE_CASING_MOTOR.getIcon(); + case 12 -> Textures.BlockIcons.MACHINE_CASING_PIPE_BRONZE.getIcon(); + case 13 -> Textures.BlockIcons.MACHINE_CASING_PIPE_STEEL.getIcon(); + case 14 -> Textures.BlockIcons.MACHINE_CASING_PIPE_TITANIUM.getIcon(); + case 15 -> Textures.BlockIcons.MACHINE_CASING_PIPE_TUNGSTENSTEEL.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + }; + } + + @Override + 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/BlockCasings3.java b/src/main/java/gregtech/common/blocks/BlockCasings3.java new file mode 100644 index 0000000000..fdd48b62ed --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings3.java @@ -0,0 +1,82 @@ +package gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.util.GTLanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings3 extends BlockCasingsAbstract { + + public BlockCasings3() { + super(ItemCasings3.class, "gt.blockcasings3", MaterialCasings.INSTANCE, 16); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Yellow Stripes Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Yellow Stripes Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Radioactive Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Bio Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Explosion Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Fire Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Acid Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Magic Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Frost Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Noise Hazard Sign Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Grate Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Filter Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Radiation Proof Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Bronze Firebox Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Steel Firebox Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Tungstensteel Firebox Casing"); + ItemList.Casing_Stripes_A.set(new ItemStack(this, 1, 0)); + ItemList.Casing_Stripes_B.set(new ItemStack(this, 1, 1)); + ItemList.Casing_RadioactiveHazard.set(new ItemStack(this, 1, 2)); + ItemList.Casing_BioHazard.set(new ItemStack(this, 1, 3)); + ItemList.Casing_ExplosionHazard.set(new ItemStack(this, 1, 4)); + ItemList.Casing_FireHazard.set(new ItemStack(this, 1, 5)); + ItemList.Casing_AcidHazard.set(new ItemStack(this, 1, 6)); + ItemList.Casing_MagicHazard.set(new ItemStack(this, 1, 7)); + ItemList.Casing_FrostHazard.set(new ItemStack(this, 1, 8)); + ItemList.Casing_NoiseHazard.set(new ItemStack(this, 1, 9)); + ItemList.Casing_Grate.set(new ItemStack(this, 1, 10)); + ItemList.Casing_Vent.set(new ItemStack(this, 1, 11)); + ItemList.Casing_RadiationProof.set(new ItemStack(this, 1, 12)); + ItemList.Casing_Firebox_Bronze.set(new ItemStack(this, 1, 13)); + ItemList.Casing_Firebox_Steel.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Firebox_TungstenSteel.set(new ItemStack(this, 1, 15)); + } + + @Override + public int getTextureIndex(int aMeta) { + return aMeta + 32; + } + + @Override + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_CASING_STRIPES_A.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_CASING_STRIPES_B.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_CASING_BIOHAZARD.getIcon(); + case 4 -> Textures.BlockIcons.MACHINE_CASING_EXPLOSIONHAZARD.getIcon(); + case 5 -> Textures.BlockIcons.MACHINE_CASING_FIREHAZARD.getIcon(); + case 6 -> Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD.getIcon(); + case 7 -> Textures.BlockIcons.MACHINE_CASING_MAGICHAZARD.getIcon(); + case 8 -> Textures.BlockIcons.MACHINE_CASING_FROSTHAZARD.getIcon(); + case 9 -> Textures.BlockIcons.MACHINE_CASING_NOISEHAZARD.getIcon(); + case 10 -> Textures.BlockIcons.MACHINE_CASING_GRATE.getIcon(); + case 11 -> Textures.BlockIcons.MACHINE_CASING_VENT.getIcon(); + case 12 -> Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + case 13 -> ordinalSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon() + : Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); + case 14 -> ordinalSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon() + : Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + case 15 -> ordinalSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TUNGSTENSTEEL.getIcon() + : Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + }; + } +} diff --git a/src/main/java/gregtech/common/blocks/BlockCasings4.java b/src/main/java/gregtech/common/blocks/BlockCasings4.java new file mode 100644 index 0000000000..0cba916548 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings4.java @@ -0,0 +1,239 @@ +package gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GTMod; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GTLanguageManager; +import gregtech.api.util.GTRenderingWorld; +import gregtech.common.tileentities.machines.multi.MTELargeTurbine; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings4 extends BlockCasingsAbstract { + + /** + * This mapping is used to look up which texture should be used to render the connected texture for fusion casings. + *

+ * This mapping is computed from that giant if ladder from #getIcon in commit + * da3421547afadc49938b5b6a7f9a9679afa1d570 The exact meaning of these numbers are like black magic. Read the + * original getIcon implementation to understand why it is 0, 1, etc, if that if ladder is even intelligible. + */ + private static final int[][] mapping = new int[][] { + { 7, 7, 7, 7, 0, 7, 0, 7, 1, 7, 1, 7, 8, 7, 8, 7, 0, 7, 0, 7, 0, 7, 0, 7, 9, 7, 9, 7, 3, 7, 3, 7, 1, 7, 1, 7, + 11, 7, 11, 7, 1, 7, 1, 7, 2, 7, 2, 7, 10, 7, 10, 7, 5, 7, 5, 7, 4, 7, 4, 7, 6, 7, 6, 7 }, + { 7, 7, 7, 7, 0, 0, 7, 7, 1, 1, 7, 7, 8, 8, 7, 7, 0, 0, 7, 7, 0, 0, 7, 7, 9, 9, 7, 7, 3, 3, 7, 7, 1, 1, 7, 7, + 11, 11, 7, 7, 1, 1, 7, 7, 2, 2, 7, 7, 10, 10, 7, 7, 5, 5, 7, 7, 4, 4, 7, 7, 6, 6, 7, 7 }, + { 7, 1, 1, 1, 0, 9, 10, 4, 7, 1, 1, 1, 0, 9, 10, 4, 0, 8, 11, 2, 0, 3, 5, 6, 0, 8, 11, 2, 0, 3, 5, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 7, 1, 1, 1, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, + 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 7, 1, 1, 1, 7, 1, 1, 1, 0, 8, 11, 2, 0, 8, 11, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 9, 10, 4, + 0, 9, 10, 4, 0, 3, 5, 6, 0, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 7, 1, 1, 1, 7, 7, 7, 7, 0, 9, 10, 4, 7, 7, 7, 7, 7, 1, 1, 1, 7, 7, 7, 7, 0, 9, 10, 4, 7, 7, 7, 7, 0, 8, 11, 2, + 7, 7, 7, 7, 0, 3, 5, 6, 7, 7, 7, 7, 0, 8, 11, 2, 7, 7, 7, 7, 0, 3, 5, 6, 7, 7, 7, 7 }, }; + + public static boolean mConnectedMachineTextures = true; + + public BlockCasings4() { + super(ItemCasings4.class, "gt.blockcasings4", MaterialCasings.INSTANCE, 16); + GTLanguageManager + .addStringLocalization(getUnlocalizedName() + ".0.name", "Robust Tungstensteel Machine Casing"); + GTLanguageManager + .addStringLocalization(getUnlocalizedName() + ".1.name", "Clean Stainless Steel Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Stable Titanium Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Titanium Firebox Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Fusion Machine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Fusion Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Fusion Machine Casing MK II"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Turbine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Stainless Steel Turbine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Titanium Turbine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Tungstensteel Turbine Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Engine Intake Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Mining Osmiridium Casing"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Firebricks"); + + ItemList.Casing_RobustTungstenSteel.set(new ItemStack(this, 1, 0)); + ItemList.Casing_CleanStainlessSteel.set(new ItemStack(this, 1, 1)); + ItemList.Casing_StableTitanium.set(new ItemStack(this, 1, 2)); + ItemList.Casing_Firebox_Titanium.set(new ItemStack(this, 1, 3)); + ItemList.Casing_Fusion.set(new ItemStack(this, 1, 6)); + ItemList.Casing_Fusion_Coil.set(new ItemStack(this, 1, 7)); + ItemList.Casing_Fusion2.set(new ItemStack(this, 1, 8)); + ItemList.Casing_Turbine.set(new ItemStack(this, 1, 9)); + ItemList.Casing_Turbine1.set(new ItemStack(this, 1, 10)); + ItemList.Casing_Turbine2.set(new ItemStack(this, 1, 11)); + ItemList.Casing_Turbine3.set(new ItemStack(this, 1, 12)); + ItemList.Casing_EngineIntake.set(new ItemStack(this, 1, 13)); + ItemList.Casing_MiningOsmiridium.set(new ItemStack(this, 1, 14)); + ItemList.Casing_Firebricks.set(new ItemStack(this, 1, 15)); + + GTMod.gregtechproxy.mCTMBlockCache.put(this, (byte) 6, true); + GTMod.gregtechproxy.mCTMBlockCache.put(this, (byte) 8, true); + } + + @Override + public int getTextureIndex(int aMeta) { + return aMeta + 48; + } + + @Override + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 3 -> ordinalSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon() + : Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 4 -> + // Do not overwrite! + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW.getIcon(); + case 5 -> + // Do not overwrite! + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS.getIcon(); + case 6 -> Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon(); + case 7 -> Textures.BlockIcons.MACHINE_CASING_FUSION_COIL.getIcon(); + case 8 -> Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon(); + case 9 -> Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); + case 10 -> Textures.BlockIcons.MACHINE_CASING_TURBINE_STAINLESSSTEEL.getIcon(); + case 11 -> Textures.BlockIcons.MACHINE_CASING_TURBINE_TITANIUM.getIcon(); + case 12 -> Textures.BlockIcons.MACHINE_CASING_TURBINE_TUNGSTENSTEEL.getIcon(); + case 13 -> Textures.BlockIcons.MACHINE_CASING_ENGINE_INTAKE.getIcon(); + case 14 -> Textures.BlockIcons.MACHINE_CASING_MINING_OSMIRIDIUM.getIcon(); + case 15 -> Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + }; + } + + @Deprecated + public IIcon getTurbineCasing(int meta, int iconIndex, boolean active, boolean hasTurbine) { + return switch (meta) { + case 10 -> active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE1[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY1[iconIndex].getIcon(); + case 11 -> active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE2[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY2[iconIndex].getIcon(); + case 12 -> active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE3[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY3[iconIndex].getIcon(); + default -> active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() + : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); + }; + } + + private static int isTurbineControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int ordinalSide) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0; + if (tTile.getMetaTileEntity() instanceof MTELargeTurbine turbine && tTile.getFrontFacing() + .ordinal() == ordinalSide) { + if (turbine.isNewStyleRendering()) return 0; + if (tTile.isActive()) return 1; + return turbine.hasTurbine() ? 2 : 3; + } + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int ordinalSide) { + aWorld = GTRenderingWorld.getInstance(aWorld); + int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (tMeta != 6 && tMeta != 8 && tMeta != 9 && tMeta != 10 && tMeta != 11 && tMeta != 12 + || !mConnectedMachineTextures) { + return getIcon(ordinalSide, tMeta); + } + // noinspection ConstantValue // tMeta < 13 should stay because mConnectedMachineTextures can be changed + if (tMeta > 8 && tMeta < 13) { + int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1; + switch (ordinalSide / 2) { + case 0 -> { + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) continue; + int tState; + if ((tState = isTurbineControllerWithSide( + aWorld, + xCoord + j, + yCoord, + zCoord + i, + ordinalSide)) != 0) { + return getTurbineCasing(tMeta, 4 - i * 3 - j, tState == 1, tState == 2); + } + } + } + } + case 1 -> { + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) continue; + int tState; + if ((tState = isTurbineControllerWithSide( + aWorld, + xCoord + j, + yCoord + i, + zCoord, + ordinalSide)) != 0) { + return getTurbineCasing( + tMeta, + 4 + i * 3 - j * tInvertLeftRightMod, + tState == 1, + tState == 2); + } + } + } + } + case 2 -> { + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) continue; + int tState; + if ((tState = isTurbineControllerWithSide( + aWorld, + xCoord, + yCoord + i, + zCoord + j, + ordinalSide)) != 0) { + return getTurbineCasing( + tMeta, + 4 + i * 3 + j * tInvertLeftRightMod, + tState == 1, + tState == 2); + } + } + } + } + } + return switch (tMeta) { + case 10 -> Textures.BlockIcons.MACHINE_CASING_TURBINE_STAINLESSSTEEL.getIcon(); + case 11 -> Textures.BlockIcons.MACHINE_CASING_TURBINE_TITANIUM.getIcon(); + case 12 -> Textures.BlockIcons.MACHINE_CASING_TURBINE_TUNGSTENSTEEL.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + }; + } + int tStartIndex = tMeta == 6 ? 1 : 13; + int tIndexIntoMapping = 0; + if (isSameBlock(aWorld, xCoord, yCoord - 1, zCoord, tMeta)) tIndexIntoMapping |= 1; + if (isSameBlock(aWorld, xCoord, yCoord + 1, zCoord, tMeta)) tIndexIntoMapping |= 1 << 1; + if (isSameBlock(aWorld, xCoord + 1, yCoord, zCoord, tMeta)) tIndexIntoMapping |= 1 << 2; + if (isSameBlock(aWorld, xCoord, yCoord, zCoord + 1, tMeta)) tIndexIntoMapping |= 1 << 3; + if (isSameBlock(aWorld, xCoord - 1, yCoord, zCoord, tMeta)) tIndexIntoMapping |= 1 << 4; + if (isSameBlock(aWorld, xCoord, yCoord, zCoord - 1, tMeta)) tIndexIntoMapping |= 1 << 5; + return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + mapping[ordinalSide][tIndexIntoMapping]].getIcon(); + } + + private boolean isSameBlock(IBlockAccess aWorld, int aX, int aY, int aZ, int aMeta) { + return aWorld.getBlock(aX, aY, aZ) == this && aWorld.getBlockMetadata(aX, aY, aZ) == aMeta; + } +} diff --git a/src/main/java/gregtech/common/blocks/BlockCasings5.java b/src/main/java/gregtech/common/blocks/BlockCasings5.java new file mode 100644 index 0000000000..15b3eedcba --- /dev/null +++ b/src/main/java/gregtech/common/blocks/BlockCasings5.java @@ -0,0 +1,161 @@ +package gregtech.common.blocks; + +import static gregtech.api.enums.HeatingCoilLevel.EV; +import static gregtech.api.enums.HeatingCoilLevel.HV; +import static gregtech.api.enums.HeatingCoilLevel.IV; +import static gregtech.api.enums.HeatingCoilLevel.LV; +import static gregtech.api.enums.HeatingCoilLevel.LuV; +import static gregtech.api.enums.HeatingCoilLevel.MAX; +import static gregtech.api.enums.HeatingCoilLevel.MV; +import static gregtech.api.enums.HeatingCoilLevel.None; +import static gregtech.api.enums.HeatingCoilLevel.UEV; +import static gregtech.api.enums.HeatingCoilLevel.UHV; +import static gregtech.api.enums.HeatingCoilLevel.UIV; +import static gregtech.api.enums.HeatingCoilLevel.UMV; +import static gregtech.api.enums.HeatingCoilLevel.UV; +import static gregtech.api.enums.HeatingCoilLevel.UXV; +import static gregtech.api.enums.HeatingCoilLevel.ZPM; + +import java.util.function.Consumer; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IHeatingCoil; +import gregtech.api.util.GTLanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class BlockCasings5 extends BlockCasingsAbstract implements IHeatingCoil { + + public BlockCasings5() { + super(ItemCasings5.class, "gt.blockcasings5", MaterialCasings.INSTANCE, 16); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Cupronickel Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Kanthal Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Nichrome Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "TPV-Alloy Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "HSS-G Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Naquadah Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Naquadah Alloy Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Electrum Flux Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Awakened Draconium Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "HSS-S Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Trinium Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Infinity Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hypogen Coil Block"); + GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Eternal Coil Block"); + + ItemList.Casing_Coil_Cupronickel.set(new ItemStack(this, 1, 0)); + ItemList.Casing_Coil_Kanthal.set(new ItemStack(this, 1, 1)); + ItemList.Casing_Coil_Nichrome.set(new ItemStack(this, 1, 2)); + ItemList.Casing_Coil_TungstenSteel.set(new ItemStack(this, 1, 3)); + ItemList.Casing_Coil_HSSG.set(new ItemStack(this, 1, 4)); + ItemList.Casing_Coil_Naquadah.set(new ItemStack(this, 1, 5)); + ItemList.Casing_Coil_NaquadahAlloy.set(new ItemStack(this, 1, 6)); + ItemList.Casing_Coil_ElectrumFlux.set(new ItemStack(this, 1, 7)); + ItemList.Casing_Coil_AwakenedDraconium.set(new ItemStack(this, 1, 8)); + ItemList.Casing_Coil_HSSS.set(new ItemStack(this, 1, 9)); + ItemList.Casing_Coil_Trinium.set(new ItemStack(this, 1, 10)); + ItemList.Casing_Coil_Infinity.set(new ItemStack(this, 1, 11)); + ItemList.Casing_Coil_Hypogen.set(new ItemStack(this, 1, 12)); + ItemList.Casing_Coil_Eternal.set(new ItemStack(this, 1, 13)); + ItemList.Casing_Shielded_Accelerator.set(new ItemStack(this, 1, 14)); + } + + @Override + public int getTextureIndex(int aMeta) { + return (1 << 7) | aMeta; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_COIL_CUPRONICKEL.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_COIL_KANTHAL.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_COIL_NICHROME.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_COIL_TUNGSTENSTEEL.getIcon(); + case 4 -> Textures.BlockIcons.MACHINE_COIL_HSSG.getIcon(); + case 5 -> Textures.BlockIcons.MACHINE_COIL_NAQUADAH.getIcon(); + case 6 -> Textures.BlockIcons.MACHINE_COIL_NAQUADAHALLOY.getIcon(); + case 7 -> Textures.BlockIcons.MACHINE_COIL_ELECTRUMFLUX.getIcon(); + case 8 -> Textures.BlockIcons.MACHINE_COIL_AWAKENEDDRACONIUM.getIcon(); + case 9 -> Textures.BlockIcons.MACHINE_COIL_HSSS.getIcon(); + case 10 -> Textures.BlockIcons.MACHINE_COIL_TRINIUM.getIcon(); + case 11 -> Textures.BlockIcons.MACHINE_COIL_INFINITY.getIcon(); + case 12 -> Textures.BlockIcons.MACHINE_COIL_HYPOGEN.getIcon(); + case 13 -> Textures.BlockIcons.MACHINE_COIL_ETERNAL.getIcon(); + case 14 -> Textures.BlockIcons.MACHINE_CASING_SHIELDED_ACCELERATOR.getIcon(); + default -> Textures.BlockIcons.MACHINE_COIL_CUPRONICKEL.getIcon(); + }; + } + + /*--------------- COIL CHECK IMPL. ------------*/ + + public static HeatingCoilLevel getCoilHeatFromDamage(int meta) { + return switch (meta) { + case 0 -> LV; + case 1 -> MV; + case 2 -> HV; + case 3 -> EV; + case 4 -> IV; + case 5 -> ZPM; + case 6 -> UV; + case 7 -> UEV; + case 8 -> UIV; + case 9 -> LuV; + case 10 -> UHV; + case 11 -> UMV; + case 12 -> UXV; + case 13 -> MAX; + default -> None; + }; + } + + public static int getMetaFromCoilHeat(HeatingCoilLevel level) { + return switch (level) { + case LV -> 0; + case MV -> 1; + case HV -> 2; + case EV -> 3; + case IV -> 4; + case ZPM -> 5; + case UV -> 6; + case UEV -> 7; + case UIV -> 8; + case LuV -> 9; + case UHV -> 10; + case UMV -> 11; + case UXV -> 12; + case MAX -> 13; + default -> 0; + }; + } + + @Override +