diff options
author | Raven Szewczyk <git@eigenraven.me> | 2022-08-27 10:19:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 11:19:57 +0200 |
commit | 6f31720697bcc351421a4d86ba3bf749375dd12c (patch) | |
tree | 3adf8f318f22c892d74cd7c9d30b6dd3f11f11bd /src/main/java/gregtech/common/tileentities/boilers | |
parent | c3eac50decd33ee2be8703dfb2ecf9cdc31c2b67 (diff) | |
download | GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.gz GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.bz2 GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.zip |
Update buildscript & apply spotless (#1306)
* Update dependencies
* Update buildscript, apply spotless
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/boilers')
6 files changed, 360 insertions, 211 deletions
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 9eebaaabc4..9d832e134c 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -1,10 +1,12 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.ParticleFX; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; +import gregtech.api.enums.ParticleFX; import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -23,8 +25,6 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTank { public static final byte SOUND_EVENT_LET_OFF_EXCESS_STEAM = 1; public int mTemperature = 20; @@ -34,11 +34,13 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa public boolean mHadNoWater = false; private int mExcessWater = 0; - public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Boiler( + int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } - public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String[] aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Boiler( + int aID, String aName, String aNameRegional, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } @@ -51,10 +53,17 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + ITexture[] tmp = + mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; if (aSide != aFacing && tmp.length == 2) { - tmp = new ITexture[]{tmp[0]}; + tmp = new ITexture[] {tmp[0]}; } return tmp; } @@ -252,7 +261,9 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa } private void calculateHeatUp(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((this.mTemperature < getMaxTemperature()) && (this.mProcessingEnergy > 0) && (aTick % getHeatUpRate() == 0L)) { + if ((this.mTemperature < getMaxTemperature()) + && (this.mProcessingEnergy > 0) + && (aTick % getHeatUpRate() == 0L)) { this.mProcessingEnergy -= getEnergyConsumption(); this.mTemperature += getHeatUpAmount(); } @@ -300,11 +311,16 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa protected final void pushSteamToSide(IGregTechTileEntity aBaseMetaTileEntity, int aSide) { IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide((byte) aSide); if (tTileEntity == null) return; - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), Math.max(1, this.mSteam.amount / 2), false); + FluidStack tDrained = aBaseMetaTileEntity.drain( + ForgeDirection.getOrientation(aSide), Math.max(1, this.mSteam.amount / 2), false); if (tDrained == null) return; - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tDrained, false); + int tFilledAmount = + tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tDrained, false); if (tFilledAmount <= 0) return; - tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), true); + tTileEntity.fill( + ForgeDirection.getOrientation(aSide).getOpposite(), + aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), + true); } protected void pushSteamToInventories(IGregTechTileEntity aBaseMetaTileEntity) { @@ -328,7 +344,6 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation; - } @Override @@ -341,7 +356,13 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa if (aIndex == GT_MetaTileEntity_Boiler.SOUND_EVENT_LET_OFF_EXCESS_STEAM) { GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 2, 1.0F, aX, aY, aZ); - new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD).setWorld(getBaseMetaTileEntity().getWorld()).setMotion(0D, 0D, 0D).<ParticleEventBuilder>times(8, x -> x.setPosition(aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat()).run()); + new ParticleEventBuilder() + .setIdentifier(ParticleFX.CLOUD) + .setWorld(getBaseMetaTileEntity().getWorld()) + .setMotion(0D, 0D, 0D) + .<ParticleEventBuilder>times(8, x -> x.setPosition( + aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat()) + .run()); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 4b4a0299c1..9d3c61fc82 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -1,11 +1,21 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; -import gregtech.api.enums.ParticleFX; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -22,22 +32,13 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.util.ForgeDirection; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, new String[]{ - "An early way to get Steam Power", - "Produces 120L of Steam per second", - "Causes " + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond + " Pollution per second"}); + super(aID, aName, aNameRegional, new String[] { + "An early way to get Steam Power", + "Produces 120L of Steam per second", + "Causes " + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond + " Pollution per second" + }); } public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional, String[] aDescription) { @@ -55,17 +56,27 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - final ITexture[] - texBottom = {TextureFactory.of(MACHINE_BRONZEBRICKS_BOTTOM)}, + final ITexture[] texBottom = {TextureFactory.of(MACHINE_BRONZEBRICKS_BOTTOM)}, texTop = {TextureFactory.of(MACHINE_BRONZEBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, texSide = {TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, - texFront = {TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT), - TextureFactory.builder().addIcon(BOILER_FRONT_GLOW).glow().build()}, - texFrontActive = { - TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT_ACTIVE), - TextureFactory.builder().addIcon(BOILER_FRONT_ACTIVE_GLOW).glow().build()}; + texFront = + { + TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT), + TextureFactory.builder() + .addIcon(BOILER_FRONT_GLOW) + .glow() + .build() + }, + texFrontActive = + { + TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; for (int i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; @@ -109,8 +120,8 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { final byte frontFacing = aBaseMetaTileEntity.getFrontFacing(); if (frontFacing > 1 - && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { final double oX = aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 8D / 16D; final double oY = aBaseMetaTileEntity.getOffsetY(frontFacing, 1); @@ -137,8 +148,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { z = oZ + offset; } - ParticleEventBuilder particleEventBuilder = - (new ParticleEventBuilder()) + ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()) .setMotion(0D, 0D, 0D) .setPosition(x, y, z) .setWorld(getBaseMetaTileEntity().getWorld()); @@ -151,7 +161,10 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L) && this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + if ((aBaseMetaTileEntity.isServerSide()) + && (aTick > 20L) + && this.mProcessingEnergy > 0 + && (aTick % 20L == 0L)) { GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); } } @@ -184,64 +197,125 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { @Override protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (this.mInventory[2] == null) return; - if ( - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Diamond) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2],OrePrefixes.block)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke") - ) { - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10); + if ((GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Diamond) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke")) { + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) > 0) { + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); - if (XSTR.XSTR_INSTANCE.nextInt(GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Charcoal) ? 3 : GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) ? 8 : 2 ) == 0) { - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal)) ? Materials.DarkAsh : Materials.Ash, 1L)); + if (XSTR.XSTR_INSTANCE.nextInt( + GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) + ? 3 + : GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) ? 8 : 2) + == 0) { + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + OrePrefixes.dustTiny, + (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal)) + ? Materials.DarkAsh + : Materials.Ash, + 1L)); } } - } - else if ( - //If its a block of the following materials - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) || - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal))|| - GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) || - - //if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block - ( - Block.getBlockFromItem(this.mInventory[2].getItem()) != null && //check if the block exists - ( - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("tile") && //check if the block is a tile -> block - ( - //If the name of the block contains these names - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("charcoal") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("diamond") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coke") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("railcraft.cube") || - Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") - ) - ) - ) - ){ - //try to add 10% of the burnvalue as Processing energy, no boost for coal coke here - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])/10) > 0) { + } else if ( + // If its a block of the following materials + GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) + || GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) + || GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal)) + || GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) + || + + // if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block + (Block.getBlockFromItem(this.mInventory[2].getItem()) != null + && // check if the block exists + (Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("tile") + && // check if the block is a tile -> block + ( + // If the name of the block contains these names + Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("charcoal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("diamond") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coke") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("railcraft.cube") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("lignite"))))) { + // try to add 10% of the burnvalue as Processing energy, no boost for coal coke here + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) > 0) { this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dust, (GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Lignite) || GT_Utility.isPartOfMaterials(this.mInventory[2],Materials.Coal) || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("coal") || Block.getBlockFromItem(this.mInventory[2].getItem()).getUnlocalizedName().toLowerCase().contains("lignite") ) ? Materials.DarkAsh : Materials.Ash, 1L)); + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + OrePrefixes.dust, + (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("lignite")) + ? Materials.DarkAsh + : Materials.Ash, + 1L)); } - //enables every other fuel with at least 2000 burntime as a fuel, i.e. peat, Magic/Solid Super Fuel, Coal Singularities, Nitor, while bucket of creosite should be blocked same goes for lava - }else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 && !(this.mInventory[2].getUnlocalizedName().toLowerCase().contains("bucket") || this.mInventory[2].getUnlocalizedName().toLowerCase().contains("cell"))){ + // enables every other fuel with at least 2000 burntime as a fuel, i.e. peat, Magic/Solid Super Fuel, Coal + // Singularities, Nitor, while bucket of creosite should be blocked same goes for lava + } else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 + && !(this.mInventory[2].getUnlocalizedName().toLowerCase().contains("bucket") + || this.mInventory[2].getUnlocalizedName().toLowerCase().contains("cell"))) { this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); - //adds tiny pile of ash for burntime under 10k, small pile for under 100k and pile for bigger values + // adds tiny pile of ash for burntime under 10k, small pile for under 100k and pile for bigger values if (XSTR.XSTR_INSTANCE.nextInt(2) == 0) - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get( (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 ? OrePrefixes.dust : OrePrefixes.dustSmall : OrePrefixes.dustTiny), Materials.Ash, 1L)); + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 + ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 + ? OrePrefixes.dust + : OrePrefixes.dustSmall + : OrePrefixes.dustTiny), + Materials.Ash, + 1L)); } - } - } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 18010c0886..38bef79f38 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -1,5 +1,14 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; + import gregtech.GT_Mod; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -14,15 +23,6 @@ import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; import net.minecraftforge.fluids.FluidStack; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.BOILER_LAVA_FRONT_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; - public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public static final int COOLDOWN_INTERVAL = 20; @@ -31,11 +31,14 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public static final int PRODUCTION_PER_SECOND = 600; public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, new String[]{ - "A Boiler running off Lava", - "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", - "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond) + " Pollution per second", - "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + " ticks when fully heat up"}); + super(aID, aName, aNameRegional, new String[] { + "A Boiler running off Lava", + "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", + "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond) + + " Pollution per second", + "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + + " ticks when fully heat up" + }); } public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -49,18 +52,24 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - final ITexture[] - texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, + final ITexture[] texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, texTop = {TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, texSide = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, - texFront = { - TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_LAVA_FRONT), - TextureFactory.of(BOILER_LAVA_FRONT_GLOW)}, - texFrontActive = { - TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), - TextureFactory.builder().addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW).glow().build()}; + texFront = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_LAVA_FRONT), + TextureFactory.of(BOILER_LAVA_FRONT_GLOW) + }, + texFrontActive = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; for (byte i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; @@ -127,7 +136,8 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA; aBaseMetaTileEntity.decrStackSize(2, 1); aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucketClay.get(Materials.Lava))) { + } else if (GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], OrePrefixes.bucketClay.get(Materials.Lava))) { this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA; aBaseMetaTileEntity.decrStackSize(2, 1); // Clay lava buckets break, so you don't get it back. diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index cd3bb00ee4..cccfb1b6b4 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -1,5 +1,10 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.GregTech_API.sMachineFile; +import static gregtech.api.enums.ConfigCategories.machineconfig; +import static mcp.mobius.waila.api.SpecialChars.GOLD; +import static mcp.mobius.waila.api.SpecialChars.RESET; + import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -11,6 +16,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; +import java.util.List; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import net.minecraft.entity.player.EntityPlayerMP; @@ -22,21 +28,13 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.List; - -import static gregtech.api.GregTech_API.sMachineFile; -import static gregtech.api.enums.ConfigCategories.machineconfig; -import static mcp.mobius.waila.api.SpecialChars.GOLD; -import static mcp.mobius.waila.api.SpecialChars.RESET; - public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { public static final String LPS_FMT = "%s L/s"; private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( "gt.blockmachines.boiler.solar.desc.format", - "Steam Power by the Sun%n" + - "Produces %sL of Steam per second%n" + - "Calcifies over time, reducing Steam output to %sL/s%n" + - "Break and replace to descale"); + "Steam Power by the Sun%n" + "Produces %sL of Steam per second%n" + + "Calcifies over time, reducing Steam output to %sL/s%n" + + "Break and replace to descale"); protected final Config mConfig; protected int basicTemperatureMod = 5; // Base Celsius gain or loss private int mRunTimeTicks = 0; @@ -56,13 +54,14 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { mConfig = createConfig(); } - protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + protected GT_MetaTileEntity_Boiler_Solar( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { super(aName, aTier, aDescription, aTextures); mConfig = aConfig; } protected Config createConfig() { - return new Config(machineconfig + ".boiler.solar.bronze",1080000,40,120,45); + return new Config(machineconfig + ".boiler.solar.bronze", 1080000, 40, 120, 45); } /** @@ -92,9 +91,10 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public String[] getDescription() { - return String.format(localizedDescFormat, - GT_Utility.formatNumbers(getMaxOutputPerSecond()), - GT_Utility.formatNumbers(getMinOutputPerSecond())) + return String.format( + localizedDescFormat, + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getMinOutputPerSecond())) .split("\\R"); } @@ -108,16 +108,17 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { for (int color = -1; color < 16; color++) { int i = color + 1; short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); - rTextures[0][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)}; - rTextures[1][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), - TextureFactory.of(BlockIcons.BOILER_SOLAR)}; - rTextures[2][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)}; - rTextures[3][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), - TextureFactory.of(BlockIcons.OVERLAY_PIPE)}; + rTextures[0][i] = + new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), + TextureFactory.of(BlockIcons.BOILER_SOLAR) + }; + rTextures[2][i] = new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), + TextureFactory.of(BlockIcons.OVERLAY_PIPE) + }; } return rTextures; } @@ -133,7 +134,13 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } @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) { int i = aColorIndex + 1; if (aSide >= 2) { if (aSide != aFacing) return mTextures[2][i]; @@ -193,7 +200,9 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { * from the maximum output per second, and return this or the minimum output per second */ return mConfig.getMaxOutputPerSecond() - - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) / mConfig.getCalcificationTicks(); + - mConfig.getMaxOutputPerSecond() + * (mRunTimeTicks - mConfig.getCalcificationTicks()) + / mConfig.getCalcificationTicks(); } else { return mConfig.getMaxOutputPerSecond(); } @@ -251,16 +260,19 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public String[] getInfoData() { - return String.format("Heat Capacity: " + EnumChatFormatting.GREEN + "%s %%" + EnumChatFormatting.RESET + - " Hot time: " + EnumChatFormatting.RED + "%s s" + EnumChatFormatting.RESET + "%n" + - "Min output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + - " Max output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + "%n" + - "Current Output: " + EnumChatFormatting.YELLOW + LPS_FMT + EnumChatFormatting.RESET, - GT_Utility.formatNumbers(getHeatCapacityPercent()), - GT_Utility.formatNumbers(getHotTimeSeconds()), - GT_Utility.formatNumbers(getMinOutputPerSecond()), - GT_Utility.formatNumbers(getMaxOutputPerSecond()), - GT_Utility.formatNumbers(getProductionPerSecond())) + return String.format( + "Heat Capacity: " + EnumChatFormatting.GREEN + "%s %%" + EnumChatFormatting.RESET + + " Hot time: " + + EnumChatFormatting.RED + "%s s" + EnumChatFormatting.RESET + "%n" + "Min output: " + + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + " Max output: " + + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + "%n" + + "Current Output: " + + EnumChatFormatting.YELLOW + LPS_FMT + EnumChatFormatting.RESET, + GT_Utility.formatNumbers(getHeatCapacityPercent()), + GT_Utility.formatNumbers(getHotTimeSeconds()), + GT_Utility.formatNumbers(getMinOutputPerSecond()), + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getProductionPerSecond())) .split("\\R"); } @@ -278,15 +290,20 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } @Override - public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public void getWailaBody( + ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); - currentTip.add(String.format((GOLD + "Solar Boiler Output: " + RESET + "%d/%d L/s"), tag.getInteger("calcificationOutput"), tag.getInteger("maxCalcificationOutput"))); + currentTip.add(String.format( + (GOLD + "Solar Boiler Output: " + RESET + "%d/%d L/s"), + tag.getInteger("calcificationOutput"), + tag.getInteger("maxCalcificationOutput"))); super.getWailaBody(itemStack, currentTip, accessor, config); } @Override - public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { + public void getWailaNBTData( + EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("calcificationOutput", (getProductionPerSecond())); tag.setInteger("maxCalcificationOutput", (getMaxOutputPerSecond())); @@ -299,27 +316,38 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { private final int coolDownTicks; private final int maxRuntimeTicks; - public Config(String aCategory, - int aDefaultCalcificationTicks, - int aDefaultMinOutputPerSecond, - int aDefaultMaxOutputPerSecond, - int aDefaultCoolDownTicks) { - calcificationTicks = get(aCategory,"CalcificationTicks", aDefaultCalcificationTicks, + public Config( + String aCategory, + int aDefaultCalcificationTicks, + int aDefaultMinOutputPerSecond, + int aDefaultMaxOutputPerSecond, + int aDefaultCoolDownTicks) { + calcificationTicks = get( + aCategory, + "CalcificationTicks", + aDefaultCalcificationTicks, "Number of run-time ticks before boiler starts calcification.", "100% calcification and minimal output will be reached at 2 times this."); - minOutputPerSecond = get(aCategory,"MinOutputPerSecond", aDefaultMinOutputPerSecond); - maxOutputPerSecond = get(aCategory,"MaxOutputPerSecond", aDefaultMaxOutputPerSecond); - coolDownTicks = get(aCategory,"CoolDownTicks", aDefaultCoolDownTicks, "Number of ticks it takes to lose 1°C."); + minOutputPerSecond = get(aCategory, "MinOutputPerSecond", aDefaultMinOutputPerSecond); + maxOutputPerSecond = get(aCategory, "MaxOutputPerSecond", aDefaultMaxOutputPerSecond); + coolDownTicks = + get(aCategory, "CoolDownTicks", aDefaultCoolDownTicks, "Number of ticks it takes to lose 1°C."); // After which min output is reached. - maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks() / getMaxOutputPerSecond() + getCalcificationTicks(); + maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) + * getCalcificationTicks() + / getMaxOutputPerSecond() + + getCalcificationTicks(); } - protected int get(final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) { + protected int get( + final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) { final StringBuilder tCommentBuilder = new StringBuilder(); - for (String tComment: aComments) - tCommentBuilder.append(tComment).append('\n'); + for (String tComment : aComments) tCommentBuilder.append(tComment).append('\n'); tCommentBuilder.append("Default: ").append(aDefaultValue); - return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()).getInt(); + return sMachineFile + .mConfig + .get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()) + .getInt(); } public int getCalcificationTicks() { diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java index e044b6fb9b..223c280ad4 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.boilers; +import static gregtech.api.enums.ConfigCategories.machineconfig; + import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -9,22 +11,23 @@ import gregtech.api.render.TextureFactory; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; -import static gregtech.api.enums.ConfigCategories.machineconfig; - public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boiler_Solar { public GT_MetaTileEntity_Boiler_Solar_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_Solar_Steel( + String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_Solar_Steel( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + public GT_MetaTileEntity_Boiler_Solar_Steel( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { super(aName, aTier, aDescription, aTextures, aConfig); } @@ -40,16 +43,17 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil for (int color = -1; color < 16; color++) { int i = color + 1; short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); - rTextures[0][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)}; - rTextures[1][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), - TextureFactory.of(BlockIcons.BOILER_SOLAR)}; - rTextures[2][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)}; - rTextures[3][i] = new ITexture[]{ - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(BlockIcons.OVERLAY_PIPE)}; + rTextures[0][i] = + new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), + TextureFactory.of(BlockIcons.BOILER_SOLAR) + }; + rTextures[2][i] = new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[] { + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), + TextureFactory.of(BlockIcons.OVERLAY_PIPE) + }; } return rTextures; } @@ -66,6 +70,7 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mConfig); + return new GT_MetaTileEntity_Boiler_Solar_Steel( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mConfig); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 98546ff09e..b417ece4d5 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -1,14 +1,5 @@ package gregtech.common.tileentities.boilers; -import gregtech.GT_Mod; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.render.TextureFactory; -import gregtech.common.gui.GT_Container_Boiler; -import gregtech.common.gui.GT_GUIContainer_Boiler; -import net.minecraft.entity.player.InventoryPlayer; - import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT; import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE; import static gregtech.api.enums.Textures.BlockIcons.BOILER_FRONT_ACTIVE_GLOW; @@ -18,14 +9,24 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE; -public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze { +import gregtech.GT_Mod; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.render.TextureFactory; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze { public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, new String[]{ - "Faster than the Bronze Boiler", - "Produces 300L of Steam per second", - "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond)+" Pollution per second"}); + super(aID, aName, aNameRegional, new String[] { + "Faster than the Bronze Boiler", + "Produces 300L of Steam per second", + "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond) + + " Pollution per second" + }); } public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -39,17 +40,27 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; - final ITexture[] - texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, + final ITexture[] texBottom = {TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM)}, texTop = {TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE)}, texSide = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE)}, - texFront = {TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT), - TextureFactory.builder().addIcon(BOILER_FRONT_GLOW).glow().build()}, - texFrontActive = { - TextureFactory.of(MACHINE_STEELBRICKS_SIDE), - TextureFactory.of(BOILER_FRONT_ACTIVE), - TextureFactory.builder().addIcon(BOILER_FRONT_ACTIVE_GLOW).glow().build()}; + texFront = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT), + TextureFactory.builder() + .addIcon(BOILER_FRONT_GLOW) + .glow() + .build() + }, + texFrontActive = + { + TextureFactory.of(MACHINE_STEELBRICKS_SIDE), + TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_FRONT_ACTIVE_GLOW) + .glow() + .build() + }; for (int i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; |