diff --git a/gradle.properties b/gradle.properties index 56ca9a3..be6388f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -128,7 +128,7 @@ curseForgeRelations = # Optional parameter to prevent the source code from being published # noPublishedSources = # Uncomment this to disable spotless checks -#disableSpotless=true +# disableSpotless=true # This should only be uncommented to keep it easier to sync with upstream/other forks. # That is, if there is no other active fork/upstream, NEVER change this. disableCheckstyle=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..3499ded 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/silvermoon/boxplusplus/api/IBoxable.java b/src/main/java/com/silvermoon/boxplusplus/api/IBoxable.java index 7a81232..cfcf8de 100644 --- a/src/main/java/com/silvermoon/boxplusplus/api/IBoxable.java +++ b/src/main/java/com/silvermoon/boxplusplus/api/IBoxable.java @@ -4,9 +4,9 @@ import gregtech.api.recipe.RecipeMap; /** - * Implements this on GT_MetaTileEntity_MultiBlockBase to allow your machine encapsulating in Box System. - * If you don't have a standard getRecipeMap(), override getRealRecipeMap(). - * Do remember to call boxRegister.registerMachineToBox() on postInit! + * Implements this on GT_MetaTileEntity_MultiBlockBase to allow your machine encapsulating in Box System. If you don't + * have a standard getRecipeMap(), override getRealRecipeMap(). Do remember to call boxRegister.registerMachineToBox() + * on postInit! *

* 为GT_MetaTileEntity_MultiBlockBase实现此接口,将允许Box封装你的机器。如果你的机器有多种模式,重写getRealRecipeMap()来返回你期望封装的那个。 * 记得在postInit调用一次boxRegister.registerMachineToBox()! diff --git a/src/main/java/com/silvermoon/boxplusplus/api/boxRegister.java b/src/main/java/com/silvermoon/boxplusplus/api/boxRegister.java index 8a16af8..6b94251 100644 --- a/src/main/java/com/silvermoon/boxplusplus/api/boxRegister.java +++ b/src/main/java/com/silvermoon/boxplusplus/api/boxRegister.java @@ -18,7 +18,7 @@ public class boxRegister { * Use this to register your boxable machine. **Should be called on CommonProxy.postInit().** *

* 在CommonProxy.postInit()阶段调用本方法。确保传入的GT_MetaTileEntity_MultiBlockBase已经实现了IBoxable。 - * + * * @param machineList You can put multi-GTMultiMachines in this parameter. *

* 可以接受多个参数 diff --git a/src/main/java/com/silvermoon/boxplusplus/boxplusplus.java b/src/main/java/com/silvermoon/boxplusplus/boxplusplus.java index f548d84..684736f 100644 --- a/src/main/java/com/silvermoon/boxplusplus/boxplusplus.java +++ b/src/main/java/com/silvermoon/boxplusplus/boxplusplus.java @@ -20,7 +20,8 @@ modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, - dependencies = "required-after:IC2;" + "required-after:structurelib;" + dependencies = "required-after:IC2;" + + "required-after:structurelib;" + "required-after:modularui;" + "after:GalacticraftCore;" + "required-after:bartworks;" diff --git a/src/main/java/com/silvermoon/boxplusplus/client/BoxNEIHandler.java b/src/main/java/com/silvermoon/boxplusplus/client/BoxNEIHandler.java index 5b198b6..02b69af 100644 --- a/src/main/java/com/silvermoon/boxplusplus/client/BoxNEIHandler.java +++ b/src/main/java/com/silvermoon/boxplusplus/client/BoxNEIHandler.java @@ -30,9 +30,8 @@ public class BoxNEIHandler { @SubscribeEvent public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) { - if (event.gui instanceof GuiRecipe gui && gui.firstGui instanceof ModularGui mui - && mui.getContext() - .isWindowOpen(10)) { + if (event.gui instanceof GuiRecipe gui && gui.firstGui instanceof ModularGui mui && mui.getContext() + .isWindowOpen(10)) { EntityPlayer player = ((ModularGui) gui.firstGui).getContext() .getPlayer(); GTMachineBox box = Util.boxMap.get(player); @@ -47,36 +46,34 @@ public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) { getRecipesPerPage = GuiRecipe.class.getDeclaredMethod("getRecipesPerPage"); getRecipesPerPage.setAccessible(true); recipesPerPage = (int) getRecipesPerPage.invoke(gui); - } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) {} + } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) { + } buttons = new GuiButton[recipesPerPage]; - int OVERLAY_BUTTON_ID_START = ObfuscationReflectionHelper - .getPrivateValue(GuiRecipe.class, gui, "OVERLAY_BUTTON_ID_START"); + int OVERLAY_BUTTON_ID_START = ObfuscationReflectionHelper.getPrivateValue( + GuiRecipe.class, + gui, + "OVERLAY_BUTTON_ID_START"); int guiTop = ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class, gui, "field_147009_r"); int buttonWidth = ObfuscationReflectionHelper.getPrivateValue(GuiRecipe.class, gui, "buttonWidth"); int buttonHeight = ObfuscationReflectionHelper.getPrivateValue(GuiRecipe.class, gui, "buttonHeight"); HandlerInfo handlerInfo = ObfuscationReflectionHelper.getPrivateValue(GuiRecipe.class, gui, "handlerInfo"); for (int i = 0; i < recipesPerPage; i++) { - buttons[i] = new GuiNEIButton( - OVERLAY_BUTTON_ID_START + i, + buttons[i] = new GuiNEIButton(OVERLAY_BUTTON_ID_START + i, (gui.width / 2) + 65, guiTop + 16 + (handlerInfo.getHeight() * (i + 1)) - 2, buttonWidth, buttonHeight, "B"); } - int counts = Math.min( - gui.getHandler() - .numRecipes() - (gui.page * recipesPerPage), - recipesPerPage); + int counts = Math.min(gui.getHandler() + .numRecipes() - (gui.page * recipesPerPage), recipesPerPage); for (int i = 0; i < buttons.length; i++) { if (i >= counts) { buttons[i].visible = false; } else { - buttons[i].visible = RecipeInfo.hasOverlayHandler( - GuiPatternTermEx.class, + buttons[i].visible = RecipeInfo.hasOverlayHandler(GuiPatternTermEx.class, gui.getHandler() - .getOverlayIdentifier()) - && gui.getHandler() instanceof GT_NEI_DefaultHandler; + .getOverlayIdentifier()) && gui.getHandler() instanceof GT_NEI_DefaultHandler; } } Collections.addAll(buttonList, buttons); @@ -85,22 +82,27 @@ public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) { @SubscribeEvent public void onActionPerformedEventPre(GuiScreenEvent.ActionPerformedEvent.Pre event) { - if (event.gui instanceof GuiRecipe gui && gui.firstGui instanceof ModularGui mui - && mui.getContext() - .isWindowOpen(10)) { + if (event.gui instanceof GuiRecipe gui && gui.firstGui instanceof ModularGui mui && mui.getContext() + .isWindowOpen(10)) { EntityPlayer player = ((ModularGui) gui.firstGui).getContext() .getPlayer(); - List overlayButtons = new ArrayList<>( - Arrays.asList(ObfuscationReflectionHelper.getPrivateValue(GuiRecipe.class, gui, "overlayButtons"))); - int OVERLAY_BUTTON_ID_START = ObfuscationReflectionHelper - .getPrivateValue(GuiRecipe.class, gui, "OVERLAY_BUTTON_ID_START"); + List overlayButtons = new ArrayList<>(Arrays.asList(ObfuscationReflectionHelper.getPrivateValue( + GuiRecipe.class, + gui, + "overlayButtons"))); + int OVERLAY_BUTTON_ID_START = ObfuscationReflectionHelper.getPrivateValue( + GuiRecipe.class, + gui, + "OVERLAY_BUTTON_ID_START"); if (event.button.id >= OVERLAY_BUTTON_ID_START && event.button.id < OVERLAY_BUTTON_ID_START + overlayButtons.size()) { IRecipeHandler handler = (IRecipeHandler) gui.currenthandlers.get(gui.recipetype); if (recipesPerPage >= 0 && handler != null) { int recipe = gui.page * recipesPerPage + event.button.id - OVERLAY_BUTTON_ID_START; - BoxRoutings - .makeRouting((GT_NEI_DefaultHandler) gui.currenthandlers.get(gui.recipetype), recipe, player); + BoxRoutings.makeRouting( + (GT_NEI_DefaultHandler) gui.currenthandlers.get(gui.recipetype), + recipe, + player); event.setCanceled(true); } } diff --git a/src/main/java/com/silvermoon/boxplusplus/client/ClientProxy.java b/src/main/java/com/silvermoon/boxplusplus/client/ClientProxy.java index 4a24aaa..3c2e9c4 100644 --- a/src/main/java/com/silvermoon/boxplusplus/client/ClientProxy.java +++ b/src/main/java/com/silvermoon/boxplusplus/client/ClientProxy.java @@ -18,10 +18,8 @@ public class ClientProxy extends CommonProxy { public void init(FMLInitializationEvent e) { super.init(e); ClientRegistry.bindTileEntitySpecialRenderer(TEBoxRing.class, new RenderBoxRing()); - ClientRegistry.bindTileEntitySpecialRenderer( - (Class) TileEntitiesLoader.DroneMaintainingCentre.getBaseMetaTileEntity() - .getClass(), - new RenderDrone()); + ClientRegistry.bindTileEntitySpecialRenderer((Class) TileEntitiesLoader.DroneMaintainingCentre.getBaseMetaTileEntity() + .getClass(), new RenderDrone()); MinecraftForge.EVENT_BUS.register(BoxNEIHandler.instance); } } diff --git a/src/main/java/com/silvermoon/boxplusplus/common/BoxModule.java b/src/main/java/com/silvermoon/boxplusplus/common/BoxModule.java index ce6d10e..120b06c 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/BoxModule.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/BoxModule.java @@ -17,20 +17,17 @@ public class BoxModule { public static BoxModule AMD_Wafer_Fabrication_Plant = new BoxModule("AMD_Wafer_Fabrication_Plant", 17, 6, -2); public static BoxModule Liquid_Level_Regulator = new BoxModule("Liquid_Level_Regulator", 1, 6, -18); public static BoxModule Solid_State_Reshaper = new BoxModule("Solid_State_Reshaper", -15, 6, -2); - public static BoxModule Residential_Flush_Toilet_with_Built_in_Pump = new BoxModule( - "Residential_Flush_Toilet_with_Built_in_Pump", + public static BoxModule Residential_Flush_Toilet_with_Built_in_Pump = new BoxModule("Residential_Flush_Toilet_with_Built_in_Pump", 1, 6, 14); - public static BoxModule Extreme_Temperature_Difference_Generation_Tower = new BoxModule( - "Extreme_Temperature_Difference_Generation_Tower", + public static BoxModule Extreme_Temperature_Difference_Generation_Tower = new BoxModule("Extreme_Temperature_Difference_Generation_Tower", 23, 6, -1); public static BoxModule Superstructure_Assembly_Plant = new BoxModule("Superstructure_Assembly_Plant", 2, 6, -23); public static BoxModule Phase_Parallel_Matrix = new BoxModule("Phase_Parallel_Matrix", -21, 6, -1); - public static BoxModule Arrayed_and_Maneuverable_Hyperbeam_Receiver_Redirector = new BoxModule( - "Arrayed_and_Maneuverable_Hyperbeam_Receiver_Redirector", + public static BoxModule Arrayed_and_Maneuverable_Hyperbeam_Receiver_Redirector = new BoxModule("Arrayed_and_Maneuverable_Hyperbeam_Receiver_Redirector", 2, 7, -1); @@ -113,19 +110,19 @@ public static int[] transMachinesToModule(BoxRoutings routing) { .substring(17)) { case "industrialmixer.controller.tier.single", "multimachine.chemicalreactor" -> new int[] { 0, 0 }; case "gtplusplus.autocrafter.multi", "mxrandomlargemolecularassembler" -> new int[] { 1, 0 }; - case "multimachine.cracker", "megadistillationtower", "multimachine.adv.distillationtower", "megaoilcracker", "multimachine.distillationtower" -> new int[] { - 2, 0 }; - case "multimachine.multifurnace", "industrialthermalcentrifuge.controller.tier.single", "industrialarcfurnace.controller.tier.single", "industrialalloysmelter.controller.tier.single" -> new int[] { - 3, 0 }; + case "multimachine.cracker", "megadistillationtower", "multimachine.adv.distillationtower", "megaoilcracker", "multimachine.distillationtower" -> + new int[] { 2, 0 }; + case "multimachine.multifurnace", "industrialthermalcentrifuge.controller.tier.single", "industrialarcfurnace.controller.tier.single", "industrialalloysmelter.controller.tier.single" -> + new int[] { 3, 0 }; case "industrialmultimachine.controller.tier.single" -> new int[] { 4, 0 }; - case "industrialrockcrusher.controller.tier.single", "industrialfluidheater.controller.tier.single", "ompressor" -> new int[] { - 5, 0 }; - case "industrialcuttingmachine.controller.tier.01", "industrialmacerator.controller.tier.single", "industrialbender.controller.tier.single", "industrialextruder.controller.tier.single", "industrialwiremill.controller.tier.single", "industrialhammer.controller.tier.single" -> new int[] { - 6, 0 }; - case "industrialwashplant.controller.tier.single", "industrialsifter.controller.tier.single", "industrialcentrifuge.controller.tier.single", "industrialelectrolyzer.controller.tier.single", "digester", "basicmachine.electromagneticseparator.tier.06" -> new int[] { - 7, 0 }; - case "industrialcokeoven.controller.tier.single", "multimachine.pyro", "multimachine.vacuumfreezer", "multimachine.adv.industrialfreezer" -> new int[] { - 8, 0 }; + case "industrialrockcrusher.controller.tier.single", "industrialfluidheater.controller.tier.single", "ompressor" -> + new int[] { 5, 0 }; + case "industrialcuttingmachine.controller.tier.01", "industrialmacerator.controller.tier.single", "industrialbender.controller.tier.single", "industrialextruder.controller.tier.single", "industrialwiremill.controller.tier.single", "industrialhammer.controller.tier.single" -> + new int[] { 6, 0 }; + case "industrialwashplant.controller.tier.single", "industrialsifter.controller.tier.single", "industrialcentrifuge.controller.tier.single", "industrialelectrolyzer.controller.tier.single", "digester", "basicmachine.electromagneticseparator.tier.06" -> + new int[] { 7, 0 }; + case "industrialcokeoven.controller.tier.single", "multimachine.pyro", "multimachine.vacuumfreezer", "multimachine.adv.industrialfreezer" -> + new int[] { 8, 0 }; case "multimachine.assemblyline" -> new int[] { 9, 0 }; case "industrialsalloyamelter.controller.tier.single" -> new int[] { 10, 0 }; case "moleculartransformer.controller.tier.single", "gtpp.multimachine.replicator" -> new int[] { 0, 1 }; @@ -135,12 +132,12 @@ public static int[] transMachinesToModule(BoxRoutings routing) { case "multimachine.pcbfactory", "circuitassemblyline" -> new int[] { 4, 1 }; case "largefusioncomputer5" -> new int[] { 5, 1 }; case "dissolution_tank", "bw.biovat" -> new int[] { 7, 1 }; - case "electricimplosioncompressor", "componentassemblyline", "projectmoduleassemblert3" -> new int[] { 9, - 1 }; - case "multimachine.plasmaforge", "multimachine.transcendentplasmamixer", "multimachine.nanoforge" -> new int[] { - 8, 1 }; - case "quantumforcetransformer.controller.tier.single", "frf", "industrialmassfab.controller.tier.single" -> new int[] { - 10, 1 }; + case "electricimplosioncompressor", "componentassemblyline", "projectmoduleassemblert3" -> + new int[] { 9, 1 }; + case "multimachine.plasmaforge", "multimachine.transcendentplasmamixer", "multimachine.nanoforge" -> + new int[] { 8, 1 }; + case "quantumforcetransformer.controller.tier.single", "frf", "industrialmassfab.controller.tier.single" -> + new int[] { 10, 1 }; default -> { for (GT_MetaTileEntity_MultiBlockBase machine : customerMachineList) { if (GT_Utility.areStacksEqual(machine.getStackForm(1), routing.RoutingMachine, true)) { diff --git a/src/main/java/com/silvermoon/boxplusplus/common/block/BlockBoxModuleCore.java b/src/main/java/com/silvermoon/boxplusplus/common/block/BlockBoxModuleCore.java index 6de8a62..1e937cb 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/block/BlockBoxModuleCore.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/block/BlockBoxModuleCore.java @@ -44,8 +44,9 @@ public void registerBlock() { @Override public void registerBlockIcons(IIconRegister iconRegister) { for (int i = 0; i < 15; i++) { - ModuleIcon[i] = iconRegister - .registerIcon(Tags.MODID + (!isUpdate ? ":modules/BoxModule" : ":modules/BoxModulePlus") + i); + ModuleIcon[i] = iconRegister.registerIcon(Tags.MODID + (!isUpdate + ? ":modules/BoxModule" + : ":modules/BoxModulePlus") + i); } } diff --git a/src/main/java/com/silvermoon/boxplusplus/common/items/IB_BoxModule.java b/src/main/java/com/silvermoon/boxplusplus/common/items/IB_BoxModule.java index 3ff83ef..7b0405c 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/items/IB_BoxModule.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/items/IB_BoxModule.java @@ -33,13 +33,12 @@ public boolean getHasSubtypes() { @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean p_77624_4_) { boolean update = ((BlockBoxModuleCore) field_150939_a).isUpdate; - list.add( - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD - + i18n("tile.boxplusplus.boxUI.module.context." + (stack.getItemDamage() + 1) + (update ? "f" : "a"))); + list.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + i18n( + "tile.boxplusplus.boxUI.module.context." + (stack.getItemDamage() + 1) + (update ? "f" : "a"))); if (update) { - list.add( - EnumChatFormatting.GOLD + i18n("tile.boxplusplus.boxUI.module." + (stack.getItemDamage() + 1)) - + " (T2)"); + list.add(EnumChatFormatting.GOLD + + i18n("tile.boxplusplus.boxUI.module." + (stack.getItemDamage() + 1)) + + " (T2)"); } list.add(i18n("tile.boxplusplus.boxUI.module.context." + (stack.getItemDamage() + 1) + (update ? "d" : "b"))); if (customUpdatedModuleList.containsKey(stack.getItemDamage()) diff --git a/src/main/java/com/silvermoon/boxplusplus/common/items/tierDrone.java b/src/main/java/com/silvermoon/boxplusplus/common/items/tierDrone.java index 5d47e99..5a61859 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/items/tierDrone.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/items/tierDrone.java @@ -63,8 +63,8 @@ public int getMetadata(int p_77647_1_) { @Override public void addInformation(ItemStack item, EntityPlayer player, List list, boolean b) { - list.add( - Util.i18n( - ("tile.boxplusplus_maintainingDrone%.desc".replaceAll("%", String.valueOf(item.getItemDamage()))))); + list.add(Util.i18n(("tile.boxplusplus_maintainingDrone%.desc".replaceAll( + "%", + String.valueOf(item.getItemDamage()))))); } } diff --git a/src/main/java/com/silvermoon/boxplusplus/common/loader/BlockRegister.java b/src/main/java/com/silvermoon/boxplusplus/common/loader/BlockRegister.java index a679898..8c48c65 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/loader/BlockRegister.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/loader/BlockRegister.java @@ -8,20 +8,26 @@ public class BlockRegister { - public static BlockMachineBase SpaceExtend = new BlockMachineBase("boxplusplus_SpaceExtend", Material.iron, 0) - .setHarvest("wrench", 3); - public static BlockMachineBase SpaceConstraint = new BlockMachineBase( - "boxplusplus_SpaceConstraint", + public static BlockMachineBase SpaceExtend = new BlockMachineBase( + "boxplusplus_SpaceExtend", + Material.iron, + 0).setHarvest("wrench", 3); + public static BlockMachineBase SpaceConstraint = new BlockMachineBase("boxplusplus_SpaceConstraint", Material.iron, 2).setHarvest("wrench", 3); - public static BlockMachineBase SpaceCompress = new BlockMachineBase("boxplusplus_SpaceCompress", Material.iron, 1) - .setHarvest("wrench", 3); - public static BlockMachineBase SpaceWall = new BlockMachineBase("boxplusplus_SpaceWall", Material.iron, 3) - .setHarvest("wrench", 3); - public static BlockBoxModuleCore BoxModule = new BlockBoxModuleCore("boxplusplus_boxmodule", Material.iron, false) - .setHarvest("wrench", 5); - public static BlockBoxModuleCore BoxModuleUpgrad = new BlockBoxModuleCore( - "boxplusplus_boxmoduleplus", + public static BlockMachineBase SpaceCompress = new BlockMachineBase( + "boxplusplus_SpaceCompress", + Material.iron, + 1).setHarvest("wrench", 3); + public static BlockMachineBase SpaceWall = new BlockMachineBase( + "boxplusplus_SpaceWall", + Material.iron, + 3).setHarvest("wrench", 3); + public static BlockBoxModuleCore BoxModule = new BlockBoxModuleCore( + "boxplusplus_boxmodule", + Material.iron, + false).setHarvest("wrench", 5); + public static BlockBoxModuleCore BoxModuleUpgrad = new BlockBoxModuleCore("boxplusplus_boxmoduleplus", Material.iron, true).setHarvest("wrench", 5); public static BlockBoxRing BoxRing = new BlockBoxRing(1); diff --git a/src/main/java/com/silvermoon/boxplusplus/common/loader/RecipeLoader.java b/src/main/java/com/silvermoon/boxplusplus/common/loader/RecipeLoader.java index 8ec9b05..f1f4294 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/loader/RecipeLoader.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/loader/RecipeLoader.java @@ -34,8 +34,7 @@ public void addBoxRecipe() { .metadata(RESEARCH_ITEM, GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 13532)) .metadata(RESEARCH_TIME, 64000) .itemOutputs(TileEntitiesLoader.Box.getStackForm(1)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 1, 0), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 1, 0), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 4, 59), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 8, 58), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 16, 57), @@ -50,8 +49,7 @@ public void addBoxRecipe() { ItemList.Tool_DataOrb.get(16), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiPart", 1, 360), ItemList.Casing_Pipe_Titanium.get(64)) - .fluidInputs( - FluidRegistry.getFluidStack("molten.titanium", 16416), + .fluidInputs(FluidRegistry.getFluidStack("molten.titanium", 16416), FluidRegistry.getFluidStack("lubricant", 16000), FluidRegistry.getFluidStack("ic2uumatter", 4000)) .eut(TierEU.RECIPE_LuV) @@ -62,8 +60,7 @@ public void addBoxRecipe() { public void addMachineBlockRecipe() { GT_Values.RA.stdBuilder() .itemOutputs(new ItemStack(BlockRegister.SpaceExtend, 32, 0)) - .itemInputs( - ItemList.Casing_StableTitanium.get(64), + .itemInputs(ItemList.Casing_StableTitanium.get(64), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 2, 32), ItemList.Electric_Motor_LuV.get(16), ItemList.Electric_Piston_LuV.get(16), @@ -75,15 +72,13 @@ public void addMachineBlockRecipe() { .metadata(RESEARCH_ITEM, new ItemStack(BlockRegister.SpaceExtend)) .metadata(RESEARCH_TIME, 24000) .itemOutputs(new ItemStack(BlockRegister.SpaceCompress, 16, 0)) - .itemInputs( - ItemList.Casing_StableTitanium.get(64), + .itemInputs(ItemList.Casing_StableTitanium.get(64), ItemList.Casing_StableTitanium.get(64), ItemList.Super_Tank_LV.get(1), ItemList.Super_Chest_LV.get(1), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 4, 33), GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "tile.TitaniumPlatedReinforcedStone", 64)) - .fluidInputs( - FluidRegistry.getFluidStack("ic2coolant", 10000), + .fluidInputs(FluidRegistry.getFluidStack("ic2coolant", 10000), FluidRegistry.getFluidStack("molten.indalloy140", 1440)) .eut(TierEU.RECIPE_LuV) .duration(1600) @@ -92,8 +87,7 @@ public void addMachineBlockRecipe() { .metadata(RESEARCH_ITEM, new ItemStack(BlockRegister.SpaceCompress)) .metadata(RESEARCH_TIME, 48000) .itemOutputs(new ItemStack(BlockRegister.SpaceConstraint, 2, 0)) - .itemInputs( - ItemList.Casing_StableTitanium.get(64), + .itemInputs(ItemList.Casing_StableTitanium.get(64), ItemList.Casing_StableTitanium.get(64), ItemList.Casing_StableTitanium.get(64), ItemList.Casing_StableTitanium.get(64), @@ -101,14 +95,12 @@ public void addMachineBlockRecipe() { GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 16, 34), ItemList.Quantum_Tank_LV.get(1), ItemList.Quantum_Chest_LV.get(1)) - .fluidInputs( - FluidRegistry.getFluidStack("supercoolant", 100000), + .fluidInputs(FluidRegistry.getFluidStack("supercoolant", 100000), FluidRegistry.getFluidStack("molten.indalloy140", 14400)) .eut(TierEU.RECIPE_UV) .duration(6400) .addTo(AssemblyLine); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.SpaceConstraint), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.SpaceConstraint), 480000, 128, 2000000, @@ -131,8 +123,7 @@ public void addMachineBlockRecipe() { public void addRingRecipe() { GT_Values.RA.stdBuilder() .itemOutputs(new ItemStack(BlockRegister.BoxRing, 1, 0)) - .itemInputs( - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Titanium, 64), + .itemInputs(GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Titanium, 64), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Titanium, 64), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Titanium, 64), GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Titanium, 64), @@ -146,24 +137,22 @@ public void addRingRecipe() { .metadata(RESEARCH_ITEM, new ItemStack(BlockRegister.BoxRing)) .metadata(RESEARCH_TIME, 48000) .itemOutputs(new ItemStack(BlockRegister.BoxRing2, 1, 0)) - .itemInputs( - GT_OreDictUnificator.get("ringLaurenium", 64), + .itemInputs(GT_OreDictUnificator.get("ringLaurenium", 64), GT_OreDictUnificator.get("ringLaurenium", 64), GT_OreDictUnificator.get("ringLaurenium", 64), GT_OreDictUnificator.get("ringLaurenium", 64), GT_OreDictUnificator.get("blockAdvancedNitinol", 16), - GT_ModHandler.getModItem(GTPlusPlus.ID, "particleIon", 64, 21), - GT_ModHandler.getModItem(GTPlusPlus.ID, "particleIon", 64, 21), + // GT_ModHandler.getModItem(GTPlusPlus.ID, "particleIon", 64, 21), + // GT_ModHandler.getModItem(GTPlusPlus.ID, "particleIon", 64, 21), + GT_ModHandler.getModItem(UniversalSingularities.ID, "universal.general.singularity", 64, 12), ItemList.Field_Generator_UV.get(4), ItemList.ZPM_Coil.get(48)) - .fluidInputs( - FluidRegistry.getFluidStack("plasma.titanium", 16000), + .fluidInputs(FluidRegistry.getFluidStack("plasma.titanium", 16000), FluidRegistry.getFluidStack("molten.advancednitinol", 14400)) .eut(TierEU.RECIPE_UV) .duration(60000) .addTo(AssemblyLine); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxRing2), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxRing2), 48000000, 10240, 8000000, @@ -195,21 +184,18 @@ public void addRingRecipe() { public void addModuleRecipe() { GT_Values.RA.stdBuilder() .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 0)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 1), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 1), ItemList.Machine_Multi_LargeChemicalReactor.get(64), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 811), GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Titanium, 16)) - .fluidInputs( - FluidRegistry.getFluidStack("glue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("glue", 8000), FluidRegistry.getFluidStack("tetrafluoroethylene", 128000)) .eut(TierEU.RECIPE_LuV) .duration(1200) .addTo(multiblockChemicalReactorRecipes); GT_Values.RA.stdBuilder() .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 1)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 1), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 1), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 876), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 14101), GT_ModHandler.getModItem(AppliedEnergistics2.ID, "item.ItemMultiMaterial", 64, 43), @@ -220,12 +206,10 @@ public void addModuleRecipe() { .addTo(assemblerRecipes); GT_Values.RA.stdBuilder() .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 2)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 1), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 1), ItemList.OilCracker.get(64), ItemList.Distillation_Tower.get(64)) - .fluidInputs( - FluidRegistry.getFluidStack("glue", 32000), + .fluidInputs(FluidRegistry.getFluidStack("glue", 32000), FluidRegistry.getFluidStack("highoctanegasoline", 128000)) .specialValue(5) .eut(TierEU.RECIPE_LuV) @@ -233,8 +217,7 @@ public void addModuleRecipe() { .addTo(GTPPRecipeMaps.chemicalPlantRecipes); GT_Values.RA.stdBuilder() .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 3)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 1), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 1), ItemList.Machine_Multi_Furnace.get(64), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 849), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 862), @@ -251,8 +234,7 @@ public void addModuleRecipe() { .metadata(RESEARCH_ITEM, GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 860)) .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 4)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing2, 2), + .itemInputs(new ItemStack(BlockRegister.BoxRing2, 2), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 860), GT_ModHandler.getModItem(GregTech.ID, "gt.metaitem.01", 64, 32764), GT_ModHandler.getModItem(OpenComputers.ID, "item", 9, 103), @@ -268,8 +250,7 @@ public void addModuleRecipe() { .metadata(RESEARCH_ITEM, GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 31077)) .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 5)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing2, 2), + .itemInputs(new ItemStack(BlockRegister.BoxRing2, 2), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 31077), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 31065), GT_ModHandler.getModItem(Avaritia.ID, "Neutronium_Compressor", 4), @@ -278,8 +259,7 @@ public void addModuleRecipe() { GT_ModHandler.getModItem(GTPlusPlus.ID, "dummyResearch", 1), GT_ModHandler.getModItem(GregTech.ID, "gt.blockcasings9", 4, 1), GT_ModHandler.getModItem(Chisel.ID, "netherStarChisel", 1)) - .fluidInputs( - FluidRegistry.getFluidStack("refinedglue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("refinedglue", 8000), FluidRegistry.getFluidStack("ic2pahoehoelava", 128000), FluidRegistry.getFluidStack("grade4purifiedwater", 128000)) .eut(TierEU.RECIPE_UV) @@ -290,8 +270,7 @@ public void addModuleRecipe() { .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 6)) - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 792), + .itemInputs(GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 792), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 992), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 859), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 797), @@ -313,8 +292,7 @@ public void addModuleRecipe() { .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModule, 1, 7)) - .itemInputs( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 850), + .itemInputs(GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 850), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 796), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 790), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 840), @@ -326,14 +304,15 @@ public void addModuleRecipe() { GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 10500), GT_OreDictUnificator.get("dustCooledMonaziteRareEarthConcentrate", 64), new ItemStack(BlockRegister.BoxRing2, 2)) - .fluidInputs( - FluidRegistry.getFluidStack("refinedglue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("refinedglue", 8000), FluidRegistry.getFluidStack("grade4purifiedwater", 128000)) .eut(TierEU.RECIPE_UV) .duration(1200) .addTo(AssemblyLine); - TT_recipeAdder.addResearchableAssemblylineRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 12730), + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem(GregTech.ID, + "gt.blockmachines", + 1, + 12730), 25600, 64, 8000000, @@ -350,8 +329,10 @@ public void addModuleRecipe() { new ItemStack(BlockRegister.BoxModule, 1, 8), 2000, (int) TierEU.RECIPE_UEV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 17001), + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem(GregTech.ID, + "gt.blockmachines", + 1, + 17001), 102400, 256, 8000000, @@ -371,8 +352,10 @@ public void addModuleRecipe() { new ItemStack(BlockRegister.BoxModule, 1, 9), 2000, (int) TierEU.RECIPE_UEV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 31150), + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem(GregTech.ID, + "gt.blockmachines", + 1, + 31150), 51200, 128, 8000000, @@ -389,8 +372,10 @@ public void addModuleRecipe() { new ItemStack(BlockRegister.BoxModule, 1, 10), 2000, (int) TierEU.RECIPE_UEV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 1, 15472), + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem(GregTech.ID, + "gt.blockmachines", + 1, + 15472), 100000, 100, 10000000, @@ -409,8 +394,10 @@ public void addModuleRecipe() { new ItemStack(BlockRegister.BoxModule, 1, 12), 2000, (int) TierEU.RECIPE_UEV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - GT_ModHandler.getModItem(AppliedEnergistics2.ID, "tile.BlockAdvancedCraftingUnit", 1, 3), + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem(AppliedEnergistics2.ID, + "tile.BlockAdvancedCraftingUnit", + 1, + 3), (int) TierEU.RECIPE_UEV, 512, (int) TierEU.RECIPE_UIV, @@ -437,15 +424,13 @@ public void addUpgradeModuleRecipe() { .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 0)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 8), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 8), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 31072), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 31050), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 31051), GT_ModHandler.getModItem(GTPlusPlus.ID, "miscutils.blockcasings", 48, 8), GT_ModHandler.getModItem(GTPlusPlus.ID, "gtplusplus.blockspecialcasings.1", 56, 13)) - .fluidInputs( - FluidRegistry.getFluidStack("refinedglue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("refinedglue", 8000), FluidRegistry.getFluidStack("ic2uumatter", 128000)) .eut(TierEU.RECIPE_UV) .duration(1200) @@ -455,8 +440,7 @@ public void addUpgradeModuleRecipe() { .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 1)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 8), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 8), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 32018), GT_ModHandler.getModItem(GoodGenerator.ID, "preciseUnitCasing", 64, 2), GT_ModHandler.getModItem(Avaritia.ID, "Dire_Crafting", 64), @@ -464,8 +448,7 @@ public void addUpgradeModuleRecipe() { GT_ModHandler.getModItem(GoodGenerator.ID, "huiCircuit", 32, 2), GT_ModHandler.getModItem(GoodGenerator.ID, "huiCircuit", 16, 3), GT_ModHandler.getModItem(GoodGenerator.ID, "huiCircuit", 8, 4)) - .fluidInputs( - FluidRegistry.getFluidStack("refinedglue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("refinedglue", 8000), FluidRegistry.getFluidStack("naquadah based liquid fuel mkii (depleted)", 128000)) .eut(TierEU.RECIPE_UHV) .duration(1200) @@ -475,14 +458,12 @@ public void addUpgradeModuleRecipe() { .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 2)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 8), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 8), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 998), GT_ModHandler.getModItem(GTPlusPlus.ID, "gtplusplus.blockspecialcasings.2", 64, 3), GT_ModHandler.getModItem(GTPlusPlus.ID, "gtplusplus.blocktieredcasings.1", 16, 9), GT_ModHandler.getModItem(GalacticraftCore.ID, "item.buggy", 1)) - .fluidInputs( - FluidRegistry.getFluidStack("refinedglue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("refinedglue", 8000), FluidRegistry.getFluidStack("fluid.rocketfuelmixa", 128000)) .eut(TierEU.RECIPE_UV) .duration(1200) @@ -492,20 +473,17 @@ public void addUpgradeModuleRecipe() { .metadata(RESEARCH_TIME, 12000) .itemOutputs(new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 3)) - .itemInputs( - new ItemStack(BlockRegister.BoxRing, 8), + .itemInputs(new ItemStack(BlockRegister.BoxRing, 8), GT_ModHandler.getModItem(GregTech.ID, "gt.blockmachines", 64, 828), GT_ModHandler.getModItem(GTPlusPlus.ID, "gtplusplus.blockcasings.2", 32, 9), GT_ModHandler.getModItem(GTPlusPlus.ID, "MU-metaitem.01", 4, 32105), GT_ModHandler.getModItem(GTPlusPlus.ID, "itemDustRadioactiveMineralMix", 1)) - .fluidInputs( - FluidRegistry.getFluidStack("refinedglue", 8000), + .fluidInputs(FluidRegistry.getFluidStack("refinedglue", 8000), FluidRegistry.getFluidStack("plasma.hydrogen", 12800)) .eut(TierEU.RECIPE_UV) .duration(1200) .addTo(AssemblyLine); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 4), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 4), 256000, 512, 8000000, @@ -529,8 +507,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 4), 2000, (int) TierEU.RECIPE_UIV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 5), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 5), 128000, 256, 8000000, @@ -550,8 +527,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 5), 2000, (int) TierEU.RECIPE_UEV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 6), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 6), 64000, 128, 8000000, @@ -568,8 +544,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 6), 2000, (int) TierEU.RECIPE_UEV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 7), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 7), 10240, 16, 2000000, @@ -587,8 +562,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 7), 2000, (int) TierEU.RECIPE_UHV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 8), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 8), 81920000, 32768, (int) TierEU.RECIPE_UMV, @@ -611,8 +585,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 8), 2000, (int) TierEU.RECIPE_UXV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 9), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 9), 10240000, 6144, (int) TierEU.RECIPE_UIV, @@ -635,8 +608,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 9), 2000, (int) TierEU.RECIPE_UIV); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 10), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 10), 20480000, 10240, (int) TierEU.RECIPE_UMV, @@ -660,8 +632,7 @@ public void addUpgradeModuleRecipe() { 2000, (int) TierEU.RECIPE_UXV); CraftingManager.getInstance() - .addRecipe( - new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 12), + .addRecipe(new ItemStack(BlockRegister.BoxModuleUpgrad, 1, 12), "ABA", "FCF", "DED", @@ -677,8 +648,7 @@ public void addUpgradeModuleRecipe() { new ItemStack(BlockRegister.BoxModule, 1, 10), 'D', GT_ModHandler.getModItem(NewHorizonsCoreMod.ID, "item.HeavyDutyRocketEngineTier4", 1)); - TT_recipeAdder.addResearchableAssemblylineRecipe( - new ItemStack(BlockRegister.BoxModule, 1, 13), + TT_recipeAdder.addResearchableAssemblylineRecipe(new ItemStack(BlockRegister.BoxModule, 1, 13), (int) TierEU.UXV, 32767, (int) TierEU.UXV, @@ -725,7 +695,8 @@ public void addUpgradeModuleRecipe() { * GT_OreDictUnificator.get("ingotSilver", 1) * }, * new FluidStack[]{ - * FluidRegistry.getFluidStack("molten.magnetohydrodynamicallyconstrainedstarmatter", 2000000000), + * FluidRegistry.getFluidStack( + * "molten.magnetohydrodynamicallyconstrainedstarmatter", 2000000000), * FluidRegistry.getFluidStack("molten.shirabon", 2000000000), * FluidRegistry.getFluidStack("molten.titanium", 2000000000), * FluidRegistry.getFluidStack("molten.silver", 2000000000)}, diff --git a/src/main/java/com/silvermoon/boxplusplus/common/loader/TileEntitiesLoader.java b/src/main/java/com/silvermoon/boxplusplus/common/loader/TileEntitiesLoader.java index 7cf86fa..28afe4a 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/loader/TileEntitiesLoader.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/loader/TileEntitiesLoader.java @@ -17,12 +17,10 @@ public class TileEntitiesLoader { public static void register() { Box = new GTMachineBox(17001, "multimachine_Box", i18n("tile.boxplusplus.box")); - DroneMaintainingCentre = new GTMachineDroneMaintainingCentre( - 18001, + DroneMaintainingCentre = new GTMachineDroneMaintainingCentre(18001, "multimachine_DroneMaintainingCentre", i18n("tile.boxplusplus.DroneMaintainingCentre")); - DroneMaintananceModule = new GTTileEntityDroneMaintananceModule( - 18002, + DroneMaintananceModule = new GTTileEntityDroneMaintananceModule(18002, "DroneMaintananceModule", "无人机维护中心下行模块", 5); diff --git a/src/main/java/com/silvermoon/boxplusplus/common/render/RenderBoxRing.java b/src/main/java/com/silvermoon/boxplusplus/common/render/RenderBoxRing.java index 077018c..7349d72 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/render/RenderBoxRing.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/render/RenderBoxRing.java @@ -19,8 +19,9 @@ public class RenderBoxRing extends TileEntitySpecialRenderer { private static final ResourceLocation BoxRingTexture = new ResourceLocation(Tags.MODID, "textures/models/ring.png"); - private static final IModelCustom Ring = AdvancedModelLoader - .loadModel(new ResourceLocation(Tags.MODID, "models/Ring.obj")); + private static final IModelCustom Ring = AdvancedModelLoader.loadModel(new ResourceLocation( + Tags.MODID, + "models/Ring.obj")); public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) { if (!(tile instanceof TEBoxRing ring)) return; diff --git a/src/main/java/com/silvermoon/boxplusplus/common/render/RenderDrone.java b/src/main/java/com/silvermoon/boxplusplus/common/render/RenderDrone.java index 975a4d7..1ff757f 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/render/RenderDrone.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/render/RenderDrone.java @@ -20,8 +20,9 @@ public class RenderDrone extends TileEntitySpecialRenderer { private static final ResourceLocation DroneTexture = new ResourceLocation(Tags.MODID, "textures/models/drone.png"); - private static final IModelCustom Drone = AdvancedModelLoader - .loadModel(new ResourceLocation(Tags.MODID, "models/drone1.obj")); + private static final IModelCustom Drone = AdvancedModelLoader.loadModel(new ResourceLocation( + Tags.MODID, + "models/drone1.obj")); public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) { if (!(tile instanceof IGregTechTileEntity te diff --git a/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineBox.java b/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineBox.java index eab49b6..c39aef5 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineBox.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineBox.java @@ -107,795 +107,791 @@ public class GTMachineBox extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase< // spotless off static { StructureDefinition.Builder A = IStructureDefinition.builder() - .addShape( - STRUCTURE_PIECE_MainFrames, - transpose( - new String[][] { - { " ", " C ", " CCC ", " CCCCC ", " CCC ", " C ", " ", " ", - " ", " ", " " }, - { " C ", " CCCCC ", " CC CC ", "CC CC", " CC CC ", " CCCCC ", " C ", " ", - " ", " ", " " }, - { " CCC ", " CC CC ", "CC CC", "C C", "CC CC", " CC CC ", " CCC ", " ", - " ", " ", " " }, - { " CC~CC ", "CC CC", "C C", "C D C", "C C", "CC CC", " CCCCC ", " C ", - " C ", " C ", " C " }, - { " CCC ", " CC CC ", "CC CC", "C C", "CC CC", " CC CC ", " CCC ", " ", - " ", " ", " " }, - { " C ", " CCCCC ", " CC CC ", "CC CC", " CC CC ", " CCCCC ", " C ", " ", - " ", " ", " " }, - { " ", " C ", " CCC ", " CCCCC ", " CCC ", " C ", " ", " ", - " ", " ", " " } })) - .addShape( - STRUCTURE_PIECE_FirstRing, - transpose( - new String[][] { - { " E ", " ", " E ", - " ", " ", " ", - " ", " ", " ", - " ", " ", "E E E E", - " ", " ", " ", - " ", " ", " ", - " ", " ", " E ", - " ", " E " }, - { " EEE ", " ", " EEE ", - " ", " ", " ", - " ", " ", " ", - " ", "E E E E", "E E E E", - "E E E E", " ", " ", - " ", " ", " ", - " ", " ", " EEE ", - " ", " EEE " }, - { " EEEEE ", " EEEEEEEEEEE ", " EEE EEEEE EEE ", - " EE E EE ", " EE E EE ", " EE EE ", - " EE EE ", " EE EE ", " E E ", - "EEE EEE", "EEE EEE", "EEEEE EEEEE", - "EEE EEE", "EEE EEE", " E E ", - " EE EE ", " EE EE ", " EE EE ", - " EE E EE ", " EE E EE ", " EEE EEEEE EEE ", - " EEEEEEEEEEE ", " EEEEE " }, - { " EEE EEE ", " E E ", " EEE EEE ", - " E E ", " E E ", " ", - " ", " ", "E E E E", - "E E E E", "EEEEE EEEEE", " ", - "EEEEE EEEEE", "E E E E", "E E E E", - " ", " ", " ", - " E E ", " E E ", " EEE EEE ", - " E E ", " EEE EEE " }, - { " EEEEE ", " EEEEEEEEEEE ", " EEE EEEEE EEE ", - " EE E EE ", " EE E EE ", " EE EE ", - " EE EE ", " EE EE ", " E E ", - "EEE EEE", "EEE EEE", "EEEEE EEEEE", - "EEE EEE", "EEE EEE", " E E ", - " EE EE ", " EE EE ", " EE EE ", - " EE E EE ", " EE E EE ", " EEE EEEEE EEE ", - " EEEEEEEEEEE ", " EEEEE " }, - { " EEE ", " ", " EEE ", - " ", " ", " ", - " ", " ", " ", - " ", "E E E E", "E E E E", - "E E E E", " ", " ", - " ", " ", " ", - " ", " ", " EEE ", - " ", " EEE " }, - { " E ", " ", " E ", - " ", " ", " ", - " ", " ", " ", - " ", " ", "E E E E", - " ", " ", " ", - " ", " ", " ", - " ", " ", " E ", - " ", " E " } })) - .addShape( - STRUCTURE_PIECE_SecondRing, - transpose( - new String[][] { - { " F ", " ", - " F ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", "F F F F", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " F ", " ", - " F " }, - { " FFF ", " ", - " FFF ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - "F F F F", "F F F F", - "F F F F", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " FFF ", " ", - " FFF " }, - { " F F ", " ", - " F F ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - "F F F F", " ", - "F F F F", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " F F ", " ", - " F F " }, - { " FFFFFFF ", " FFFFFFFFFFFFF ", - " FFFF FFFFFFF FFFF ", " FF F FF ", - " FFF F FFF ", " FF F FF ", - " FF FF ", " F F ", - " FF FF ", " FF FF ", - " F F ", " FF FF ", - " FF FF ", " F F ", - "FFF FFF", "FFF FFF", - "FFF FFF", "FFFFFF FFFFFF", - "FFF FFF", "FFF FFF", - "FFF FFF", " F F ", - " FF FF ", " FF FF ", - " F F ", " FF FF ", - " FF FF ", " F F ", - " FF FF ", " FF F FF ", - " FFF F FFF ", " FF F FF ", - " FFFF FFFFFFF FFFF ", " FFFFFFFFFFFFF ", - " FFFFFFF " }, - { " FF F F FF ", " F F ", - " FF F F FF ", " F F ", - " F F ", " F F ", - " ", " ", - " ", " ", - " ", " ", - " ", "F F F F", - "F F F F", " ", - "FFFFFF FFFFFF", " ", - "FFFFFF FFFFFF", " ", - "F F F F", "F F F F", - " ", " ", - " ", " ", - " ", " ", - " ", " F F ", - " F F ", " F F ", - " FF F F FF ", " F F ", - " FF F F FF " }, - { " FFFFFFF ", " FFFFFFFFFFFFF ", - " FFFF FFFFFFF FFFF ", " FF F FF ", - " FFF F FFF ", " FF F FF ", - " FF FF ", " F F ", - " FF FF ", " FF FF ", - " F F ", " FF FF ", - " FF FF ", " F F ", - "FFF FFF", "FFF FFF", - "FFF FFF", "FFFFFF FFFFFF", - "FFF FFF", "FFF FFF", - "FFF FFF", " F F ", - " FF FF ", " FF FF ", - " F F ", " FF FF ", - " FF FF ", " F F ", - " FF FF ", " FF F FF ", - " FFF F FFF ", " FF F FF ", - " FFFF FFFFFFF FFFF ", " FFFFFFFFFFFFF ", - " FFFFFFF " }, - { " F F ", " ", - " F F ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - "F F F F", " ", - "F F F F", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " F F ", " ", - " F F " }, - { " FFF ", " ", - " FFF ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - "F F F F", "F F F F", - "F F F F", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " FFF ", " ", - " FFF " }, - { " F ", " ", - " F ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", "F F F F", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " F ", " ", - " F " } })) - .addShape( - STRUCTURE_PIECE_Final, - transpose( - new String[][] { - { " G ", - " ", - " G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G ", - " ", - " G " }, - { " GGG ", - " ", - " GGG ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - "G G G G", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " GGG ", - " ", - " GGG " }, - { " G G ", - " ", - " G G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - " ", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G G ", - " ", - " G G " }, - { " GGGGG ", - " GGGGGGGGGGGGGGG ", - " GGGG GG GG GGGG ", - " GGG GGG ", - " GGG GGG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " GG GG ", - " G G ", - " G G ", - " G G ", - "GGG GGG", - "GGG GGG", - "GG GG", - "GGG GGG", - "GGG GGG", - " G G ", - " G G ", - " G G ", - " GG GG ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GGG GGG ", - " GGG GGG ", - " GGGG GG GG GGGG ", - " GGGGGGGGGGGGGGG ", - " GGGGG " }, - { " GGG G GGG ", - " G ", - " GGG G GGG ", - " G ", - " G ", - " G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - "G G G G", - "G G G G", - " ", - "GGGGGG GGGGGG", - " ", - "G G G G", - "G G G G", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G ", - " G ", - " G ", - " GGG G GGG ", - " G ", - " GGG G GGG " }, - { " GG G G GG ", - " G G ", - " GG G G GG ", - " G G ", - " G G ", - " G G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - "G G G G", - " ", - " ", - "GGGGGG GGGGGG", - " ", - "GGGGGG GGGGGG", - " ", - " ", - "G G G G", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G G ", - " G G ", - " G G ", - " GG G G GG ", - " G G ", - " GG G G GG " }, - { " GGG G GGG ", - " G ", - " GGG G GGG ", - " G ", - " G ", - " G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - "G G G G", - "G G G G", - " ", - "GGGGGG GGGGGG", - " ", - "G G G G", - "G G G G", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G ", - " G ", - " G ", - " GGG G GGG ", - " G ", - " GGG G GGG " }, - { " GGGGG ", - " GGGGGGGGGGGGGGG ", - " GGGG GG GG GGGG ", - " GGG GGG ", - " GGG GGG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " GG GG ", - " G G ", - " G G ", - " G G ", - "GGG GGG", - "GGG GGG", - "GG GG", - "GGG GGG", - "GGG GGG", - " G G ", - " G G ", - " G G ", - " GG GG ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " G G ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GG GG ", - " GGG GGG ", - " GGG GGG ", - " GGGG GG GG GGGG ", - " GGGGGGGGGGGGGGG ", - " GGGGG " }, - { " G G ", - " ", - " G G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - " ", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G G ", - " ", - " G G " }, - { " GGG ", - " ", - " GGG ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - "G G G G", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " GGG ", - " ", - " GGG " }, - { " G ", - " ", - " G ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "G G G G", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " G ", - " ", - " G " } })); + .addShape(STRUCTURE_PIECE_MainFrames, + transpose(new String[][] { + { " ", " C ", " CCC ", " CCCCC ", " CCC ", " C ", " ", " ", " ", + " ", " " }, + { " C ", " CCCCC ", " CC CC ", "CC CC", " CC CC ", " CCCCC ", " C ", " ", " ", + " ", " " }, + { " CCC ", " CC CC ", "CC CC", "C C", "CC CC", " CC CC ", " CCC ", " ", " ", + " ", " " }, + { " CC~CC ", "CC CC", "C C", "C D C", "C C", "CC CC", " CCCCC ", " C ", " C ", + " C ", " C " }, + { " CCC ", " CC CC ", "CC CC", "C C", "CC CC", " CC CC ", " CCC ", " ", " ", + " ", " " }, + { " C ", " CCCCC ", " CC CC ", "CC CC", " CC CC ", " CCCCC ", " C ", " ", " ", + " ", " " }, + { " ", " C ", " CCC ", " CCCCC ", " CCC ", " C ", " ", " ", " ", + " ", " " } })) + .addShape(STRUCTURE_PIECE_FirstRing, + transpose(new String[][] { + { " E ", " ", " E ", + " ", " ", " ", + " ", " ", " ", + " ", " ", "E E E E", + " ", " ", " ", + " ", " ", " ", + " ", " ", " E ", + " ", " E " }, + { " EEE ", " ", " EEE ", + " ", " ", " ", + " ", " ", " ", + " ", "E E E E", "E E E E", + "E E E E", " ", " ", + " ", " ", " ", + " ", " ", " EEE ", + " ", " EEE " }, + { " EEEEE ", " EEEEEEEEEEE ", " EEE EEEEE EEE ", + " EE E EE ", " EE E EE ", " EE EE ", + " EE EE ", " EE EE ", " E E ", + "EEE EEE", "EEE EEE", "EEEEE EEEEE", + "EEE EEE", "EEE EEE", " E E ", + " EE EE ", " EE EE ", " EE EE ", + " EE E EE ", " EE E EE ", " EEE EEEEE EEE ", + " EEEEEEEEEEE ", " EEEEE " }, + { " EEE EEE ", " E E ", " EEE EEE ", + " E E ", " E E ", " ", + " ", " ", "E E E E", + "E E E E", "EEEEE EEEEE", " ", + "EEEEE EEEEE", "E E E E", "E E E E", + " ", " ", " ", + " E E ", " E E ", " EEE EEE ", + " E E ", " EEE EEE " }, + { " EEEEE ", " EEEEEEEEEEE ", " EEE EEEEE EEE ", + " EE E EE ", " EE E EE ", " EE EE ", + " EE EE ", " EE EE ", " E E ", + "EEE EEE", "EEE EEE", "EEEEE EEEEE", + "EEE EEE", "EEE EEE", " E E ", + " EE EE ", " EE EE ", " EE EE ", + " EE E EE ", " EE E EE ", " EEE EEEEE EEE ", + " EEEEEEEEEEE ", " EEEEE " }, + { " EEE ", " ", " EEE ", + " ", " ", " ", + " ", " ", " ", + " ", "E E E E", "E E E E", + "E E E E", " ", " ", + " ", " ", " ", + " ", " ", " EEE ", + " ", " EEE " }, + { " E ", " ", " E ", + " ", " ", " ", + " ", " ", " ", + " ", " ", "E E E E", + " ", " ", " ", + " ", " ", " ", + " ", " ", " E ", + " ", " E " } })) + .addShape(STRUCTURE_PIECE_SecondRing, + transpose(new String[][] { + { " F ", " ", + " F ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", "F F F F", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " F ", " ", + " F " }, + { " FFF ", " ", + " FFF ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + "F F F F", "F F F F", + "F F F F", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " FFF ", " ", + " FFF " }, + { " F F ", " ", + " F F ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + "F F F F", " ", + "F F F F", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " F F ", " ", + " F F " }, + { " FFFFFFF ", " FFFFFFFFFFFFF ", + " FFFF FFFFFFF FFFF ", " FF F FF ", + " FFF F FFF ", " FF F FF ", + " FF FF ", " F F ", + " FF FF ", " FF FF ", + " F F ", " FF FF ", + " FF FF ", " F F ", + "FFF FFF", "FFF FFF", + "FFF FFF", "FFFFFF FFFFFF", + "FFF FFF", "FFF FFF", + "FFF FFF", " F F ", + " FF FF ", " FF FF ", + " F F ", " FF FF ", + " FF FF ", " F F ", + " FF FF ", " FF F FF ", + " FFF F FFF ", " FF F FF ", + " FFFF FFFFFFF FFFF ", " FFFFFFFFFFFFF ", + " FFFFFFF " }, + { " FF F F FF ", " F F ", + " FF F F FF ", " F F ", + " F F ", " F F ", + " ", " ", + " ", " ", + " ", " ", + " ", "F F F F", + "F F F F", " ", + "FFFFFF FFFFFF", " ", + "FFFFFF FFFFFF", " ", + "F F F F", "F F F F", + " ", " ", + " ", " ", + " ", " ", + " ", " F F ", + " F F ", " F F ", + " FF F F FF ", " F F ", + " FF F F FF " }, + { " FFFFFFF ", " FFFFFFFFFFFFF ", + " FFFF FFFFFFF FFFF ", " FF F FF ", + " FFF F FFF ", " FF F FF ", + " FF FF ", " F F ", + " FF FF ", " FF FF ", + " F F ", " FF FF ", + " FF FF ", " F F ", + "FFF FFF", "FFF FFF", + "FFF FFF", "FFFFFF FFFFFF", + "FFF FFF", "FFF FFF", + "FFF FFF", " F F ", + " FF FF ", " FF FF ", + " F F ", " FF FF ", + " FF FF ", " F F ", + " FF FF ", " FF F FF ", + " FFF F FFF ", " FF F FF ", + " FFFF FFFFFFF FFFF ", " FFFFFFFFFFFFF ", + " FFFFFFF " }, + { " F F ", " ", + " F F ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + "F F F F", " ", + "F F F F", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " F F ", " ", + " F F " }, + { " FFF ", " ", + " FFF ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + "F F F F", "F F F F", + "F F F F", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " FFF ", " ", + " FFF " }, + { " F ", " ", + " F ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", "F F F F", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " F ", " ", + " F " } })) + .addShape(STRUCTURE_PIECE_Final, + transpose(new String[][] { { " G ", + " ", + " G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G ", + " ", + " G " }, + { " GGG ", + " ", + " GGG ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + "G G G G", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " GGG ", + " ", + " GGG " }, + { " G G ", + " ", + " G G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + " ", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G G ", + " ", + " G G " }, + { " GGGGG ", + " GGGGGGGGGGGGGGG ", + " GGGG GG GG GGGG ", + " GGG GGG ", + " GGG GGG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " GG GG ", + " G G ", + " G G ", + " G G ", + "GGG GGG", + "GGG GGG", + "GG GG", + "GGG GGG", + "GGG GGG", + " G G ", + " G G ", + " G G ", + " GG GG ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GGG GGG ", + " GGG GGG ", + " GGGG GG GG GGGG ", + " GGGGGGGGGGGGGGG ", + " GGGGG " }, + { " GGG G GGG ", + " G ", + " GGG G GGG ", + " G ", + " G ", + " G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + "G G G G", + "G G G G", + " ", + "GGGGGG GGGGGG", + " ", + "G G G G", + "G G G G", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G ", + " G ", + " G ", + " GGG G GGG ", + " G ", + " GGG G GGG " }, + { " GG G G GG ", + " G G ", + " GG G G GG ", + " G G ", + " G G ", + " G G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + "G G G G", + " ", + " ", + "GGGGGG GGGGGG", + " ", + "GGGGGG GGGGGG", + " ", + " ", + "G G G G", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G G ", + " G G ", + " G G ", + " GG G G GG ", + " G G ", + " GG G G GG " }, + { " GGG G GGG ", + " G ", + " GGG G GGG ", + " G ", + " G ", + " G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + "G G G G", + "G G G G", + " ", + "GGGGGG GGGGGG", + " ", + "G G G G", + "G G G G", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G ", + " G ", + " G ", + " GGG G GGG ", + " G ", + " GGG G GGG " }, + { " GGGGG ", + " GGGGGGGGGGGGGGG ", + " GGGG GG GG GGGG ", + " GGG GGG ", + " GGG GGG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " GG GG ", + " G G ", + " G G ", + " G G ", + "GGG GGG", + "GGG GGG", + "GG GG", + "GGG GGG", + "GGG GGG", + " G G ", + " G G ", + " G G ", + " GG GG ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " G G ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GG GG ", + " GGG GGG ", + " GGG GGG ", + " GGGG GG GG GGGG ", + " GGGGGGGGGGGGGGG ", + " GGGGG " }, + { " G G ", + " ", + " G G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + " ", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G G ", + " ", + " G G " }, + { " GGG ", + " ", + " GGG ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + "G G G G", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " GGG ", + " ", + " GGG " }, + { " G ", + " ", + " G ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "G G G G", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " G ", + " ", + " G " } })); for (int i = 0; i < 14; i++) { A.addShape(getModuleByIndex(i).name, transpose(getModuleByIndex(i).moduleStructure)); } - A.addElement( - 'C', - buildHatchAdder(GTMachineBox.class) - .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Energy, ExoticEnergy, Maintenance) - .casingIndex(114 << 7) - .dot(1) - .buildAndChain(onElementPass(i -> ++i.extendCasing, ofBlock(BlockRegister.SpaceExtend, 0)))) + A.addElement('C', + buildHatchAdder(GTMachineBox.class).atLeast(InputBus, + OutputBus, + InputHatch, + OutputHatch, + Energy, + ExoticEnergy, + Maintenance) + .casingIndex(114 << 7) + .dot(1) + .buildAndChain(onElementPass(i -> ++i.extendCasing, ofBlock(BlockRegister.SpaceExtend, 0)))) .addElement('D', Util.RingTileAdder((v, t) -> { - if ((t.getBlockType() - .isAssociatedBlock(BlockRegister.BoxRing) && v.ringCountSet != 1)) return false; - if ((t.getBlockType() - .isAssociatedBlock(BlockRegister.BoxRing2) && v.ringCountSet != 2)) return false; - if ((t.getBlockType() - .isAssociatedBlock(BlockRegister.BoxRing3) && v.ringCountSet != 3)) return false; - v.teBoxRing = t; - return true; - }, + if ((t.getBlockType() + .isAssociatedBlock(BlockRegister.BoxRing) && v.ringCountSet != 1)) return false; + if ((t.getBlockType() + .isAssociatedBlock(BlockRegister.BoxRing2) && v.ringCountSet != 2)) return false; + if ((t.getBlockType() + .isAssociatedBlock(BlockRegister.BoxRing3) && v.ringCountSet != 3)) return false; + v.teBoxRing = t; + return true; + }, TEBoxRing.class, BlockRegister.BoxRing, 0, - v -> v.ringCountSet == 1 ? BlockRegister.BoxRing + v -> v.ringCountSet == 1 + ? BlockRegister.BoxRing : (v.ringCountSet == 2 ? BlockRegister.BoxRing2 : BlockRegister.BoxRing3))) .addElement('E', ofBlock(BlockRegister.SpaceCompress, 0)) .addElement('F', ofBlock(BlockRegister.SpaceConstraint, 0)) @@ -1025,8 +1021,7 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { } for (int i = 0; i < 14; i++) { if (moduleSwitch[i] || stackSize.stackSize - 4 >= i) { - buildPiece( - getModuleByIndex(i).name, + buildPiece(getModuleByIndex(i).name, stackSize, hintsOnly, getModuleByIndex(i).horizontalOffset, @@ -1045,8 +1040,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE case 1 -> { switch (stack.stackSize) { case 1 -> { - count += survivialBuildPiece( - STRUCTURE_PIECE_MainFrames, + count += survivialBuildPiece(STRUCTURE_PIECE_MainFrames, stack, 3, 3, @@ -1055,8 +1049,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_FirstRing, + count += survivialBuildPiece(STRUCTURE_PIECE_FirstRing, stack, 11, 3, @@ -1067,8 +1060,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE true); } case 2 -> { - count += survivialBuildPiece( - STRUCTURE_PIECE_MainFrames, + count += survivialBuildPiece(STRUCTURE_PIECE_MainFrames, stack, 3, 3, @@ -1077,8 +1069,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_FirstRing, + count += survivialBuildPiece(STRUCTURE_PIECE_FirstRing, stack, 11, 3, @@ -1087,8 +1078,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_SecondRing, + count += survivialBuildPiece(STRUCTURE_PIECE_SecondRing, stack, 17, 5, @@ -1099,8 +1089,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE true); } default -> { - count += survivialBuildPiece( - STRUCTURE_PIECE_MainFrames, + count += survivialBuildPiece(STRUCTURE_PIECE_MainFrames, stack, 3, 3, @@ -1109,8 +1098,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_FirstRing, + count += survivialBuildPiece(STRUCTURE_PIECE_FirstRing, stack, 11, 3, @@ -1119,8 +1107,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_SecondRing, + count += survivialBuildPiece(STRUCTURE_PIECE_SecondRing, stack, 17, 5, @@ -1129,8 +1116,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_Final, + count += survivialBuildPiece(STRUCTURE_PIECE_Final, stack, 23, 5, @@ -1143,8 +1129,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE } } case 2 -> { - count += survivialBuildPiece( - STRUCTURE_PIECE_MainFrames, + count += survivialBuildPiece(STRUCTURE_PIECE_MainFrames, stack, 3, 3, @@ -1153,8 +1138,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_FirstRing, + count += survivialBuildPiece(STRUCTURE_PIECE_FirstRing, stack, 11, 3, @@ -1163,8 +1147,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_SecondRing, + count += survivialBuildPiece(STRUCTURE_PIECE_SecondRing, stack, 17, 5, @@ -1175,8 +1158,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE true); } case 3 -> { - count += survivialBuildPiece( - STRUCTURE_PIECE_MainFrames, + count += survivialBuildPiece(STRUCTURE_PIECE_MainFrames, stack, 3, 3, @@ -1185,8 +1167,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_FirstRing, + count += survivialBuildPiece(STRUCTURE_PIECE_FirstRing, stack, 11, 3, @@ -1195,8 +1176,7 @@ public int survivalConstruct(ItemStack stack, int elementBudget, ISurvivalBuildE env, false, true); - count += survivialBuildPiece( - STRUCTURE_PIECE_SecondRing, + count += survivialBuildPiece(STRUCTURE_PIECE_SecondRing, stack, 17, 5, @@ -1224,8 +1204,11 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a machineError = new int[2]; switch (ringCountSet) { case 1 -> { - if (checkPiece(STRUCTURE_PIECE_MainFrames, 3, 3, 0) - && checkPiece(STRUCTURE_PIECE_FirstRing, 11, 3, 8)) { + if (checkPiece(STRUCTURE_PIECE_MainFrames, 3, 3, 0) && checkPiece( + STRUCTURE_PIECE_FirstRing, + 11, + 3, + 8)) { ringCount = 1; break; } @@ -1237,7 +1220,8 @@ && checkPiece(STRUCTURE_PIECE_FirstRing, 11, 3, 8)) { return false; } case 2 -> { - if (checkPiece(STRUCTURE_PIECE_MainFrames, 3, 3, 0) && checkPiece(STRUCTURE_PIECE_FirstRing, 11, 3, 8) + if (checkPiece(STRUCTURE_PIECE_MainFrames, 3, 3, 0) + && checkPiece(STRUCTURE_PIECE_FirstRing, 11, 3, 8) && checkPiece(STRUCTURE_PIECE_SecondRing, 17, 5, 14)) { ringCount = 2; maxParallel = 6400; @@ -1252,7 +1236,8 @@ && checkPiece(STRUCTURE_PIECE_SecondRing, 17, 5, 14)) { return false; } case 3 -> { - if (checkPiece(STRUCTURE_PIECE_MainFrames, 3, 3, 0) && checkPiece(STRUCTURE_PIECE_FirstRing, 11, 3, 8) + if (checkPiece(STRUCTURE_PIECE_MainFrames, 3, 3, 0) + && checkPiece(STRUCTURE_PIECE_FirstRing, 11, 3, 8) && checkPiece(STRUCTURE_PIECE_SecondRing, 17, 5, 14) && checkPiece(STRUCTURE_PIECE_Final, 23, 5, 20)) { ringCount = 3; @@ -1273,8 +1258,7 @@ && checkPiece(STRUCTURE_PIECE_Final, 23, 5, 20)) { } for (int i = 0; i < 15; i++) { if (moduleSwitch[i]) { - if (checkPiece( - getModuleByIndex(i).name, + if (checkPiece(getModuleByIndex(i).name, getModuleByIndex(i).horizontalOffset, getModuleByIndex(i).verticalOffset, getModuleByIndex(i).depthOffset)) { @@ -1331,8 +1315,8 @@ public CheckRecipeResult checkProcessing() { inputFluid.addAll(Arrays.asList(inv.getFluidInputs())); } } - if ((inputItem.isEmpty() && !recipe.FinalItemInput.isEmpty()) - || (inputFluid.isEmpty() && !recipe.FinalFluidInput.isEmpty())) return CheckRecipeResultRegistry.NO_RECIPE; + if ((inputItem.isEmpty() && !recipe.FinalItemInput.isEmpty()) || (inputFluid.isEmpty() + && !recipe.FinalFluidInput.isEmpty())) return CheckRecipeResultRegistry.NO_RECIPE; for (int k : recipe.requireModules.keySet()) { if (k == 13 && recipe.requireModules.get(k) == 2 && !debug) return SimpleCheckRecipeResult.ofFailure("box_debugmode"); @@ -1353,9 +1337,9 @@ public CheckRecipeResult checkProcessing() { inputFluid.removeAll(Collections.singleton(null)); return (!recipe.FinalItemInput.isEmpty()) ? (!recipe.FinalFluidInput.isEmpty() - ? ((requireItem.isEmpty() && requireFluid.isEmpty()) ? runBox(inputItem, inputFluid) - : CheckRecipeResultRegistry.NO_RECIPE) - : (requireItem.isEmpty() ? runBox(inputItem, inputFluid) : CheckRecipeResultRegistry.NO_RECIPE)) + ? ((requireItem.isEmpty() + && requireFluid.isEmpty()) ? runBox(inputItem, inputFluid) : CheckRecipeResultRegistry.NO_RECIPE) + : (requireItem.isEmpty() ? runBox(inputItem, inputFluid) : CheckRecipeResultRegistry.NO_RECIPE)) : (requireFluid.isEmpty() ? runBox(inputItem, inputFluid) : CheckRecipeResultRegistry.NO_RECIPE); } @@ -1372,8 +1356,9 @@ public CheckRecipeResult runBox(List inputItem, List inpu return CheckRecipeResultRegistry.insufficientPower(recipe.FinalVoteage); lEUt = -recipe.FinalVoteage; } - if (moduleActive[12] && moduleTier[12] == 1 - && !addEUToGlobalEnergyMap(userUUID, -recipe.FinalVoteage * recipe.FinalTime)) { + if (moduleActive[12] && moduleTier[12] == 1 && !addEUToGlobalEnergyMap( + userUUID, + -recipe.FinalVoteage * recipe.FinalTime)) { return SimpleCheckRecipeResult.ofFailure("no_wireless_power"); } calTime(); @@ -1443,12 +1428,10 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec if (side == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[114][0], TextureFactory.builder() .addIcon(boxActive) - .extFacing() - .build() }; + .extFacing().build() }; return new ITexture[] { casingTexturePages[114][0], TextureFactory.builder() .addIcon(boxInactive) - .extFacing() - .build() }; + .extFacing().build() }; } return new ITexture[] { casingTexturePages[114][0] }; } @@ -1496,8 +1479,9 @@ private void makeAE2Pattern(EntityPlayer player, String item, String fluid) { patternDetail.setCanBeSubstitute(0); outputPattern = patternDetail.writeToStack(); } - outputPattern.stackTagCompound - .setString("author", player.getDisplayName() + i18n("tile.boxplusplus.boxinfo.16")); + outputPattern.stackTagCompound.setString( + "author", + player.getDisplayName() + i18n("tile.boxplusplus.boxinfo.16")); pattern.stackSize -= 1; mOutputItems = new ItemStack[] { outputPattern }; mMaxProgresstime = 100; @@ -1520,8 +1504,10 @@ public void buildRecipe() { recipe = new BoxRecipe(); routingMap.forEach(boxRoutings -> { inputItemContainer.addItemStackList(boxRoutings.InputItem, boxRoutings.Parallel); - outputItemContainer - .addItemStackList(boxRoutings.OutputItem, boxRoutings.OutputChance, boxRoutings.Parallel); + outputItemContainer.addItemStackList( + boxRoutings.OutputItem, + boxRoutings.OutputChance, + boxRoutings.Parallel); inputFluidContainer.addFluidStackList(boxRoutings.InputFluid, boxRoutings.Parallel); OutputFluidContainer.addFluidStackList(boxRoutings.OutputFluid, boxRoutings.Parallel); recipe.FinalTime += boxRoutings.time * 5000 / (1 + Math.exp(-(boxRoutings.Parallel - 2000) / 320.0)); @@ -1566,9 +1552,8 @@ private boolean halveRecipe() { @Override public void onRemoval() { if (boxMap.containsValue(this)) boxMap.entrySet() - .removeIf( - t -> t.getValue() - .equals(this)); + .removeIf(t -> t.getValue() + .equals(this)); } /** @@ -1581,8 +1566,7 @@ public void saveNBTData(NBTTagCompound NBT) { NBTTagCompound Routing = new NBTTagCompound(); Routing.setInteger("ActiveRouting", routingMap.size()); for (int i = 0; i < routingMap.size(); i++) { - Routing.setTag( - "Routing" + (i + 1), + Routing.setTag("Routing" + (i + 1), routingMap.get(i) .routingToNbt()); } @@ -1651,28 +1635,27 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont buildContext.addSyncedWindow(20, this::createClearWindow); Synchronize(builder); builder.widget(// Module - new ButtonWidget().setOnClick( - (clickData, widget) -> { - if (!widget.isClient()) widget.getContext() - .openSyncedWindow(13); - }) - .setSize(16, 16) - .setBackground(() -> { - List UI = new ArrayList<>(); - UI.add(GT_UITextures.BUTTON_STANDARD); - UI.add(GT_UITextures.OVERLAY_BUTTON_WHITELIST); - return UI.toArray(new IDrawable[0]); - }) - .addTooltip(i18n("tile.boxplusplus.boxUI.01")) - .setPos(94, 91)) + new ButtonWidget().setOnClick((clickData, widget) -> { + if (!widget.isClient()) widget.getContext() + .openSyncedWindow(13); + }) + .setSize(16, 16) + .setBackground(() -> { + List UI = new ArrayList<>(); + UI.add(GT_UITextures.BUTTON_STANDARD); + UI.add(GT_UITextures.OVERLAY_BUTTON_WHITELIST); + return UI.toArray(new IDrawable[0]); + }) + .addTooltip(i18n("tile.boxplusplus.boxUI.01")) + .setPos(94, 91)) .widget(// SwitchRender new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - if (teBoxRing != null) { - teBoxRing.teRingSwitch = !teBoxRing.teRingSwitch; + if (!widget.isClient()) { + if (teBoxRing != null) { + teBoxRing.teRingSwitch = !teBoxRing.teRingSwitch; + } } - } - }) + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1684,15 +1667,13 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setPos(146, 91)) .widget(// Routing new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - Util.boxMap.put( + if (!widget.isClient()) { + Util.boxMap.put(widget.getContext() + .getPlayer(), this); widget.getContext() - .getPlayer(), - this); - widget.getContext() - .openSyncedWindow(10); - } - }) + .openSyncedWindow(10); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1703,8 +1684,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .addTooltip(i18n("tile.boxplusplus.boxUI.03")) .setPos(120, 91)) .widget(// WIKI - new ButtonWidget().setOnClick( - (clickData, widget) -> { + new ButtonWidget().setOnClick((clickData, widget) -> { if (!widget.isClient()) widget.getContext() .openSyncedWindow(15); }) @@ -1724,25 +1704,29 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont */ protected ModularWindow createModuleWindow(final EntityPlayer player) { ModularWindow.Builder builder = ModularWindow.builder(250, 250); - builder - .setBackground(AdaptableUITexture.of(Tags.MODID, "textures/gui/ring" + ringCountSet + ".png", 695, 695, 4)); + builder.setBackground(AdaptableUITexture.of( + Tags.MODID, + "textures/gui/ring" + ringCountSet + ".png", + 695, + 695, + 4)); builder.setGuiTint(getGUIColorization()); Synchronize(builder); builder.widget(// Ring1 new ButtonWidget().setOnClick((clickData, widget) -> { - this.ringCountSet = 1; - for (int i = 4; i < 14; i++) { - moduleSwitch[i] = false; - moduleActive[i] = false; - onMachineBlockUpdate(); - } - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(13); - } - }) + this.ringCountSet = 1; + for (int i = 4; i < 14; i++) { + moduleSwitch[i] = false; + moduleActive[i] = false; + onMachineBlockUpdate(); + } + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(13); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1754,19 +1738,19 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setPos(8, 8)); builder.widget(// Ring2 new ButtonWidget().setOnClick((clickData, widget) -> { - this.ringCountSet = 2; - for (int i = 8; i < 14; i++) { - moduleSwitch[i] = false; - moduleActive[i] = false; - onMachineBlockUpdate(); - } - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(13); - } - }) + this.ringCountSet = 2; + for (int i = 8; i < 14; i++) { + moduleSwitch[i] = false; + moduleActive[i] = false; + onMachineBlockUpdate(); + } + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(13); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1777,54 +1761,53 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .addTooltip(i18n("tile.boxplusplus.boxUI.module.21")) .setPos(8, 26)); builder.widget(// Ring3 - new ButtonWidget().setOnClick((clickData, widget) -> { - this.ringCountSet = 3; - onMachineBlockUpdate(); - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(13); - } - }) - .setSize(16, 16) - .setBackground(() -> { - List UI = new ArrayList<>(); - UI.add(GT_UITextures.BUTTON_STANDARD); - UI.add(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID); - return UI.toArray(new IDrawable[0]); - }) - .addTooltip(i18n("tile.boxplusplus.boxUI.module.22")) - .setPos(8, 44)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(238, 0)); + new ButtonWidget().setOnClick((clickData, widget) -> { + this.ringCountSet = 3; + onMachineBlockUpdate(); + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(13); + } + }) + .setSize(16, 16) + .setBackground(() -> { + List UI = new ArrayList<>(); + UI.add(GT_UITextures.BUTTON_STANDARD); + UI.add(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID); + return UI.toArray(new IDrawable[0]); + }) + .addTooltip(i18n("tile.boxplusplus.boxUI.module.22")) + .setPos(8, 44)) + .widget(ButtonWidget.closeWindowButton(true) + .setPos(238, 0)); builder.widget(// 3.1 - new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 8; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) - .setSize(16, 16) - .setBackground(() -> { - List UI = new ArrayList<>(); - UI.add(AdaptableUITexture.of(Tags.MODID, "textures/gui/09a.png", 16, 16, 4)); - UI.add(AdaptableUITexture.of(Tags.MODID, "textures/gui/01b.png", 16, 16, 4)); - return UI.toArray(new IDrawable[0]); - }) - .addTooltip(i18n("tile.boxplusplus.boxUI.module.9")) - .setPos(8, 117) - .setEnabled(ringCountSet == 3)) + new ButtonWidget().setOnClick((clickData, widget) -> { + moduleSN = 8; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) + .setSize(16, 16) + .setBackground(() -> { + List UI = new ArrayList<>(); + UI.add(AdaptableUITexture.of(Tags.MODID, "textures/gui/09a.png", 16, 16, 4)); + UI.add(AdaptableUITexture.of(Tags.MODID, "textures/gui/01b.png", 16, 16, 4)); + return UI.toArray(new IDrawable[0]); + }) + .addTooltip(i18n("tile.boxplusplus.boxUI.module.9")) + .setPos(8, 117) + .setEnabled(ringCountSet == 3)) .widget(// 3.2 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 9; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 9; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1837,12 +1820,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setEnabled(ringCountSet == 3)) .widget(// 3.3 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 10; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 10; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1870,15 +1853,14 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { * .addTooltip(i18n("tile.boxplusplus.boxUI.module.12")) * .setPos(117, 223) * .setEnabled(RingCounts==3)) - */ - .widget(// 2.1 + */.widget(// 2.1 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 4; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 4; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1891,12 +1873,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setEnabled(ringCountSet > 1)) .widget(// 2.2 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 5; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 5; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1909,12 +1891,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setEnabled(ringCountSet > 1)) .widget(// 2.3 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 6; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 6; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1927,12 +1909,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setEnabled(ringCountSet > 1)) .widget(// 2.4 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 7; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 7; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1945,12 +1927,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setEnabled(ringCountSet > 1)) .widget(// 1.1 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 0; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 0; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1962,12 +1944,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setPos(64, 117)) .widget(// 1.2 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 1; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 1; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1979,12 +1961,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setPos(117, 67)) .widget(// 1.3 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 2; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 2; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -1996,12 +1978,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setPos(164, 117)) .widget(// 1.4 new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 3; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 3; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2013,12 +1995,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setPos(117, 167)) .widget(// Up new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 12; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 12; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(AdaptableUITexture.of(Tags.MODID, "textures/gui/13a.png", 16, 16, 1)) .addTooltip(i18n("tile.boxplusplus.boxUI.module.13")) @@ -2026,12 +2008,12 @@ protected ModularWindow createModuleWindow(final EntityPlayer player) { .setEnabled(ringCountSet == 3)) .widget(// Down new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = 13; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(14); - } - }) + moduleSN = 13; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(14); + } + }) .setSize(16, 16) .setBackground(AdaptableUITexture.of(Tags.MODID, "textures/gui/14a.png", 16, 16, 1)) .addTooltip(i18n("tile.boxplusplus.boxUI.module.14")) @@ -2047,61 +2029,63 @@ protected ModularWindow createSingleModuleWindow(final EntityPlayer player) { ModularWindow.Builder builder = ModularWindow.builder(150, 200); builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); - builder.widget( - ButtonWidget.closeWindowButton(true) + builder.widget(ButtonWidget.closeWindowButton(true) .setPos(136, 3)) - .widget( - new DrawableWidget().setDrawable(AdaptableUITexture.of(Tags.MODID, "textures/gui/dream.png", 16, 16, 1)) - .setPos(5, 5) - .setSize(16, 16)) + .widget(new DrawableWidget().setDrawable(AdaptableUITexture.of(Tags.MODID, + "textures/gui/dream.png", + 16, + 16, + 1)) + .setPos(5, 5) + .setSize(16, 16)) .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.module." + (moduleSN + 1))).setPos(25, 9)) - .widget( - new DrawableWidget() - .setDrawable( - AdaptableUITexture.of(Tags.MODID, "textures/gui/" + (moduleSN + 1) + ".png", 100, 80, 1)) - .setPos(20, 25) - .setSize(110, 73)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.module.context." + (moduleSN + 1) + "a")) - .setTextAlignment(TopCenter) - .setMaxWidth(130) - .setPos(10, 100)) + .widget(new DrawableWidget().setDrawable(AdaptableUITexture.of(Tags.MODID, + "textures/gui/" + (moduleSN + 1) + ".png", + 100, + 80, + 1)) + .setPos(20, 25) + .setSize(110, 73)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.module.context." + + (moduleSN + 1) + + "a")).setTextAlignment(TopCenter) + .setMaxWidth(130) + .setPos(10, 100)) .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.26")).setPos(20, 130)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.module.context." + (moduleSN + 1) + "b")).setMaxWidth(110) - .setPos(20, 140)) - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.module.24") - + i18n("tile.boxplusplus.boxUI.module.16" + (moduleSwitch[moduleSN] ? "" : "a")) - + (moduleTier[moduleSN] == 0 ? " (T1)" : " (T2)")).setPos(20, 175)); + .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.module.context." + (moduleSN + 1) + "b")).setMaxWidth( + 110) + .setPos(20, 140)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.module.24") + i18n("tile.boxplusplus.boxUI.module.16" + + (moduleSwitch[moduleSN] ? "" : "a")) + (moduleTier[moduleSN] == 0 ? " (T1)" : " (T2)")).setPos( + 20, + 175)); builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSwitch[moduleSN] = true; - onMachineBlockUpdate(); - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - } - }) - .setSize(20, 20) - .setBackground(() -> { - List UI = new ArrayList<>(); - UI.add(GT_UITextures.BUTTON_STANDARD); - UI.add(GT_UITextures.OVERLAY_BUTTON_CHECKMARK); - return UI.toArray(new IDrawable[0]); - }) - .addTooltip(i18n("tile.boxplusplus.boxUI.module.16")) - .setPos(100, 170) - .setEnabled(!moduleSwitch[moduleSN])) + moduleSwitch[moduleSN] = true; + onMachineBlockUpdate(); + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + } + }) + .setSize(20, 20) + .setBackground(() -> { + List UI = new ArrayList<>(); + UI.add(GT_UITextures.BUTTON_STANDARD); + UI.add(GT_UITextures.OVERLAY_BUTTON_CHECKMARK); + return UI.toArray(new IDrawable[0]); + }) + .addTooltip(i18n("tile.boxplusplus.boxUI.module.16")) + .setPos(100, 170) + .setEnabled(!moduleSwitch[moduleSN])) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSwitch[moduleSN] = false; - moduleActive[moduleSN] = false; - onMachineBlockUpdate(); - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - } - }) + moduleSwitch[moduleSN] = false; + moduleActive[moduleSN] = false; + onMachineBlockUpdate(); + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + } + }) .setSize(20, 20) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2129,23 +2113,21 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { for (int i = 0; i < 5; i++) { randomSN.add(new Random().nextInt(5) + 1); } - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_ARROW_GREEN_UP) + builder.widget(new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_ARROW_GREEN_UP) .setPos(5, 5) .setSize(16, 16)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.05") + i18n("tile.boxplusplus.boxUI.06") + maxRouting) - .setPos(25, 9)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.05") + + i18n("tile.boxplusplus.boxUI.06") + + maxRouting).setPos(25, 9)) .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.40") + maxParallel).setPos(170, 9)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(240, 5)); + .widget(ButtonWidget.closeWindowButton(true) + .setPos(240, 5)); builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(16); - } - }) + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(16); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2158,33 +2140,33 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setEnabled(routingMap.size() == 0)); // Next Page & Previous Page builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - routingPageCode += 1; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(10); - } - }) - .setSize(16, 16) - .setBackground(() -> { - List UI = new ArrayList<>(); - UI.add(GT_UITextures.BUTTON_STANDARD); - UI.add(GT_UITextures.OVERLAY_BUTTON_ARROW_GREEN_DOWN); - return UI.toArray(new IDrawable[0]); - }) - .addTooltip(i18n("tile.boxplusplus.boxUI.38")) - .setPos(200, 48) - .setEnabled(routingPageCode < Math.ceil((routingMap.size() + (recipe.islocked ? 0 : 1)) / 10.0))) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - routingPageCode -= 1; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(10); - } - }) + routingPageCode += 1; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(10); + } + }) + .setSize(16, 16) + .setBackground(() -> { + List UI = new ArrayList<>(); + UI.add(GT_UITextures.BUTTON_STANDARD); + UI.add(GT_UITextures.OVERLAY_BUTTON_ARROW_GREEN_DOWN); + return UI.toArray(new IDrawable[0]); + }) + .addTooltip(i18n("tile.boxplusplus.boxUI.38")) + .setPos(200, 48) + .setEnabled(routingPageCode < Math.ceil((routingMap.size() + (recipe.islocked ? 0 : 1)) / 10.0))) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + routingPageCode -= 1; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(10); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2197,20 +2179,19 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setEnabled(routingPageCode != 1)); // export builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (widget.isClient()) { - NBTTagCompound Routing = new NBTTagCompound(); - Routing.setInteger("TotalRouting", routingMap.size()); - for (int i = 0; i < routingMap.size(); i++) { - Routing.setTag( - "Routing" + (i + 1), - routingMap.get(i) - .routingToUNbt()); + if (widget.isClient()) { + NBTTagCompound Routing = new NBTTagCompound(); + Routing.setInteger("TotalRouting", routingMap.size()); + for (int i = 0; i < routingMap.size(); i++) { + Routing.setTag("Routing" + (i + 1), + routingMap.get(i) + .routingToUNbt()); + } + GuiScreen.setClipboardString(serialize(Routing)); + player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.2"))); + player.closeScreen(); } - GuiScreen.setClipboardString(serialize(Routing)); - player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.2"))); - player.closeScreen(); - } - }) + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2221,18 +2202,19 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .addTooltip(i18n("tile.boxplusplus.boxUI.31")) .setPos(200, 25) .setEnabled(recipe.islocked)); - for (int i = 10 * routingPageCode - 9; i - <= Math.min(10 * routingPageCode, routingMap.size() + (recipe.islocked ? 0 : 1)); i++) { + for (int i = 10 * routingPageCode - 9; i <= Math.min( + 10 * routingPageCode, + routingMap.size() + (recipe.islocked ? 0 : 1)); i++) { int finalI = i; int posY = 18 * (i % 10 == 0 ? 10 : i % 10); builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.07") + i).setPos(43, 9 + posY)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - BoxRoutings.checkRouting(this); - if (!widget.isClient()) { - player.closeScreen(); - GT_UIInfos.openGTTileEntityUI(getBaseMetaTileEntity(), player); - } - }) + BoxRoutings.checkRouting(this); + if (!widget.isClient()) { + player.closeScreen(); + GT_UIInfos.openGTTileEntityUI(getBaseMetaTileEntity(), player); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2244,12 +2226,12 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setPos(81, 7 + posY) .setEnabled(routingMap.size() == (i - 1))) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = finalI; - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(11); - } - }) + moduleSN = finalI; + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(11); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2261,16 +2243,16 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setPos(81, 7 + posY) .setEnabled(routingMap.size() >= i)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!clickData.shift) return; - moduleSN = finalI; - routingMap.remove(moduleSN - 1); - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(10); - } - }) + if (!clickData.shift) return; + moduleSN = finalI; + routingMap.remove(moduleSN - 1); + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(10); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2284,52 +2266,49 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { if (routingMap.size() != i - 1) { ItemStackHandler drawitem = new ItemStackHandler(1); drawitem.setStackInSlot(0, routingMap.get(i - 1).RoutingMachine); - builder.widget( - SlotWidget.phantom(drawitem, 0) - .disableInteraction() - .setSize(16, 16) - .setPos(21, 7 + posY)); + builder.widget(SlotWidget.phantom(drawitem, 0) + .disableInteraction() + .setSize(16, 16) + .setPos(21, 7 + posY)); } } - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS) + builder.widget(new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS) .setPos(140, 71) .setSize(24, 24) .addTooltip(i18n("tile.boxplusplus.boxUI.ErrorCode." + routingStatus)) .setEnabled(routingStatus != 0 && !recipe.islocked)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CHECKMARK) - .setPos(140, 71) - .setSize(36, 36) - .addTooltip(i18n("tile.boxplusplus.boxUI.19")) - .setEnabled(routingStatus == 0 && !recipe.islocked)); + .widget(new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CHECKMARK) + .setPos(140, 71) + .setSize(36, 36) + .addTooltip(i18n("tile.boxplusplus.boxUI.19")) + .setEnabled(routingStatus == 0 && !recipe.islocked)); builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!recipe.islocked) buildRecipe(); - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(12); - } - }) - .setSize(32, 32) - .setBackground(() -> { - List UI = new ArrayList<>(); - UI.add(GT_UITextures.BUTTON_STANDARD); - UI.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); - return UI.toArray(new IDrawable[0]); - }) - .addTooltip(i18n("tile.boxplusplus.boxUI.20")) - .setPos(140, 26) - .setEnabled(!routingMap.isEmpty() && !recipe.islocked)) + if (!recipe.islocked) buildRecipe(); + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(12); + } + }) + .setSize(32, 32) + .setBackground(() -> { + List UI = new ArrayList<>(); + UI.add(GT_UITextures.BUTTON_STANDARD); + UI.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); + return UI.toArray(new IDrawable[0]); + }) + .addTooltip(i18n("tile.boxplusplus.boxUI.20")) + .setPos(140, 26) + .setEnabled(!routingMap.isEmpty() && !recipe.islocked)) // Double Recipe .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - routingStatus = doubleRecipe() ? 0 : 10; - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(10); - } - }) + if (!widget.isClient()) { + routingStatus = doubleRecipe() ? 0 : 10; + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(10); + } + }) .setSize(14, 14) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2342,14 +2321,14 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setEnabled(!routingMap.isEmpty() && !recipe.islocked)) // Halve Recipe .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - routingStatus = halveRecipe() ? 0 : 9; - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(10); - } - }) + if (!widget.isClient()) { + routingStatus = halveRecipe() ? 0 : 9; + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(10); + } + }) .setSize(14, 14) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2362,11 +2341,11 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setEnabled(!routingMap.isEmpty() && !recipe.islocked)) // export AE pattern .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(17); - } - }) + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(17); + } + }) .setSize(14, 14) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2379,11 +2358,11 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setEnabled(recipe.islocked)) // clear recipe .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(20); - } - }) + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(20); + } + }) .setSize(14, 14) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2395,11 +2374,11 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { .setPos(175, 44) .setEnabled(recipe.islocked)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - widget.getContext() - .openSyncedWindow(12); - } - }) + if (!widget.isClient()) { + widget.getContext() + .openSyncedWindow(12); + } + }) .setSize(32, 32) .setBackground(() -> { List ret = new ArrayList<>(); @@ -2419,127 +2398,93 @@ protected ModularWindow createInitialingWindow(final EntityPlayer player) { * @param player who is using the box */ protected ModularWindow createRoutingWindow(final EntityPlayer player) { - ModularWindow.Builder builder = ModularWindow.builder( - 220, - 80 + routingMap.get(moduleSN - 1) + ModularWindow.Builder builder = ModularWindow.builder(220, + 80 + + routingMap.get(moduleSN - 1) .calHeight() * 18); builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); Synchronize(builder); - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) + builder.widget(new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) .setPos(5, 5) .setSize(16, 16)) .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.10") + moduleSN).setPos(25, 9)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(200, 5)); + .widget(ButtonWidget.closeWindowButton(true) + .setPos(200, 5)); int Ycord = 9; for (int i = 0; i < routingMap.get(moduleSN - 1).InputItem.size(); i++) { ItemStackHandler drawitem = new ItemStackHandler(1); drawitem.setStackInSlot(0, routingMap.get(moduleSN - 1).InputItem.get(i)); - builder.widget( - SlotWidget.phantom(drawitem, 0) - .disableInteraction() - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.11") + (i + 1) - + ": " - + routingMap.get(moduleSN - 1).InputItem.get(i) - .getDisplayName()).setPos(50, Ycord + 4)); + builder.widget(SlotWidget.phantom(drawitem, 0) + .disableInteraction() + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.11") + (i + 1) + ": " + routingMap.get(moduleSN + - 1).InputItem.get(i) + .getDisplayName()).setPos(50, Ycord + 4)); } for (int i = 0; i < routingMap.get(moduleSN - 1).InputFluid.size(); i++) { - builder.widget( - FluidSlotWidget - .phantom( - new FluidTank( - routingMap.get(moduleSN - 1).InputFluid.get(i), - routingMap.get(moduleSN - 1).InputFluid.get(i).amount), - true) - .setInteraction(false, false) - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.12") + (i + 1) - + ": " - + routingMap.get(moduleSN - 1).InputFluid.get(i) - .getLocalizedName()).setPos(50, Ycord + 4)); + builder.widget(FluidSlotWidget.phantom(new FluidTank(routingMap.get(moduleSN - 1).InputFluid.get(i), + routingMap.get(moduleSN - 1).InputFluid.get(i).amount), true) + .setInteraction(false, false) + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.12") + (i + 1) + ": " + routingMap.get(moduleSN + - 1).InputFluid.get(i) + .getLocalizedName()).setPos(50, Ycord + 4)); } for (int i = 0; i < routingMap.get(moduleSN - 1).OutputItem.size(); i++) { ItemStackHandler drawitem = new ItemStackHandler(1); drawitem.setStackInSlot(0, routingMap.get(moduleSN - 1).OutputItem.get(i)); - builder.widget( - SlotWidget.phantom(drawitem, 0) - .disableInteraction() - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.13") + (i + 1) - + ": " - + routingMap.get(moduleSN - 1).OutputItem.get(i) - .getDisplayName() - + "(" - + routingMap.get(moduleSN - 1).OutputChance.get(i) / 10000.0 - + ")").setPos(50, Ycord + 4)); + builder.widget(SlotWidget.phantom(drawitem, 0) + .disableInteraction() + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.13") + (i + 1) + ": " + routingMap.get(moduleSN + - 1).OutputItem.get(i) + .getDisplayName() + "(" + routingMap.get(moduleSN - 1).OutputChance.get(i) / 10000.0 + ")").setPos( + 50, + Ycord + 4)); } for (int i = 0; i < routingMap.get(moduleSN - 1).OutputFluid.size(); i++) { - builder.widget( - FluidSlotWidget - .phantom( - new FluidTank( - routingMap.get(moduleSN - 1).OutputFluid.get(i), - routingMap.get(moduleSN - 1).OutputFluid.get(i).amount), - true) - .setInteraction(false, false) - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.14") + (i + 1) - + ": " - + routingMap.get(moduleSN - 1).OutputFluid.get(i) - .getLocalizedName()).setPos(50, Ycord + 4)); + builder.widget(FluidSlotWidget.phantom(new FluidTank(routingMap.get(moduleSN - 1).OutputFluid.get(i), + routingMap.get(moduleSN - 1).OutputFluid.get(i).amount), true) + .setInteraction(false, false) + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.14") + (i + 1) + ": " + routingMap.get(moduleSN + - 1).OutputFluid.get(i) + .getLocalizedName()).setPos(50, Ycord + 4)); } ItemStackHandler drawitem = new ItemStackHandler(1); drawitem.setStackInSlot(0, routingMap.get(moduleSN - 1).RoutingMachine); - builder.widget( - SlotWidget.phantom(drawitem, 0) - .disableInteraction() - .setPos(25, Ycord += 20)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.15") + routingMap.get(moduleSN - 1).RoutingMachine.getDisplayName()) - .setPos(50, Ycord + 4)); - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.16") + routingMap.get(moduleSN - 1).voltage + "eu/t") - .setPos(50, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.17") + routingMap.get(moduleSN - 1).time / 20.00 - + "s (" - + routingMap.get(moduleSN - 1).time - + "tick)").setPos(50, Ycord += 16)); - builder.widget( - new TextWidget(new Text(i18n("tile.boxplusplus.boxUI.23"))).setTextAlignment(Alignment.Center) + builder.widget(SlotWidget.phantom(drawitem, 0) + .disableInteraction() + .setPos(25, Ycord += 20)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.15") + routingMap.get(moduleSN + - 1).RoutingMachine.getDisplayName()).setPos(50, Ycord + 4)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.16") + + routingMap.get(moduleSN - 1).voltage + + "eu/t").setPos(50, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.17") + + routingMap.get(moduleSN - 1).time / 20.00 + + "s (" + + routingMap.get(moduleSN - 1).time + + "tick)").setPos(50, Ycord += 16)); + builder.widget(new TextWidget(new Text(i18n("tile.boxplusplus.boxUI.23"))).setTextAlignment(Alignment.Center) .setSize(30, 16) .setPos(22, Ycord - 15)) - .widget( - new TextFieldWidget().setGetterInt(() -> routingMap.get(moduleSN - 1).Parallel) - .setSetterInt(val -> routingMap.get(moduleSN - 1).Parallel = val) - .setNumbers(1, maxParallel) - .setTextColor(Color.WHITE.normal) - .setTextAlignment(Alignment.Center) - .addTooltip(i18n("tile.boxplusplus.boxUI.24")) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize(40, 14) - .setPos(5, Ycord) - .setEnabled(!recipe.islocked)) - .widget( - new TextWidget(new Text(String.valueOf(routingMap.get(moduleSN - 1).Parallel))).setScale(1.2f) - .setTextAlignment(Alignment.Center) - .setSize(20, 16) - .setPos(25, Ycord - 2) - .setEnabled(recipe.islocked)); + .widget(new TextFieldWidget().setGetterInt(() -> routingMap.get(moduleSN - 1).Parallel) + .setSetterInt(val -> routingMap.get(moduleSN - 1).Parallel = val) + .setNumbers(1, maxParallel) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip(i18n("tile.boxplusplus.boxUI.24")) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(40, 14) + .setPos(5, Ycord) + .setEnabled(!recipe.islocked)) + .widget(new TextWidget(new Text(String.valueOf(routingMap.get(moduleSN - 1).Parallel))).setScale(1.2f) + .setTextAlignment(Alignment.Center) + .setSize(20, 16) + .setPos(25, Ycord - 2) + .setEnabled(recipe.islocked)); return builder.build(); } @@ -2590,43 +2535,41 @@ public void onRemoveFocus() { } }; return builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.46")).setPos(5, 5)) - .widget( - textField.setMaxLength(10000) - .setTextAlignment(Alignment.CenterLeft) - .setTextColor(Color.WHITE.dark(1)) - .setFocusOnGuiOpen(true) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2)) - .setPos(5, 16) - .setSize(250, 16)) + .widget(textField.setMaxLength(10000) + .setTextAlignment(Alignment.CenterLeft) + .setTextColor(Color.WHITE.dark(1)) + .setFocusOnGuiOpen(true) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2)) + .setPos(5, 16) + .setSize(250, 16)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - String ls = textField.getText(); - NBTTagCompound routing = deserialize(ls); - try { - if (routing != null) { - int count = routing.getInteger("TotalRouting"); - if (count > maxRouting) { - routingStatus = 8; - player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.4"))); - return; - } - routingMap.clear(); - for (int i = 1; i <= count; i++) { - routingMap.add(new BoxRoutings(routing.getCompoundTag("Routing" + i), true)); + if (!widget.isClient()) { + String ls = textField.getText(); + NBTTagCompound routing = deserialize(ls); + try { + if (routing != null) { + int count = routing.getInteger("TotalRouting"); + if (count > maxRouting) { + routingStatus = 8; + player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.4"))); + return; + } + routingMap.clear(); + for (int i = 1; i <= count; i++) { + routingMap.add(new BoxRoutings(routing.getCompoundTag("Routing" + i), true)); + } + player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.5").replaceFirst( + "%count", + String.valueOf(count)))); + routingStatus = 0; + } else { + player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.6"))); } - player.addChatMessage( - new ChatComponentText( - i18n("tile.boxplusplus.chatmessage.5") - .replaceFirst("%count", String.valueOf(count)))); - routingStatus = 0; - } else { - player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.chatmessage.6"))); + } finally { + player.closeScreen(); } - } finally { - player.closeScreen(); } - } - }) + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2647,30 +2590,28 @@ protected ModularWindow createExportPatternWindow(final EntityPlayer player) { TextFieldWidget inputItem = new TextFieldWidget().setValidator(var -> Util.validator(recipe, var, false)); TextFieldWidget inputFluid = new TextFieldWidget().setValidator(var -> Util.validator(recipe, var, true)); return builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.48")).setPos(5, 45)) - .widget( - inputItem.setTextAlignment(Alignment.CenterLeft) - .setTextColor(Color.WHITE.dark(1)) - .setFocusOnGuiOpen(false) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2)) - .setPos(12, 10) - .addTooltip(i18n("tile.boxplusplus.boxUI.13")) - .setSize(60, 12)) - .widget( - inputFluid.setTextAlignment(Alignment.CenterLeft) - .setTextColor(Color.WHITE.dark(1)) - .setFocusOnGuiOpen(false) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2)) - .setPos(96, 10) - .addTooltip(i18n("tile.boxplusplus.boxUI.14")) - .setSize(60, 12)) + .widget(inputItem.setTextAlignment(Alignment.CenterLeft) + .setTextColor(Color.WHITE.dark(1)) + .setFocusOnGuiOpen(false) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2)) + .setPos(12, 10) + .addTooltip(i18n("tile.boxplusplus.boxUI.13")) + .setSize(60, 12)) + .widget(inputFluid.setTextAlignment(Alignment.CenterLeft) + .setTextColor(Color.WHITE.dark(1)) + .setFocusOnGuiOpen(false) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2)) + .setPos(96, 10) + .addTooltip(i18n("tile.boxplusplus.boxUI.14")) + .setSize(60, 12)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - String itemInput = inputItem.getText(); - String fluidInput = inputFluid.getText(); - makeAE2Pattern(player, itemInput, fluidInput); - player.closeScreen(); - } - }) + if (!widget.isClient()) { + String itemInput = inputItem.getText(); + String fluidInput = inputFluid.getText(); + makeAE2Pattern(player, itemInput, fluidInput); + player.closeScreen(); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2691,55 +2632,56 @@ protected ModularWindow createClearWindow(final EntityPlayer player) { builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); Synchronize(builder); - builder - .widget( - new DrawableWidget().setDrawable(AdaptableUITexture.of(Tags.MODID, "textures/gui/clear.png", 16, 16, 1)) - .setPos(5, 5) - .setSize(16, 16)) - .widget( - new TextWidget( - (randomSN.size() != 1 ? i18n("tile.boxplusplus.boxUI.42") : i18n("tile.boxplusplus.boxUI.43")) - + i18n("tile.boxplusplus.boxUI.44") - + EnumChatFormatting.RED - + randomSN.get(randomSN.size() - 1)).setPos(25, 5)); + builder.widget(new DrawableWidget().setDrawable(AdaptableUITexture.of( + Tags.MODID, + "textures/gui/clear.png", + 16, + 16, + 1)) + .setPos(5, 5) + .setSize(16, 16)) + .widget(new TextWidget((randomSN.size() != 1 + ? i18n("tile.boxplusplus.boxUI.42") + : i18n("tile.boxplusplus.boxUI.43")) + + i18n("tile.boxplusplus.boxUI.44") + + EnumChatFormatting.RED + + randomSN.get(randomSN.size() - 1)).setPos(25, 5)); for (int i = 1; i <= 5; i++) { int finalI = i; builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (finalI == randomSN.get(randomSN.size() - 1)) { - if (randomSN.size() == 1) { - if (!widget.isClient()) { - routingMap.clear(); - recipe = new BoxRecipe(); - routingPageCode = 1; - routingStatus = 0; - player.closeScreen(); - player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.boxUI.45"))); + if (finalI == randomSN.get(randomSN.size() - 1)) { + if (randomSN.size() == 1) { + if (!widget.isClient()) { + routingMap.clear(); + recipe = new BoxRecipe(); + routingPageCode = 1; + routingStatus = 0; + player.closeScreen(); + player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.boxUI.45"))); + } + } else { + randomSN.remove(randomSN.size() - 1); + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(20); + } } } else { - randomSN.remove(randomSN.size() - 1); - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(20); - } + player.closeScreen(); + player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.boxUI.47"))); } - } else { - player.closeScreen(); - player.addChatMessage(new ChatComponentText(i18n("tile.boxplusplus.boxUI.47"))); - } - }) + }) .setSize(24, 24) .setBackground(() -> { List UI = new ArrayList<>(); UI.add(GT_UITextures.BUTTON_STANDARD); - UI.add( - AdaptableUITexture.of( - Tags.MODID, - "textures/gui/number%.png".replaceFirst("%", String.valueOf(finalI)), - 275, - 81, - 1)); + UI.add(AdaptableUITexture.of(Tags.MODID, + "textures/gui/number%.png".replaceFirst("%", String.valueOf(finalI)), + 275, + 81, + 1)); return UI.toArray(new IDrawable[0]); }) .setPos(28 * (i - 1) + 5, 30 + (randomSN.size() == 1 ? 15 : 0))); @@ -2756,103 +2698,93 @@ protected ModularWindow createFinalRecipeWindow(final EntityPlayer player) { ModularWindow.Builder builder = ModularWindow.builder(220, 150 + recipe.calHeight() * 20); builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) + builder.widget(new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) .setPos(5, 5) .setSize(16, 16)) .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.22")).setPos(25, 9)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(200, 5)); + .widget(ButtonWidget.closeWindowButton(true) + .setPos(200, 5)); int Ycord = 9; for (int i = 0; i < recipe.FinalItemInput.size(); i++) { ItemStackHandler drawitem = new ItemStackHandler(1); drawitem.setStackInSlot(0, recipe.FinalItemInput.get(i)); - builder.widget( - SlotWidget.phantom(drawitem, 0) - .disableInteraction() - .disableInteraction() - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.11") + (i + 1) - + ": " - + recipe.FinalItemInput.get(i) - .getDisplayName()).setPos(50, Ycord + 4)); + builder.widget(SlotWidget.phantom(drawitem, 0) + .disableInteraction() + .disableInteraction() + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.11") + + (i + 1) + + ": " + + recipe.FinalItemInput.get(i) + .getDisplayName()).setPos(50, Ycord + 4)); } for (int i = 0; i < recipe.FinalFluidInput.size(); i++) { - builder.widget( - FluidSlotWidget - .phantom(new FluidTank(recipe.FinalFluidInput.get(i), recipe.FinalFluidInput.get(i).amount), true) - .setInteraction(false, false) - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.12") + (i + 1) - + ": " - + recipe.FinalFluidInput.get(i) - .getLocalizedName()).setPos(50, Ycord + 4)); + builder.widget(FluidSlotWidget.phantom(new FluidTank( + recipe.FinalFluidInput.get(i), + recipe.FinalFluidInput.get(i).amount), true) + .setInteraction(false, false) + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.12") + + (i + 1) + + ": " + + recipe.FinalFluidInput.get(i) + .getLocalizedName()).setPos(50, Ycord + 4)); } for (int i = 0; i < recipe.FinalItemOutput.size(); i++) { ItemStackHandler drawitem = new ItemStackHandler(1); drawitem.setStackInSlot(0, recipe.FinalItemOutput.get(i)); - builder.widget( - SlotWidget.phantom(drawitem, 0) - .disableInteraction() - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.13") + (i + 1) - + ": " - + recipe.FinalItemOutput.get(i) - .getDisplayName()).setPos(50, Ycord + 4)); + builder.widget(SlotWidget.phantom(drawitem, 0) + .disableInteraction() + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.13") + + (i + 1) + + ": " + + recipe.FinalItemOutput.get(i) + .getDisplayName()).setPos(50, Ycord + 4)); } for (int i = 0; i < recipe.FinalFluidOutput.size(); i++) { - builder.widget( - FluidSlotWidget - .phantom(new FluidTank(recipe.FinalFluidOutput.get(i), recipe.FinalFluidOutput.get(i).amount), true) - .setInteraction(false, false) - .setPos(25, Ycord += 16)); - builder.widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.14") + (i + 1) - + ": " - + recipe.FinalFluidOutput.get(i) - .getLocalizedName()).setPos(50, Ycord + 4)); + builder.widget(FluidSlotWidget.phantom(new FluidTank( + recipe.FinalFluidOutput.get(i), + recipe.FinalFluidOutput.get(i).amount), true) + .setInteraction(false, false) + .setPos(25, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.14") + + (i + 1) + + ": " + + recipe.FinalFluidOutput.get(i) + .getLocalizedName()).setPos(50, Ycord + 4)); } - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.16") + recipe.FinalVoteage + " eu/t").setPos(50, Ycord += 20)) - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxUI.17") + recipe.FinalTime / 20.00 + "s (" + recipe.FinalTime + "tick)") - .setPos(50, Ycord += 16)); - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.29") + recipe.parallel).setMaxWidth(180) - .setPos(50, Ycord += 16)); - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.32").replace("%max", String.valueOf(maxParallel))) - .setMaxWidth(180) - .setPos(25, Ycord += 16) - .setEnabled(recipe.parallel > maxParallel)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.16") + recipe.FinalVoteage + " eu/t").setPos( + 50, + Ycord += 20)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.17") + + recipe.FinalTime / 20.00 + + "s (" + + recipe.FinalTime + + "tick)").setPos(50, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.29") + recipe.parallel).setMaxWidth(180) + .setPos(50, Ycord += 16)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxUI.32").replace( + "%max", + String.valueOf(maxParallel))).setMaxWidth(180) + .setPos(25, Ycord += 16) + .setEnabled(recipe.parallel > maxParallel)); StringBuilder modules = new StringBuilder(); modules.append(i18n("tile.boxplusplus.boxUI.27")); for (int i : recipe.requireModules.keySet()) { - modules - .append( - recipe.requireModules.get(i) == 1 ? i18n("tile.boxplusplus.boxUI.module." + (i + 1)) + " (T2)" - : i18n("tile.boxplusplus.boxUI.module." + (i + 1))) + modules.append(recipe.requireModules.get(i) == 1 ? i18n("tile.boxplusplus.boxUI.module." + (i + 1)) + + " (T2)" : i18n("tile.boxplusplus.boxUI.module." + (i + 1))) .append(" | "); } - builder.widget( - new TextWidget(modules.toString()).setMaxWidth(180) + builder.widget(new TextWidget(modules.toString()).setMaxWidth(180) .setPos(25, Ycord += 32)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - recipe.islocked = true; - if (!widget.isClient()) { - player.closeScreen(); - GT_UIInfos.openGTTileEntityUI(getBaseMetaTileEntity(), player); - } - }) + recipe.islocked = true; + if (!widget.isClient()) { + player.closeScreen(); + GT_UIInfos.openGTTileEntityUI(getBaseMetaTileEntity(), player); + } + }) .setSize(20, 20) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2864,14 +2796,14 @@ protected ModularWindow createFinalRecipeWindow(final EntityPlayer player) { .setPos(80, Ycord + 20) .setEnabled(!recipe.islocked && recipe.parallel <= maxParallel)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - recipe = new BoxRecipe(); - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(10); - } - }) + recipe = new BoxRecipe(); + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(10); + } + }) .setSize(20, 20) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2893,24 +2825,22 @@ protected ModularWindow createWikiWindow(final EntityPlayer player) { builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); Synchronize(builder); - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_NEI) + builder.widget(new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_NEI) .setPos(5, 5) .setSize(16, 16)) .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.1")).setPos(25, 9)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(285, 5)) + .widget(ButtonWidget.closeWindowButton(true) + .setPos(285, 5)) .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.2")).setPos(25, 30)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 3; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 3; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2921,14 +2851,14 @@ protected ModularWindow createWikiWindow(final EntityPlayer player) { .addTooltip(i18n("tile.boxplusplus.boxwiki.3")) .setPos(30, 45)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 4; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 4; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2939,14 +2869,14 @@ protected ModularWindow createWikiWindow(final EntityPlayer player) { .addTooltip(i18n("tile.boxplusplus.boxwiki.4")) .setPos(80, 45)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 5; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 5; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2957,14 +2887,14 @@ protected ModularWindow createWikiWindow(final EntityPlayer player) { .addTooltip(i18n("tile.boxplusplus.boxwiki.5")) .setPos(130, 45)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 6; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 6; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -2975,14 +2905,14 @@ protected ModularWindow createWikiWindow(final EntityPlayer player) { .addTooltip(i18n("tile.boxplusplus.boxwiki.6")) .setPos(180, 45)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 7; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 7; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -3001,50 +2931,44 @@ protected ModularWindow createWikiWindow(final EntityPlayer player) { @Override protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { super.drawTexts(screenElements, inventorySlot); - screenElements.widget( - new TextWidget(i18n("tile.boxplusplus.boxError." + machineError[0])).setDefaultColor(COLOR_TEXT_WHITE.get()) + screenElements.widget(new TextWidget(i18n("tile.boxplusplus.boxError." + machineError[0])).setDefaultColor( + COLOR_TEXT_WHITE.get()) .setEnabled(machineError[0] != 0)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxUI.module." + machineError[1])) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(machineError[1] != 0)); + .widget(new TextWidget(i18n("tile.boxplusplus.boxUI.module." + machineError[1])).setDefaultColor( + COLOR_TEXT_WHITE.get()) + .setEnabled(machineError[1] != 0)); } // Help wiki show pages private void getwikiByIndex(ModularWindow.Builder builder) { switch (wikiPageCode) { - case 3 -> builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.8")).setMaxWidth(260) - .setPos(25, 85)); + case 3 -> builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.8")).setMaxWidth(260) + .setPos(25, 85)); case 4 -> { - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.9")).setMaxWidth(260) - .setPos(25, 85)); - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.10") + i18n("tile.boxplusplus.boxwiki.11")) - .setTextAlignment(TopLeft) - .setMaxWidth(260) - .setPos(25, 95)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.9")).setMaxWidth(260) + .setPos(25, 85)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.10") + + i18n("tile.boxplusplus.boxwiki.11")).setTextAlignment(TopLeft) + .setMaxWidth(260) + .setPos(25, 95)); } case 5 -> { - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.12")).setTextAlignment(TopLeft) - .setMaxWidth(260) - .setPos(25, 85)); - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.13") + i18n("tile.boxplusplus.boxwiki.14")) - .setTextAlignment(TopLeft) - .setMaxWidth(260) - .setPos(25, 115)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.12")).setTextAlignment(TopLeft) + .setMaxWidth(260) + .setPos(25, 85)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.13") + + i18n("tile.boxplusplus.boxwiki.14")).setTextAlignment(TopLeft) + .setMaxWidth(260) + .setPos(25, 115)); builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 50; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 50; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -3055,34 +2979,28 @@ private void getwikiByIndex(ModularWindow.Builder builder) { .addTooltip(i18n("tile.boxplusplus.boxwiki.0")) .setPos(135, 175)); } - case 6 -> builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.16")).setTextAlignment(TopLeft) + case 6 -> builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.16")).setTextAlignment(TopLeft) .setMaxWidth(260) .setPos(25, 85)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.17")).setMaxWidth(260) - .setPos(25, 105)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.18")).setMaxWidth(260) - .setPos(25, 115)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.19")).setMaxWidth(260) - .setPos(25, 125)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.20")).setMaxWidth(260) - .setPos(25, 135)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.21")).setMaxWidth(260) - .setPos(25, 145)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.17")).setMaxWidth(260) + .setPos(25, 105)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.18")).setMaxWidth(260) + .setPos(25, 115)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.19")).setMaxWidth(260) + .setPos(25, 125)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.20")).setMaxWidth(260) + .setPos(25, 135)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.21")).setMaxWidth(260) + .setPos(25, 145)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - wikiPageCode = 51; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + wikiPageCode = 51; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -3093,20 +3011,19 @@ private void getwikiByIndex(ModularWindow.Builder builder) { .addTooltip(i18n("tile.boxplusplus.boxwiki.0")) .setPos(135, 175)); case 7 -> { - builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.24")).setMaxWidth(260) - .setPos(25, 85)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.24")).setMaxWidth(260) + .setPos(25, 85)); for (int i = 1; i < 15; i++) { int finalI = i; builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - moduleSN = finalI; - if (!widget.isClient()) { - widget.getWindow() - .closeWindow(); - widget.getContext() - .openSyncedWindow(15); - } - }) + moduleSN = finalI; + if (!widget.isClient()) { + widget.getWindow() + .closeWindow(); + widget.getContext() + .openSyncedWindow(15); + } + }) .setSize(16, 16) .setBackground(() -> { List UI = new ArrayList<>(); @@ -3117,56 +3034,45 @@ private void getwikiByIndex(ModularWindow.Builder builder) { .addTooltip(i18n("tile.boxplusplus.boxUI.module." + i)) .setPos(10 + 18 * i, 100)); } - builder - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxwiki.25") + i18n("tile.boxplusplus.boxUI.module." + moduleSN)) - .setMaxWidth(260) - .setPos(25, 120)) - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxwiki.26") - + i18n("tile.boxplusplus.boxUI.module.context." + moduleSN + "b")).setMaxWidth(260) - .setPos(25, 130)) - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxwiki.27") - + i18n("tile.boxplusplus.boxUI.module.context." + moduleSN + "c")).setMaxWidth(260) - .setPos(25, 150)) - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxwiki.28") - + i18n("tile.boxplusplus.boxUI.module.context." + moduleSN + "d")).setMaxWidth(260) - .setPos(25, 160)) - .widget( - new TextWidget( - i18n("tile.boxplusplus.boxwiki.29") - + i18n("tile.boxplusplus.boxUI.module.context." + moduleSN + "e")).setMaxWidth(260) - .setPos(25, 170)); + builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.25") + i18n( + "tile.boxplusplus.boxUI.module." + moduleSN)).setMaxWidth(260) + .setPos(25, 120)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.26") + i18n( + "tile.boxplusplus.boxUI.module.context." + moduleSN + "b")).setMaxWidth(260) + .setPos(25, 130)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.27") + i18n( + "tile.boxplusplus.boxUI.module.context." + moduleSN + "c")).setMaxWidth(260) + .setPos(25, 150)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.28") + i18n( + "tile.boxplusplus.boxUI.module.context." + moduleSN + "d")).setMaxWidth(260) + .setPos(25, 160)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.29") + i18n( + "tile.boxplusplus.boxUI.module.context." + moduleSN + "e")).setMaxWidth(260) + .setPos(25, 170)); } - case 50 -> builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.15")).setTextAlignment(TopLeft) - .setMaxWidth(260) - .setPos(25, 85)); - case 51 -> builder.widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.22")).setMaxWidth(260) + case 50 -> builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.15")).setTextAlignment(TopLeft) + .setMaxWidth(260) + .setPos(25, 85)); + case 51 -> builder.widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.22")).setMaxWidth(260) .setPos(25, 85)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.23")).setMaxWidth(260) - .setPos(180, 85)) - .widget( - new DrawableWidget() - .setDrawable(AdaptableUITexture.of(Tags.MODID, "textures/gui/time.png", 275, 81, 1)) - .setPos(20, 105) - .setSize(130, 42)) - .widget( - new DrawableWidget() - .setDrawable(AdaptableUITexture.of(Tags.MODID, "textures/gui/voteage.png", 124, 81, 1)) - .setPos(190, 105) - .setSize(62, 40)) - .widget( - new TextWidget(i18n("tile.boxplusplus.boxwiki.52")).setMaxWidth(260) - .setPos(25, 165)); + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.23")).setMaxWidth(260) + .setPos(180, 85)) + .widget(new DrawableWidget().setDrawable(AdaptableUITexture.of(Tags.MODID, + "textures/gui/time.png", + 275, + 81, + 1)) + .setPos(20, 105) + .setSize(130, 42)) + .widget(new DrawableWidget().setDrawable(AdaptableUITexture.of(Tags.MODID, + "textures/gui/voteage.png", + 124, + 81, + 1)) + .setPos(190, 105) + .setSize(62, 40)) + .widget(new TextWidget(i18n("tile.boxplusplus.boxwiki.52")).setMaxWidth(260) + .setPos(25, 165)); } } @@ -3175,9 +3081,9 @@ private void getwikiByIndex(ModularWindow.Builder builder) { */ public void Synchronize(ModularWindow.Builder builder) { builder.widget(new FakeSyncWidget.ListSyncer<>(() -> randomSN, var1 -> { - randomSN.clear(); - randomSN.addAll(var1); - }, PacketBuffer::writeInt, PacketBuffer::readInt)) + randomSN.clear(); + randomSN.addAll(var1); + }, PacketBuffer::writeInt, PacketBuffer::readInt)) .widget(new FakeSyncWidget.ListSyncer<>(() -> routingMap, var1 -> { routingMap.clear(); routingMap.addAll(var1); @@ -3217,11 +3123,12 @@ public void Synchronize(ModularWindow.Builder builder) { .widget(new FakeSyncWidget.IntegerSyncer(() -> maxRouting, var1 -> maxRouting = var1)); for (int i = 0; i < 14; i++) { int finalI = i; - builder - .widget( - new FakeSyncWidget.BooleanSyncer(() -> moduleSwitch[finalI], var1 -> moduleSwitch[finalI] = var1)) - .widget( - new FakeSyncWidget.BooleanSyncer(() -> moduleActive[finalI], var1 -> moduleActive[finalI] = var1)) + builder.widget(new FakeSyncWidget.BooleanSyncer( + () -> moduleSwitch[finalI], + var1 -> moduleSwitch[finalI] = var1)) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> moduleActive[finalI], + var1 -> moduleActive[finalI] = var1)) .widget(new FakeSyncWidget.IntegerSyncer(() -> moduleTier[finalI], var1 -> moduleTier[finalI] = var1)); } } diff --git a/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineDroneMaintainingCentre.java b/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineDroneMaintainingCentre.java index 880f6d0..beb3f51 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineDroneMaintainingCentre.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTMachineDroneMaintainingCentre.java @@ -42,8 +42,9 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -public class GTMachineDroneMaintainingCentre extends - GT_MetaTileEntity_ExtendedPowerMultiBlockBase implements ISurvivalConstructable { +public class GTMachineDroneMaintainingCentre + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase + implements ISurvivalConstructable { private static final IIconContainer Active = new Textures.BlockIcons.CustomIcon("iconsets/droneCentre"); private static final IIconContainer Inactive = new Textures.BlockIcons.CustomIcon("iconsets/droneCentre"); @@ -53,17 +54,16 @@ public class GTMachineDroneMaintainingCentre extends public int droneLevel = 0; private final Random random = new Random(); // spotless off - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() + private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape( "main", - transpose( - new String[][] { { " ", " ", " ", " ", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, - { "CE~EC", "C C", "C C", "C C", "CAAAC", "CCCCC", "CAAAC", "C C", "CCCCC" }, - { "CEEEC", "CBBBC", "CBDBC", "CBBBC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, - { "C C", " ", " ", " ", " ", " ", " ", " ", "C C" }, - { "C C", " ", " ", " ", " ", " ", " ", " ", "C C" }, - { "C C", " ", " ", " ", " ", " ", " ", " ", "C C" } })) + transpose(new String[][] { + { " ", " ", " ", " ", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, + { "CE~EC", "C C", "C C", "C C", "CAAAC", "CCCCC", "CAAAC", "C C", "CCCCC" }, + { "CEEEC", "CBBBC", "CBDBC", "CBBBC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, + { "C C", " ", " ", " ", " ", " ", " ", " ", "C C" }, + { "C C", " ", " ", " ", " ", " ", " ", " ", "C C" }, + { "C C", " ", " ", " ", " ", " ", " ", " ", "C C" } })) .addElement( 'E', buildHatchAdder(GTMachineDroneMaintainingCentre.class).atLeast(InputBus) @@ -96,12 +96,10 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec if (side == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[8][67], TextureFactory.builder() .addIcon(Active) - .extFacing() - .build() }; + .extFacing().build() }; return new ITexture[] { casingTexturePages[8][67], TextureFactory.builder() .addIcon(Inactive) - .extFacing() - .build() }; + .extFacing().build() }; } return new ITexture[] { casingTexturePages[8][67] }; } @@ -171,7 +169,8 @@ public boolean explodesOnComponentBreak(ItemStack aStack) { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { disableMaintenance = true; rotation = (rotation + 50) % 360d; - if (aTick % 200 == 0 && aBaseMetaTileEntity.isServerSide() + if (aTick % 200 == 0 + && aBaseMetaTileEntity.isServerSide() && (droneLevel == 1 || droneLevel == 2) && random.nextInt(360 * (3 - droneLevel)) == 0) { droneLevel = 0; diff --git a/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTTileEntityDroneMaintananceModule.java b/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTTileEntityDroneMaintananceModule.java index 52ec638..706b1c0 100644 --- a/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTTileEntityDroneMaintananceModule.java +++ b/src/main/java/com/silvermoon/boxplusplus/common/tileentities/GTTileEntityDroneMaintananceModule.java @@ -124,8 +124,7 @@ public void loadNBTData(NBTTagCompound aNBT) { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if (Util.droneMap.containsKey(aBaseMetaTileEntity.getWorld().provider.dimensionId)) { - List target = Util.droneMap - .get(aBaseMetaTileEntity.getWorld().provider.dimensionId) + List target = Util.droneMap.get(aBaseMetaTileEntity.getWorld().provider.dimensionId) .stream() .collect(Collectors.toList()); for (GTMachineDroneMaintainingCentre DMC : target) { @@ -162,9 +161,8 @@ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex } public boolean hasConnection() { - return mainframe != null && mainframe.getBaseMetaTileEntity() != null - && !mainframe.getBaseMetaTileEntity() - .isDead(); + return mainframe != null && mainframe.getBaseMetaTileEntity() != null && !mainframe.getBaseMetaTileEntity() + .isDead(); } private void setRandomFault(GT_MetaTileEntity_MultiBlockBase mte) { @@ -185,9 +183,8 @@ private void setRandomFault(GT_MetaTileEntity_MultiBlockBase mte) { public GT_MetaTileEntity_MultiBlockBase tryFindGTMultiBlock(GTTileEntityDroneMaintananceModule maintain) { Queue tQueue = new LinkedList<>(); Set visited = new HashSet<>(80); - tQueue.add( - maintain.getBaseMetaTileEntity() - .getCoords()); + tQueue.add(maintain.getBaseMetaTileEntity() + .getCoords()); World world = maintain.getBaseMetaTileEntity() .getWorld(); while (!tQueue.isEmpty()) { @@ -208,10 +205,8 @@ public GT_MetaTileEntity_MultiBlockBase tryFindGTMultiBlock(GTTileEntityDroneMai // 1) If we've visited less than 5 blocks, then yes // 2) If the tile says we should recursively updated (pipes don't, machine blocks do) // 3) If the block at the coordinates is marked as a machine block - if (visited.size() < 5 - || (tTileEntity instanceof IMachineBlockUpdateable - && ((IMachineBlockUpdateable) tTileEntity).isMachineBlockUpdateRecursive()) - || isMachineBlock) { + if (visited.size() < 5 || (tTileEntity instanceof IMachineBlockUpdateable + && ((IMachineBlockUpdateable) tTileEntity).isMachineBlockUpdateRecursive()) || isMachineBlock) { ChunkCoordinates tCoords; if (visited.add(tCoords = new ChunkCoordinates(aCoords.posX + 1, aCoords.posY, aCoords.posZ))) diff --git a/src/main/java/com/silvermoon/boxplusplus/util/BoxRecipe.java b/src/main/java/com/silvermoon/boxplusplus/util/BoxRecipe.java index 20776da..4869266 100644 --- a/src/main/java/com/silvermoon/boxplusplus/util/BoxRecipe.java +++ b/src/main/java/com/silvermoon/boxplusplus/util/BoxRecipe.java @@ -70,8 +70,9 @@ public static void ItemOnBox(List input, List output) { for (ItemStack iItem : input) { for (ItemStack oItem : output) { if (GT_Utility.areStacksEqual(oItem, iItem, true) || (oItem.getUnlocalizedName() - .startsWith("item.Circuit") - && GT_OreDictUnificator.isInputStackEqual(iItem, GT_OreDictUnificator.get(oItem)))) { + .startsWith("item.Circuit") && GT_OreDictUnificator.isInputStackEqual( + iItem, + GT_OreDictUnificator.get(oItem)))) { if (iItem.stackSize == oItem.stackSize) { iItem.stackSize = 0; oItem.stackSize = 0; @@ -120,14 +121,14 @@ public NBTTagCompound RecipeToNBT() { recipe.setTag("InputItem" + (i + 1), writeBoxItemToNBT(FinalItemInput.get(i), new NBTTagCompound())); for (int i = 0; i < FinalItemOutput.size(); i++) recipe.setTag("OutputItem" + (i + 1), writeBoxItemToNBT(FinalItemOutput.get(i), new NBTTagCompound())); - for (int i = 0; i < FinalFluidInput.size(); i++) recipe.setTag( - "InputFluid" + (i + 1), - FinalFluidInput.get(i) - .writeToNBT(new NBTTagCompound())); - for (int i = 0; i < FinalFluidOutput.size(); i++) recipe.setTag( - "OutputFluid" + (i + 1), - FinalFluidOutput.get(i) - .writeToNBT(new NBTTagCompound())); + for (int i = 0; i < FinalFluidInput.size(); i++) + recipe.setTag("InputFluid" + (i + 1), + FinalFluidInput.get(i) + .writeToNBT(new NBTTagCompound())); + for (int i = 0; i < FinalFluidOutput.size(); i++) + recipe.setTag("OutputFluid" + (i + 1), + FinalFluidOutput.get(i) + .writeToNBT(new NBTTagCompound())); NBTTagCompound requireModule = new NBTTagCompound(); requireModules.forEach((k, v) -> requireModule.setInteger(String.valueOf(k), v)); recipe.setLong("Voteage", FinalVoteage); diff --git a/src/main/java/com/silvermoon/boxplusplus/util/BoxRoutings.java b/src/main/java/com/silvermoon/boxplusplus/util/BoxRoutings.java index d8a2d81..d19d9ad 100644 --- a/src/main/java/com/silvermoon/boxplusplus/util/BoxRoutings.java +++ b/src/main/java/com/silvermoon/boxplusplus/util/BoxRoutings.java @@ -80,10 +80,11 @@ public BoxRoutings(GT_Recipe recipe, ItemStack machine) { time *= 4; OutputFluid.forEach(f -> f.amount = (int) (f.amount * 0.75)); } - case "multimachine.blastfurnace", "multimachine.adv.blastfurnace", "megablastfurnace" -> this.special = recipe.mSpecialValue; + case "multimachine.blastfurnace", "multimachine.adv.blastfurnace", "megablastfurnace" -> + this.special = recipe.mSpecialValue; case "componentassemblyline" -> time /= 16; - case "quantumforcetransformer.controller.tier.single" -> OutputFluid - .forEach(f -> f.amount = f.amount / (OutputFluid.size() + OutputItem.size())); + case "quantumforcetransformer.controller.tier.single" -> + OutputFluid.forEach(f -> f.amount = f.amount / (OutputFluid.size() + OutputItem.size())); } } @@ -116,9 +117,8 @@ public BoxRoutings(FluidStack fOutputs, ItemStack machine, Long v, int t) { public BoxRoutings(InventoryCrafting inputs, ItemStack outputs, ItemStack machine) { for (int i = 0; i < 9; i++) { if (inputs.getStackInSlot(i) == null) continue; - InputItem.add( - inputs.getStackInSlot(i) - .copy()); + InputItem.add(inputs.getStackInSlot(i) + .copy()); } ItemStack b = outputs.copy(); OutputItem.add(b); @@ -195,14 +195,14 @@ public NBTTagCompound routingToNbt() { routing.setTag("OutputItem" + (i + 1), writeBoxItemToNBT(OutputItem.get(i), new NBTTagCompound())); routing.setInteger("OutputChance" + (i + 1), OutputChance.get(i)); } - for (int i = 0; i < InputFluid.size(); i++) routing.setTag( - "InputFluid" + (i + 1), - InputFluid.get(i) - .writeToNBT(new NBTTagCompound())); - for (int i = 0; i < OutputFluid.size(); i++) routing.setTag( - "OutputFluid" + (i + 1), - OutputFluid.get(i) - .writeToNBT(new NBTTagCompound())); + for (int i = 0; i < InputFluid.size(); i++) + routing.setTag("InputFluid" + (i + 1), + InputFluid.get(i) + .writeToNBT(new NBTTagCompound())); + for (int i = 0; i < OutputFluid.size(); i++) + routing.setTag("OutputFluid" + (i + 1), + OutputFluid.get(i) + .writeToNBT(new NBTTagCompound())); routing.setLong("Voltage", voltage); routing.setInteger("Parallel", Parallel); routing.setInteger("Time", time); @@ -219,14 +219,14 @@ public NBTTagCompound routingToUNbt() { routing.setTag("OutputItem" + (i + 1), writeBoxItemToUNBT(OutputItem.get(i), new NBTTagCompound())); routing.setInteger("OutputChance" + (i + 1), OutputChance.get(i)); } - for (int i = 0; i < InputFluid.size(); i++) routing.setTag( - "InputFluid" + (i + 1), - InputFluid.get(i) - .writeToNBT(new NBTTagCompound())); - for (int i = 0; i < OutputFluid.size(); i++) routing.setTag( - "OutputFluid" + (i + 1), - OutputFluid.get(i) - .writeToNBT(new NBTTagCompound())); + for (int i = 0; i < InputFluid.size(); i++) + routing.setTag("InputFluid" + (i + 1), + InputFluid.get(i) + .writeToNBT(new NBTTagCompound())); + for (int i = 0; i < OutputFluid.size(); i++) + routing.setTag("OutputFluid" + (i + 1), + OutputFluid.get(i) + .writeToNBT(new NBTTagCompound())); routing.setLong("Voltage", voltage); routing.setInteger("Parallel", Parallel); routing.setInteger("Time", time); @@ -255,8 +255,7 @@ public static void checkRouting(GTMachineBox box) { .getUnlocalizedName() .equals("gt.blockmachines.basicmachine.electromagneticseparator.tier.06")) { RecipeMap = RecipeMaps.electroMagneticSeparatorRecipes; - RoutingRecipe = RecipeMap.findRecipe( - box.getBaseMetaTileEntity(), + RoutingRecipe = RecipeMap.findRecipe(box.getBaseMetaTileEntity(), true, true, Long.MAX_VALUE / 10, @@ -283,8 +282,12 @@ public static void checkRouting(GTMachineBox box) { ItemStack machine = inputBus.getStackInSlot(i) .copy(); machine.stackSize = 1; - box.routingMap - .add(new BoxRoutings(in, out, machine, TierEU.RECIPE_ZPM, TickTime.MINUTE)); + box.routingMap.add(new BoxRoutings( + in, + out, + machine, + TierEU.RECIPE_ZPM, + TickTime.MINUTE)); box.routingStatus = 0; return; } @@ -301,8 +304,7 @@ public static void checkRouting(GTMachineBox box) { .getRecipeList(); for (Object recipe : recipeList) { if (recipe instanceof ExtremeShapedRecipe exRecipe) { - if (GT_OreDictUnificator.isInputStackEqual( - item, + if (GT_OreDictUnificator.isInputStackEqual(item, GT_OreDictUnificator.get(exRecipe.getRecipeOutput()))) { ItemStack[] in = exRecipe.recipeItems; ItemContainer var = new ItemContainer(); @@ -313,15 +315,13 @@ public static void checkRouting(GTMachineBox box) { ItemStack machine = inputBus.getStackInSlot(i) .copy(); machine.stackSize = 1; - box.routingMap.add( - new BoxRoutings( - var.getItemStack() - .toArray(new ItemStack[0]), - exRecipe.getRecipeOutput(), - new FluidStack[] {}, - machine, - TierEU.RECIPE_UV, - TickTime.MINUTE)); + box.routingMap.add(new BoxRoutings(var.getItemStack() + .toArray(new ItemStack[0]), + exRecipe.getRecipeOutput(), + new FluidStack[] {}, + machine, + TierEU.RECIPE_UV, + TickTime.MINUTE)); box.routingStatus = 0; return; } @@ -341,15 +341,13 @@ public static void checkRouting(GTMachineBox box) { ItemStack machine = inputBus.getStackInSlot(i) .copy(); machine.stackSize = 1; - box.routingMap.add( - new BoxRoutings( - var.getItemStack() - .toArray(new ItemStack[0]), - exRecipe.getRecipeOutput(), - new FluidStack[] {}, - machine, - TierEU.RECIPE_UV, - TickTime.MINUTE)); + box.routingMap.add(new BoxRoutings(var.getItemStack() + .toArray(new ItemStack[0]), + exRecipe.getRecipeOutput(), + new FluidStack[] {}, + machine, + TierEU.RECIPE_UV, + TickTime.MINUTE)); box.routingStatus = 0; return; } @@ -360,8 +358,7 @@ public static void checkRouting(GTMachineBox box) { return; } } - if (getMetaTileEntity( - inputBus.getStackInSlot(i)) instanceof GT_MetaTileEntity_MultiBlockBase RoutingMachine) { + if (getMetaTileEntity(inputBus.getStackInSlot(i)) instanceof GT_MetaTileEntity_MultiBlockBase RoutingMachine) { boxplusplus.LOG.debug(RoutingMachine.mName); List ItemInputs = deepCopyItemList(box.getStoredInputs()); List FluidInputs = deepCopyFluidList(box.getStoredFluids()); @@ -377,16 +374,19 @@ public static void checkRouting(GTMachineBox box) { } case "multimachine.multifurnace" -> { for (ItemStack input : ItemInputs) { - ItemStack output = GT_OreDictUnificator.get( - FurnaceRecipes.smelting() - .getSmeltingResult(input)); + ItemStack output = GT_OreDictUnificator.get(FurnaceRecipes.smelting() + .getSmeltingResult(input)); if (output != null) { ItemStack var1 = input.copy(); var1.stackSize = 1; ItemStack var2 = output.copy(); var2.stackSize = 1; - box.routingMap - .add(new BoxRoutings(var1, var2, RoutingMachine.getStackForm(1), 30L, 100)); + box.routingMap.add(new BoxRoutings( + var1, + var2, + RoutingMachine.getStackForm(1), + 30L, + 100)); box.routingStatus = 0; return; } @@ -404,8 +404,7 @@ public static void checkRouting(GTMachineBox box) { } } ItemStack out = CraftingManager.getInstance() - .findMatchingRecipe( - fakeCraft, + .findMatchingRecipe(fakeCraft, box.getBaseMetaTileEntity() .getWorld()); if (out != null) { @@ -424,13 +423,11 @@ public static void checkRouting(GTMachineBox box) { } ItemStack output; switch (Circuit.getItemDamage()) { - case 1 -> output = new ItemStack( - Blocks.cobblestone, - (int) Math.pow(16, box.ringCount)); + case 1 -> + output = new ItemStack(Blocks.cobblestone, (int) Math.pow(16, box.ringCount)); case 2 -> output = new ItemStack(Blocks.stone, (int) Math.pow(16, box.ringCount)); - case 3 -> output = new ItemStack( - Blocks.obsidian, - (int) Math.pow(16, box.ringCount)); + case 3 -> + output = new ItemStack(Blocks.obsidian, (int) Math.pow(16, box.ringCount)); default -> { box.routingStatus = 3; return; @@ -438,8 +435,12 @@ public static void checkRouting(GTMachineBox box) { } ItemStack input = Circuit.copy(); input.stackSize = 0; - box.routingMap - .add(new BoxRoutings(input, output, RoutingMachine.getStackForm(1), 30L, 20)); + box.routingMap.add(new BoxRoutings( + input, + output, + RoutingMachine.getStackForm(1), + 30L, + 20)); box.routingStatus = 0; return; } @@ -486,8 +487,9 @@ public static void checkRouting(GTMachineBox box) { } // We can find assemblyline recipe using the original method, but no need to update it, // nor check it - GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils - .findAssemblyLineRecipeFromDataStick(data, false); + GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick( + data, + false); if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) { box.routingStatus = 5; return; @@ -500,21 +502,18 @@ public static void checkRouting(GTMachineBox box) { for (ItemStack replace : ItemInputs) { if (GT_OreDictUnificator.getAssociation(replace) != null && GT_OreDictUnificator.isInputStackEqual(replace, in[j])) { - in[j] = new ItemStack( - replace.getItem(), + in[j] = new ItemStack(replace.getItem(), in[j].stackSize, replace.getItemDamage()); } } } - box.routingMap.add( - new BoxRoutings( - in, - tRecipe.mOutput, - tRecipe.mFluidInputs, - RoutingMachine.getStackForm(1), - (long) tRecipe.mEUt, - tRecipe.mDuration)); + box.routingMap.add(new BoxRoutings(in, + tRecipe.mOutput, + tRecipe.mFluidInputs, + RoutingMachine.getStackForm(1), + (long) tRecipe.mEUt, + tRecipe.mDuration)); box.routingStatus = 0; return; } @@ -528,8 +527,7 @@ public static void checkRouting(GTMachineBox box) { // it. // But not anymore. RoutingRecipe = RoutingMachine.getRecipeMap() - .findRecipe( - box.getBaseMetaTileEntity(), + .findRecipe(box.getBaseMetaTileEntity(), true, Long.MAX_VALUE / 10, FluidInputs.toArray(new FluidStack[0]), @@ -548,8 +546,7 @@ public static void checkRouting(GTMachineBox box) { } case "largefusioncomputer5" -> { // Why there are two fusionRecipeMaps?! FK! - RoutingRecipe = RecipeMaps.fusionRecipes.findRecipe( - box.getBaseMetaTileEntity(), + RoutingRecipe = RecipeMaps.fusionRecipes.findRecipe(box.getBaseMetaTileEntity(), false, Long.MAX_VALUE / 10, FluidInputs.toArray(new FluidStack[0]), @@ -560,23 +557,19 @@ public static void checkRouting(GTMachineBox box) { // Circuitassemblyline will check imprint first. Let us do the same thing here. RecipeMap = BartWorksRecipeMaps.bacterialVatRecipes; if (inputBus.getStackInSlot(i) - .getTagCompound() == null - || !inputBus.getStackInSlot(i) - .getTagCompound() - .hasKey("Type")) { + .getTagCompound() == null || !inputBus.getStackInSlot(i) + .getTagCompound() + .hasKey("Type")) { box.routingStatus = 6; return; } for (GT_Recipe recipe : RecipeMap.getAllRecipes()) { - if (GT_Utility.areStacksEqual( - recipe.mOutputs[0], - ItemStack.loadItemStackFromNBT( - inputBus.getStackInSlot(i) - .getTagCompound() - .getCompoundTag("Type")), + if (GT_Utility.areStacksEqual(recipe.mOutputs[0], + ItemStack.loadItemStackFromNBT(inputBus.getStackInSlot(i) + .getTagCompound() + .getCompoundTag("Type")), true)) { - if (recipe.isRecipeInputEqual( - false, + if (recipe.isRecipeInputEqual(false, true, FluidInputs.toArray(new FluidStack[0]), ItemInputs.toArray(new ItemStack[0]))) { @@ -607,8 +600,8 @@ public static void checkRouting(GTMachineBox box) { Materials replicatorItem = null; for (ItemStack item : ItemInputs) { if (Behaviour_DataOrb.getDataName(item) == null) continue; - replicatorItem = Element.get(Behaviour_DataOrb.getDataName(item)).mLinkedMaterials - .get(0); + replicatorItem = Element.get(Behaviour_DataOrb.getDataName(item)).mLinkedMaterials.get( + 0); break; } if (replicatorItem == Materials._NULL) { @@ -616,11 +609,11 @@ public static void checkRouting(GTMachineBox box) { return; } for (GT_Recipe recipe : RecipeMap.getAllRecipes()) { - if (!(recipe.mSpecialItems instanceof ItemStack[]var1)) { + if (!(recipe.mSpecialItems instanceof ItemStack[] var1)) { continue; } - if (replicatorItem.equals( - Element.get(Behaviour_DataOrb.getDataName(var1[0])).mLinkedMaterials.get(0))) { + if (replicatorItem.equals(Element.get(Behaviour_DataOrb.getDataName(var1[0])).mLinkedMaterials.get( + 0))) { box.routingMap.add(new BoxRoutings(recipe, RoutingMachine.getStackForm(1))); box.routingStatus = 0; return; @@ -630,12 +623,10 @@ public static void checkRouting(GTMachineBox box) { return; } case "industrialmassfab.controller.tier.single" -> { - box.routingMap.add( - new BoxRoutings( - FluidRegistry.getFluidStack("ic2uumatter", 1000), - RoutingMachine.getStackForm(1), - TierEU.RECIPE_UEV, - 20)); + box.routingMap.add(new BoxRoutings(FluidRegistry.getFluidStack("ic2uumatter", 1000), + RoutingMachine.getStackForm(1), + TierEU.RECIPE_UEV, + 20)); box.routingStatus = 0; return; } @@ -644,12 +635,12 @@ public static void checkRouting(GTMachineBox box) { case "digester" -> RecipeMap = LanthanidesRecipeMaps.digesterRecipes; case "dissolution_tank" -> RecipeMap = LanthanidesRecipeMaps.dissolutionTankRecipes; case "cyclotron.tier.single" -> RecipeMap = GTPPRecipeMaps.cyclotronRecipes; - case "multimachine.transcendentplasmamixer" -> RecipeMap = RecipeMaps.transcendentPlasmaMixerRecipes; + case "multimachine.transcendentplasmamixer" -> + RecipeMap = RecipeMaps.transcendentPlasmaMixerRecipes; case "projectmoduleassemblert3" -> RecipeMap = IGRecipeMaps.spaceAssemblerRecipes; default -> { - RecipeMap = (RoutingMachine instanceof IBoxable boxable) - ? boxable.getRealRecipeMap(RoutingMachine) - : RoutingMachine.getRecipeMap(); + RecipeMap = (RoutingMachine instanceof IBoxable boxable) ? boxable.getRealRecipeMap( + RoutingMachine) : RoutingMachine.getRecipeMap(); if (RecipeMap == null) { box.routingStatus = 3; return; @@ -657,8 +648,7 @@ public static void checkRouting(GTMachineBox box) { } } ItemInputs.remove(inputBus.getStackInSlot(i)); - if (RoutingRecipe == null) RoutingRecipe = RecipeMap.findRecipe( - box.getBaseMetaTileEntity(), + if (RoutingRecipe == null) RoutingRecipe = RecipeMap.findRecipe(box.getBaseMetaTileEntity(), true, true, Long.MAX_VALUE / 10, @@ -670,11 +660,9 @@ public static void checkRouting(GTMachineBox box) { if (tempRecipe.mInputs[j] == null) continue; if (GT_OreDictUnificator.getAssociation(tempRecipe.mInputs[j]) != null) { for (ItemStack si : box.getStoredInputs()) { - if (GT_OreDictUnificator.isInputStackEqual( - tempRecipe.mInputs[j], + if (GT_OreDictUnificator.isInputStackEqual(tempRecipe.mInputs[j], GT_OreDictUnificator.get(false, si))) { - tempRecipe.mInputs[j] = new ItemStack( - si.getItem(), + tempRecipe.mInputs[j] = new ItemStack(si.getItem(), tempRecipe.mInputs[j].stackSize, si.getItemDamage()); } @@ -701,12 +689,9 @@ public static void makeRouting(GT_NEI_DefaultHandler recipe, int recipeIndex, En .collect(Collectors.toList()); for (ItemStack machine : machineList) { if (getMetaTileEntity(machine) instanceof GT_MetaTileEntity_MultiBlockBase) { - NetworkLoader.instance.sendToServer( - new MessageRouting( - new BoxRoutings( - ((GT_NEI_DefaultHandler.CachedDefaultRecipe) recipe.arecipes.get(recipeIndex)).mRecipe, - machine).routingToNbt(), - player)); + NetworkLoader.instance.sendToServer(new MessageRouting(new BoxRoutings(((GT_NEI_DefaultHandler.CachedDefaultRecipe) recipe.arecipes.get( + recipeIndex)).mRecipe, + machine).routingToNbt(), player)); break; } } diff --git a/src/main/java/com/silvermoon/boxplusplus/util/FluidContainer.java b/src/main/java/com/silvermoon/boxplusplus/util/FluidContainer.java index d0635eb..ac3050d 100644 --- a/src/main/java/com/silvermoon/boxplusplus/util/FluidContainer.java +++ b/src/main/java/com/silvermoon/boxplusplus/util/FluidContainer.java @@ -13,12 +13,12 @@ public class FluidContainer { public void addFluidStack(FluidStack input, int multiple) { String name = input.getUnlocalizedName(); if (!stack.containsKey(name)) { - stack.put( - name, + stack.put(name, new FluidStack(input.getFluid(), (int) Math.min((long) input.amount * multiple, Integer.MAX_VALUE))); } else { - stack.get(name).amount = (int) Math - .min(stack.get(name).amount + (long) input.amount * multiple, Integer.MAX_VALUE); + stack.get(name).amount = (int) Math.min( + stack.get(name).amount + (long) input.amount * multiple, + Integer.MAX_VALUE); } } diff --git a/src/main/java/com/silvermoon/boxplusplus/util/ItemContainer.java b/src/main/java/com/silvermoon/boxplusplus/util/ItemContainer.java index 6b087d2..0c737aa 100644 --- a/src/main/java/com/silvermoon/boxplusplus/util/ItemContainer.java +++ b/src/main/java/com/silvermoon/boxplusplus/util/ItemContainer.java @@ -18,8 +18,10 @@ public void addItemStack(ItemStack input, int multiple, int chance) { if (input.getItem() == null) return; Optional isNull = Optional.ofNullable(stack.get(input.getItem(), input.getItemDamage())); if (isNull.isPresent()) { - stack - .put(input.getItem(), input.getItemDamage(), chance * (long) input.stackSize * multiple + isNull.get()); + stack.put( + input.getItem(), + input.getItemDamage(), + chance * (long) input.stackSize * multiple + isNull.get()); } else { stack.put(input.getItem(), input.getItemDamage(), chance * (long) input.stackSize * multiple); } @@ -44,11 +46,9 @@ public List getItemStack() { for (Item item : stack.rowKeySet()) { for (int meta : stack.columnKeySet()) { if (stack.get(item, meta) != null) { - output.add( - new ItemStack( - item, - (int) Math.min(stack.get(item, meta) / 10000, Integer.MAX_VALUE - 1), - meta)); + output.add(new ItemStack(item, + (int) Math.min(stack.get(item, meta) / 10000, Integer.MAX_VALUE - 1), + meta)); } } } diff --git a/src/main/java/com/silvermoon/boxplusplus/util/ResultModuleRequirement.java b/src/main/java/com/silvermoon/boxplusplus/util/ResultModuleRequirement.java index 045681b..b0c0c6d 100644 --- a/src/main/java/com/silvermoon/boxplusplus/util/ResultModuleRequirement.java +++ b/src/main/java/com/silvermoon/boxplusplus/util/ResultModuleRequirement.java @@ -30,8 +30,9 @@ public boolean wasSuccessful() { @Override public String getDisplayString() { - return EnumChatFormatting.AQUA + i18n("tile.boxplusplus.boxUI.37") - + i18n("tile.boxplusplus_" + (isUpdated ? "boxmoduleplus." : "boxmodule." + required + ".name")); + return EnumChatFormatting.AQUA + i18n("tile.boxplusplus.boxUI.37") + i18n("tile.boxplusplus_" + (isUpdated + ? "boxmoduleplus." + : "boxmodule." + required + ".name")); } @Override diff --git a/src/main/java/com/silvermoon/boxplusplus/util/Util.java b/src/main/java/com/silvermoon/boxplusplus/util/Util.java index c736225..392f3ae 100644 --- a/src/main/java/com/silvermoon/boxplusplus/util/Util.java +++ b/src/main/java/com/silvermoon/boxplusplus/util/Util.java @@ -134,8 +134,11 @@ public static ItemStack readBoxItemFromUNBT(NBTTagCompound nbt) { if (itemDamage < 0) { itemDamage = 0; } - ItemStack boxItem = GT_ModHandler - .getModItem(nbt.getString("modID"), nbt.getString("name"), stackSize, itemDamage); + ItemStack boxItem = GT_ModHandler.getModItem( + nbt.getString("modID"), + nbt.getString("name"), + stackSize, + itemDamage); if (nbt.hasKey("tag", 10)) { boxItem.stackTagCompound = nbt.getCompoundTag("tag"); } @@ -179,11 +182,11 @@ public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigge @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock( - x, + world.setBlock(x, y, z, - trigger.stackSize == 1 ? RingAdder.apply(t) + trigger.stackSize == 1 + ? RingAdder.apply(t) : (trigger.stackSize == 2 ? BlockRegister.BoxRing2 : BlockRegister.BoxRing3), hintMeta, 2); @@ -195,7 +198,8 @@ public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigg public static String serialize(NBTTagCompound nbt) { try { return org.apache.commons.codec.binary.Base64.encodeBase64String(CompressedStreamTools.compress(nbt)); - } catch (IOException ignored) {} + } catch (IOException ignored) { + } return null; } @@ -204,7 +208,8 @@ public static String serialize(NBTTagCompound nbt) { byte[] b = org.apache.commons.codec.binary.Base64.decodeBase64(str); try { return CompressedStreamTools.func_152457_a(b, new NBTSizeTracker(2097152L)); - } catch (IOException ignored) {} + } catch (IOException ignored) { + } } return null; } @@ -281,10 +286,8 @@ public static EntityPlayer getPlayerFromUUID(String uuid) { for (Object player : MinecraftServer.getServer() .getConfigurationManager().playerEntityList) { if (player instanceof EntityPlayer player1) { - if (uuid.equals( - player1.getUniqueID() - .toString())) - return player1; + if (uuid.equals(player1.getUniqueID() + .toString())) return player1; } } return null;