diff options
| author | miozune <miozune@gmail.com> | 2023-05-11 17:44:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-11 10:44:36 +0200 |
| commit | d755802d116daddc62b47679d7f65490c4bdd7d6 (patch) | |
| tree | 9f23082f952b6dfd4be25e497b88129776f15180 /src | |
| parent | 3d3605a1f20bfcf164290b29c7632d3bdca00fe5 (diff) | |
| download | GT5-Unofficial-d755802d116daddc62b47679d7f65490c4bdd7d6.tar.gz GT5-Unofficial-d755802d116daddc62b47679d7f65490c4bdd7d6.tar.bz2 GT5-Unofficial-d755802d116daddc62b47679d7f65490c4bdd7d6.zip | |
spotlessApply (#10)
Diffstat (limited to 'src')
12 files changed, 358 insertions, 364 deletions
diff --git a/src/main/java/net/glease/ggfab/BlockIcons.java b/src/main/java/net/glease/ggfab/BlockIcons.java index 7e1cfe43ef..638b206f44 100644 --- a/src/main/java/net/glease/ggfab/BlockIcons.java +++ b/src/main/java/net/glease/ggfab/BlockIcons.java @@ -1,19 +1,21 @@ package net.glease.ggfab; -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.IIconContainer; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; + public enum BlockIcons implements IIconContainer, Runnable { + OVERLAY_FRONT_ADV_ASSLINE_ACTIVE, OVERLAY_FRONT_ADV_ASSLINE_ACTIVE_GLOW, OVERLAY_FRONT_ADV_ASSLINE_STUCK, OVERLAY_FRONT_ADV_ASSLINE_STUCK_GLOW, OVERLAY_FRONT_ADV_ASSLINE, - OVERLAY_FRONT_ADV_ASSLINE_GLOW, - ; + OVERLAY_FRONT_ADV_ASSLINE_GLOW,; + public static final String RES_PATH = GGConstants.MODID + ":"; private IIcon mIcon; diff --git a/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java b/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java index 6cf35d97a6..088ad86025 100644 --- a/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java +++ b/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java @@ -1,19 +1,21 @@ package net.glease.ggfab; +import static gregtech.api.enums.GT_Values.RA; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -import static gregtech.api.enums.GT_Values.RA; class ComponentRecipeLoader implements Runnable { + @Override public void run() { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null @@ -22,28 +24,20 @@ class ComponentRecipeLoader implements Runnable { RA.addAssemblylineRecipe( ItemList.Machine_Multi_Assemblyline.get(1L), 96000, - new Object[]{ - ItemList.Machine_Multi_Assemblyline.get(1L), - new Object[]{OrePrefixes.circuit.get(Materials.Master), 2}, - new Object[]{OrePrefixes.circuit.get(Materials.Elite), 4}, - new Object[]{OrePrefixes.circuit.get(Materials.Data), 8}, - ItemList.Automation_ChestBuffer_LuV.get(1L), - }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1296), - Materials.Lubricant.getFluid(2000) - }, + new Object[] { ItemList.Machine_Multi_Assemblyline.get(1L), + new Object[] { OrePrefixes.circuit.get(Materials.Master), 2 }, + new Object[] { OrePrefixes.circuit.get(Materials.Elite), 4 }, + new Object[] { OrePrefixes.circuit.get(Materials.Data), 8 }, + ItemList.Automation_ChestBuffer_LuV.get(1L), }, + new FluidStack[] { new FluidStack(solderIndalloy, 1296), Materials.Lubricant.getFluid(2000) }, GGItemList.AdvAssLine.get(1L), 1200, - 6000 - ); - RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Input_Bus_IV.get(1L), - ItemList.Emitter_IV.get(1L), + 6000); + RA.addAssemblerRecipe( + new ItemStack[] { ItemList.Hatch_Input_Bus_IV.get(1L), ItemList.Emitter_IV.get(1L), ItemList.Sensor_IV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Enderium, 1L), - GT_Utility.getIntegratedCircuit(12), - }, + GT_Utility.getIntegratedCircuit(12), }, Materials.Polybenzimidazole.getMolten(144L), GGItemList.LinkedInputBus.get(1L), 600, diff --git a/src/main/java/net/glease/ggfab/ConfigurationHandler.java b/src/main/java/net/glease/ggfab/ConfigurationHandler.java index 812b6cbedc..249bb16da8 100644 --- a/src/main/java/net/glease/ggfab/ConfigurationHandler.java +++ b/src/main/java/net/glease/ggfab/ConfigurationHandler.java @@ -1,13 +1,14 @@ package net.glease.ggfab; +import java.io.File; +import java.util.Map; + import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; -import java.io.File; -import java.util.Map; - public enum ConfigurationHandler { + INSTANCE; private Configuration config; @@ -30,7 +31,13 @@ public enum ConfigurationHandler { } private void loadConfig() { - laserOCPenaltyFactor = config.getFloat("advasslinePenaltyFactor", "common.balancing", 0.3f, 0f, 10f, "Laser overclock penalty factor. This will incredibly change the game balance. Even a small step from 0.2 to 0.3 can have very significant impact. Tweak with caution!"); + laserOCPenaltyFactor = config.getFloat( + "advasslinePenaltyFactor", + "common.balancing", + 0.3f, + 0f, + 10f, + "Laser overclock penalty factor. This will incredibly change the game balance. Even a small step from 0.2 to 0.3 can have very significant impact. Tweak with caution!"); config.save(); } diff --git a/src/main/java/net/glease/ggfab/GGConstants.java b/src/main/java/net/glease/ggfab/GGConstants.java index ef8027bf92..6e8b4a048f 100644 --- a/src/main/java/net/glease/ggfab/GGConstants.java +++ b/src/main/java/net/glease/ggfab/GGConstants.java @@ -3,10 +3,11 @@ package net.glease.ggfab; import net.minecraft.util.EnumChatFormatting; public class GGConstants { + public static final String MODID = "ggfab"; public static final String MODNAME = "GigaGramFab"; public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String GGMARK = EnumChatFormatting.GOLD + "GigaGram" + EnumChatFormatting.RESET + "Fab"; - public static final String GGMARK_TOOLTIP = "Added by "+ GGMARK; + public static final String GGMARK_TOOLTIP = "Added by " + GGMARK; } diff --git a/src/main/java/net/glease/ggfab/GGItemList.java b/src/main/java/net/glease/ggfab/GGItemList.java index b54f5d6406..6363f90983 100644 --- a/src/main/java/net/glease/ggfab/GGItemList.java +++ b/src/main/java/net/glease/ggfab/GGItemList.java @@ -1,19 +1,20 @@ package net.glease.ggfab; +import static gregtech.api.enums.GT_Values.W; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import static gregtech.api.enums.GT_Values.W; +public enum GGItemList implements IItemContainer { -public enum GGItemList implements IItemContainer{ LinkedInputBus, - AdvAssLine, - ; + AdvAssLine,; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/net/glease/ggfab/GigaGramFab.java b/src/main/java/net/glease/ggfab/GigaGramFab.java index b05703ef2e..08f5cc9d2b 100644 --- a/src/main/java/net/glease/ggfab/GigaGramFab.java +++ b/src/main/java/net/glease/ggfab/GigaGramFab.java @@ -1,25 +1,35 @@ package net.glease.ggfab; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.*; -import gregtech.api.GregTech_API; import net.glease.ggfab.mte.MTE_AdvAssLine; import net.glease.ggfab.mte.MTE_LinkedInputBus; import net.glease.ggfab.nei.IMCForNEI; -@Mod(modid = GGConstants.MODID, version = GGConstants.VERSION, name = GGConstants.MODNAME, acceptedMinecraftVersions = "[1.7.10]", dependencies = "required-after:IC2;required-before:gregtech") +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.*; +import gregtech.api.GregTech_API; + +@Mod( + modid = GGConstants.MODID, + version = GGConstants.VERSION, + name = GGConstants.MODNAME, + acceptedMinecraftVersions = "[1.7.10]", + dependencies = "required-after:IC2;required-before:gregtech") public class GigaGramFab { + public GigaGramFab() { // initialize the textures - //noinspection ResultOfMethodCallIgnored + // noinspection ResultOfMethodCallIgnored BlockIcons.OVERLAY_FRONT_ADV_ASSLINE.name(); } @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { GregTech_API.sAfterGTPreload.add(() -> { - GGItemList.AdvAssLine.set(new MTE_AdvAssLine(13532, "ggfab.machine.adv_assline", "Advanced Assembly Line").getStackForm(1)); - GGItemList.LinkedInputBus.set(new MTE_LinkedInputBus(13533, "ggfab.machine.linked_input_bus", "Linked Input Bus", 5).getStackForm(1)); + GGItemList.AdvAssLine.set( + new MTE_AdvAssLine(13532, "ggfab.machine.adv_assline", "Advanced Assembly Line").getStackForm(1)); + GGItemList.LinkedInputBus.set( + new MTE_LinkedInputBus(13533, "ggfab.machine.linked_input_bus", "Linked Input Bus", 5) + .getStackForm(1)); }); GregTech_API.sBeforeGTPostload.add(new ComponentRecipeLoader()); ConfigurationHandler.INSTANCE.init(event.getSuggestedConfigurationFile()); @@ -31,7 +41,6 @@ public class GigaGramFab { } @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) { - } + public void postInit(FMLPostInitializationEvent event) {} -}
\ No newline at end of file +} diff --git a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java index 1fa00f6532..c4eafa7fad 100644 --- a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java +++ b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java @@ -1,21 +1,17 @@ package net.glease.ggfab.mte; -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; -import gregtech.api.interfaces.IHatchElement; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.*; -import mcp.mobius.waila.api.IWailaConfigHandler; -import mcp.mobius.waila.api.IWailaDataAccessor; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static net.glease.ggfab.BlockIcons.*; + +import java.util.*; +import java.util.stream.IntStream; + import net.glease.ggfab.ConfigurationHandler; import net.glease.ggfab.GGConstants; import net.glease.ggfab.util.OverclockHelper; @@ -33,92 +29,87 @@ import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.*; -import java.util.stream.IntStream; +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 static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.GT_Mod.GT_FML_LOGGER; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static net.glease.ggfab.BlockIcons.*; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.interfaces.IHatchElement; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.*; +import mcp.mobius.waila.api.IWailaConfigHandler; +import mcp.mobius.waila.api.IWailaDataAccessor; /* -Dev note: -1. This multi will be an assline but with greater throughput. it will take one input every -2. + * Dev note: 1. This multi will be an assline but with greater throughput. it will take one input every 2. */ -public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<MTE_AdvAssLine> implements ISurvivalConstructable { +public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<MTE_AdvAssLine> + implements ISurvivalConstructable { + private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_LATER = "later"; private static final String STRUCTURE_PIECE_LAST = "last"; public static final String TAG_KEY_CURRENT_STICK = "mCurrentStick"; public static final String TAG_KEY_PROGRESS_TIMES = "mProgressTimeArray"; - private static final IStructureDefinition<MTE_AdvAssLine> STRUCTURE_DEFINITION = - StructureDefinition.<MTE_AdvAssLine>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.or(ExoticEnergy).newAny(16, 1, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH), - ofBlock(GregTech_API.sBlockCasings2, 0))) - .addElement( - 'd', - buildHatchAdder(MTE_AdvAssLine.class) - .atLeast(DataHatchElement.DataAccess) - .dot(2) - .casingIndex(42) - .allowOnly(ForgeDirection.NORTH) - .buildAndChain(GregTech_API.sBlockCasings3, 10)) - .addElement( - 'b', - buildHatchAdder(MTE_AdvAssLine.class) - .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) - .casingIndex(16) - .dot(3) - .allowOnly(ForgeDirection.DOWN) - .buildAndChain( - ofBlock(GregTech_API.sBlockCasings2, 0), - ofHatchAdder( - MTE_AdvAssLine::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<MTE_AdvAssLine> STRUCTURE_DEFINITION = StructureDefinition + .<MTE_AdvAssLine>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.or(ExoticEnergy) + .newAny(16, 1, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH), + ofBlock(GregTech_API.sBlockCasings2, 0))) + .addElement( + 'd', + buildHatchAdder(MTE_AdvAssLine.class).atLeast(DataHatchElement.DataAccess).dot(2).casingIndex(42) + .allowOnly(ForgeDirection.NORTH).buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement( + 'b', + buildHatchAdder(MTE_AdvAssLine.class) + .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance).casingIndex(16).dot(3) + .allowOnly(ForgeDirection.DOWN).buildAndChain( + ofBlock(GregTech_API.sBlockCasings2, 0), ofHatchAdder(MTE_AdvAssLine::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(MTE_AdvAssLine::addOutputToMachineList, 16, 4))) + .addElement('i', InputBus.newAny(16, 5, ForgeDirection.DOWN)) + .addElement('o', OutputBus.newAny(16, 4, ForgeDirection.DOWN)).build(); private ItemStack currentStick; private GT_Recipe.GT_Recipe_AssemblyLine currentRecipe; private final Slice[] slices = IntStream.range(0, 16).mapToObj(Slice::new).toArray(Slice[]::new); @@ -164,7 +155,8 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas for (int i = 1; i < 16; i++) { if (!checkPiece(STRUCTURE_PIECE_LATER, leftToRight ? -i : i, 1, 0)) return false; if (!mOutputBusses.isEmpty()) - return (!mEnergyHatches.isEmpty() || !mExoticEnergyHatches.isEmpty()) && mMaintenanceHatches.size() == 1 && mDataAccessHatches.size() <= 1; + return (!mEnergyHatches.isEmpty() || !mExoticEnergyHatches.isEmpty()) && mMaintenanceHatches.size() == 1 + && mDataAccessHatches.size() <= 1; } return false; } @@ -197,13 +189,11 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas // blockrenderer6343 seems to place the block in a weird way, let's catch that if (getBaseMetaTileEntity() != null && getBaseMetaTileEntity().isServerSide()) { UUID ownerUuid = getBaseMetaTileEntity().getOwnerUuid(); - if (ownerUuid == null) - return; + if (ownerUuid == null) return; float factor = ConfigurationHandler.INSTANCE.getLaserOCPenaltyFactor(); MinecraftServer server = MinecraftServer.getServer(); // more blockrenderer6343 weirdness - if (server == null) - return; + if (server == null) return; @SuppressWarnings("unchecked") List<EntityPlayerMP> l = server.getConfigurationManager().playerEntityList; for (EntityPlayerMP p : l) { @@ -213,10 +203,12 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas Object[] args; switch (i) { case 7: - args = new Object[]{factor}; + args = new Object[] { factor }; break; case 8: - args = new Object[]{(int) (factor * 100) + 400, (int) ((4 + factor) * (4 + factor + factor) * 100), 4 + factor, 4 + factor + factor}; + args = new Object[] { (int) (factor * 100) + 400, + (int) ((4 + factor) * (4 + factor + factor) * 100), 4 + factor, + 4 + factor + factor }; break; default: args = new Object[0]; @@ -229,63 +221,35 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, int colorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (stuck) { - return new ITexture[]{ - casingTexturePages[0][16], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ADV_ASSLINE_STUCK) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ADV_ASSLINE_STUCK_GLOW) - .extFacing() - .glow() - .build() - }; + return new ITexture[] { casingTexturePages[0][16], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ADV_ASSLINE_STUCK).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ADV_ASSLINE_STUCK_GLOW).extFacing().glow() + .build() }; } - if (aActive) - return new ITexture[]{ - casingTexturePages[0][16], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ADV_ASSLINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ADV_ASSLINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - }; - return new ITexture[]{ - casingTexturePages[0][16], - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ADV_ASSLINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ADV_ASSLINE_GLOW) - .extFacing() - .glow() - .build() - }; - } - return new ITexture[]{casingTexturePages[0][16]}; + if (aActive) return new ITexture[] { casingTexturePages[0][16], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ADV_ASSLINE_ACTIVE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ADV_ASSLINE_ACTIVE_GLOW).extFacing().glow() + .build() }; + return new ITexture[] { casingTexturePages[0][16], + TextureFactory.builder().addIcon(OVERLAY_FRONT_ADV_ASSLINE).extFacing().build(), + TextureFactory.builder().addIcon(OVERLAY_FRONT_ADV_ASSLINE_GLOW).extFacing().glow().build() }; + } + return new ITexture[] { casingTexturePages[0][16] }; } @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 Advanced Assembling Line") + tt.addMachineType("Assembling Line").addInfo("Controller block for the Advanced Assembling Line") .addInfo("Built exactly the same as standard Assembling Line") .addInfo("Place in world to get more info. It will be a lengthy read.") - .addInfo("Assembling Line with item pipelining") - .addInfo("All fluids are however consumed at start") + .addInfo("Assembling Line with item pipelining").addInfo("All fluids are however consumed at start") .addInfo("Use voltage of worst energy hatch for overclocking") - .addInfo("EU/t is (number of slices working) * (overclocked EU/t)") - .addSeparator() + .addInfo("EU/t is (number of slices working) * (overclocked EU/t)").addSeparator() .beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false) .addStructureInfo("From Bottom to Top, Left to Right") .addStructureInfo( @@ -295,10 +259,8 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas .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) @@ -332,7 +294,9 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas if (getBaseMetaTileEntity().isActive() && GT_Utility.isStackValid(currentStick)) { aNBT.setTag(TAG_KEY_CURRENT_STICK, currentStick.writeToNBT(new NBTTagCompound())); aNBT.setInteger("mRecipeHash", currentRecipe.getPersistentHash()); - aNBT.setIntArray(TAG_KEY_PROGRESS_TIMES, Arrays.stream(slices).limit(currentRecipe.mInputs.length).mapToInt(s -> s.progress).toArray()); + aNBT.setIntArray( + TAG_KEY_PROGRESS_TIMES, + Arrays.stream(slices).limit(currentRecipe.mInputs.length).mapToInt(s -> s.progress).toArray()); aNBT.setBoolean("stuck", stuck); aNBT.setLong("inputV", inputVoltage); aNBT.setLong("inputEU", inputEUt); @@ -353,13 +317,13 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas if (arr[i] == 0) // this will be synced to client by first MTE packet to client stuck = true; - } else - slices[i].reset(); + } else slices[i].reset(); } } if (aNBT.hasKey(TAG_KEY_CURRENT_STICK, Constants.NBT.TAG_COMPOUND)) { loadedStack = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag(TAG_KEY_CURRENT_STICK)); - GT_AssemblyLineUtils.LookupResult lookupResult = GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(loadedStack, false); + GT_AssemblyLineUtils.LookupResult lookupResult = GT_AssemblyLineUtils + .findAssemblyLineRecipeFromDataStick(loadedStack, false); switch (lookupResult.getType()) { case VALID_STACK_AND_VALID_HASH: recipe = lookupResult.getRecipe(); @@ -417,12 +381,10 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas } private void recordEnergySupplier(GT_MetaTileEntity_Hatch hatch) { - if (!isValidMetaTileEntity(hatch)) - return; + if (!isValidMetaTileEntity(hatch)) return; inputEUt += hatch.maxEUInput() * hatch.maxWorkingAmperesIn(); inputVoltage = Math.min(inputVoltage, hatch.maxEUInput()); - if (inputEUt < 0) - inputEUt = Long.MAX_VALUE; + if (inputEUt < 0) inputEUt = Long.MAX_VALUE; } @Override @@ -435,8 +397,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas @Override protected void endRecipeProcessing() { - if (!processing) - return; + if (!processing) return; super.endRecipeProcessing(); processing = false; } @@ -445,8 +406,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas public void onValueUpdate(byte aValue) { boolean oStuck = stuck; stuck = (aValue & 1) == 1; - if (oStuck != stuck) - getBaseMetaTileEntity().issueTextureUpdate(); + if (oStuck != stuck) getBaseMetaTileEntity().issueTextureUpdate(); } @Override @@ -488,8 +448,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas mProgresstime = (slice.id + 1) * (mMaxProgresstime / currentRecipe.mInputs.length) - slice.progress; } } - if (slice.progress > 0) - working++; + if (slice.progress > 0) working++; } lEUt = working * baseEUt; @@ -503,11 +462,9 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas } } } else { - if (!super.onRunningTick(aStack)) - return false; + if (!super.onRunningTick(aStack)) return false; } - if (getBaseMetaTileEntity().isAllowedToWork()) { if (hasAllFluids(currentRecipe) && slices[0].start()) { drainAllFluids(currentRecipe); @@ -520,8 +477,8 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas } private GT_Recipe.GT_Recipe_AssemblyLine findRecipe(ItemStack tDataStick) { - 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) return null; @@ -541,8 +498,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas // Check Inputs align int aItemCount = tRecipe.mInputs.length; - if (mInputBusses.size() < aItemCount) - return null; + if (mInputBusses.size() < aItemCount) return null; for (int i = 0; i < aItemCount; i++) { GT_MetaTileEntity_Hatch_InputBus tInputBus = mInputBusses.get(i); if (tInputBus == null) { @@ -558,8 +514,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas } // Check Fluid Inputs align - if (!hasAllFluids(tRecipe)) - return null; + if (!hasAllFluids(tRecipe)) return null; if (GT_Values.D1) { GT_FML_LOGGER.info("Check overclock"); @@ -572,8 +527,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas private boolean hasAllFluids(GT_Recipe.GT_Recipe_AssemblyLine tRecipe) { int aFluidCount = tRecipe.mFluidInputs.length; - if (mInputHatches.size() < aFluidCount) - return false; |
