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_AbstractMultiFurnace.java | 3 +- .../multi/GT_MetaTileEntity_AssemblyLine.java | 209 ++- .../GT_MetaTileEntity_BrickedBlastFurnace.java | 44 +- .../GT_MetaTileEntity_BronzeBlastFurnace.java | 30 +- .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 115 +- .../multi/GT_MetaTileEntity_Cleanroom.java | 163 +- .../GT_MetaTileEntity_ConcreteBackfiller1.java | 1 + .../GT_MetaTileEntity_ConcreteBackfiller2.java | 1 + .../GT_MetaTileEntity_ConcreteBackfillerBase.java | 35 +- .../multi/GT_MetaTileEntity_DieselEngine.java | 218 ++- .../multi/GT_MetaTileEntity_DistillationTower.java | 149 +- .../multi/GT_MetaTileEntity_DrillerBase.java | 183 +-- .../GT_MetaTileEntity_ElectricBlastFurnace.java | 247 ++-- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 143 +- .../multi/GT_MetaTileEntity_FusionComputer.java | 389 +++-- .../multi/GT_MetaTileEntity_FusionComputer1.java | 27 +- .../multi/GT_MetaTileEntity_FusionComputer2.java | 27 +- .../multi/GT_MetaTileEntity_FusionComputer3.java | 27 +- .../multi/GT_MetaTileEntity_HeatExchanger.java | 210 ++- .../GT_MetaTileEntity_ImplosionCompressor.java | 76 +- .../GT_MetaTileEntity_IntegratedOreFactory.java | 235 ++- .../multi/GT_MetaTileEntity_LargeBoiler.java | 181 +-- .../GT_MetaTileEntity_LargeBoiler_Bronze.java | 3 +- .../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 4 +- .../GT_MetaTileEntity_LargeBoiler_Titanium.java | 4 +- ...T_MetaTileEntity_LargeBoiler_TungstenSteel.java | 4 +- .../GT_MetaTileEntity_LargeChemicalReactor.java | 198 +-- .../multi/GT_MetaTileEntity_LargeTurbine.java | 242 +-- .../multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 79 +- ...GT_MetaTileEntity_LargeTurbine_GasAdvanced.java | 77 +- .../GT_MetaTileEntity_LargeTurbine_HPSteam.java | 95 +- .../GT_MetaTileEntity_LargeTurbine_Plasma.java | 218 ++- .../GT_MetaTileEntity_LargeTurbine_Steam.java | 92 +- .../multi/GT_MetaTileEntity_MultiFurnace.java | 249 ++-- .../multi/GT_MetaTileEntity_NanoForge.java | 192 +-- .../multi/GT_MetaTileEntity_OilCracker.java | 177 +-- .../multi/GT_MetaTileEntity_OilDrill1.java | 1 + .../multi/GT_MetaTileEntity_OilDrill2.java | 1 + .../multi/GT_MetaTileEntity_OilDrill3.java | 1 + .../multi/GT_MetaTileEntity_OilDrillBase.java | 157 +- .../multi/GT_MetaTileEntity_OilDrillInfinite.java | 19 +- .../multi/GT_MetaTileEntity_OreDrillingPlant1.java | 1 + .../multi/GT_MetaTileEntity_OreDrillingPlant2.java | 1 + .../multi/GT_MetaTileEntity_OreDrillingPlant3.java | 1 + .../multi/GT_MetaTileEntity_OreDrillingPlant4.java | 1 + .../GT_MetaTileEntity_OreDrillingPlantBase.java | 128 +- .../multi/GT_MetaTileEntity_PCBFactory.java | 946 ++++++------ .../multi/GT_MetaTileEntity_PlasmaForge.java | 1554 +++++++------------- .../GT_MetaTileEntity_PrimitiveBlastFurnace.java | 237 ++- .../multi/GT_MetaTileEntity_ProcessingArray.java | 269 ++-- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 124 +- .../multi/GT_MetaTileEntity_VacuumFreezer.java | 81 +- 52 files changed, 3417 insertions(+), 4452 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities/machines/multi') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java index 3dde1feb83..51c7c2eb13 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java @@ -1,9 +1,10 @@ package gregtech.common.tileentities.machines.multi; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; -import net.minecraft.item.ItemStack; public abstract class GT_MetaTileEntity_AbstractMultiFurnace> extends GT_MetaTileEntity_EnhancedMultiBlockBase { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index e5b7110659..6f09aa6ede 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -10,10 +10,19 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -34,84 +43,66 @@ import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_AssemblyLine - extends GT_MetaTileEntity_EnhancedMultiBlockBase - implements ISurvivalConstructable { +public class GT_MetaTileEntity_AssemblyLine extends + GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { public ArrayList mDataAccessHatches = new ArrayList<>(); private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_LATER = "later"; private static final String STRUCTURE_PIECE_LAST = "last"; - private static final IStructureDefinition STRUCTURE_DEFINITION = - StructureDefinition.builder() - .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { - {" ", "e", " "}, - {"~", "l", "G"}, - {"g", "m", "g"}, - {"b", "i", "b"}, - })) - .addShape(STRUCTURE_PIECE_LATER, transpose(new String[][] { - {" ", "e", " "}, - {"d", "l", "d"}, - {"g", "m", "g"}, - {"b", "I", "b"}, - })) - .addShape(STRUCTURE_PIECE_LAST, transpose(new String[][] { - {" ", "e", " "}, - {"d", "l", "d"}, - {"g", "m", "g"}, - {"o", "i", "b"}, - })) - .addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate machine casing - .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler machine casing - .addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casing - .addElement( - 'g', - ofChain( - ofBlockUnlocalizedName("IC2", "blockAlloyGlass", 0, true), - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true), - // warded glass - ofBlockUnlocalizedName("Thaumcraft", "blockCosmeticOpaque", 2, false))) - .addElement( - 'e', - ofChain( - Energy.newAny(16, 1, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH), - ofBlock(GregTech_API.sBlockCasings2, 0))) - .addElement( - 'd', - buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) - .atLeast(DataHatchElement.DataAccess) - .dot(2) - .casingIndex(42) - .allowOnly(ForgeDirection.NORTH) - .buildAndChain(GregTech_API.sBlockCasings3, 10)) - .addElement( - 'b', - buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) - .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) - .casingIndex(16) - .dot(3) - .allowOnly(ForgeDirection.DOWN) - .buildAndChain( - ofBlock(GregTech_API.sBlockCasings2, 0), - ofHatchAdder( - GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) - .addElement( - 'I', - ofChain( - // all blocks nearby use solid steel casing, so let's use the texture of that - InputBus.newAny(16, 5, ForgeDirection.DOWN), + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition + .builder() + .addShape( + STRUCTURE_PIECE_FIRST, + transpose( + new String[][] { { " ", "e", " " }, { "~", "l", "G" }, { "g", "m", "g" }, + { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_LATER, + transpose( + new String[][] { { " ", "e", " " }, { "d", "l", "d" }, { "g", "m", "g" }, + { "b", "I", "b" }, })) + .addShape( + STRUCTURE_PIECE_LAST, + transpose( + new String[][] { { " ", "e", " " }, { "d", "l", "d" }, { "g", "m", "g" }, + { "o", "i", "b" }, })) + .addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate machine casing + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler machine casing + .addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casing + .addElement( + 'g', + ofChain( + ofBlockUnlocalizedName("IC2", "blockAlloyGlass", 0, true), + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true), + // warded glass + ofBlockUnlocalizedName("Thaumcraft", "blockCosmeticOpaque", 2, false))) + .addElement( + 'e', + ofChain( + Energy.newAny(16, 1, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH), + ofBlock(GregTech_API.sBlockCasings2, 0))) + .addElement( + 'd', + buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class).atLeast(DataHatchElement.DataAccess).dot(2) + .casingIndex(42).allowOnly(ForgeDirection.NORTH) + .buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) + .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance).casingIndex(16).dot(3) + .allowOnly(ForgeDirection.DOWN).buildAndChain( + ofBlock(GregTech_API.sBlockCasings2, 0), ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) - .addElement('i', InputBus.newAny(16, 5, ForgeDirection.DOWN)) - .addElement('o', OutputBus.newAny(16, 4, ForgeDirection.DOWN)) - .build(); + .addElement( + 'I', + ofChain( + // all blocks nearby use solid steel casing, so let's use the texture of that + InputBus.newAny(16, 5, ForgeDirection.DOWN), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) + .addElement('i', InputBus.newAny(16, 5, ForgeDirection.DOWN)) + .addElement('o', OutputBus.newAny(16, 4, ForgeDirection.DOWN)).build(); public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -129,12 +120,9 @@ public class GT_MetaTileEntity_AssemblyLine @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Assembling Line") - .addInfo("Controller block for the Assembling Line") - .addInfo("Used to make complex machine parts (LuV+)") - .addInfo("Does not make Assembler items") - .addSeparator() - .beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false) // ? + tt.addMachineType("Assembling Line").addInfo("Controller block for the Assembling Line") + .addInfo("Used to make complex machine parts (LuV+)").addInfo("Does not make Assembler items") + .addSeparator().beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false) // ? .addStructureInfo("From Bottom to Top, Left to Right") .addStructureInfo( "Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") @@ -143,10 +131,8 @@ public class GT_MetaTileEntity_AssemblyLine .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") - .addController("Either Grate on layer 3 of the first slice") - .addEnergyHatch("Any layer 4 casing", 1) - .addMaintenanceHatch("Any layer 1 casing", 3) - .addInputBus("As specified on layer 1", 4, 5) + .addController("Either Grate on layer 3 of the first slice").addEnergyHatch("Any layer 4 casing", 1) + .addMaintenanceHatch("Any layer 1 casing", 3).addInputBus("As specified on layer 1", 4, 5) .addInputHatch("Any layer 1 casing", 3) .addOutputBus("Replaces Input Bus on final slice or on any solid steel casing on layer 1", 4) .addOtherStructurePart("Data Access Hatch", "Optional, next to controller", 2) @@ -155,41 +141,18 @@ public class GT_MetaTileEntity_AssemblyLine } @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 == aFacing) { - if (aActive) - return new ITexture[] { - BlockIcons.casingTexturePages[0][16], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[] { - BlockIcons.casingTexturePages[0][16], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) - .extFacing() - .glow() - .build() - }; + if (aActive) return new ITexture[] { BlockIcons.casingTexturePages[0][16], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { BlockIcons.casingTexturePages[0][16], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build() }; } - return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][16]}; + return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][16] }; } @Override @@ -220,10 +183,9 @@ public class GT_MetaTileEntity_AssemblyLine int[] tFluidSlot = null; boolean foundRecipe = false; - nextDataStick: - for (ItemStack tDataStick : tDataStickList) { - GT_AssemblyLineUtils.LookupResult tLookupResult = - GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick, false); + nextDataStick: for (ItemStack tDataStick : tDataStickList) { + GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils + .findAssemblyLineRecipeFromDataStick(tDataStick, false); if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) continue; @@ -281,8 +243,8 @@ public class GT_MetaTileEntity_AssemblyLine continue nextDataStick; } else { if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) { - GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = - (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i); + GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches + .get(i); if (!tMultiHatch.hasFluid(tRecipe.mFluidInputs[i]) || tMultiHatch.getFluidAmount(tRecipe.mFluidInputs[i]) < tRecipe.mFluidInputs[i].amount) { @@ -318,7 +280,7 @@ public class GT_MetaTileEntity_AssemblyLine if (GT_Values.D1) { GT_FML_LOGGER.info("Find available recipe"); } - mOutputItems = new ItemStack[] {tRecipe.mOutput}; + mOutputItems = new ItemStack[] { tRecipe.mOutput }; foundRecipe = true; break; } @@ -338,8 +300,8 @@ public class GT_MetaTileEntity_AssemblyLine for (int i = 0; i < tFluids.length; i++) { if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) { - GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = - (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i); + GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches + .get(i); tMultiHatch.getFluid(tFluidSlot[i]).amount -= tFluids[i]; if (tMultiHatch.getFluid(tFluidSlot[i]).amount <= 0) { tMultiHatch.setFluid(null, tFluidSlot[i]); @@ -494,6 +456,7 @@ public class GT_MetaTileEntity_AssemblyLine } private enum DataHatchElement implements IHatchElement { + DataAccess; @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index 7536735634..5babf4405d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -1,5 +1,10 @@ package gregtech.common.tileentities.machines.multi; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Keyboard; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.SteamVariant; @@ -11,23 +16,16 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace implements ISecondaryDescribable { - private static final ITexture[] FACING_SIDE = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)}; + + private static final ITexture[] FACING_SIDE = { TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS) }; private static final ITexture[] FACING_FRONT = { - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE) - }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE) }; private static final ITexture[] FACING_ACTIVE = { - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW) - .glow() - .build() - }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), TextureFactory.builder() + .addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW).glow().build() }; private GT_Multiblock_Tooltip_Builder tooltipBuilder; public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) { @@ -59,32 +57,22 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri protected GT_Multiblock_Tooltip_Builder getTooltip() { if (tooltipBuilder == null) { tooltipBuilder = new GT_Multiblock_Tooltip_Builder(); - tooltipBuilder - .addMachineType("Blast Furnace") - .addInfo("Controller Block for the Bricked Blast Furnace") + tooltipBuilder.addMachineType("Blast Furnace").addInfo("Controller Block for the Bricked Blast Furnace") .addInfo("Usable for Steel and general Pyrometallurgy") .addInfo("Has a useful interface, unlike other gregtech multis") - .addPollutionAmount(GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Front center") + .addPollutionAmount(GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond).addSeparator() + .beginStructureBlock(3, 4, 3, true).addController("Front center") .addOtherStructurePart("Firebricks", "Everything except the controller") .addStructureInfo("The top block is also empty") .addStructureInfo("You can share the walls of GT multis, so") - .addStructureInfo("each additional one costs less, up to 4") - .toolTipFinisher("Gregtech"); + .addStructureInfo("each additional one costs less, up to 4").toolTipFinisher("Gregtech"); } return tooltipBuilder; } @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 == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 734d11e4c8..8c22ab780f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -5,25 +5,22 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import gregtech.api.GregTech_API; import gregtech.api.enums.SteamVariant; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace { - private static final ITexture[] FACING_SIDE = {TextureFactory.of(MACHINE_BRONZEPLATEDBRICKS)}; - private static final ITexture[] FACING_FRONT = {TextureFactory.of(MACHINE_BRONZEBLASTFURNACE)}; - private static final ITexture[] FACING_ACTIVE = { - TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW) - .glow() - .build() - }; + + private static final ITexture[] FACING_SIDE = { TextureFactory.of(MACHINE_BRONZEPLATEDBRICKS) }; + private static final ITexture[] FACING_FRONT = { TextureFactory.of(MACHINE_BRONZEBLASTFURNACE) }; + private static final ITexture[] FACING_ACTIVE = { TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), + TextureFactory.builder().addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW).glow().build() }; public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -35,17 +32,12 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim @Override public String[] getDescription() { - return new String[] {"Disabled"}; + return new String[] { "Disabled" }; } @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 == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 8a2f969b18..4f1aec7f4a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -7,6 +7,16 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; @@ -21,14 +31,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.common.GT_Pollution; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.ChunkPosition; -import net.minecraftforge.oredict.OreDictionary; public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase implements ISecondaryDescribable { @@ -110,15 +112,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul if (isWoodLog( getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) - getBaseMetaTileEntity() - .getWorld() - .setBlock( - getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, - getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, - getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, - GregTech_API.sBlockReinforced, - 4, - 3); + getBaseMetaTileEntity().getWorld().setBlock( + getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, + getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, + getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, + GregTech_API.sBlockReinforced, + 4, + 3); } running = false; return false; @@ -134,13 +134,12 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul if (OreDictionary.getOreName(id).equals("logWood")) return true; } String tTool = log.getHarvestTool(meta); - return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) - && ("axe".equals(tTool)) + return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) && ("axe".equals(tTool)) && (log.getMaterial() == Material.wood); } - private boolean checkAllBlockSides( - int aX, int aY, int aZ, ArrayList aList1, ArrayList aList2) { + private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList aList1, + ArrayList aList2) { boolean expandToChunkXPos = false; boolean expandToChunkXNeg = false; boolean expandToChunkYPos = false; @@ -151,7 +150,8 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockXPos = getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); if (aX + 1 < 6 && (isWoodLog(blockXPos, getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) - && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) expandToChunkXPos = true; + && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) + expandToChunkXPos = true; } else if (!(blockXPos == Blocks.dirt || blockXPos == Blocks.grass)) { return false; } @@ -159,7 +159,8 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockXNeg = getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); if (aX - 1 > -6 && (isWoodLog(blockXNeg, getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) - && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) expandToChunkXNeg = true; + && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) + expandToChunkXNeg = true; } else if (!(blockXNeg == Blocks.dirt || blockXNeg == Blocks.grass)) { return false; } @@ -167,17 +168,18 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockYPos = getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); if (aY + 1 < 1 && (isWoodLog(blockYPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) - && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) expandToChunkYPos = true; - } else if (!(blockYPos == Blocks.dirt - || blockYPos == Blocks.grass + && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) + expandToChunkYPos = true; + } else if (!(blockYPos == Blocks.dirt || blockYPos == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { - return false; - } + return false; + } Block blockYNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); if (aY - 1 > -6 && (isWoodLog(blockYNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) - && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) expandToChunkYNeg = true; + && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) + expandToChunkYNeg = true; } else if (blockYNeg != Blocks.brick_block) { return false; } @@ -185,7 +187,8 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockZPos = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); if (aZ + 1 < 6 && (isWoodLog(blockZPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) - && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) expandToChunkZPos = true; + && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) + expandToChunkZPos = true; } else if (!(blockZPos == Blocks.dirt || blockZPos == Blocks.grass)) { return false; } @@ -193,7 +196,8 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockZNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); if (aZ - 1 > -6 && (isWoodLog(blockZNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) - && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) expandToChunkZNeg = true; + && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) + expandToChunkZNeg = true; } else if (!(blockZNeg == Blocks.dirt || blockZNeg == Blocks.grass)) { return false; } @@ -250,50 +254,29 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Charcoal Pile Igniter") - .addInfo("Controller for the Charcoal Pit") - .addInfo("Converts Logs into Brittle Charcoal blocks") - .addInfo("Will automatically start when valid") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() + tt.addMachineType("Charcoal Pile Igniter").addInfo("Controller for the Charcoal Pit") + .addInfo("Converts Logs into Brittle Charcoal blocks").addInfo("Will automatically start when valid") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator() .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") - .addStructureInfo("No air between logs allowed") - .toolTipFinisher("Gregtech"); + .addStructureInfo("No air between logs allowed").toolTipFinisher("Gregtech"); return tt; } @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 == 1) { if (aActive) - return new ITexture[] { - casingTexturePages[0][10], - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build() - }; - return new ITexture[] { - casingTexturePages[0][10], - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) - .glow() - .build(), - }; + return new ITexture[] { casingTexturePages[0][10], TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW).glow().build() }; + return new ITexture[] { casingTexturePages[0][10], TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW).glow().build(), }; } - return new ITexture[] {casingTexturePages[0][10]}; + return new ITexture[] { casingTexturePages[0][10] }; } @Override @@ -308,15 +291,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul super.onPostTick(aBaseMetaTileEntity, aTimer); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { - new WorldSpawnedEventBuilder.ParticleEventBuilder() - .setMotion(0D, 0.3D, 0D) + new WorldSpawnedEventBuilder.ParticleEventBuilder().setMotion(0D, 0.3D, 0D) .setIdentifier(ParticleFX.LARGE_SMOKE) .setPosition( aBaseMetaTileEntity.getOffsetX((byte) 1, 1) + XSTR_INSTANCE.nextFloat(), aBaseMetaTileEntity.getOffsetY((byte) 1, 1), aBaseMetaTileEntity.getOffsetZ((byte) 1, 1) + XSTR_INSTANCE.nextFloat()) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setWorld(getBaseMetaTileEntity().getWorld()).run(); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 5e6651cdad..aa082afee0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -4,8 +4,20 @@ import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; import static gregtech.api.enums.GT_Values.debugCleanroom; import static gregtech.api.enums.Textures.BlockIcons.*; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.config.ConfigCategory; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ISecondaryDescribable; @@ -19,18 +31,10 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.config.ConfigCategory; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiBlockBase implements IConstructable, ISecondaryDescribable { + private int mHeight = -1; public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { @@ -49,22 +53,17 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Cleanroom") - .addInfo("Controller block for the Cleanroom") + tt.addMachineType("Cleanroom").addInfo("Controller block for the Cleanroom") .addInfo("Consumes 40 EU/t when first turned on") .addInfo("and 4 EU/t once at 100% efficiency when not overclocked") // ? .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") .addInfo("2 LV batteries + 1 LV generator or 1 MV generator") // ? .addInfo("Time required to reach full efficiency is proportional to") - .addInfo("the height of empty space within") - .addInfo("Make sure your Energy Hatch matches! ?") - .addInfo("Machines that cause pollution aren't allowed to be put in.") - .addSeparator() - .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) - .addController("Top center") + .addInfo("the height of empty space within").addInfo("Make sure your Energy Hatch matches! ?") + .addInfo("Machines that cause pollution aren't allowed to be put in.").addSeparator() + .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true).addController("Top center") .addCasingInfo("Plascrete", 20) - .addStructureInfo( - GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass") // check + .addStructureInfo(GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass") // check .addStructureInfo("Other material can be used in place of Plascrete. See config for detail") // check .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") .addEnergyHatch("Any casing. Exactly one.") // check @@ -72,14 +71,13 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") .addStructureInfo("You can also use Diodes for more power") - .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") - .toolTipFinisher("Gregtech"); + .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit").toolTipFinisher("Gregtech"); return tt; } @Override public String[] getStructureDescription(ItemStack itemStack) { - return new String[] {"The structure in both X and Z axis has to be a square."}; + return new String[] { "The structure in both X and Z axis has to be a square." }; } @Override @@ -195,17 +193,17 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { mPlascreteCount++; } else { - final IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(dX, dY, dZ); if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { // let's not fiddle with bits anymore. if (Math.abs(dZ) < z) // on side parallel to z axis - doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; + doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; else if (Math.abs(dX) < x) // on side parallel to x axis - doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; + doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; // corners ignored } mDoorCount++; @@ -222,8 +220,9 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB mHullCount++; } else { if (debugCleanroom) { - GT_Log.out.println("Cleanroom: Incorrect GT block? " - + tBlock.getUnlocalizedName()); + GT_Log.out.println( + "Cleanroom: Incorrect GT block? " + + tBlock.getUnlocalizedName()); } return false; } @@ -236,9 +235,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB if (config.containsKey(key)) { otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); } else { - if (debugCleanroom) - GT_Log.out.println("Cleanroom: not allowed block " - + tBlock.getUnlocalizedName()); + if (debugCleanroom) GT_Log.out.println( + "Cleanroom: not allowed block " + tBlock.getUnlocalizedName()); return false; } } @@ -250,8 +248,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } } } - if (this.mMaintenanceHatches.size() != 1 - || this.mEnergyHatches.size() != 1 + if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount > 4 || mHullCount > 10) { return false; @@ -289,26 +286,25 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB private void setCallbacks(int x, int y, int z, IGregTechTileEntity aBaseMetaTileEntity) { for (int dX = -x + 1; dX <= x - 1; dX++) - for (int dZ = -z + 1; dZ <= z - 1; dZ++) - for (int dY = -1; dY >= y + 1; dY--) { - TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ); + for (int dZ = -z + 1; dZ <= z - 1; dZ++) for (int dY = -1; dY >= y + 1; dY--) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ); - if (tTileEntity instanceof IGregTechTileEntity) { - IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (iMetaTileEntity instanceof IMachineCallback) - checkAndSetCallback((IMachineCallback) iMetaTileEntity); + if (iMetaTileEntity instanceof IMachineCallback) + checkAndSetCallback((IMachineCallback) iMetaTileEntity); - } else if (tTileEntity instanceof IMachineCallback) - checkAndSetCallback((IMachineCallback) tTileEntity); - } + } else if (tTileEntity instanceof IMachineCallback) + checkAndSetCallback((IMachineCallback) tTileEntity); + } } @SuppressWarnings("unchecked") private void checkAndSetCallback(IMachineCallback iMachineCallback) { - if (debugCleanroom) - GT_Log.out.println("Cleanroom: IMachineCallback detected, checking for cleanroom: " - + (iMachineCallback.getType() == this.getClass())); + if (debugCleanroom) GT_Log.out.println( + "Cleanroom: IMachineCallback detected, checking for cleanroom: " + + (iMachineCallback.getType() == this.getClass())); if (iMachineCallback.getType() == this.getClass()) ((IMachineCallback) iMachineCallback).setCallbackBase(this); } @@ -319,32 +315,18 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } @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.DOWN.ordinal() || aSide == ForgeDirection.UP.ordinal()) { - return new ITexture[] { - TextureFactory.of(BLOCK_PLASCRETE), - aActive - ? TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW) - .glow() - .build()) - : TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_CLEANROOM), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_CLEANROOM_GLOW) - .glow() - .build()) - }; + return new ITexture[] { TextureFactory.of(BLOCK_PLASCRETE), + aActive ? TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW).glow().build()) + : TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM), + TextureFactory.builder().addIcon(OVERLAY_TOP_CLEANROOM_GLOW).glow().build()) }; } - return new ITexture[] {TextureFactory.of(BLOCK_PLASCRETE)}; + return new ITexture[] { TextureFactory.of(BLOCK_PLASCRETE) }; } @Override @@ -381,21 +363,20 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB int y = baseEntity.getYCoord(); int z = baseEntity.getZCoord(); int yoff = Math.max(i * 2, 3); - for (int X = x - i; X <= x + i; X++) - for (int Y = y; Y >= y - yoff; Y--) - for (int Z = z - i; Z <= z + i; Z++) { - if (X == x && Y == y && Z == z) continue; - if (X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) { - if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockReinforced, 2); - else world.setBlock(X, Y, Z, GregTech_API.sBlockReinforced, 2, 2); - } else if (Y == y) { - if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockCasings3, 11); - else world.setBlock(X, Y, Z, GregTech_API.sBlockCasings3, 11, 2); - } - } + for (int X = x - i; X <= x + i; X++) for (int Y = y; Y >= y - yoff; Y--) for (int Z = z - i; Z <= z + i; Z++) { + if (X == x && Y == y && Z == z) continue; + if (X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) { + if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockReinforced, 2); + else world.setBlock(X, Y, Z, GregTech_API.sBlockReinforced, 2, 2); + } else if (Y == y) { + if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockCasings3, 11); + else world.setBlock(X, Y, Z, GregTech_API.sBlockCasings3, 11, 2); + } + } } private static class ConfigEntry { + int percentage; int allowedCount; int meta; @@ -434,20 +415,14 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB for (ConfigCategory cc : cfg.getCategory(category).getChildren()) { final String name = cc.get("Name").getString(); if (cc.containsKey("Count")) { - if (cc.containsKey("Meta")) - config.put( - name + ":" + cc.get("Meta").getInt(), - new ConfigEntry( - 0, cc.get("Count").getInt(), cc.get("Meta").getInt())); + if (cc.containsKey("Meta")) config.put( + name + ":" + cc.get("Meta").getInt(), + new ConfigEntry(0, cc.get("Count").getInt(), cc.get("Meta").getInt())); else config.put(name, new ConfigEntry(0, cc.get("Count").getInt(), wildcard_meta)); } else if (cc.containsKey("Percentage")) { - if (cc.containsKey("Meta")) - config.put( - name + ":" + cc.get("Meta").getInt(), - new ConfigEntry( - cc.get("Percentage").getInt(), - 0, - cc.get("Meta").getInt())); + if (cc.containsKey("Meta")) config.put( + name + ":" + cc.get("Meta").getInt(), + new ConfigEntry(cc.get("Percentage").getInt(), 0, cc.get("Meta").getInt())); else config.put(name, new ConfigEntry(cc.get("Percentage").getInt(), 0, wildcard_meta)); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java index af1468396b..e61cfc0feb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java @@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_ConcreteBackfiller1 extends GT_MetaTileEntity_ConcreteBackfillerBase { + public GT_MetaTileEntity_ConcreteBackfiller1(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java index 05646676e7..c175d73cb1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java @@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_ConcreteBackfillerBase { + public GT_MetaTileEntity_ConcreteBackfiller2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java index de477af9e4..dd2f54455a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java @@ -3,15 +3,18 @@ package gregtech.common.tileentities.machines.multi; import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.enums.GT_Values.VN; +import java.util.List; + +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableList; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; -import java.util.List; -import net.minecraft.item.ItemStack; public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTileEntity_DrillerBase { @@ -29,24 +32,18 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi String casings = getCasingBlockItem().get(0).getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Concrete Backfiller") - .addInfo("Controller Block for the " + aStructureName) + tt.addMachineType("Concrete Backfiller").addInfo("Controller Block for the " + aStructureName) .addInfo("Will fill in areas below it with light concrete. This goes through walls") .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") .addInfo("Will pull back the pipes after it finishes that layer") - .addInfo("Radius is " + getRadius() + " blocks") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addInfo("Radius is " + getRadius() + " blocks").addSeparator().beginStructureBlock(3, 7, 3, false) + .addController("Front bottom").addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1).addMaintenanceHatch("Any base casing", 1) .addInputBus("Mining Pipes, optional, any base casing", 1) .addInputHatch("GT Concrete, any base casing", 1) - .addOutputBus("Mining Pipes, optional, any base casing", 1) - .toolTipFinisher("Gregtech"); + .addOutputBus("Mining Pipes, optional, any base casing", 1).toolTipFinisher("Gregtech"); return tt; } @@ -73,8 +70,8 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi } @Ove