From 0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 30 Jan 2023 10:56:42 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../gregtech/common/blocks/GT_Block_Casings1.java | 31 ++- .../gregtech/common/blocks/GT_Block_Casings2.java | 19 +- .../gregtech/common/blocks/GT_Block_Casings3.java | 15 +- .../gregtech/common/blocks/GT_Block_Casings4.java | 114 ++++------ .../gregtech/common/blocks/GT_Block_Casings5.java | 8 +- .../gregtech/common/blocks/GT_Block_Casings6.java | 8 +- .../gregtech/common/blocks/GT_Block_Casings8.java | 65 +++--- .../gregtech/common/blocks/GT_Block_Casings9.java | 10 +- .../common/blocks/GT_Block_Casings_Abstract.java | 21 +- .../gregtech/common/blocks/GT_Block_Concretes.java | 15 +- .../gregtech/common/blocks/GT_Block_Granites.java | 10 +- .../gregtech/common/blocks/GT_Block_Machines.java | 115 +++++----- .../gregtech/common/blocks/GT_Block_Metal.java | 8 +- .../java/gregtech/common/blocks/GT_Block_Ores.java | 75 +++---- .../common/blocks/GT_Block_Ores_Abstract.java | 86 ++++---- .../gregtech/common/blocks/GT_Block_Ores_UB1.java | 60 ++--- .../gregtech/common/blocks/GT_Block_Ores_UB2.java | 64 ++---- .../gregtech/common/blocks/GT_Block_Ores_UB3.java | 64 ++---- .../common/blocks/GT_Block_Reinforced.java | 87 +++----- .../gregtech/common/blocks/GT_Block_Stones.java | 18 +- .../common/blocks/GT_Block_Stones_Abstract.java | 47 ++-- .../gregtech/common/blocks/GT_Block_Storage.java | 10 +- .../gregtech/common/blocks/GT_Cyclotron_Coils.java | 10 +- .../common/blocks/GT_Cyclotron_Item_Casings.java | 1 + .../gregtech/common/blocks/GT_Item_Casings1.java | 1 + .../gregtech/common/blocks/GT_Item_Casings2.java | 2 + .../gregtech/common/blocks/GT_Item_Casings3.java | 1 + .../gregtech/common/blocks/GT_Item_Casings4.java | 1 + .../gregtech/common/blocks/GT_Item_Casings5.java | 19 +- .../gregtech/common/blocks/GT_Item_Casings6.java | 1 + .../gregtech/common/blocks/GT_Item_Casings8.java | 1 + .../gregtech/common/blocks/GT_Item_Casings9.java | 1 + .../common/blocks/GT_Item_Casings_Abstract.java | 55 ++--- .../gregtech/common/blocks/GT_Item_Concretes.java | 9 +- .../gregtech/common/blocks/GT_Item_Granites.java | 1 + .../common/blocks/GT_Item_LongDistancePipe.java | 15 +- .../gregtech/common/blocks/GT_Item_Machines.java | 245 +++++++++++---------- .../java/gregtech/common/blocks/GT_Item_Ores.java | 39 +--- .../common/blocks/GT_Item_Stones_Abstract.java | 11 +- .../gregtech/common/blocks/GT_Item_Storage.java | 5 +- .../common/blocks/GT_Material_Casings.java | 1 + .../common/blocks/GT_Material_Machines.java | 1 + .../common/blocks/GT_Material_Reinforced.java | 1 + .../gregtech/common/blocks/GT_Packet_Ores.java | 9 +- .../gregtech/common/blocks/GT_TileEntity_Ores.java | 159 ++++++------- 45 files changed, 725 insertions(+), 814 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 3f717b4d79..7d04a7bde3 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java @@ -1,26 +1,22 @@ package gregtech.common.blocks; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Textures; -import gregtech.api.util.GT_LanguageManager; 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.GT_LanguageManager; + 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] - TecTech - * Textures.BlockIcons.casingTexturePages[8][0-127] - TecTech + * 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 GT_Block_Casings1() { super(GT_Item_Casings1.class, "gt.blockcasings", GT_Material_Casings.INSTANCE, 16); @@ -37,8 +33,8 @@ public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "UHV Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Bronze Plated Bricks"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Heat Proof Machine Casing"); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".12.name", "Dimensionally Transcendent Casing"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".12.name", "Dimensionally Transcendent Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Dimensional Injection Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Dimensional Bridge"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Superconducting Coil Block"); @@ -95,8 +91,7 @@ public class GT_Block_Casings1 extends GT_Block_Casings_Abstract { @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) + 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/GT_Block_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java index 7ee9472308..044806874b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings2.java @@ -1,10 +1,5 @@ package gregtech.common.blocks; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Textures; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -13,7 +8,14 @@ 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.GT_LanguageManager; + 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, 96); // Special handler for Pyrolyse Oven Casing on hatches... @@ -102,10 +104,9 @@ public class GT_Block_Casings2 extends GT_Block_Casings_Abstract { } @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) + 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_Casings3.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java index 677c457678..aef025d08f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings3.java @@ -1,12 +1,14 @@ 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.GT_LanguageManager; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GT_Block_Casings3 extends GT_Block_Casings_Abstract { + public GT_Block_Casings3() { super(GT_Item_Casings3.class, "gt.blockcasings3", GT_Material_Casings.INSTANCE, 16); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Yellow Stripes Block"); @@ -78,16 +80,13 @@ public class GT_Block_Casings3 extends GT_Block_Casings_Abstract { case 12: return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); case 13: - return aSide > 1 - ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon() + return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon() : Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); case 14: - return aSide > 1 - ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon() + return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon() : Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); case 15: - return aSide > 1 - ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TUNGSTENSTEEL.getIcon() + return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TUNGSTENSTEEL.getIcon() : Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); } return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 62c7649dc2..087818d099 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -1,5 +1,10 @@ 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.GT_Mod; @@ -9,58 +14,42 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_RenderingWorld; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { + /** * 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. + * 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 - }, - }; + { 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 GT_Block_Casings4() { super(GT_Item_Casings4.class, "gt.blockcasings4", GT_Material_Casings.INSTANCE, 16); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".0.name", "Robust Tungstensteel Machine Casing"); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".1.name", "Clean Stainless Steel Machine Casing"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".0.name", "Robust Tungstensteel Machine Casing"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".1.name", "Clean Stainless Steel Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Stable Titanium Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Titanium Firebox Casing"); - // GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Fusion Casing"); - // GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Fusion Casing"); + // GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Fusion Casing"); + // GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Fusion Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Fusion Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Fusion Coil Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Fusion Machine Casing MK II"); @@ -109,8 +98,7 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { case 11: return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); case 3: - return aSide > 1 - ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon() + return aSide > 1 ? Textures.BlockIcons.MACHINE_CASING_FIREBOX_TITANIUM.getIcon() : Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); case 4: // Do not overwrite! @@ -140,20 +128,16 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { public IIcon getTurbineCasing(int meta, int iconIndex, boolean active) { switch (meta) { case 10: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() : Textures.BlockIcons.TURBINE1[iconIndex].getIcon(); case 11: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() : Textures.BlockIcons.TURBINE2[iconIndex].getIcon(); case 12: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() : Textures.BlockIcons.TURBINE3[iconIndex].getIcon(); default: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); } } @@ -162,28 +146,20 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { public IIcon getTurbineCasing(int meta, int iconIndex, boolean active, boolean hasTurbine) { switch (meta) { case 10: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() - : hasTurbine - ? Textures.BlockIcons.TURBINE1[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE1[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE1[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY1[iconIndex].getIcon(); case 11: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() - : hasTurbine - ? Textures.BlockIcons.TURBINE2[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE2[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE2[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY2[iconIndex].getIcon(); case 12: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() - : hasTurbine - ? Textures.BlockIcons.TURBINE3[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE3[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE3[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY3[iconIndex].getIcon(); default: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() - : hasTurbine - ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); } } @@ -233,7 +209,10 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) != 0) { return getTurbineCasing( - tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); + tMeta, + 4 + i * 3 - j * tInvertLeftRightMod, + tState == 1, + tState == 2); } } } @@ -246,7 +225,10 @@ public class GT_Block_Casings4 extends GT_Block_Casings_Abstract { if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) != 0) { return getTurbineCasing( - tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); + tMeta, + 4 + i * 3 + j * tInvertLeftRightMod, + tState == 1, + tState == 2); } } } 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 c02bc79206..364d6e0eed 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings5.java @@ -2,6 +2,11 @@ package gregtech.common.blocks; import static gregtech.api.enums.HeatingCoilLevel.*; +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; @@ -9,9 +14,6 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHeatingCoil; import gregtech.api.util.GT_LanguageManager; -import java.util.function.Consumer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GT_Block_Casings5 extends GT_Block_Casings_Abstract implements IHeatingCoil { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java index 0b6b89198a..177b5bdbe7 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java @@ -1,15 +1,17 @@ package gregtech.common.blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + 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.GT_LanguageManager; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GT_Block_Casings6 extends GT_Block_Casings_Abstract { + public GT_Block_Casings6() { super(GT_Item_Casings6.class, "gt.blockcasings6", GT_Material_Casings.INSTANCE, 16); 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 03f7262219..bda180b45d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java @@ -1,5 +1,10 @@ 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.api.enums.ItemList; @@ -8,20 +13,16 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_RenderingWorld; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { + public static boolean mConnectedMachineTextures = true; // WATCH OUT FOR TEXTURE ID's public GT_Block_Casings8() { super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE, 15); /* - * DO NOT USE INDEX 15 ! - * USED HERE: https://github.com/GTNewHorizons/Electro-Magic-Tools/pull/17 + * DO NOT USE INDEX 15 ! USED HERE: https://github.com/GTNewHorizons/Electro-Magic-Tools/pull/17 */ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Chemically Inert Machine Casing"); @@ -30,20 +31,24 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Mining Black Plutonium Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Extreme Engine Intake Casing"); GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".5.name", "Europium Reinforced Radiation Proof Machine Casing"); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".6.name", "Advanced Rhodium Plated Palladium Machine Casing"); + getUnlocalizedName() + ".5.name", + "Europium Reinforced Radiation Proof Machine Casing"); GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".7.name", "Advanced Iridium Plated Machine Casing"); + getUnlocalizedName() + ".6.name", + "Advanced Rhodium Plated Palladium Machine Casing"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".7.name", "Advanced Iridium Plated Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Magical Machine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "HSS-S Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Radiant Naquadah Alloy Casing"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".11.name", "Basic Photolithographic Framework Casing"); GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".11.name", "Basic Photolithographic Framework Casing"); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".12.name", "Reinforced Photolithographic Framework Casing"); + getUnlocalizedName() + ".12.name", + "Reinforced Photolithographic Framework Casing"); GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".13.name", "Radiation Proof Photolithographic Framework Casing"); + getUnlocalizedName() + ".13.name", + "Radiation Proof Photolithographic Framework Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Infinity Cooled Casing"); ItemList.Casing_Chemically_Inert.set(new ItemStack(this, 1, 0)); @@ -81,8 +86,8 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { case 3: return Textures.BlockIcons.MACHINE_CASING_MINING_BLACKPLUTONIUM.getIcon(); case 4: - return Textures.BlockIcons.MACHINE_CASING_EXTREME_ENGINE_INTAKE - .getIcon(); // changed color in a terrible way + return Textures.BlockIcons.MACHINE_CASING_EXTREME_ENGINE_INTAKE.getIcon(); // changed color in a + // terrible way case 5: return Textures.BlockIcons.MACHINE_CASING_ADVANCEDRADIATIONPROOF.getIcon(); case 6: @@ -111,12 +116,10 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { public IIcon getTurbineCasing(int meta, int iconIndex, boolean active) { switch (meta) { case 9: - return active - ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon(); default: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon(); } } @@ -124,16 +127,12 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { public IIcon getTurbineCasing(int meta, int iconIndex, boolean active, boolean hasTurbine) { switch (meta) { case 9: - return active - ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() - : hasTurbine - ? Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ADVGASACTIVE[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINEADVGAS[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_ADVGASEMPTY[iconIndex].getIcon(); default: - return active - ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() - : hasTurbine - ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() + return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() + : hasTurbine ? Textures.BlockIcons.TURBINE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE_EMPTY[iconIndex].getIcon(); } } @@ -182,7 +181,10 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { if ((tState = isTurbineControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide)) != 0) { return getTurbineCasing( - tMeta, 4 + i * 3 - j * tInvertLeftRightMod, tState == 1, tState == 2); + tMeta, + 4 + i * 3 - j * tInvertLeftRightMod, + tState == 1, + tState == 2); } } } @@ -195,7 +197,10 @@ public class GT_Block_Casings8 extends GT_Block_Casings_Abstract { if ((tState = isTurbineControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide)) != 0) { return getTurbineCasing( - tMeta, 4 + i * 3 + j * tInvertLeftRightMod, tState == 1, tState == 2); + tMeta, + 4 + i * 3 + j * tInvertLeftRightMod, + tState == 1, + tState == 2); } } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings9.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings9.java index 423cc1da9a..55e0f508d5 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings9.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings9.java @@ -1,20 +1,22 @@ 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.GT_LanguageManager; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GT_Block_Casings9 extends GT_Block_Casings_Abstract { + public GT_Block_Casings9() { super(GT_Item_Casings9.class, "gt.blockcasings9", GT_Material_Casings.INSTANCE, 2); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "PBI Pipe Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Advanced Filter Casing"); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".1.tooltip", "Less than five 0.1μm particles per m^3"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".1.tooltip", "Less than five 0.1μm particles per m^3"); ItemList.Casing_Pipe_Polybenzimidazole.set(new ItemStack(this, 1, 0)); ItemList.Casing_Vent_T2.set(new ItemStack(this, 1, 1)); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java index 452ed16d44..6cd2700250 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java @@ -1,13 +1,7 @@ package gregtech.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -22,8 +16,17 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_LanguageManager; + public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block implements gregtech.api.interfaces.IHasIndexedTexture { + public GT_Block_Casings_Abstract(Class aItemClass, String aName, Material aMaterial) { super(aItemClass, aName, aMaterial); setStepSound(soundTypeMetal); @@ -32,8 +35,8 @@ public abstract class GT_Block_Casings_Abstract extends GT_Generic_Block GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); } - public GT_Block_Casings_Abstract( - Class aItemClass, String aName, Material aMaterial, int aMaxMeta) { + public GT_Block_Casings_Abstract(Class aItemClass, String aName, Material aMaterial, + int aMaxMeta) { this(aItemClass, aName, aMaterial); for (int i = 0; i < aMaxMeta; i++) { Textures.BlockIcons.setCasingTextureForId(getTextureIndex(i), TextureFactory.of(this, i)); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java index 7debd01173..0207ab975a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java @@ -1,17 +1,19 @@ package gregtech.common.blocks; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.IBlockOnWalkOver; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IBlockOnWalkOver; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; + public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlockOnWalkOver { + public GT_Block_Concretes() { super(GT_Item_Concretes.class, "gt.blockconcretes"); setResistance(20.0F); @@ -70,8 +72,7 @@ public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlo @Override public void onWalkOver(EntityLivingBase aEntity, World aWorld, int aX, int aY, int aZ) { - if ((aEntity.motionX != 0 || aEntity.motionZ != 0) - && !aEntity.isInWater() + if ((aEntity.motionX != 0 || aEntity.motionZ != 0) && !aEntity.isInWater() && !aEntity.isWet() && !aEntity.isSneaking()) { double tSpeed = (aWorld.getBlock(aX, aY - 1, aZ).slipperiness >= 0.8 ? 1.5 : 1.2); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Granites.java b/src/main/java/gregtech/common/blocks/GT_Block_Granites.java index 5c98c18920..df50c5223f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Granites.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Granites.java @@ -1,9 +1,5 @@ package gregtech.common.blocks; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.entity.Entity; import net.minecraft.entity.boss.EntityWither; import net.minecraft.init.Blocks; @@ -12,7 +8,13 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; + public class GT_Block_Granites extends GT_Block_Stones_Abstract { + public GT_Block_Granites() { super(GT_Item_Granites.class, "gt.blockgranites"); setResistance(60.0F); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index 25db7f32dd..82e7ec61ac 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -5,32 +5,11 @@ import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; import static gregtech.api.enums.GT_Values.SIDE_UP; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import com.cricketcraft.chisel.api.IFacade; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IDebugableBlock; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IDebugableTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.BaseTileEntity; -import gregtech.api.metatileentity.CoverableTileEntity; -import gregtech.api.util.GT_BaseCrop; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; -import gregtech.common.covers.CoverInfo; -import gregtech.common.render.GT_Renderer_Block; -import gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.client.renderer.texture.IIconRegister; @@ -53,8 +32,33 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import com.cricketcraft.chisel.api.IFacade; + +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IDebugableTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.metatileentity.CoverableTileEntity; +import gregtech.api.util.GT_BaseCrop; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import gregtech.common.covers.CoverInfo; +import gregtech.common.render.GT_Renderer_Block; +import gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest; + @Optional.Interface(iface = "com.cricketcraft.chisel.api.IFacade", modid = "ChiselAPI") public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider, IFacade { + private static final ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); private boolean renderAsNormalBlock; @@ -226,8 +230,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @SuppressWarnings("unchecked") // Old API uses raw List type @Override - public void addCollisionBoxesToList( - World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, + Entity collider) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { @@ -334,35 +338,25 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @Override public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) tTileEntity).privateAccess() - && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) - ? -1.0F - : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); - } - - @Override - public boolean onBlockActivated( - World aWorld, - int aX, - int aY, - int aZ, - EntityPlayer aPlayer, - int aSide, - float aOffsetX, - float aOffsetY, - float aOffsetZ) { + return tTileEntity instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTileEntity).privateAccess() + && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) ? -1.0F + : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + } + + @Override + public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, + float aOffsetX, float aOffsetY, float aOffsetZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity == null) { return false; } if (aPlayer.isSneaking()) { final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null - && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) + if (tCurrentItem != null && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) - && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) return false; + && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) + return false; } if ((tTileEntity instanceof IGregTechTileEntity)) { if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) { @@ -400,7 +394,10 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if (tTileEntity instanceof BaseMetaTileEntity) { GT_Log.exp.printf( "Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", - aX, aY, aZ, aWorld.provider.dimensionId); + aX, + aY, + aZ, + aWorld.provider.dimensionId); ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); } super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion); @@ -417,8 +414,7 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if (!(tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest)) { for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) { final ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); - if ((tItem != null) - && (tItem.stackSize > 0) + if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i)) && tGregTechTileEntity.shouldDropItemAt(i)) { final EntityItem tItemEntity = new EntityItem( @@ -428,8 +424,7 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { - tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) - tItem.getTagCompound().copy()); + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); } tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.05D); tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.25D); @@ -508,15 +503,18 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo } @Override - public void dropBlockAsItemWithChance( - World aWorld, int aX, int aY, int aZ, int aMetadata, float chance, int aFortune) { + public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int aMetadata, float chance, + int aFortune) { if (!aWorld.isRemote) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity != null && (chance < 1.0F)) { if (tTileEntity instanceof BaseMetaTileEntity && (GregTech_API.sMachineNonWrenchExplosions)) { GT_Log.exp.printf( "Explosion at : %d | %d | %d DIMID: %s NonWrench picking/Rain!%n", - aX, aY, aZ, aWorld.provider.dimensionId); + aX, + aY, + aZ, + aWorld.provider.dimensionId); ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); } } else { @@ -595,15 +593,8 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo } @Override - public float getExplosionResistance( - Entity entity, - World aWorld, - int aX, - int aY, - int aZ, - double explosionX, - double explosionY, - double explosionZ) { + public float getExplosionResistance(Entity entity, World aWorld, int aX, int aY, int aZ, double explosionX, + double explosionY, double explosionZ) { final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity) { return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index 2bb703a2f9..b33a43e821 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -1,16 +1,18 @@ package gregtech.common.blocks; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import cpw.mods.fml.common.Loader; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GT_Block_Metal extends GT_Block_Storage { + public Materials[] mMats; public OrePrefixes mPrefix; public IIconContainer[] mBlockIcons; diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java index 3f0c829b50..942441b0ba 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -5,15 +5,8 @@ import static gregtech.api.enums.Textures.BlockIcons.GRANITE_BLACK_STONE; import static gregtech.api.enums.Textures.BlockIcons.GRANITE_RED_STONE; import static gregtech.api.enums.Textures.BlockIcons.MARBLE_STONE; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ITexture; -import gregtech.api.render.TextureFactory; import java.util.Arrays; + import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; @@ -22,7 +15,17 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.render.TextureFactory; + public class GT_Block_Ores extends GT_Block_Ores_Abstract { + private static final String UNLOCALIZED_NAME = "gt.blockores"; public GT_Block_Ores() { @@ -35,18 +38,11 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { } @Override - public OrePrefixes[] - getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic recipes. - return new OrePrefixes[] { - OrePrefixes.ore, - OrePrefixes.oreNetherrack, - OrePrefixes.oreEndstone, - OrePrefixes.oreBlackgranite, - OrePrefixes.oreRedgranite, - OrePrefixes.oreMarble, - OrePrefixes.oreBasalt, - null - }; + public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic + // recipes. + return new OrePrefixes[] { OrePrefixes.ore, OrePrefixes.oreNetherrack, OrePrefixes.oreEndstone, + OrePrefixes.oreBlackgranite, OrePrefixes.oreRedgranite, OrePrefixes.oreMarble, OrePrefixes.oreBasalt, + null }; } @Override @@ -110,30 +106,15 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { @Override public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { - Materials.Stone, - Materials.Netherrack, - Materials.Endstone, - Materials.GraniteBlack, - Materials.GraniteRed, - Materials.Marble, - Materials.Basalt, - Materials.Stone - }; + return new Materials[] { Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, + Materials.GraniteRed, Materials.Marble, Materials.Basalt, Materials.Stone }; } @Override public boolean[] getEnabledMetas() { - return new boolean[] { - true, - true, - true, - GT_Mod.gregtechproxy.enableBlackGraniteOres, - GT_Mod.gregtechproxy.enableRedGraniteOres, - GT_Mod.gregtechproxy.enableMarbleOres, - GT_Mod.gregtechproxy.enableBasaltOres, - true - }; + return new boolean[] { true, true, true, GT_Mod.gregtechproxy.enableBlackGraniteOres, + GT_Mod.gregtechproxy.enableRedGraniteOres, GT_Mod.gregtechproxy.enableMarbleOres, + GT_Mod.gregtechproxy.enableBasaltOres, true }; } @Override @@ -142,16 +123,10 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { Arrays.fill(rTextures, TextureFactory.of(Blocks.stone)); rTextures[1] = TextureFactory.of(Blocks.netherrack); rTextures[2] = TextureFactory.of(Blocks.end_stone); - rTextures[3] = TextureFactory.builder() - .addIcon(GRANITE_BLACK_STONE) - .stdOrient() - .build(); - rTextures[4] = - TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build(); - rTextures[5] = - TextureFactory.builder().addIcon(MARBLE_STONE).stdOrient().build(); - rTextures[6] = - TextureFactory.builder().addIcon(BASALT_STONE).stdOrient().build(); + rTextures[3] = TextureFactory.builder().addIcon(GRANITE_BLACK_STONE).stdOrient().build(); + rTextures[4] = TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build(); + rTextures[5] = TextureFactory.builder().addIcon(MARBLE_STONE).stdOrient().build(); + rTextures[6] = TextureFactory.builder().addIcon(BASALT_STONE).stdOrient().build(); return rTextures; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index ae41933c1c..66acc22a22 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -1,23 +1,10 @@ package gregtech.common.blocks; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ITexture; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gregtech.common.render.GT_Renderer_Block; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -37,7 +24,23 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.render.GT_Renderer_Block; + public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider { + private static final String DOT_NAME = ".name"; private static final String DOT_TOOLTIP = ".tooltip"; public static ThreadLocal mTemporaryTileEntity = new ThreadLocal<>(); @@ -45,8 +48,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public static boolean tHideOres; public static Set aBlockedOres = new HashSet<>(); - protected GT_Block_Ores_Abstract( - String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { + protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, + Material aMaterial) { super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); this.isBlockContainer = true; setStepSound(soundTypeStone); @@ -71,10 +74,9 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements GregTech_API.sGeneratedMaterials[i].getToolTip()); GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + DOT_NAME, - "Small " - + (GT_LanguageManager.i18nPlaceholder - ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) - : getLocalizedName(GregTech_API.sGeneratedMaterials[i]))); + "Small " + (GT_LanguageManager.i18nPlaceholder + ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) + : getLocalizedName(GregTech_API.sGeneratedMaterials[i]))); GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + DOT_TOOLTIP, GregTech_API.sGeneratedMaterials[i].getToolTip()); @@ -159,16 +161,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override - public boolean onBlockActivated( - World aWorld, - int aX, - int aY, - int aZ, - EntityPlayer aPlayer, - int aSide, - float aOffsetX, - float aOffsetY, - float aOffsetZ) { + public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, + float aOffsetX, float aOffsetY, float aOffsetZ) { if (!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode) { return false; } @@ -184,8 +178,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override - public boolean onBlockEventReceived( - World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, + int p_149696_5_, int p_149696_6_) { super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); return tileentity != null && tileentity.receiveClientEvent(p_149696_5_, p_149696_6_); @@ -212,15 +206,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override - public float getExplosionResistance( - Entity entity, - World aWorld, - int aX, - int aY, - int aZ, - double explosionX, - double explosionY, - double explosionZ) { + public float getExplosionResistance(Entity entity, World aWorld, int aX, int aY, int aZ, double explosionX, + double explosionY, double explosionZ) { return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; } @@ -285,7 +272,13 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements @SideOnly(Side.CLIENT) public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) { GT_Renderer_Block.addHitEffects( - effectRenderer, this, worldObj, target.blockX, target.blockY, target.blockZ, target.sideHit); + effectRenderer, + this, + worldObj, + target.blockX, + target.blockY, + target.blockZ, + target.sideHit); return true; } @@ -315,8 +308,8 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements aWorld.removeTileEntity(aX, aY, aZ); } - public abstract OrePrefixes[] - getProcessingPrefix(); // Must have 8 entries; an entry can be null to disable automatic recipes. + public abstract OrePrefixes[] getProcessingPrefix(); // Must have 8 entries; an