diff options
| author | Raven Szewczyk <git@eigenraven.me> | 2024-05-23 17:41:55 +0100 |
|---|---|---|
| committer | Raven Szewczyk <git@eigenraven.me> | 2024-05-23 17:41:55 +0100 |
| commit | dc9f68ad0ab8ce378a1680da0d59510de1f7236c (patch) | |
| tree | a8ff3976cef19443247f200fd69451884e79bf67 | |
| parent | 0cce27d780a9fa7afc2e7673c5ba590eaa27ead9 (diff) | |
| download | GT5-Unofficial-dc9f68ad0ab8ce378a1680da0d59510de1f7236c.tar.gz GT5-Unofficial-dc9f68ad0ab8ce378a1680da0d59510de1f7236c.tar.bz2 GT5-Unofficial-dc9f68ad0ab8ce378a1680da0d59510de1f7236c.zip | |
Spotless
13 files changed, 465 insertions, 375 deletions
diff --git a/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java b/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java index 088ad86025..916fa92a50 100644 --- a/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java +++ b/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java @@ -19,28 +19,27 @@ class ComponentRecipeLoader implements Runnable { @Override public void run() { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null - ? FluidRegistry.getFluid("molten.indalloy140") - : FluidRegistry.getFluid("molten.solderingalloy"); + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); 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) }, - GGItemList.AdvAssLine.get(1L), - 1200, - 6000); + 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) }, + GGItemList.AdvAssLine.get(1L), + 1200, + 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), }, - Materials.Polybenzimidazole.getMolten(144L), - GGItemList.LinkedInputBus.get(1L), - 600, - (int) GT_Values.VP[5]); + 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), }, + Materials.Polybenzimidazole.getMolten(144L), + GGItemList.LinkedInputBus.get(1L), + 600, + (int) GT_Values.VP[5]); } } diff --git a/src/main/java/net/glease/ggfab/ConfigurationHandler.java b/src/main/java/net/glease/ggfab/ConfigurationHandler.java index 249bb16da8..5364b00941 100644 --- a/src/main/java/net/glease/ggfab/ConfigurationHandler.java +++ b/src/main/java/net/glease/ggfab/ConfigurationHandler.java @@ -25,19 +25,20 @@ public enum ConfigurationHandler { ConfigCategory category = config.getCategory(categoryName); category.setLanguageKey("ggfab.config." + categoryName); for (Map.Entry<String, Property> entry : category.entrySet()) { - entry.getValue().setLanguageKey(String.format("%s.%s", category.getLanguagekey(), entry.getKey())); + entry.getValue() + .setLanguageKey(String.format("%s.%s", category.getLanguagekey(), entry.getKey())); } } } 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!"); + "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 5a07a3f6c2..8547dfc857 100644 --- a/src/main/java/net/glease/ggfab/GGConstants.java +++ b/src/main/java/net/glease/ggfab/GGConstants.java @@ -1,8 +1,9 @@ package net.glease.ggfab; -import gregtech.GT_Version; import net.minecraft.util.EnumChatFormatting; +import gregtech.GT_Version; + public class GGConstants { public static final String MODID = "ggfab"; diff --git a/src/main/java/net/glease/ggfab/GigaGramFab.java b/src/main/java/net/glease/ggfab/GigaGramFab.java index 52fd51a13a..e03c1eacc5 100644 --- a/src/main/java/net/glease/ggfab/GigaGramFab.java +++ b/src/main/java/net/glease/ggfab/GigaGramFab.java @@ -23,11 +23,11 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.util.GT_ProcessingArray_Manager; @Mod( - modid = GGConstants.MODID, - version = GGConstants.VERSION, - name = GGConstants.MODNAME, - acceptedMinecraftVersions = "[1.7.10]", - dependencies = "required-after:IC2;required-before:gregtech") + 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() { @@ -39,80 +39,79 @@ public class GigaGramFab { @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.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)); + new MTE_LinkedInputBus(13533, "ggfab.machine.linked_input_bus", "Linked Input Bus", 5).getStackForm(1)); GGItemList.ToolCast_MV.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 13534, - "ggfab.toolcast.tier.mv", - "Basic Tool Casting Machine", - 2, - "Cheap Crafting Tool for you!", - toolCastRecipes, - 1, - 4, - 32000, - SoundResource.NONE, - GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS, - "TOOL_CAST", - new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'P', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', - ItemList.Shape_Empty.get(1L) }).getStackForm(1L)); + new GT_MetaTileEntity_BasicMachine_GT_Recipe( + 13534, + "ggfab.toolcast.tier.mv", + "Basic Tool Casting Machine", + 2, + "Cheap Crafting Tool for you!", + toolCastRecipes, + 1, + 4, + 32000, + SoundResource.NONE, + GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS, + "TOOL_CAST", + new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'P', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', ItemList.Shape_Empty.get(1L) }) + .getStackForm(1L)); GGItemList.ToolCast_HV.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 13535, - "ggfab.toolcast.tier.hv", - "Advanced Tool Casting Machine", - 3, - "Cheap Crafting Tool for you!", - toolCastRecipes, - 1, - 4, - 64000, - SoundResource.NONE, - GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS, - "TOOL_CAST", - new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'P', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', - ItemList.Shape_Empty.get(1L) }).getStackForm(1L)); + new GT_MetaTileEntity_BasicMachine_GT_Recipe( + 13535, + "ggfab.toolcast.tier.hv", + "Advanced Tool Casting Machine", + 3, + "Cheap Crafting Tool for you!", + toolCastRecipes, + 1, + 4, + 64000, + SoundResource.NONE, + GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS, + "TOOL_CAST", + new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'P', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', ItemList.Shape_Empty.get(1L) }) + .getStackForm(1L)); GGItemList.ToolCast_EV.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 13536, - "ggfab.toolcast.tier.ev", - "Master Tool Casting Machine", - 4, - "Cheap Crafting Tool for you!", - toolCastRecipes, - 1, - 4, - 128000, - SoundResource.NONE, - GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS, - "TOOL_CAST", - new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'P', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', - ItemList.Shape_Empty.get(1L) }).getStackForm(1L)); + new GT_MetaTileEntity_BasicMachine_GT_Recipe( + 13536, + "ggfab.toolcast.tier.ev", + "Master Tool Casting Machine", + 4, + "Cheap Crafting Tool for you!", + toolCastRecipes, + 1, + 4, + 128000, + SoundResource.NONE, + GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS, + "TOOL_CAST", + new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'P', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', ItemList.Shape_Empty.get(1L) }) + .getStackForm(1L)); long plate = OrePrefixes.plate.mMaterialAmount, ingot = OrePrefixes.ingot.mMaterialAmount, - screw = OrePrefixes.screw.mMaterialAmount, rod = OrePrefixes.stick.mMaterialAmount; + screw = OrePrefixes.screw.mMaterialAmount, rod = OrePrefixes.stick.mMaterialAmount; GigaGramFabAPI.addSingleUseToolType(craftingToolFile, INSTANCE.mToolStats.get(FILE), 2 * plate); GigaGramFabAPI.addSingleUseToolType(craftingToolWrench, INSTANCE.mToolStats.get(WRENCH), 6 * ingot); GigaGramFabAPI.addSingleUseToolType(craftingToolCrowbar, INSTANCE.mToolStats.get(CROWBAR), 3 * rod); GigaGramFabAPI.addSingleUseToolType( - craftingToolWireCutter, - INSTANCE.mToolStats.get(WIRECUTTER), - 3 * plate + 2 * rod + screw); + craftingToolWireCutter, + INSTANCE.mToolStats.get(WIRECUTTER), + 3 * plate + 2 * rod + screw); GigaGramFabAPI.addSingleUseToolType(craftingToolHardHammer, INSTANCE.mToolStats.get(HARDHAMMER), 6 * ingot); GigaGramFabAPI.addSingleUseToolType(craftingToolSoftHammer, INSTANCE.mToolStats.get(SOFTMALLET), 6 * ingot); GigaGramFabAPI.addSingleUseToolType(craftingToolScrewdriver, INSTANCE.mToolStats.get(SCREWDRIVER), 2 * rod); @@ -141,23 +140,33 @@ public class GigaGramFab { String prefix2 = "Shape_One_Use_craftingTool"; for (GGItemList i : GGItemList.values()) { ItemStack stack = null; - if (i.name().startsWith(prefix)) { - stack = i1.addItem( - id++, - "Single Use " - + GGUtils.processSentence(i.name().substring(prefix.length()), ' ', true, true), - null, - i, - i.name().substring("One_Use_".length())); - } else if (i.name().startsWith(prefix2)) { + if (i.name() + .startsWith(prefix)) { stack = i1.addItem( + id++, + "Single Use " + GGUtils.processSentence( + i.name() + .substring(prefix.length()), + ' ', + true, + true), + null, + i, + i.name() + .substring("One_Use_".length())); + } else if (i.name() + .startsWith(prefix2)) { + stack = i1.addItem( idShape++, - "Tool Casting Mold (" - + GGUtils.processSentence(i.name().substring(prefix2.length()), ' ', true, true) - + ")", + "Tool Casting Mold (" + GGUtils.processSentence( + i.name() + .substring(prefix2.length()), + ' ', + true, + true) + ")", null, i); - } + } if (stack != null) { i.set(stack); } diff --git a/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java b/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java index 8fc78b7486..bc01c8f633 100644 --- a/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java +++ b/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java @@ -20,7 +20,7 @@ class SingleUseToolRecipeLoader implements Runnable { @Override public void run() { ToolDictNames[] hardTools = new ToolDictNames[] { craftingToolHardHammer, craftingToolScrewdriver, - craftingToolWrench, craftingToolCrowbar, craftingToolWireCutter, craftingToolFile }; + craftingToolWrench, craftingToolCrowbar, craftingToolWireCutter, craftingToolFile }; ToolDictNames[] softTools = new ToolDictNames[] { craftingToolSoftHammer }; addSingleUseToolRecipe(Materials.Steel, hardTools); addSingleUseToolRecipe(Materials.Silver, 5000, hardTools); @@ -33,13 +33,15 @@ class SingleUseToolRecipeLoader implements Runnable { String prefix = "Shape_One_Use_"; for (GGItemList value : GGItemList.values()) { - if (!value.name().startsWith(prefix)) { + if (!value.name() + .startsWith(prefix)) { continue; } - ToolDictNames type = ToolDictNames.valueOf(value.name().substring(prefix.length())); - GT_ModHandler.addCraftingRecipe( - value.get(1L), - new Object[] { "h", "P", "I", 'P', ItemList.Shape_Empty, 'I', type }); + ToolDictNames type = ToolDictNames.valueOf( + value.name() + .substring(prefix.length())); + GT_ModHandler + .addCraftingRecipe(value.get(1L), new Object[] { "h", "P", "I", 'P', ItemList.Shape_Empty, 'I', type }); } } @@ -67,10 +69,10 @@ class SingleUseToolRecipeLoader implements Runnable { } long fluids = cost * GT_Values.L / GT_Values.M, duration = 6 * SECONDS; long count = (long) (material.mDurability * stats.getMaxDurabilityMultiplier() - * outputModifier - * 100 - / stats.getToolDamagePerContainerCraft() - / 10000); + * outputModifier + * 100 + / stats.getToolDamagePerContainerCraft() + / 10000); if (count > 64 * 4) { long niceFactor = findNiceFactor(fluids, count); if (niceFactor < 0) { @@ -89,11 +91,13 @@ class SingleUseToolRecipeLoader implements Runnable { duration *= mod; count *= mod; } - GT_Values.RA.stdBuilder().fluidInputs(material.getMolten(fluids)) // - .metadata(GGFabRecipeMaps.OUTPUT_TYPE, type) // - .metadata(GGFabRecipeMaps.OUTPUT_COUNT, (int) count) // - .eut(TierEU.RECIPE_MV).duration(duration) // - .addTo(GGFabRecipeMaps.toolCastRecipes); + GT_Values.RA.stdBuilder() + .fluidInputs(material.getMolten(fluids)) // + .metadata(GGFabRecipeMaps.OUTPUT_TYPE, type) // + .metadata(GGFabRecipeMaps.OUTPUT_COUNT, (int) count) // + .eut(TierEU.RECIPE_MV) + .duration(duration) // + .addTo(GGFabRecipeMaps.toolCastRecipes); } } } diff --git a/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java b/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java index 088e9a7782..039b9d2b58 100644 --- a/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java +++ b/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java @@ -22,34 +22,43 @@ import gregtech.api.util.GT_Recipe; public class GGFabRecipeMaps { public static final RecipeMetadataKey<ToolDictNames> OUTPUT_TYPE = SimpleRecipeMetadataKey - .create(ToolDictNames.class, "output_type"); + .create(ToolDictNames.class, "output_type"); public static final RecipeMetadataKey<Integer> OUTPUT_COUNT = SimpleRecipeMetadataKey - .create(Integer.class, "output_count"); + .create(Integer.class, "output_count"); public static final RecipeMap<RecipeMapBackend> toolCastRecipes = RecipeMapBuilder.of("ggfab.recipe.toolcast") - .maxIO(1, 4, 1, 0).minInputs(1, 1).progressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .recipeEmitter(b -> { - Optional<GT_Recipe> rr = b.noOptimize().validateNoInput().validateInputFluidCount(0, 1) - .validateNoOutput().validateNoOutputFluid().build(); - if (!rr.isPresent()) return Collections.emptyList(); - ToolDictNames outputType = b.getMetadata(OUTPUT_TYPE); - GT_Recipe r = rr.get(); - int outputSize = b.getMetadataOrDefault(OUTPUT_COUNT, 0); - if (outputSize > 64 * 4 || outputSize <= 0) return Collections.emptyList(); - ItemStack shape, output; - try { - shape = GGItemList.valueOf("Shape_One_Use_" + outputType).get(0L); - output = GGItemList.valueOf("One_Use_" + outputType).get(outputSize); - } catch (IllegalArgumentException ex) { - // this looks like python not java, but I don't have better way around this - return Collections.emptyList(); - } - output.stackSize = outputSize; - List<ItemStack> outputs = new ArrayList<>(); - int maxStackSize = output.getMaxStackSize(); - while (output.stackSize > maxStackSize) outputs.add(output.splitStack(maxStackSize)); - outputs.add(output); - r.mInputs = new ItemStack[] { shape }; - r.mOutputs = outputs.toArray(new ItemStack[0]); - return Collections.singletonList(r); - }).build(); + .maxIO(1, 4, 1, 0) + .minInputs(1, 1) + .progressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .recipeEmitter(b -> { + Optional<GT_Recipe> rr = b.noOptimize() + .validateNoInput() + .validateInputFluidCount(0, 1) + .validateNoOutput() + .validateNoOutputFluid() + .build(); + if (!rr.isPresent()) return Collections.emptyList(); + ToolDictNames outputType = b.getMetadata(OUTPUT_TYPE); + GT_Recipe r = rr.get(); + int outputSize = b.getMetadataOrDefault(OUTPUT_COUNT, 0); + if (outputSize > 64 * 4 || outputSize <= 0) return Collections.emptyList(); + ItemStack shape, output; + try { + shape = GGItemList.valueOf("Shape_One_Use_" + outputType) + .get(0L); + output = GGItemList.valueOf("One_Use_" + outputType) + .get(outputSize); + } catch (IllegalArgumentException ex) { + // this looks like python not java, but I don't have better way around this + return Collections.emptyList(); + } + output.stackSize = outputSize; + List<ItemStack> outputs = new ArrayList<>(); + int maxStackSize = output.getMaxStackSize(); + while (output.stackSize > maxStackSize) outputs.add(output.splitStack(maxStackSize)); + outputs.add(output); + r.mInputs = new ItemStack[] { shape }; + r.mOutputs = outputs.toArray(new ItemStack[0]); + return Collections.singletonList(r); + }) + .build(); } diff --git a/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java b/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java index 7797d037c3..6b35b26486 100644 --- a/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java +++ b/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java @@ -16,11 +16,11 @@ public class GigaGramFabAPI { private static final Map<ToolDictNames, IToolStats> SINGLE_USE_TOOLS_STORE = new HashMap<>(); public static final Map<ToolDictNames, IToolStats> SINGLE_USE_TOOLS = Collections - .unmodifiableMap(SINGLE_USE_TOOLS_STORE); + .unmodifiableMap(SINGLE_USE_TOOLS_STORE); private static final Map<ToolDictNames, Long> COST_SINGLE_USE_TOOLS_STORE = new HashMap<>(); public static final Map<ToolDictNames, Long> COST_SINGLE_USE_TOOLS = Collections - .unmodifiableMap(COST_SINGLE_USE_TOOLS_STORE); + .unmodifiableMap(COST_SINGLE_USE_TOOLS_STORE); public static void addSingleUseToolType(ToolDictNames type, IToolStats stat, long materialCost) { if (SINGLE_USE_TOOLS_STORE.put(type, stat) != null) 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 de2071329d..be0446c8ad 100644 --- a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java +++ b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java @@ -106,7 +106,7 @@ 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. */ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<MTE_AdvAssLine> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private static final ItemStack NOT_CHECKED = new ItemStack(Blocks.dirt); private static final String STRUCTURE_PIECE_FIRST = "first"; @@ -115,8 +115,8 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas 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() - // @formatter:off + .<MTE_AdvAssLine>builder() + // @formatter:off .addShape( STRUCTURE_PIECE_FIRST, transpose(new String[][] { @@ -142,44 +142,52 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas { "o", "i", "b" }, })) // @formatter:on - .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), - ofHatchAdder(MTE_AdvAssLine::addOutputToMachineList, 16, 4))) - .addElement('i', InputBus.newAny(16, 5, ForgeDirection.DOWN)) - .addElement('o', OutputBus.newAny(16, 4, ForgeDirection.DOWN)).build(); + .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), + 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); + private final Slice[] slices = IntStream.range(0, 16) + .mapToObj(Slice::new) + .toArray(Slice[]::new); private boolean processing; private long inputVoltage; // surely no one is using more EUt than this, no? @@ -232,7 +240,7 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas 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; + && mDataAccessHatches.size() <= 1; } return false; } @@ -273,7 +281,8 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas @SuppressWarnings("unchecked") List<EntityPlayerMP> l = server.getConfigurationManager().playerEntityList; for (EntityPlayerMP p : l) { - if (p.getUniqueID().equals(ownerUuid)) { + if (p.getUniqueID() + .equals(ownerUuid)) { for (int i = 0; i < 9; i++) { // switch is stupid, but I have no better idea Object[] args; @@ -283,8 +292,8 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas break; case 8: args = new Object[] { (int) (factor * 100) + 400, - (int) ((4 + factor) * (4 + factor + factor) * 100), 4 + factor, - 4 + factor + factor }; + (int) ((4 + factor) * (4 + factor + factor) * 100), 4 + factor, + 4 + factor + factor }; break; default: args = new Object[0]; @@ -298,21 +307,37 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + 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() }; + if (aActive) return new ITexture[] { casingTexturePages[0][16], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ADV_ASSLINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() |
