From 6f31720697bcc351421a4d86ba3bf749375dd12c Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 27 Aug 2022 10:19:57 +0100 Subject: Update buildscript & apply spotless (#1306) * Update dependencies * Update buildscript, apply spotless --- .../GT_MetaTileEntity_AbstractMultiFurnace.java | 11 +- .../multi/GT_MetaTileEntity_AssemblyLine.java | 275 +++-- .../GT_MetaTileEntity_BrickedBlastFurnace.java | 23 +- .../GT_MetaTileEntity_BronzeBlastFurnace.java | 27 +- .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 112 +- .../multi/GT_MetaTileEntity_Cleanroom.java | 268 ++--- .../GT_MetaTileEntity_ConcreteBackfillerBase.java | 70 +- .../multi/GT_MetaTileEntity_DieselEngine.java | 224 ++-- .../multi/GT_MetaTileEntity_DistillationTower.java | 245 ++-- .../multi/GT_MetaTileEntity_DrillerBase.java | 284 +++-- .../GT_MetaTileEntity_ElectricBlastFurnace.java | 286 ++--- .../GT_MetaTileEntity_ExtremeDieselEngine.java | 123 +- .../multi/GT_MetaTileEntity_FusionComputer.java | 244 ++-- .../multi/GT_MetaTileEntity_FusionComputer1.java | 13 +- .../multi/GT_MetaTileEntity_FusionComputer2.java | 12 +- .../multi/GT_MetaTileEntity_FusionComputer3.java | 13 +- .../multi/GT_MetaTileEntity_HeatExchanger.java | 179 +-- .../GT_MetaTileEntity_ImplosionCompressor.java | 101 +- .../GT_MetaTileEntity_IntegratedOreFactory.java | 272 +++-- .../multi/GT_MetaTileEntity_LargeBoiler.java | 262 +++-- .../GT_MetaTileEntity_LargeBoiler_Bronze.java | 9 +- .../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 13 +- .../GT_MetaTileEntity_LargeBoiler_Titanium.java | 18 +- ...T_MetaTileEntity_LargeBoiler_TungstenSteel.java | 14 +- .../GT_MetaTileEntity_LargeChemicalReactor.java | 175 +-- .../multi/GT_MetaTileEntity_LargeTurbine.java | 242 ++-- .../multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 77 +- ...GT_MetaTileEntity_LargeTurbine_GasAdvanced.java | 106 +- .../GT_MetaTileEntity_LargeTurbine_HPSteam.java | 90 +- .../GT_MetaTileEntity_LargeTurbine_Plasma.java | 207 ++-- .../GT_MetaTileEntity_LargeTurbine_Steam.java | 108 +- .../multi/GT_MetaTileEntity_MultiFurnace.java | 219 ++-- .../multi/GT_MetaTileEntity_OilCracker.java | 229 ++-- .../multi/GT_MetaTileEntity_OilDrillBase.java | 219 ++-- .../multi/GT_MetaTileEntity_OilDrillInfinite.java | 12 +- .../multi/GT_MetaTileEntity_OreDrillingPlant1.java | 4 +- .../multi/GT_MetaTileEntity_OreDrillingPlant2.java | 4 +- .../multi/GT_MetaTileEntity_OreDrillingPlant3.java | 4 +- .../multi/GT_MetaTileEntity_OreDrillingPlant4.java | 4 +- .../GT_MetaTileEntity_OreDrillingPlantBase.java | 200 ++-- .../multi/GT_MetaTileEntity_PlasmaForge.java | 1192 +++++++++++++++++--- .../GT_MetaTileEntity_PrimitiveBlastFurnace.java | 143 +-- .../multi/GT_MetaTileEntity_ProcessingArray.java | 233 ++-- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 169 +-- .../multi/GT_MetaTileEntity_VacuumFreezer.java | 73 +- 45 files changed, 4370 insertions(+), 2438 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 af6afbc4c4..3dde1feb83 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 @@ -5,7 +5,8 @@ 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 { +public abstract class GT_MetaTileEntity_AbstractMultiFurnace> + extends GT_MetaTileEntity_EnhancedMultiBlockBase { private HeatingCoilLevel mCoilLevel; @@ -23,10 +24,10 @@ public abstract class GT_MetaTileEntity_AbstractMultiFurnace 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("bartworks", "BW_GlasBlocks", 0, true), - ofBlockUnlocalizedName("Thaumcraft", "blockCosmeticOpaque", 2, false), //warded glass - ofBlockUnlocalizedName("IC2", "blockAlloyGlass", 0, true)) - ) - .addElement('e', ofChain( - Energy.newAny(16, 1), - ofBlock(GregTech_API.sBlockCasings2, 0) - )) - .addElement('d', ofChain( - DataHatchElement.DataAccess.newAny(42, 2), - ofBlock(GregTech_API.sBlockCasings3, 10) - )) - .addElement('b', buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) - .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) - .casingIndex(16).dot(3) - .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), - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4) - )) - .addElement('i', InputBus.newAny(16, 5)) - .addElement('o', OutputBus.newAny(16, 4)) - .build(); + 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("bartworks", "BW_GlasBlocks", 0, true), + ofBlockUnlocalizedName( + "Thaumcraft", "blockCosmeticOpaque", 2, false), // warded glass + ofBlockUnlocalizedName("IC2", "blockAlloyGlass", 0, true))) + .addElement('e', ofChain(Energy.newAny(16, 1), ofBlock(GregTech_API.sBlockCasings2, 0))) + .addElement( + 'd', + ofChain( + DataHatchElement.DataAccess.newAny(42, 2), + ofBlock(GregTech_API.sBlockCasings3, 10))) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) + .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) + .casingIndex(16) + .dot(3) + .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), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) + .addElement('i', InputBus.newAny(16, 5)) + .addElement('o', OutputBus.newAny(16, 4)) + .build(); public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -118,48 +122,72 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu 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)//? - .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") - .addStructureInfo("Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") - .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) - .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) - .toolTipFinisher("Gregtech"); + .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") + .addStructureInfo( + "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") + .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) + .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) + .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 == aFacing) { if (aActive) - return new ITexture[]{ + 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[]{ + 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()}; + 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 public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); } @Override @@ -192,13 +220,14 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu nextDataStick: for (ItemStack tDataStick : tDataStickList) { - GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick, false); + GT_AssemblyLineUtils.LookupResult tLookupResult = + GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick, false); - if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) - continue; + if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) continue; GT_Recipe_AssemblyLine tRecipe = tLookupResult.getRecipe(); - // Check if the recipe on the data stick is the current recipe for it's given output, if not we update it and continue to next. + // Check if the recipe on the data stick is the current recipe for it's given output, if not we update it + // and continue to next. if (tLookupResult.getType() != GT_AssemblyLineUtils.LookupResultType.VALID_STACK_AND_VALID_HASH) { tRecipe = GT_AssemblyLineUtils.processDataStick(tDataStick); if (tRecipe == null) { @@ -235,18 +264,21 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu for (int i = 0; i < aFluidCount; i++) { if (mInputHatches.get(i) == null) { continue nextDataStick; - }else { + } else { if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) { - 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) { + 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) { continue nextDataStick; } tFluids[i] = tRecipe.mFluidInputs[i].amount; tFluidSlot[i] = tMultiHatch.getFluidSlot(tRecipe.mFluidInputs[i]); - } - else { + } else { FluidStack fluidInHatch = mInputHatches.get(i).mFluid; - if (!GT_Utility.areFluidsEqual(fluidInHatch, tRecipe.mFluidInputs[i], true) || fluidInHatch.amount < tRecipe.mFluidInputs[i].amount) { + if (!GT_Utility.areFluidsEqual(fluidInHatch, tRecipe.mFluidInputs[i], true) + || fluidInHatch.amount < tRecipe.mFluidInputs[i].amount) { continue nextDataStick; } tFluids[i] = tRecipe.mFluidInputs[i].amount; @@ -261,7 +293,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu GT_FML_LOGGER.info("Check overclock"); } calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) { if (GT_Values.D1) { GT_FML_LOGGER.info("Recipe too OP"); @@ -271,7 +303,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu if (GT_Values.D1) { GT_FML_LOGGER.info("Find available recipe"); } - mOutputItems = new ItemStack[]{tRecipe.mOutput}; + mOutputItems = new ItemStack[] {tRecipe.mOutput}; foundRecipe = true; break; } @@ -281,7 +313,6 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu return false; } - if (GT_Values.D1) { GT_FML_LOGGER.info("All checked start consuming inputs"); } @@ -292,7 +323,8 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu 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]); @@ -318,12 +350,10 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu } private static int isStackValidIngredient(ItemStack aSlotStack, ItemStack aIngredient, ItemStack[] alts) { - if (alts == null || alts.length == 0) - return isStackValidIngredient(aSlotStack, aIngredient); + if (alts == null || alts.length == 0) return isStackValidIngredient(aSlotStack, aIngredient); for (ItemStack tAltStack : alts) { int i = isStackValidIngredient(aSlotStack, tAltStack); - if (i >= 0) - return i; + if (i >= 0) return i; } return -1; } @@ -358,15 +388,13 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mDataAccessHatches.clear(); - if (!checkPiece(STRUCTURE_PIECE_FIRST, 0, 1, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_FIRST, 0, 1, 0)) return false; return checkMachine(true) || checkMachine(false); } private boolean checkMachine(boolean leftToRight) { for (int i = 1; i < 16; i++) { - if (!checkPiece(STRUCTURE_PIECE_LATER, leftToRight ? -i : i, 1, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_LATER, leftToRight ? -i : i, 1, 0)) return false; if (!mOutputBusses.isEmpty()) return !mEnergyHatches.isEmpty() && mMaintenanceHatches.size() == 1 && mDataAccessHatches.size() <= 1; } @@ -394,7 +422,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu if (isValidMetaTileEntity(tHatch)) { for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null - && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) + && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); } } @@ -440,14 +468,17 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; - int build = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 1, 0, elementBudget, source, actor, false, true); + int build = survivialBuildPiece( + STRUCTURE_PIECE_FIRST, stackSize, 0, 1, 0, elementBudget, source, actor, false, true); if (build >= 0) return build; int tLength = Math.min(stackSize.stackSize + 1, 16); for (int i = 1; i < tLength - 1; i++) { - build = survivialBuildPiece(STRUCTURE_PIECE_LATER, stackSize, -i, 1, 0, elementBudget, source, actor, false, true); + build = survivialBuildPiece( + STRUCTURE_PIECE_LATER, stackSize, -i, 1, 0, elementBudget, source, actor, false, true); if (build >= 0) return build; } - return survivialBuildPiece(STRUCTURE_PIECE_LAST, stackSize, 1 - tLength, 1, 0, elementBudget, source, actor, false); + return survivialBuildPiece( + STRUCTURE_PIECE_LAST, stackSize, 1 - tLength, 1, 0, elementBudget, source, actor, false); } private enum DataHatchElement implements IHatchElement { 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 e55837ab2d..adf09ad6db 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 @@ -13,12 +13,18 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.block.Block; import org.lwjgl.input.Keyboard; -public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace implements ISecondaryDescribable { +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_FRONT = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE)}; + private static final ITexture[] FACING_FRONT = { + 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() }; public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) { @@ -66,7 +72,13 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri } @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; } @@ -93,4 +105,3 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri return "Bricked Blast Furnace"; } } - 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 93b36d376c..9bccfa3376 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 @@ -1,5 +1,10 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -7,17 +12,15 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.render.TextureFactory; import net.minecraft.block.Block; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS; - 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() + TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW) + .glow() + .build() }; public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { @@ -30,11 +33,17 @@ 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 5f6a34832e..8a2f969b18 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 @@ -1,9 +1,16 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +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.OrePrefixes; +import gregtech.api.enums.ParticleFX; import gregtech.api.interfaces.ISecondaryDescribable; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -14,6 +21,7 @@ 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; @@ -22,17 +30,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; - -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; - -import static gregtech.api.objects.XSTR.XSTR_INSTANCE; - -public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase implements ISecondaryDescribable { +public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase + implements ISecondaryDescribable { private boolean running = false; @@ -80,7 +79,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul mEfficiencyIncrease = 10000; mMaxProgresstime = Math.max(1, mMaxProgresstime); - //adds all the pollution at once when the recipe starts + // adds all the pollution at once when the recipe starts GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime * getPollutionPerTick(null)); return true; } else { @@ -108,8 +107,18 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul } if (running) { for (ChunkPosition tPos : tList1) { - 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); + 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); } running = false; return false; @@ -122,14 +131,16 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul private boolean isWoodLog(Block log, int meta) { for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { - if (OreDictionary.getOreName(id).equals("logWood")) - return true; + 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)) && (log.getMaterial() == Material.wood); + 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; @@ -139,48 +150,50 @@ 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; + if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) + && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) expandToChunkXPos = true; } else if (!(blockXPos == Blocks.dirt || blockXPos == Blocks.grass)) { return false; } 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; + if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) + && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) expandToChunkXNeg = true; } else if (!(blockXNeg == Blocks.dirt || blockXNeg == Blocks.grass)) { return false; } 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 || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { + 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 + || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { 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; + if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) + && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) expandToChunkYNeg = true; } else if (blockYNeg != Blocks.brick_block) { return false; } 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; + if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) + && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) expandToChunkZPos = true; } else if (!(blockZPos == Blocks.dirt || blockZPos == Blocks.grass)) { return false; } 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; + if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) + && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) expandToChunkZNeg = true; } else if (!(blockZNeg == Blocks.dirt || blockZNeg == Blocks.grass)) { return false; } @@ -254,19 +267,33 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul } @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[]{ + 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(), + 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 @@ -282,13 +309,12 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { new WorldSpawnedEventBuilder.ParticleEventBuilder() - .setMotion(0D,0.3D,0D) + .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() - ) + aBaseMetaTileEntity.getOffsetZ((byte) 1, 1) + XSTR_INSTANCE.nextFloat()) .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 6b167654b4..ae935a06bb 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 @@ -1,5 +1,8 @@ package gregtech.common.tileentities.machines.multi; +import static gregtech.api.enums.GT_Values.debugCleanroom; +import static gregtech.api.enums.Textures.BlockIcons.*; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import gregtech.api.GregTech_API; @@ -16,6 +19,8 @@ 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.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -25,13 +30,8 @@ import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.util.ForgeDirection; -import java.util.HashMap; -import java.util.Map; - -import static gregtech.api.enums.GT_Values.debugCleanroom; -import static gregtech.api.enums.Textures.BlockIcons.*; - -public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiBlockBase implements IConstructable, ISecondaryDescribable { +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) { @@ -50,35 +50,36 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB 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") - .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") - .addCasingInfo("Plascrete", 20) - .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 - .addMaintenanceHatch("Any casing") - .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"); + .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") + .addCasingInfo("Plascrete", 20) + .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 + .addMaintenanceHatch("Any casing") + .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"); 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 @@ -86,7 +87,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB mEfficiencyIncrease = 100; // use the standard overclock mechanism to determine duration and estimate a maximum consumption calculateOverclockedNessMulti(40, 45 * Math.max(1, mHeight - 1), 1, getMaxInputVoltage()); - // negate it to trigger the special energy consumption function. divide by 10 to get the actual final consumption. + // negate it to trigger the special energy consumption function. divide by 10 to get the actual final + // consumption. mEUt /= -10; return true; } @@ -109,9 +111,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB this.mUpdate = 100; if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Checking machine" - ); + GT_Log.out.println("Cleanroom: Checking machine"); } for (int i = 1; i < 8; i++) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); @@ -143,7 +143,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } } } - //detect room square for filters + // detect room square for filters for (int i = -x + 1; i < x; i++) { for (int j = -z + 1; j < z; j++) { if (i == 0 && j == 0) continue; @@ -165,9 +165,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } if (y > -2) { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Room not tall enough?" - ); + GT_Log.out.println("Cleanroom: Room not tall enough?"); } return false; } @@ -177,22 +175,19 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB if (dX == -x || dX == x || dY == 0 || dY == y || dZ == -z || dZ == z) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); - if (dY == 0) { // TOP - if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border + if (dY == 0) { // TOP + if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Non reinforced block on top edge? tMeta != 2" - ); + GT_Log.out.println("Cleanroom: Non reinforced block on top edge? tMeta != 2"); } return false; } - } else if (dX != 0 || dZ != 0) { // Top Inner exclude center + } else if (dX != 0 || dZ != 0) { // Top Inner exclude center if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { if (debugCleanroom) { GT_Log.out.println( - "Cleanroom: Non reinforced block on top face interior? tMeta != 11" - ); + "Cleanroom: Non reinforced block on top face interior? tMeta != 11"); } return false; } @@ -200,15 +195,17 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { mPlascreteCount++; } else { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { + 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++; @@ -217,37 +214,31 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Missing block? Not a aMetaTileEntity" - ); + GT_Log.out.println("Cleanroom: Missing block? Not a aMetaTileEntity"); } return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { mHullCount++; - } - else { + } 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; } - } - else { - String key = tBlock.getUnlocalizedName() + ":"+ tMeta; + } else { + String key = tBlock.getUnlocalizedName() + ":" + tMeta; if (config.containsKey(key)) { // check with meta first otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); - } - else { + } else { key = tBlock.getUnlocalizedName(); if (config.containsKey(key)) { otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); - } - else { + } else { if (debugCleanroom) - GT_Log.out.println("Cleanroom: not allowed block " + tBlock.getUnlocalizedName()); + GT_Log.out.println("Cleanroom: not allowed block " + + tBlock.getUnlocalizedName()); return false; } } @@ -259,19 +250,19 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } } } - if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount > 2 || mHullCount > 10) { + if (this.mMaintenanceHatches.size() != 1 + || this.mEnergyHatches.size() != 1 + || mDoorCount > 2 + || mHullCount > 10) { return false; } - if (mPlascreteCount < 20) - return false; + if (mPlascreteCount < 20) return false; float ratio = (((float) mPlascreteCount) / 100f); for (Map.Entry e : otherBlocks.entrySet()) { ConfigEntry ce = config.get(e.getKey()); if (ce.allowedCount > 0) { // count has priority - if (e.getValue() > ce.allowedCount) - return false; - } else if (e.getValue() > ratio * ce.percentage) - return false; + if (e.getValue() > ce.allowedCount) return false; + } else if (e.getValue() > ratio * ce.percentage) return false;