From 0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 30 Jan 2023 10:56:42 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../GT_MetaTileEntity_DieselGenerator.java | 185 +++++++---------- .../generators/GT_MetaTileEntity_GasTurbine.java | 182 +++++++---------- .../generators/GT_MetaTileEntity_LightningRod.java | 69 +++---- .../GT_MetaTileEntity_MagicEnergyConverter.java | 106 +++------- .../GT_MetaTileEntity_MagicalEnergyAbsorber.java | 221 +++++++++------------ .../GT_MetaTileEntity_NaquadahReactor.java | 127 ++++-------- .../GT_MetaTileEntity_PlasmaGenerator.java | 65 ++---- .../generators/GT_MetaTileEntity_SteamTurbine.java | 149 +++++--------- 8 files changed, 401 insertions(+), 703 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities/generators') diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 1b53de5b42..d2304cc948 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -3,6 +3,10 @@ package gregtech.common.tileentities.generators; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -20,22 +24,22 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[] { - "Requires liquid Fuel", - "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond - * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) - + " Pollution per second" - }); + super( + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires liquid Fuel", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond + * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) + + " Pollution per second" }); onConfigLoad(); } @@ -98,8 +102,13 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) { GT_Log.err.println( - "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + " Coords: " + aBaseMetaTileEntity.getXCoord() - + " " + aBaseMetaTileEntity.getYCoord() + " " + aBaseMetaTileEntity.getZCoord()); + "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + + " Coords: " + + aBaseMetaTileEntity.getXCoord() + + " " + + aBaseMetaTileEntity.getYCoord() + + " " + + aBaseMetaTileEntity.getZCoord()); aBaseMetaTileEntity.setToFire(); } super.onPostTick(aBaseMetaTileEntity, aTick); @@ -120,152 +129,98 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe if (aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { - final double x = - aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 16D + XSTR_INSTANCE.nextFloat() * 14D / 16D; + final double x = aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 16D + + XSTR_INSTANCE.nextFloat() * 14D / 16D; final double y = aBaseMetaTileEntity.getOffsetY(topFacing, 1) + 1D / 32D; - final double z = - aBaseMetaTileEntity.getOffsetZ(topFacing, 1) + 2D / 16D + XSTR_INSTANCE.nextFloat() * 14D / 16D; - - new ParticleEventBuilder() - .setMotion(0D, 0D, 0D) - .setPosition(x, y, z) - .setWorld(getBaseMetaTileEntity().getWorld()) - .setIdentifier(ParticleFX.SMOKE) - .run(); + final double z = aBaseMetaTileEntity.getOffsetZ(topFacing, 1) + 2D / 16D + + XSTR_INSTANCE.nextFloat() * 14D / 16D; + + new ParticleEventBuilder().setMotion(0D, 0D, 0D).setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()).setIdentifier(ParticleFX.SMOKE).run(); } } } @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_FRONT_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BACK_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_GLOW).glow().build()) }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BOTTOM_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_GLOW).glow().build()) }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_TOP_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_GLOW).glow().build()) }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_SIDE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getSides(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_GLOW).glow().build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW).glow().build()) }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW).glow().build()) }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW).glow().build()) }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), + TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW).glow().build()) }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index b085d82bab..90b076abaa 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -18,25 +18,31 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Deprecated public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, new String[] { - "Requires flammable Gasses", - "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond - * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) - + " Pollution per second" - }); + super( + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires flammable Gasses", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + + " Pollution per second" }); this.mEfficiency = 100 - aTier * 5; onConfigLoad(); } public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier, int mEfficiency) { - super(aID, aName, aNameRegional, aTier, new String[] { - "Requires flammable Gasses", - "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond - * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) - + " Pollution per second" - }); + super( + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires flammable Gasses", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + + " Pollution per second" }); this.mEfficiency = mEfficiency; onConfigLoad(); } @@ -55,8 +61,8 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat onConfigLoad(); } - public GT_MetaTileEntity_GasTurbine( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int mEfficiency) { + public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, + int mEfficiency) { super(aName, aTier, aDescription, aTextures); this.mEfficiency = mEfficiency; onConfigLoad(); @@ -70,7 +76,11 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_GasTurbine( - this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mEfficiency); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mEfficiency); } @Override @@ -84,8 +94,8 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, this.mEfficiency); + this.mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, this.mEfficiency); } @Override @@ -95,134 +105,84 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_FRONT), - TextureFactory.builder() - .addIcon(GAS_TURBINE_FRONT_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT), + TextureFactory.builder().addIcon(GAS_TURBINE_FRONT_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BACK), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BACK_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK), + TextureFactory.builder().addIcon(GAS_TURBINE_BACK_GLOW).glow().build()) }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BOTTOM), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BOTTOM_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM), + TextureFactory.builder().addIcon(GAS_TURBINE_BOTTOM_GLOW).glow().build()) }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_TOP), - TextureFactory.builder() - .addIcon(GAS_TURBINE_TOP_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP), + TextureFactory.builder().addIcon(GAS_TURBINE_TOP_GLOW).glow().build()) }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_SIDE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_SIDE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getSides(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE), + TextureFactory.builder().addIcon(GAS_TURBINE_SIDE_GLOW).glow().build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW).glow().build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW).glow().build()) }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW).glow().build()) }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW).glow().build()) }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), + TextureFactory.builder().addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW).glow().build()) }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index dbb8931848..2436beba77 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -2,6 +2,13 @@ package gregtech.common.tileentities.generators; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -9,54 +16,35 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.render.TextureFactory; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMachineBlock { + public GT_MetaTileEntity_LightningRod(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Generates EU From Lightning Bolts"); } - public GT_MetaTileEntity_LightningRod( - String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_LightningRod( - String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide != ForgeDirection.UP.ordinal()) { - return new ITexture[] { - BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] - }; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] }; } - if (!aActive) - return new ITexture[] { - BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS) - }; - return new ITexture[] { - BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build() - }; + if (!aActive) return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS) }; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), + TextureFactory.builder().addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).glow().build() }; } @Override @@ -67,7 +55,11 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LightningRod( - this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override @@ -90,10 +82,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight() - 1; i++) { if (isRodValid - && aBaseMetaTileEntity - .getBlock(aX, i, aZ) - .getUnlocalizedName() - .equals("blockFenceIron")) { + && aBaseMetaTileEntity.getBlock(aX, i, aZ).getUnlocalizedName().equals("blockFenceIron")) { aRodValue++; } else { isRodValid = false; @@ -105,8 +94,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } if (!aWorld.isThundering() && ((aY + aRodValue) < 128)) aRodValue = 0; if (XSTR_INSTANCE.nextInt(4 * aWorld.getHeight()) < (aRodValue * (aY + aRodValue))) { - aBaseMetaTileEntity.increaseStoredEnergyUnits( - maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); + aBaseMetaTileEntity + .increaseStoredEnergyUnits(maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); aWorld.addWeatherEffect(new EntityLightningBolt(aWorld, aX, aY + aRodValue, aZ)); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index 2e1bfd655f..6bc904d384 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -20,6 +20,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) { @@ -27,14 +28,14 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba onConfigLoad(); } - public GT_MetaTileEntity_MagicEnergyConverter( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } - public GT_MetaTileEntity_MagicEnergyConverter( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } @@ -47,7 +48,10 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MagicEnergyConverter( - this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -74,112 +78,64 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build() }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() - }; + return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() - }; + return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() - }; + return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build() }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build() }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build() }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build() }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 210483cbe8..c92cf8b699 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -12,24 +12,6 @@ import static net.minecraft.util.EnumChatFormatting.RESET; import static net.minecraft.util.EnumChatFormatting.UNDERLINE; import static net.minecraft.util.EnumChatFormatting.YELLOW; -import com.google.common.base.Enums; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ParticleFX; -import gregtech.api.enums.TC_Aspects; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Config; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -38,6 +20,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; + import net.minecraft.block.Block; import net.minecraft.block.BlockDragonEgg; import net.minecraft.enchantment.Enchantment; @@ -54,13 +37,35 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectSourceHelper; import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.visnet.VisNetHandler; +import com.google.common.base.Enums; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ParticleFX; +import gregtech.api.enums.TC_Aspects; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; + interface MagicalEnergyBBListener { + void onMagicalEnergyBBUpdate(); } @@ -68,10 +73,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B implements MagicalEnergyBBListener { private static final boolean THAUMCRAFT_LOADED = Loader.isModLoaded(MOD_ID_TC); - private static final ConcurrentHashMap sSubscribedCrystals = - new ConcurrentHashMap<>(4); - private static final List sPrimalAspects = - (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<>(); + private static final ConcurrentHashMap sSubscribedCrystals = new ConcurrentHashMap<>( + 4); + private static final List sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() + : new ArrayList<>(); private static final Map sAspectsEnergy = new HashMap<>(); private static boolean sAllowMultipleEggs = false; private static GT_MetaTileEntity_MagicalEnergyAbsorber sActiveSiphon = null; @@ -92,8 +97,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B onConfigLoad(GregTech_API.sMachineFile); } - private GT_MetaTileEntity_MagicalEnergyAbsorber( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + private GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(GregTech_API.sMachineFile); } @@ -112,13 +117,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B sEnergyFromVis = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerVis", 20); sEnergyPerEssentia = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerEssentia", 320); for (Aspect tAspect : Aspect.aspects.values()) { - //noinspection UnstableApiUsage + // noinspection UnstableApiUsage sAspectsEnergy.put( tAspect, Enums.getIfPresent(TC_Aspects.class, tAspect.getTag().toUpperCase(Locale.ENGLISH)) - .or(TC_Aspects.AER) - .mValue - * sEnergyPerEssentia); + .or(TC_Aspects.AER).mValue * sEnergyPerEssentia); } } } @@ -131,8 +134,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B public void onConfigLoad(GT_Config aConfig) { sharedConfigLoad(aConfig); mEfficiency = aConfig.get(machineconfig, "MagicEnergyAbsorber.efficiency.tier." + mTier, 100 - mTier * 10); - mMaxVisPerDrain = (int) Math.round(Math.sqrt( - (double) (V[mTier] * 10000) / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); + mMaxVisPerDrain = (int) Math.round( + Math.sqrt( + (double) (V[mTier] * 10000) + / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); if (Math.pow(mMaxVisPerDrain, 2) * sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100) < V[mTier]) { mMaxVisPerDrain += 1; } @@ -203,15 +208,26 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B List description = new ArrayList<>(); description.add( UNDERLINE + "Feasts on " + LIGHT_PURPLE + UNDERLINE + "magic" + GRAY + UNDERLINE + " close to it:"); - description.add(LI + (sAllowMultipleEggs ? "A " : "An " + YELLOW + UNDERLINE + "EXCLUSIVE" + RESET) + GRAY + " " - + LIGHT_PURPLE + "Dragon Egg" + GRAY + " atop"); + description.add( + LI + (sAllowMultipleEggs ? "A " : "An " + YELLOW + UNDERLINE + "EXCLUSIVE" + RESET) + + GRAY + + " " + + LIGHT_PURPLE + + "Dragon Egg" + + GRAY + + " atop"); if (sEnergyPerEndercrystal > 0) { description.add(LI + sEnergyPerEndercrystal + EU_PER + LIGHT_PURPLE + "Ender Crystal" + GRAY + " in range"); } if (THAUMCRAFT_LOADED) { description.add(LI + mMaxVisPerDrain + "%%%CV/t from an " + LIGHT_PURPLE + "Energised Node" + GRAY); - description.add(LI + (sEnergyPerEssentia * getEfficiency()) / 100 + EU_PER + LIGHT_PURPLE + "Essentia" - + GRAY + " Aspect-Value from containers in range"); + description.add( + LI + (sEnergyPerEssentia * getEfficiency()) / 100 + + EU_PER + + LIGHT_PURPLE + + "Essentia" + + GRAY + + " Aspect-Value from containers in range"); } description.add(" "); description.add(UNDERLINE + "Lookup range (Use Screwdriver to change):"); @@ -220,8 +236,13 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B description.add(" "); description.add( UNDERLINE + "Fuels on " + LIGHT_PURPLE + UNDERLINE + "enchantments" + GRAY + UNDERLINE + " input:"); - description.add("- Item:%%%" + (10000 * getEfficiency()) / 100 + EU_PER + LIGHT_PURPLE + "enchant" + GRAY - + " weight × level / max"); + description.add( + "- Item:%%%" + (10000 * getEfficiency()) / 100 + + EU_PER + + LIGHT_PURPLE + + "enchant" + + GRAY + + " weight × level / max"); description.add("- Book:%%%" + 10000 + EU_PER + LIGHT_PURPLE + "enchant" + GRAY + " weight × level / max"); description.add(" "); description.add("Efficiency:%%%" + GREEN + getEfficiency() + "%"); @@ -230,108 +251,63 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), - OVERLAYS_ENERGY_OUT[mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW).glow().build() }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() - }; + return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] {super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG)}; + return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG) }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() - }; + return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_GLOW).glow().build() }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW).glow().build() }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build() }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_DRAGONEGG), - TextureFactory.builder() - .addIcon(MACHINE_CASING_DRAGONEGG_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG), + TextureFactory.builder().addIcon(MACHINE_CASING_DRAGONEGG_GLOW).glow().build() }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() - }; + return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build() }; } @Override @@ -373,8 +349,9 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B mNextGenerateTickRate = 20; } aBaseMetaTileEntity.increaseStoredEnergyUnits(tGeneratedEU, true); - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() + && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); } } @@ -398,8 +375,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final double oZ = aBaseMetaTileEntity.getZCoord() + 8D / 16D; final ParticleEventBuilder particleEventBuilder = new ParticleEventBuilder() - .setWorld(getBaseMetaTileEntity().getWorld()) - .setIdentifier(ParticleFX.PORTAL); + .setWorld(getBaseMetaTileEntity().getWorld()).setIdentifier(ParticleFX.PORTAL); for (int i = 0; i < 9; i++) { final double dX = (XSTR_INSTANCE.nextFloat() - 0.5D) / 2D; @@ -415,10 +391,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final double mY = -(dXZ * dY) / 4D; final double mZ = dZ * 4D; - particleEventBuilder - .setMotion(mX, mY, mZ) - .setPosition(x, y, z) - .run(); + particleEventBuilder.setMotion(mX, mY, mZ).setPosition(x, y, z).run(); } } } @@ -498,8 +471,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } // Only consume input when it can store EU and push output - if ((getBaseMetaTileEntity().getStoredEU() + tEU) - < getBaseMetaTileEntity().getEUCapacity() + if ((getBaseMetaTileEntity().getStoredEU() + tEU) < getBaseMetaTileEntity().getEUCapacity() && getBaseMetaTileEntity().addStackToSlot(getOutputSlot(), tOutputStack)) { decrStackSize(getInputSlot(), 1); } else { @@ -516,8 +488,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B private long absorbFromEgg() { if (!hasEgg()) return 0; if (!sAllowMultipleEggs) { - if (sActiveSiphon != null - && sActiveSiphon != this + if (sActiveSiphon != null && sActiveSiphon != this && sActiveSiphon.getBaseMetaTileEntity() != null && !sActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity() && sActiveSiphon.isChunkLoaded() @@ -575,20 +546,18 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B long tEU = 0; - long tEUtoGen = getBaseMetaTileEntity().getEUCapacity() - - getBaseMetaTileEntity().getUniversalEnergyStored(); + long tEUtoGen = getBaseMetaTileEntity().getEUCapacity() - getBaseMetaTileEntity().getUniversalEnergyStored(); List mAvailableEssentiaAspects = mMagicalEnergyBB.getAvailableAspects(); // try to drain 1 of whatever aspect available in containers within RANGE for (int i = mAvailableEssentiaAspects.size() - 1; i >= 0 && tEUtoGen > 0; i--) { Aspect aspect = mAvailableEssentiaAspects.get(i); long tAspectEU = ((long) sAspectsEnergy.get(aspect) * getEfficiency()) / 100; - if (tAspectEU <= tEUtoGen - && AspectSourceHelper.drainEssentia( - (TileEntity) getBaseMetaTileEntity(), - aspect, - ForgeDirection.UNKNOWN, - mMagicalEnergyBB.getRange())) { + if (tAspectEU <= tEUtoGen && AspectSourceHelper.drainEssentia( + (TileEntity) getBaseMetaTileEntity(), + aspect, + ForgeDirection.UNKNOWN, + mMagicalEnergyBB.getRange())) { tEUtoGen -= tAspectEU; tEU += tAspectEU; } @@ -634,6 +603,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B * Handles Bounding Box ranged operations for Magic sources */ static class MagicalEnergyBB { + private final GT_MetaTileEntity_MagicalEnergyAbsorber mAbsorber; private final MagicalEnergyBBListener mListener; private final int mDefaultTier; @@ -709,8 +679,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B double tX = tBaseMetaTileEntity.getXCoord(); double tY = tBaseMetaTileEntity.getYCoord(); double tZ = tBaseMetaTileEntity.getZCoord(); - return AxisAlignedBB.getBoundingBox( - tX - tRange, tY - tRange, tZ - tRange, tX + tRange, tY + tRange, tZ + tRange); + return AxisAlignedBB + .getBoundingBox(tX - tRange, tY - tRange, tZ - tRange, tX + tRange, tY + tRange, tZ + tRange); } private void scanLivingCrystals() { @@ -788,8 +758,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } /** - * Change the Bounding Box tier relatively to offset - * with wrapping at tier limits + * Change the Bounding Box tier relatively to offset with wrapping at tier limits * * @param aOffset relative tier change */ diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java index 6ca6da874f..5fe5107dc4 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java @@ -15,8 +15,8 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe private int mEfficiency; - public GT_MetaTileEntity_NaquadahReactor( - int aID, String aName, String[] aDescription, String aNameRegional, int aTier) { + public GT_MetaTileEntity_NaquadahReactor(int aID, String aName, String[] aDescription, String aNameRegional, + int aTier) { super(aID, aName, aNameRegional, aTier, aDescription); if (aTier > 8 || aTier < 4) { new Exception("Tier without Recipe Map!").printStackTrace(); @@ -34,8 +34,7 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe @Override public boolean isOutputFacing(byte aSide) { - return (aSide > 1) - && (aSide != getBaseMetaTileEntity().getFrontFacing()) + return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); } @@ -91,133 +90,79 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe } public int onConfigLoad() { - return mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); + return mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); } @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getFront(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW).glow().build()) }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBack(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW).glow().build()) }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getBottom(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW).glow().build()) }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW) - .glow() - .build()) - }; + return new ITexture[] { super.getTop(aColor)[0], + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), + TextureFactory.builder().addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW).glow().build()) }; } @Override public ITexture[] getSides(byte aColor) { -