diff options
author | Jason Mitchell <mitchej@gmail.com> | 2023-01-30 10:56:42 -0800 |
---|---|---|
committer | Jason Mitchell <mitchej@gmail.com> | 2023-01-30 10:56:42 -0800 |
commit | 0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a (patch) | |
tree | 1e2c649f3a6ce3f6b2babd0098a5f4819e9cd0b6 /src/main/java/gregtech/common/blocks | |
parent | f8cc82edeb9810c45cba762d733a2c909a302faa (diff) | |
download | GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.gz GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.bz2 GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.zip |
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
45 files changed, 725 insertions, 814 deletions
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<? extends ItemBlock> 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<? extends ItemBlock> aItemClass, String aName, Material aMaterial, int aMaxMeta) { + public GT_Block_Casings_Abstract(Class<? extends ItemBlock> 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<IGregTechTileEntity> 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<GT_TileEntity_Ores> 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<Materials> 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 entry can be null to disable + // automatic recipes. public abstract boolean[] getEnabledMetas(); // Must have 8 entries. @@ -330,8 +323,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements if ((tTileEntity instanceof GT_TileEntity_Ores)) { return ((GT_TileEntity_Ores) tTileEntity).getDrops(getDroppedBlock(), aFortune); } - return mTemporaryTileEntity.get() == null - ? new ArrayList<>() + return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(getDroppedBlock(), aFortune); } @@ -342,7 +334,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public abstract ITexture[] getTextureSet(); // Must have 16 entries. - @SuppressWarnings({"unchecked"}) + @SuppressWarnings({ "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java index 73fe674fbe..4b730ef0ff 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java @@ -1,17 +1,19 @@ package gregtech.common.blocks; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + import cpw.mods.fml.common.registry.GameRegistry; 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 net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { + Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "igneousStone"); public GT_Block_Ores_UB1() { @@ -26,16 +28,8 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { @Override public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries. - return new OrePrefixes[] { - OrePrefixes.oreRedgranite, - OrePrefixes.oreBlackgranite, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.oreBasalt, - OrePrefixes.ore, - OrePrefixes.ore - }; + return new OrePrefixes[] { OrePrefixes.oreRedgranite, OrePrefixes.oreBlackgranite, OrePrefixes.ore, + OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreBasalt, OrePrefixes.ore, OrePrefixes.ore }; } @Override @@ -55,42 +49,22 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { @Override public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone - }; + return new Materials[] { Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, + Materials.Stone, Materials.Stone, Materials.Stone }; } @Override public boolean[] getEnabledMetas() { - return new boolean[] {true, true, true, true, true, true, true, true}; + return new boolean[] { true, true, true, true, true, true, true, true }; } @Override public ITexture[] getTextureSet() { // Must have 16 entries. - return new ITexture[] { - TextureFactory.of(aUBBlock, 0), - TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), - TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), - TextureFactory.of(aUBBlock, 7), - TextureFactory.of(aUBBlock, 0), - TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), - TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), - TextureFactory.of(aUBBlock, 7) - }; + return new ITexture[] { TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), + TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7) }; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java index 0d7e2c3428..890aed5a2c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java @@ -1,17 +1,19 @@ package gregtech.common.blocks; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + import cpw.mods.fml.common.registry.GameRegistry; 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 net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { + Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "metamorphicStone"); public GT_Block_Ores_UB2() { @@ -25,18 +27,10 @@ public class GT_Block_Ores_UB2 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.ore, - OrePrefixes.oreMarble, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore - }; + public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic + // recipes. + return new OrePrefixes[] { OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreMarble, OrePrefixes.ore, + OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore }; } @Override @@ -56,42 +50,22 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { @Override public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone - }; + return new Materials[] { Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, + Materials.Stone, Materials.Stone, Materials.Stone }; } @Override public boolean[] getEnabledMetas() { - return new boolean[] {true, true, true, true, true, true, true, true}; + return new boolean[] { true, true, true, true, true, true, true, true }; } @Override public ITexture[] getTextureSet() { // Must have 16 entries. - return new ITexture[] { - TextureFactory.of(aUBBlock, 0), - TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), - TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), - TextureFactory.of(aUBBlock, 7), - TextureFactory.of(aUBBlock, 0), - TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), - TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), - TextureFactory.of(aUBBlock, 7) - }; + return new ITexture[] { TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), + TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7) }; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java index 5754f87454..873902a344 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java @@ -1,17 +1,19 @@ package gregtech.common.blocks; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + import cpw.mods.fml.common.registry.GameRegistry; 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 net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { + Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "sedimentaryStone"); public GT_Block_Ores_UB3() { @@ -25,18 +27,10 @@ public class GT_Block_Ores_UB3 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.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore, - OrePrefixes.ore - }; + public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic + // recipes. + return new OrePrefixes[] { OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, + OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore }; } @Override @@ -56,42 +50,22 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { @Override public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone, - Materials.Stone - }; + return new Materials[] { Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, + Materials.Stone, Materials.Stone, Materials.Stone }; } @Override public boolean[] getEnabledMetas() { - return new boolean[] {true, true, true, true, true, true, true, true}; + return new boolean[] { true, true, true, true, true, true, true, true }; } @Override public ITexture[] getTextureSet() { // Must have 16 entries. - return new ITexture[] { - TextureFactory.of(aUBBlock, 0), - TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), - TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), - TextureFactory.of(aUBBlock, 7), - TextureFactory.of(aUBBlock, 0), - TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), - TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), - TextureFactory.of(aUBBlock, 7) - }; + return new ITexture[] { TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), + TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), + TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), + TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), + TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), + TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7) }; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 37887ac5f6..f446bc7518 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -2,16 +2,8 @@ package gregtech.common.blocks; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.*; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.WorldSpawnedEventBuilder; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -30,6 +22,16 @@ import net.minecraft.world.Explosion; 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.*; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.WorldSpawnedEventBuilder; + public class GT_Block_Reinforced extends GT_Generic_Block { public GT_Block_Reinforced(String aName) { @@ -53,11 +55,9 @@ public class GT_Block_Reinforced extends GT_Generic_Block { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Neutronium Reinforced Block"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Raw Deep Dark Portal Block"); ItemList.Block_BronzePlate.set(new ItemStack(this.setHardness(60.0f).setResistance(150.0f), 1, 0)); - ItemList.Block_IridiumTungstensteel.set( - new ItemStack(this.setHardness(400.0f).setResistance(600.0f), 1, 1)); + ItemList.Block_IridiumTungstensteel.set(new ItemStack(this.setHardness(400.0f).setResistance(600.0f), 1, 1)); ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(5.0f).setResistance(6.0f), 1, 2)); - ItemList.Block_TungstenSteelReinforced.set( - new ItemStack(this.setHardness(250.0f).setResistance(400.0f), 1, 3)); + ItemList.Block_TungstenSteelReinforced.set(new ItemStack(this.setHardness(250.0f).setResistance(400.0f), 1, 3)); ItemList.Block_BrittleCharcoal.set(new ItemStack(this.setHardness(0.5f).setResistance(8.0f), 1, 4)); ItemList.Block_Powderbarrel.set(new ItemStack(this.setHardness(2.5f).setResistance(2.0f), 1, 5)); ItemList.Block_SSFUEL.set(new ItemStack(this.setHardness(2.5f).setResistance(2.0f), 1, 6)); @@ -65,24 +65,16 @@ public class GT_Block_Reinforced extends GT_Generic_Block { ItemList.Block_SteelPlate.set(new ItemStack(this.setHardness(150.0f).setResistance(200.0f), 1, 8)); ItemList.Block_TitaniumPlate.set(new ItemStack(this.setHardness(200.0f).setResistance(300.0f), 1, 9)); ItemList.Block_NaquadahPlate.set(new ItemStack(this.setHardness(500.0f).setResistance(1000.0f), 1, 10)); - ItemList.Block_NeutroniumPlate.set( - new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11)); - ItemList.Block_BedrockiumCompressed.set( - new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12)); + ItemList.Block_NeutroniumPlate.set(new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11)); + ItemList.Block_BedrockiumCompressed.set(new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12)); GT_ModHandler.addShapelessCraftingRecipe( - new ItemStack(Items.coal, 1, 1), new Object[] {ItemList.Block_BrittleCharcoal.get(1)}); + new ItemStack(Items.coal, 1, 1), + new Object[] { ItemList.Block_BrittleCharcoal.get(1) }); GT_ModHandler.addCraftingRecipe( - ItemList.Block_Powderbarrel.get(1L), GT_ModHandler.RecipeBits.REVERSIBLE, new Object[] { - "WSW", - "GGG", - "WGW", - 'W', - OrePrefixes.plate.get(Materials.Wood), - 'G', - new ItemStack(Items.gunpowder, 1), - 'S', - new ItemStack(Items.string, 1) - }); + ItemList.Block_Powderbarrel.get(1L), + GT_ModHandler.RecipeBits.REVERSIBLE, + new Object[] { "WSW", "GGG", "WGW", 'W', OrePrefixes.plate.get(Materials.Wood), 'G', + new ItemStack(Items.gunpowder, 1), 'S', new ItemStack(Items.string, 1) }); } @Override @@ -176,8 +168,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } @Override - public float getExplosionResistance( - Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { + public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX, + double explosionY, double explosionZ) { if (world == null) { return 0.0F; } @@ -251,8 +243,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } @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 (aMetadata == 4) { this.dropBlockAsItem(aWorld, aX, aY, aZ, new ItemStack(Items.coal, XSTR_INSTANCE.nextInt(2) + 1, 1)); } else { @@ -265,13 +257,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { if (!world.isRemote && world.getBlockMetadata(x, y, z) == 5) { EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player); world.spawnEntityInWorld(entitytntprimed); - new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder() - .setPitch(1f) - .setVolume(1f) - .setIdentifier(SoundResource.GAME_TNT_PRIMED) - .setEntity(entitytntprimed) - .setWorld(world) - .run(); + new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder().setPitch(1f).setVolume(1f) + .setIdentifier(SoundResource.GAME_TNT_PRIMED).setEntity(entitytntprimed).setWorld(world).run(); world.setBlockToAir(x, y, z); return false; } @@ -296,8 +283,12 @@ public class GT_Block_Reinforced extends GT_Generic_Block { @Override public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { if (!world.isRemote && world.getBlockMetadata(x, y, z) == 5) { - EntityTNTPrimed entitytntprimed = - new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, explosion.getExplosivePlacedBy()); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed( + world, + x + 0.5F, + y + 0.5F, + z + 0.5F, + explosion.getExplosivePlacedBy()); entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8); world.spawnEntityInWorld(entitytntprimed); } @@ -305,16 +296,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer player, - int side, - float xOffset, - float yOffset, - float zOffset) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, + float yOffset, float zOffset) { if ((player.getCurrentEquippedItem() != null) && (player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) && world.getBlockMetadata(x, y, z) == 5) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java index 1ee8e6df50..2f9e9e9d71 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones.java @@ -1,15 +1,17 @@ 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.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.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; + public class GT_Block_Stones extends GT_Block_Stones_Abstract { + public GT_Block_Stones() { super(GT_Item_Granites.class, "gt.blockstones"); setResistance(60.0F); @@ -31,9 +33,13 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Smooth Basalt"); for (int i = 0; i < 16; i++) { GT_OreDictUnificator.registerOre( - OrePrefixes.stone, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); + OrePrefixes.stone, + i < 8 ? Materials.Marble : Materials.Basalt, + new ItemStack(this, 1, i)); GT_OreDictUnificator.registerOre( - OrePrefixes.block, i < 8 ? Materials.Marble : Materials.Basalt, new ItemStack(this, 1, i)); + OrePrefixes.block, + i < 8 ? Materials.Marble : Materials.Basalt, + new ItemStack(this, 1, i)); GT_OreDictUnificator.registerOre( (i < 8 ? Materials.Marble.mName.toLowerCase() : Materials.Basalt.mName.toLowerCase()), new ItemStack(this, 1, i)); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index f40a6b8173..47e9fe250d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -1,14 +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.*; -import gregtech.api.interfaces.IOreRecipeRegistrator; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -22,7 +15,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.*; +import gregtech.api.interfaces.IOreRecipeRegistrator; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; + public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRecipeRegistrator { + public GT_Block_Stones_Abstract(Class<? extends ItemBlock> aItemClass, String aName) { super(aItemClass, aName, Material.rock); OrePrefixes.crafting.add(this); @@ -59,27 +62,27 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"f", "X", 'X', new ItemStack(this, 1, 7)}); + new Object[] { "f", "X", 'X', new ItemStack(this, 1, 7) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 14), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"f", "X", 'X', new ItemStack(this, 1, 15)}); + new Object[] { "f", "X", 'X', new ItemStack(this, 1, 15) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"h", "X", 'X', new ItemStack(this, 1, 3)}); + new Object[] { "h", "X", 'X', new ItemStack(this, 1, 3) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 12), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"h", "X", 'X', new ItemStack(this, 1, 11)}); + new Object[] { "h", "X", 'X', new ItemStack(this, 1, 11) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"h", "X", 'X', new ItemStack(this, 1, 0)}); + new Object[] { "h", "X", 'X', new ItemStack(this, 1, 0) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"h", "X", 'X', new ItemStack(this, 1, 8)}); + new Object[] { "h", "X", 'X', new ItemStack(this, 1, 8) }); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 4), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 12), 16, 10); GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 1), 16, 10); @@ -87,34 +90,34 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe GT_ModHandler.addCraftingRecipe( new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 0)}); + new Object[] { "XX", "XX", 'X', new ItemStack(this, 4, 0) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 8)}); + new Object[] { "XX", "XX", 'X', new ItemStack(this, 4, 8) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 7)}); + new Object[] { "XX", "XX", 'X', new ItemStack(this, 4, 7) }); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {"XX", "XX", 'X', new ItemStack(this, 4, 15)}); + new Object[] { "XX", "XX", 'X', new ItemStack(this, 4, 15) }); } @Override - public void registerOre( - OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, + ItemStack aStack) { if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) { GT_Values.RA.addLaserEngraverRecipe( new ItemStack(this, 1, 7), - GT_Utility.copyAmount(0L, new Object[] {aStack}), + GT_Utility.copyAmount(0L, new Object[] { aStack }), new ItemStack(this, 1, 6), 50, 16); GT_Values.RA.addLaserEngraverRecipe( new ItemStack(this, 1, 15), - GT_Utility.copyAmount(0L, new Object[] {aStack}), + GT_Utility.copyAmount(0L, new Object[] { aStack }), new ItemStack(this, 1, 14), 50, 16); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java index f318eab8ff..967d98c080 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java @@ -1,10 +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.items.GT_Generic_Block; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -18,6 +15,11 @@ 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.items.GT_Generic_Block; + public class GT_Block_Storage extends GT_Generic_Block { protected GT_Block_Storage(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { diff --git a/src/main/java/gregtech/common/blocks/GT_Cyclotron_Coils.java b/src/main/java/gregtech/common/blocks/GT_Cyclotron_Coils.java index 66d9ffe6e8..b42bbfa076 100644 --- a/src/main/java/gregtech/common/blocks/GT_Cyclotron_Coils.java +++ b/src/main/java/gregtech/common/blocks/GT_Cyclotron_Coils.java @@ -1,12 +1,13 @@ 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_Cyclotron_Coils extends GT_Block_Casings_Abstract { public GT_Cyclotron_Coils() { @@ -108,8 +109,7 @@ public class GT_Cyclotron_Coils 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_Cyclotron_Item_Casings.java b/src/main/java/gregtech/common/blocks/GT_Cyclotron_Item_Casings.java index a522b2bd3f..f1ca45a805 100644 --- a/src/main/java/gregtech/common/blocks/GT_Cyclotron_Item_Casings.java +++ b/src/main/java/gregtech/common/blocks/GT_Cyclotron_Item_Casings.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Cyclotron_Item_Casings extends GT_Item_Casings_Abstract { + public GT_Cyclotron_Item_Casings(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java index 70748d5f1a..cd2f818b37 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings1.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Casings1 extends GT_Item_Casings_Abstract { + public GT_Item_Casings1(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java index 5e77ace15d..4f126426cb 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings2.java @@ -1,11 +1,13 @@ package gregtech.common.blocks; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; public class GT_Item_Casings2 extends GT_Item_Casings_Abstract { + public GT_Item_Casings2(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java index d80d88d2d1..fdcb5dbd86 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings3.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Casings3 extends GT_Item_Casings_Abstract { + public GT_Item_Casings3(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java index 7848398a0b..5665150407 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings4.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Casings4 extends GT_Item_Casings_Abstract { + public GT_Item_Casings4(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java index 7486d25ec5..b7fe3298ec 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java @@ -1,23 +1,26 @@ package gregtech.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.HeatingCoilLevel; +import gregtech.api.util.GT_LanguageManager; + public class GT_Item_Casings5 extends GT_Item_Casings_Abstract { + public GT_Item_Casings5(Block block) { super(block); } - protected static final String mCoilHeatTooltip = - GT_LanguageManager.addStringLocalization("gt.coilheattooltip", "Base Heating Capacity = "); - protected static final String mCoilUnitTooltip = - GT_LanguageManager.addStringLocalization("gt.coilunittooltip", " Kelvin"); + protected static final String mCoilHeatTooltip = GT_LanguageManager + .addStringLocalization("gt.coilheattooltip", "Base Heating Capacity = "); + protected static final String mCoilUnitTooltip = GT_LanguageManager + .addStringLocalization("gt.coilunittooltip", " Kelvin"); @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java index f4a8d38ba6..f5250e73da 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings6.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Casings6 extends GT_Item_Casings_Abstract { + public GT_Item_Casings6(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java index 0d87b5d906..3130006a50 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Casings8 extends GT_Item_Casings_Abstract { + public GT_Item_Casings8(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings9.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings9.java index c5aee22cff..f413ffdfb8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings9.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings9.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Casings9 extends GT_Item_Casings_Abstract { + public GT_Item_Casings9(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java index bca2de6eb6..bd6b12c23a 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java @@ -1,38 +1,41 @@ package gregtech.common.blocks; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; + public abstract class GT_Item_Casings_Abstract extends ItemBlock { - protected final String mNoMobsToolTip = - GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = - GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); - protected final String mCoil01Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil01tooltip", "Base Heating Capacity = 1800 Kelvin"); - protected final String mCoil02Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil02tooltip", "Base Heating Capacity = 2700 Kelvin"); - protected final String mCoil03Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil03tooltip", "Base Heating Capacity = 3600 Kelvin"); - protected final String mCoil04Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil04tooltip", "Base Heating Capacity = 4500 Kelvin"); - protected final String mCoil05Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil05tooltip", "Base Heating Capacity = 5400 Kelvin"); - protected final String mCoil06Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil06tooltip", "Base Heating Capacity = 7200 Kelvin"); - protected final String mCoil07Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil07tooltip", "Base Heating Capacity = 9001 Kelvin"); - protected final String mCoil08Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil08tooltip", "Base Heating Capacity = 9900 Kelvin"); - protected final String mCoil09Tooltip = - GT_LanguageManager.addStringLocalization("gt.coil09tooltip", "Base Heating Capacity = 10800 Kelvin"); - protected final String mBlastProofTooltip = - GT_LanguageManager.addStringLocalization("gt.blastprooftooltip", "This Block is Blast Proof"); + + protected final String mNoMobsToolTip = GT_LanguageManager + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager + .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + protected final String mCoil01Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil01tooltip", "Base Heating Capacity = 1800 Kelvin"); + protected final String mCoil02Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil02tooltip", "Base Heating Capacity = 2700 Kelvin"); + protected final String mCoil03Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil03tooltip", "Base Heating Capacity = 3600 Kelvin"); + protected final String mCoil04Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil04tooltip", "Base Heating Capacity = 4500 Kelvin"); + protected final String mCoil05Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil05tooltip", "Base Heating Capacity = 5400 Kelvin"); + protected final String mCoil06Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil06tooltip", "Base Heating Capacity = 7200 Kelvin"); + protected final String mCoil07Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil07tooltip", "Base Heating Capacity = 9001 Kelvin"); + protected final String mCoil08Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil08tooltip", "Base Heating Capacity = 9900 Kelvin"); + protected final String mCoil09Tooltip = GT_LanguageManager + .addStringLocalization("gt.coil09tooltip", "Base Heating Capacity = 10800 Kelvin"); + protected final String mBlastProofTooltip = GT_LanguageManager + .addStringLocalization("gt.blastprooftooltip", "This Block is Blast Proof"); public GT_Item_Casings_Abstract(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java index 0ee92868e8..c659d153d9 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Concretes.java @@ -1,14 +1,17 @@ package gregtech.common.blocks; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import gregtech.api.util.GT_LanguageManager; + public class GT_Item_Concretes extends GT_Item_Stones_Abstract { - private final String mRunFasterToolTip = - GT_LanguageManager.addStringLocalization("gt.runfastertooltip", "You can walk faster on this Block"); + + private final String mRunFasterToolTip = GT_LanguageManager + .addStringLocalization("gt.runfastertooltip", "You can walk faster on this Block"); public GT_Item_Concretes(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Granites.java b/src/main/java/gregtech/common/blocks/GT_Item_Granites.java index e0df50d07b..6e3eb8f12c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Granites.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Granites.java @@ -3,6 +3,7 @@ package gregtech.common.blocks; import net.minecraft.block.Block; public class GT_Item_Granites extends GT_Item_Stones_Abstract { + public GT_Item_Granites(Block block) { super(block); } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java b/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java index eda3c9b01b..5ce04103ab 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_LongDistancePipe.java @@ -1,18 +1,21 @@ package gregtech.common.blocks; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; + public class GT_Item_LongDistancePipe extends ItemBlock { - protected final String mNoMobsToolTip = - GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = - GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + protected final String mNoMobsToolTip = GT_LanguageManager + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager + .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public GT_Item_LongDistancePipe(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 7ca54ad115..87aa14342c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -2,23 +2,10 @@ package gregtech.common.blocks; import static gregtech.GT_Mod.GT_FML_LOGGER; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.interfaces.ISecondaryDescribable; -import gregtech.api.interfaces.metatileentity.IConnectable; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.CoverableTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item; -import gregtech.api.util.GT_ItsNotMyFaultException; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.storage.*; import java.util.List; + import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -33,7 +20,24 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISecondaryDescribable; +import gregtech.api.interfaces.metatileentity.IConnectable; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.CoverableTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item; +import gregtech.api.util.GT_ItsNotMyFaultException; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.storage.*; + public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { + public GT_Item_Machines(Block block) { super(block); setMaxDamage(0); @@ -61,82 +65,113 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { final IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity(); if (!GregTech_API.sPostloadFinished && tTileEntity.getMetaTileEntity() instanceof ISecondaryDescribable) { - final String[] tSecondaryDescription = - ((ISecondaryDescribable) tTileEntity.getMetaTileEntity()).getSecondaryDescription(); + final String[] tSecondaryDescription = ((ISecondaryDescribable) tTileEntity.getMetaTileEntity()) + .getSecondaryDescription(); addDescription(null, tSecondaryDescription, tDamage, "_Secondary", true); } { final IMetaTileEntity tMetaTileEntity = tTileEntity.getMetaTileEntity(); final String tSuffix = (tMetaTileEntity instanceof ISecondaryDescribable - && ((ISecondaryDescribable) tMetaTileEntity).isDisplaySecondaryDescription()) - ? "_Secondary" - : ""; + && ((ISecondaryDescribable) tMetaTileEntity).isDisplaySecondaryDescription()) ? "_Secondary" + : ""; addDescription( - aList, tTileEntity.getDescription(), tDamage, tSuffix, !GregTech_API.sPostloadFinished); + aList, + tTileEntity.getDescription(), + tDamage, + tSuffix, + !GregTech_API.sPostloadFinished); } if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { final byte inputTier = GT_Utility.getTier(tTileEntity.getInputVoltage()); - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tTileEntity.getInputVoltage()) - + " (" + GT_Utility.getColoredTierNameFromTier(inputTier) - + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_IN", + "Voltage IN: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tTileEntity.getInputVoltage()) + + " (" + + GT_Utility.getColoredTierNameFromTier(inputTier) + + EnumChatFormatting.GREEN + + ")" + + EnumChatFormatting.GRAY); } if (tTileEntity.getOutputVoltage() > 0L) { final byte outputTier = GT_Utility.getTier(tTileEntity.getOutputVoltage()); - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tTileEntity.getOutputVoltage()) - + " (" + GT_Utility.getColoredTierNameFromTier(outputTier) - + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_OUT", + "Voltage OUT: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tTileEntity.getOutputVoltage()) + + " (" + + GT_Utility.getColoredTierNameFromTier(outputTier) + + EnumChatFormatting.GREEN + + ")" + + EnumChatFormatting.GRAY); } if (tTileEntity.getOutputAmperage() > 1L) { - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(tTileEntity.getOutputAmperage()) - + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_AMOUNT", + "Amperage: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(tTileEntity.getOutputAmperage()) + + EnumChatFormatting.GRAY); } - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) - + EnumChatFormatting.GRAY + " EU"); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_STORE", + "Capacity: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) + + EnumChatFormatting.GRAY + + " EU"); } if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank) { if (aStack.hasTagCompound() && aStack.stackTagCompound.hasKey("mFluid")) { - final FluidStack tContents = - FluidStack.loadFluidStackFromNBT(aStack.stackTagCompound.getCompoundTag("mFluid")); + final FluidStack tContents = FluidStack + .loadFluidStackFromNBT(aStack.stackTagCompound.getCompoundTag("mFluid")); if (tContents != null && tContents.amount > 0) { - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_TANK_INFO", "Contains Fluid: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.YELLOW - + tContents.getLocalizedName() - + EnumChatFormatting.GRAY); - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_TANK_AMOUNT", "Fluid Amount: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tContents.amount) + " L" - + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_INFO", + "Contains Fluid: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + + tContents.getLocalizedName() + + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_AMOUNT", + "Fluid Amount: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tContents.amount) + + " L" + + EnumChatFormatting.GRAY); } } } if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_DigitalChestBase) { if (aStack.hasTagCompound() && aStack.stackTagCompound.hasKey("mItemStack")) { - final ItemStack tContents = - ItemStack.loadItemStackFromNBT(aStack.stackTagCompound.getCompoundTag("mItemStack")); + final ItemStack tContents = ItemStack + .loadItemStackFromNBT(aStack.stackTagCompound.getCompoundTag("mItemStack")); final int tSize = aStack.stackTagCompound.getInteger("mItemCount"); if (tContents != null && tSize > 0) { - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_CHEST_INFO", "Contains Item: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.YELLOW - + tContents.getDisplayName() - + EnumChatFormatting.GRAY); - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_CHEST_AMOUNT", "Item Amount: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(tSize) - + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_CHEST_INFO", + "Contains Item: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + + tContents.getDisplayName() + + EnumChatFormatting.GRAY); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_CHEST_AMOUNT", + "Item Amount: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tSize) + + EnumChatFormatting.GRAY); } } } @@ -144,20 +179,27 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { final NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { if (aNBT.getBoolean("mMuffler")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_MUFFLER", + "has Muffler Upgrade", + !GregTech_API.sPostloadFinished)); } if (aNBT.getBoolean("mSteamConverter")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMCONVERTER", + "has Steam Upgrade", + !GregTech_API.sPostloadFinished)); } int tAmount = 0; if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { - aList.add(tAmount + " " - + GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMTANKS", - "Steam Tank Upgrades", - !GregTech_API.sPostloadFinished)); + aList.add( + tAmount + " " + + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMTANKS", + "Steam Tank Upgrades", + !GregTech_API.sPostloadFinished)); } CoverableTileEntity.addInstalledCoversInformation(aNBT, aList); @@ -167,12 +209,8 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { } } - private void addDescription( - @Nullable List<String> aList, - @Nullable String[] aDescription, - int aDamage, - String aSuffix, - boolean aWriteIntoLangFile) { + private void addDescription(@Nullable List<String> aList, @Nullable String[] aDescription, int aDamage, + String aSuffix, boolean aWriteIntoLangFile) { if (aDescription == null) return; for (int i = 0, tLength = aDescription.length; i < tLength; i++) { String tDescLine = aDescription[i]; @@ -183,12 +221,11 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { final String[] tSplitStrings = tDescLine.split("%%%"); final StringBuilder tBuffer = new StringBuilder(); final String[] tRep = new String[tSplitStrings.length / 2]; - for (int j = 0; j < tSplitStrings.length; j++) - if (j % 2 == 0) tBuffer.append(tSplitStrings[j]); - else { - tBuffer.append(" %s"); - tRep[j / 2] = tSplitStrings[j]; - } + for (int j = 0; j < tSplitStrings.length; j++) if (j % 2 == 0) tBuffer.append(tSplitStrings[j]); + else { + tBuffer.append(" %s"); + tRep[j / 2] = tSplitStrings[j]; + } final String tTranslated = String.format( GT_LanguageManager.addStringLocalization(tKey, tBuffer.toString(), aWriteIntoLangFile), (Object[]) tRep); @@ -201,17 +238,8 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { } @Override - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { return false; } @@ -231,8 +259,7 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { public String getItemStackDisplayName(ItemStack aStack) { String aName = super.getItemStackDisplayName(aStack); final short aDamage = (short) getDamage(aStack); - if (aDamage >= 0 - && aDamage < GregTech_API.METATILEENTITIES.length + if (aDamage >= 0 && aDamage < GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[aDamage] != null) { Materials aMaterial = null; if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Item) { @@ -255,26 +282,15 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { super.onCreated(aStack, aWorld, aPlayer); final short tDamage = (short) getDamage(aStack); - if ((tDamage < 0) - || ((tDamage >= GregTech_API.METATILEENTITIES.length) - && (GregTech_API.METATILEENTITIES[tDamage] != null))) { + if ((tDamage < 0) || ((tDamage >= GregTech_API.METATILEENTITIES.length) + && (GregTech_API.METATILEENTITIES[tDamage] != null))) { GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer); } } @Override - public boolean placeBlockAt( - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int side, - float hitX, - float hitY, - float hitZ, - int aMeta) { + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, + float hitX, float hitY, float hitZ, int aMeta) { final short tDamage = (short) getDamage(aStack); if (tDamage > 0) { if (GregTech_API.METATILEENTITIES[tDamage] == null) { @@ -336,9 +352,8 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { aStack.setTagCompound(null); return; } - if ((tNBT.hasKey("mItemCount") && tNBT.getInteger("mItemCount") > 0) - || (tNBT.hasKey("mFluid") - && FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")).amount > 64000)) { + if ((tNBT.hasKey("mItemCount") && tNBT.getInteger("mItemCount") > 0) || (tNBT.hasKey("mFluid") + && FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")).amount > 64000)) { final FluidStack tFluid = FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")); int tEffectDuration = 1200; if (tFluid != null) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java index 117e6ae1c6..e32558795c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java @@ -1,17 +1,21 @@ package gregtech.common.blocks; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import org.apache.commons.lang3.StringUtils; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; + public class GT_Item_Ores extends ItemBlock { + public GT_Item_Ores(Block block) { super(block); setMaxDamage(0); @@ -20,17 +24,8 @@ public class GT_Item_Ores extends ItemBlock { } @Override - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { return false; } @@ -49,18 +44,8 @@ public class GT_Item_Ores extends ItemBlock { } @Override - public boolean placeBlockAt( - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int side, - float hitX, - float hitY, - float hitZ, - int aMeta) { + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, + float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock( @@ -89,8 +74,8 @@ public class GT_Item_Ores extends ItemBlock { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - String formula = StatCollector.translateToLocal( - field_150939_a.getUnlocalizedName() + '.' + getDamage(aStack) + ".tooltip"); + String formula = StatCollector + .translateToLocal(field_150939_a.getUnlocalizedName() + '.' + getDamage(aStack) + ".tooltip"); if (!StringUtils.isBlank(formula)) aList.add(formula); } } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java index b62c7c0232..db6356b173 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Stones_Abstract.java @@ -1,16 +1,19 @@ package gregtech.common.blocks; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; + public class GT_Item_Stones_Abstract extends ItemBlock { - private final String mNoMobsToolTip = - GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + + private final String mNoMobsToolTip = GT_LanguageManager + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); public GT_Item_Stones_Abstract(Block block) { super(block); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java index 55c19ae48c..fddf64163d 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java @@ -1,13 +1,16 @@ package gregtech.common.blocks; -import gregtech.api.GregTech_API; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import gregtech.api.GregTech_API; + public class GT_Item_Storage extends ItemBlock { + public GT_Item_Storage(Block block) { super(block); setMaxDamage(0); diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Casings.java b/src/main/java/gregtech/common/blocks/GT_Material_Casings.java index 3b6cd37f9c..2fc839768f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Casings.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Casings.java @@ -4,6 +4,7 @@ import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; public class GT_Material_Casings extends Material { + public static final Material INSTANCE = new GT_Material_Casings(); private GT_Material_Casings() { diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Machines.java b/src/main/java/gregtech/common/blocks/GT_Material_Machines.java index d51e588522..df8b57226c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Machines.java @@ -4,6 +4,7 @@ import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; public class GT_Material_Machines extends Material { + public GT_Material_Machines() { super(MapColor.ironColor); setRequiresTool(); diff --git a/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java index 38de5dbee7..2e3301bb60 100644 --- a/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Material_Reinforced.java @@ -4,6 +4,7 @@ import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; public class GT_Material_Reinforced extends Material { + public GT_Material_Reinforced() { super(MapColor.stoneColor); setRequiresTool(); diff --git a/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java b/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java index 657ac9b934..d7ab28a19e 100644 --- a/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Packet_Ores.java @@ -1,13 +1,16 @@ package gregtech.common.blocks; -import com.google.common.io.ByteArrayDataInput; -import gregtech.api.net.GT_Packet_New; -import io.netty.buffer.ByteBuf; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import com.google.common.io.ByteArrayDataInput; + +import gregtech.api.net.GT_Packet_New; +import io.netty.buffer.ByteBuf; + public class GT_Packet_Ores extends GT_Packet_New { + private int mX; private int mZ; private short mY; diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 452e9db5d4..56a59e7ab3 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -2,6 +2,17 @@ package gregtech.common.blocks; import static gregtech.api.enums.TextureSet.SET_NONE; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -13,30 +24,20 @@ import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntity { + public short mMetaData = 0; public boolean mNatural = false; public boolean mBlocked = true; public static byte getHarvestData(short aMetaData, int aBaseBlockHarvestLevel) { Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)]; - byte tByte = aMaterial == null - ? 0 - : (byte) Math.max( - aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); + byte tByte = aMaterial == null ? 0 + : (byte) Math + .max(aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); if (GT_Mod.gregtechproxy.mChangeHarvestLevels) { - tByte = aMaterial == null - ? 0 + tByte = aMaterial == null ? 0 : (byte) Math.max( aBaseBlockHarvestLevel, Math.min( @@ -51,8 +52,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit return setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, true); } - public static boolean setOreBlock( - World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre, boolean air) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre, + boolean air) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -177,35 +178,45 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) { if (this.worldObj == null || blockType == null) return; this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L)); - if (aOverridingStoneBlock.isReplaceableOreGen( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { + if (aOverridingStoneBlock + .isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { this.mMetaData = ((short) (this.mMetaData + 1000)); - } else if (aOverridingStoneBlock.isReplaceableOreGen( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { - this.mMetaData = ((short) (this.mMetaData + 2000)); - } else if (aOverridingStoneBlock.isReplaceableOreGen( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) { - if (aOverridingStoneBlock == GregTech_API.sBlockGranites) { - if (aOverridingStoneMeta < 8) { - this.mMetaData = ((short) (this.mMetaData + 3000)); - } else { - this.mMetaData = ((short) (this.mMetaData + 4000)); - } - } else { - this.mMetaData = ((short) (this.mMetaData + 3000)); - } - } else if (aOverridingStoneBlock.isReplaceableOreGen( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) { - if (aOverridingStoneBlock == GregTech_API.sBlockStones) { - if (aOverridingStoneMeta < 8) { - this.mMetaData = ((short) (this.mMetaData + 5000)); - } else { - this.mMetaData = ((short) (this.mMetaData + 6000)); - } - } else { - this.mMetaData = ((short) (this.mMetaData + 5000)); - } - } + } else if (aOverridingStoneBlock + .isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { + this.mMetaData = ((short) (this.mMetaData + 2000)); + } else + if (aOverridingStoneBlock.isReplaceableOreGen( + this.worldObj, + this.xCoord, + this.yCoord, + this.zCoord, + GregTech_API.sBlockGranites)) { + if (aOverridingStoneBlock == GregTech_API.sBlockGranites) { + if (aOverridingStoneMeta < 8) { + this.mMetaData = ((short) (this.mMetaData + 3000)); + } else { + this.mMetaData = ((short) (this.mMetaData + 4000)); + } + } else { + this.mMetaData = ((short) (this.mMetaData + 3000)); + } + } else + if (aOverridingStoneBlock.isReplaceableOreGen( + this.worldObj, + this.xCoord, + this.yCoord, + this.zCoord, + GregTech_API.sBlockStones)) { + if (aOverridingStoneBlock == GregTech_API.sBlockStones) { + if (aOverridingStoneMeta < 8) { + this.mMetaData = ((short) (this.mMetaData + 5000)); + } else { + this.mMetaData = ((short) (this.mMetaData + 6000)); + } + } else { + this.mMetaData = ((short) (this.mMetaData + 5000)); + } + } this.worldObj.setBlockMetadataWithNotify( this.xCoord, this.yCoord, @@ -267,14 +278,20 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit Materials aMaterial = aOreMaterial.mOreReplacement; ItemStack tStack = GT_OreDictUnificator.get( - OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + OrePrefixes.gemExquisite, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 1; i++) { tSelector.add(tStack); } } tStack = GT_OreDictUnificator.get( - OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + OrePrefixes.gemFlawless, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 2; i++) { tSelector.add(tStack); @@ -287,7 +304,10 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } } tStack = GT_OreDictUnificator.get( - OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + OrePrefixes.gemFlawed, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -318,21 +338,19 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit if (!tSelector.isEmpty()) { int i = 0; for (int j = Math.max( - 1, - aMaterial.mOreMultiplier - + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) - / 2); - i < j; - i++) { + 1, + aMaterial.mOreMultiplier + + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) / 2); i + < j; i++) { rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); } } if (tRandom.nextInt(3 + aFortune) > 1) { - Materials dustMat = - ((GT_Block_Ores_Abstract) aDroppedOre).getDroppedDusts()[this.mMetaData / 1000 % 16]; - if (dustMat != null) - rList.add(GT_OreDictUnificator.get( - tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); + Materials dustMat = ((GT_Block_Ores_Abstract) aDroppedOre).getDroppedDusts()[this.mMetaData / 1000 + % 16]; + if (dustMat != null) rList.add( + GT_OreDictUnificator + .get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); } } return rList; @@ -343,27 +361,16 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)]; if ((aMaterial != null) && (this.mMetaData < 32000)) { ITexture iTexture = TextureFactory.builder() - .addIcon(aMaterial - .mIconSet - .mTextures[ - this.mMetaData / 16000 == 0 - ? OrePrefixes.ore.mTextureIndex + .addIcon( + aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex]) - .setRGBA(aMaterial.mRGBa) - .stdOrient() - .build(); + .setRGBA(aMaterial.mRGBa).stdOrient().build(); if (aBlock instanceof GT_Block_Ores_Abstract) { return new ITexture[] { - ((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], iTexture - }; + ((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], iTexture }; } } - return new ITexture[] { - TextureFactory.of(Blocks.stone, 0), - TextureFactory.builder() - .addIcon(SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) - .stdOrient() - .build() - }; + return new ITexture[] { TextureFactory.of(Blocks.stone, 0), TextureFactory.builder() + .addIcon(SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]).stdOrient().build() }; } } |