From 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 10 Apr 2023 17:49:16 +0100 Subject: Update spotless config to 0.2.2 --- src/main/java/gregtech/api/GregTech_API.java | 437 +- .../api/damagesources/GT_DamageSources.java | 10 +- .../api/enchants/Enchantment_EnderDamage.java | 28 +- .../api/enchants/Enchantment_Radioactivity.java | 10 +- src/main/java/gregtech/api/enums/Dyes.java | 2 +- src/main/java/gregtech/api/enums/Element.java | 2 +- src/main/java/gregtech/api/enums/FluidState.java | 2 +- .../gregtech/api/enums/GTNH_ExtraMaterials.java | 1144 ++-- .../java/gregtech/api/enums/GT_HatchElement.java | 6 +- src/main/java/gregtech/api/enums/GT_Values.java | 350 +- src/main/java/gregtech/api/enums/ItemList.java | 70 +- .../java/gregtech/api/enums/MaterialBuilder.java | 56 +- src/main/java/gregtech/api/enums/Materials.java | 1479 +++-- .../java/gregtech/api/enums/MaterialsBotania.java | 374 +- .../java/gregtech/api/enums/MaterialsKevlar.java | 1246 ++-- .../java/gregtech/api/enums/MaterialsOreAlum.java | 148 +- src/main/java/gregtech/api/enums/Mods.java | 2 +- src/main/java/gregtech/api/enums/OrePrefixes.java | 1218 ++-- .../java/gregtech/api/enums/SoundResource.java | 4 +- src/main/java/gregtech/api/enums/SubTag.java | 4 +- src/main/java/gregtech/api/enums/TextureSet.java | 104 +- src/main/java/gregtech/api/enums/Textures.java | 563 +- src/main/java/gregtech/api/enums/Tier.java | 856 +-- .../java/gregtech/api/enums/ToolDictNames.java | 2 +- .../gregtech/api/events/BlockScanningEvent.java | 3 +- src/main/java/gregtech/api/fluid/FluidTankGT.java | 17 +- .../java/gregtech/api/fluid/GT_FluidFactory.java | 18 +- .../java/gregtech/api/graphs/GenerateNodeMap.java | 24 +- .../gregtech/api/graphs/GenerateNodeMapPower.java | 26 +- src/main/java/gregtech/api/graphs/Node.java | 2 +- src/main/java/gregtech/api/graphs/PowerNodes.java | 46 +- .../api/graphs/consumers/NodeEnergyConnected.java | 2 +- .../api/graphs/consumers/NodeEnergyReceiver.java | 17 +- .../api/graphs/consumers/NodeEnergySink.java | 4 +- .../api/graphs/consumers/NodeGTBaseMetaTile.java | 2 +- .../gregtech/api/graphs/paths/PowerNodePath.java | 5 +- src/main/java/gregtech/api/gui/GT_Container.java | 96 +- .../api/gui/GT_ContainerMetaTile_Machine.java | 19 +- .../api/gui/GT_Container_BasicMachine.java | 12 +- .../gregtech/api/gui/GT_Container_BasicTank.java | 10 +- .../api/gui/GT_Container_MultiMachine.java | 2 +- .../java/gregtech/api/gui/GT_GUIColorOverride.java | 37 +- .../api/gui/GT_GUIContainerMetaTile_Machine.java | 60 +- .../gregtech/api/gui/GT_GUIContainer_1by1.java | 10 +- .../gregtech/api/gui/GT_GUIContainer_2by2.java | 10 +- .../gregtech/api/gui/GT_GUIContainer_3by3.java | 10 +- .../gregtech/api/gui/GT_GUIContainer_4by4.java | 10 +- .../api/gui/GT_GUIContainer_BasicMachine.java | 137 +- .../api/gui/GT_GUIContainer_BasicTank.java | 23 +- .../api/gui/GT_GUIContainer_MultiMachine.java | 98 +- src/main/java/gregtech/api/gui/GT_GUICover.java | 14 +- .../gregtech/api/gui/GT_GUIDialogSelectItem.java | 32 +- src/main/java/gregtech/api/gui/GT_Slot_Armor.java | 4 +- src/main/java/gregtech/api/gui/GT_Slot_Holo.java | 2 +- .../gui/modularui/FallbackableSteamTexture.java | 4 +- .../api/gui/modularui/GT_CoverUIBuildContext.java | 2 +- .../gregtech/api/gui/modularui/GT_UIInfos.java | 173 +- .../gregtech/api/gui/modularui/GT_UITextures.java | 855 +-- .../gregtech/api/gui/modularui/GUITextureSet.java | 66 +- .../gregtech/api/gui/modularui/SteamTexture.java | 32 +- .../api/gui/widgets/GT_GuiCoverTabLine.java | 42 +- .../api/gui/widgets/GT_GuiFakeItemButton.java | 14 +- .../java/gregtech/api/gui/widgets/GT_GuiIcon.java | 8 +- .../gregtech/api/gui/widgets/GT_GuiIconButton.java | 4 +- .../api/gui/widgets/GT_GuiIconCheckButton.java | 2 +- .../api/gui/widgets/GT_GuiIntegerTextBox.java | 18 +- .../java/gregtech/api/gui/widgets/GT_GuiTab.java | 32 +- .../gregtech/api/gui/widgets/GT_GuiTabLine.java | 24 +- .../api/gui/widgets/GT_GuiTooltipManager.java | 6 +- .../api/interfaces/IDragAndDropSupport.java | 2 +- .../api/interfaces/IGlobalWirelessEnergy.java | 10 +- .../gregtech/api/interfaces/IHatchElement.java | 50 +- .../gregtech/api/interfaces/IItemBehaviour.java | 8 +- .../gregtech/api/interfaces/IProjectileItem.java | 2 +- .../java/gregtech/api/interfaces/IToolStats.java | 4 +- .../api/interfaces/fluid/IGT_FluidBuilder.java | 2 +- .../api/interfaces/fluid/IGT_RegisteredFluid.java | 2 +- .../api/interfaces/internal/IGT_RecipeAdder.java | 206 +- .../api/interfaces/internal/IThaumcraftCompat.java | 26 +- .../interfaces/metatileentity/IMetaTileEntity.java | 12 +- .../metatileentity/IMetaTileEntityCable.java | 2 +- .../metatileentity/IMetaTileEntityItemPipe.java | 45 +- .../interfaces/tileentity/IColoredTileEntity.java | 4 +- .../api/interfaces/tileentity/ICoverable.java | 2 +- .../interfaces/tileentity/IEnergyConnected.java | 19 +- .../tileentity/IExperimentalEnergyTileEntity.java | 45 +- .../interfaces/tileentity/IGregTechTileEntity.java | 10 +- .../tileentity/IGregtechWailaProvider.java | 4 +- .../api/items/GT_Block_LongDistancePipe.java | 5 +- .../gregtech/api/items/GT_BreederCell_Item.java | 24 +- .../gregtech/api/items/GT_CoolantCellIC_Item.java | 2 +- .../gregtech/api/items/GT_CoolantCell_Item.java | 4 +- .../gregtech/api/items/GT_EnergyArmor_Item.java | 58 +- .../java/gregtech/api/items/GT_Generic_Item.java | 12 +- .../java/gregtech/api/items/GT_MetaBase_Item.java | 104 +- .../gregtech/api/items/GT_MetaGenerated_Item.java | 55 +- .../api/items/GT_MetaGenerated_Item_X01.java | 43 +- .../api/items/GT_MetaGenerated_Item_X32.java | 26 +- .../gregtech/api/items/GT_MetaGenerated_Tool.java | 415 +- .../api/items/GT_RadioactiveCellIC_Item.java | 45 +- .../api/items/GT_RadioactiveCell_Item.java | 10 +- .../gregtech/api/items/GT_SolderingTool_Item.java | 30 +- .../java/gregtech/api/items/GT_Spray_Bug_Item.java | 30 +- .../gregtech/api/items/GT_Spray_Foam_Item.java | 82 +- .../gregtech/api/items/GT_Spray_Hardener_Item.java | 35 +- .../api/items/GT_Spray_Hydration_Item.java | 22 +- .../java/gregtech/api/items/GT_Spray_Ice_Item.java | 38 +- .../gregtech/api/items/GT_Spray_Pepper_Item.java | 36 +- src/main/java/gregtech/api/items/GT_Tool_Item.java | 34 +- .../api/metatileentity/BaseMetaPipeEntity.java | 360 +- .../api/metatileentity/BaseMetaTileEntity.java | 804 ++- .../api/metatileentity/BaseTileEntity.java | 203 +- .../api/metatileentity/CommonMetaTileEntity.java | 2 +- .../api/metatileentity/CoverableTileEntity.java | 226 +- .../api/metatileentity/MetaPipeEntity.java | 67 +- .../api/metatileentity/MetaTileEntity.java | 107 +- .../api/metatileentity/TileIC2EnergySink.java | 22 +- .../examples/GT_MetaTileEntity_E_Furnace.java | 124 +- .../implementations/GT_MetaPipeEntity_Cable.java | 275 +- .../implementations/GT_MetaPipeEntity_Fluid.java | 299 +- .../implementations/GT_MetaPipeEntity_Frame.java | 31 +- .../implementations/GT_MetaPipeEntity_Item.java | 170 +- .../GT_MetaTileEntity_BasicBatteryBuffer.java | 177 +- .../GT_MetaTileEntity_BasicGenerator.java | 55 +- .../GT_MetaTileEntity_BasicHull.java | 16 +- .../GT_MetaTileEntity_BasicHull_NonElectric.java | 8 +- .../GT_MetaTileEntity_BasicMachine.java | 624 +- .../GT_MetaTileEntity_BasicMachine_Bronze.java | 171 +- .../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 446 +- .../GT_MetaTileEntity_BasicMachine_Steel.java | 64 +- .../GT_MetaTileEntity_BasicTank.java | 134 +- .../implementations/GT_MetaTileEntity_Buffer.java | 214 +- .../GT_MetaTileEntity_CubicMultiBlockBase.java | 42 +- .../GT_MetaTileEntity_EnhancedMultiBlockBase.java | 188 +- ...MetaTileEntity_ExtendedPowerMultiBlockBase.java | 112 +- .../implementations/GT_MetaTileEntity_Hatch.java | 12 +- .../GT_MetaTileEntity_Hatch_DataAccess.java | 28 +- .../GT_MetaTileEntity_Hatch_Dynamo.java | 14 +- .../GT_MetaTileEntity_Hatch_Energy.java | 18 +- .../GT_MetaTileEntity_Hatch_Input.java | 44 +- .../GT_MetaTileEntity_Hatch_InputBus.java | 56 +- .../GT_MetaTileEntity_Hatch_Maintenance.java | 121 +- .../GT_MetaTileEntity_Hatch_Muffler.java | 51 +- .../GT_MetaTileEntity_Hatch_MultiInput.java | 63 +- .../GT_MetaTileEntity_Hatch_Output.java | 275 +- .../GT_MetaTileEntity_Hatch_OutputBus.java | 58 +- .../GT_MetaTileEntity_MultiBlockBase.java | 779 ++- .../GT_MetaTileEntity_SpecialFilter.java | 144 +- .../GT_MetaTileEntity_TieredMachineBlock.java | 22 +- .../GT_MetaTileEntity_TooltipMultiBlockBase.java | 4 +- .../GT_MetaTileEntity_Transformer.java | 166 +- .../GT_MetaTileEntity_Wireless_Dynamo.java | 10 +- .../GT_MetaTileEntity_Wireless_Hatch.java | 12 +- .../api/multitileentity/MultiTileEntityBlock.java | 209 +- .../MultiTileEntityBlockInternal.java | 15 +- .../MultiTileEntityClassContainer.java | 14 +- .../MultiTileEntityItemInternal.java | 152 +- .../multitileentity/MultiTileEntityRegistry.java | 57 +- .../api/multitileentity/base/MultiTileEntity.java | 267 +- .../base/NonTickableMultiTileEntity.java | 2 +- .../interfaces/IMultiTileEntity.java | 12 +- .../machine/MultiTileBasicMachine.java | 110 +- .../multiblock/base/MultiBlockController.java | 571 +- .../multiblock/base/MultiBlockPart.java | 113 +- .../multiblock/base/MultiBlockPowerController.java | 2 +- .../gregtech/api/net/GT_Packet_Block_Event.java | 10 +- .../api/net/GT_Packet_ClientPreference.java | 2 +- .../api/net/GT_Packet_GtTileEntityGuiRequest.java | 40 +- .../api/net/GT_Packet_MultiTileEntity.java | 48 +- .../api/net/GT_Packet_RequestCoverData.java | 10 +- .../gregtech/api/net/GT_Packet_SendCoverData.java | 18 +- .../api/net/GT_Packet_SetConfigurationCircuit.java | 16 +- .../gregtech/api/net/GT_Packet_SetLockedFluid.java | 14 +- .../java/gregtech/api/net/GT_Packet_Sound.java | 12 +- .../gregtech/api/net/GT_Packet_TileEntity.java | 127 +- .../api/net/GT_Packet_TileEntityCover.java | 14 +- .../api/net/GT_Packet_TileEntityCoverGUI.java | 46 +- .../api/net/GT_Packet_TileEntityCoverNew.java | 20 +- .../api/net/GT_Packet_WirelessRedstoneCover.java | 23 +- .../api/objects/AE2DigitalChestHandler.java | 6 +- .../java/gregtech/api/objects/CollectorUtils.java | 2 +- .../java/gregtech/api/objects/ElementStack.java | 2 +- .../java/gregtech/api/objects/GT_ChunkManager.java | 75 +- .../gregtech/api/objects/GT_Cover_Default.java | 12 +- .../java/gregtech/api/objects/GT_Cover_None.java | 62 +- src/main/java/gregtech/api/objects/GT_Fluid.java | 2 +- .../java/gregtech/api/objects/GT_FluidStack.java | 16 +- src/main/java/gregtech/api/objects/GT_HashSet.java | 2 +- .../java/gregtech/api/objects/GT_ItemStack.java | 6 +- .../gregtech/api/objects/GT_RenderedTexture.java | 2 +- .../java/gregtech/api/objects/GT_SidedTexture.java | 8 +- .../api/objects/GT_StdRenderedTexture.java | 2 +- .../java/gregtech/api/objects/GT_UO_Dimension.java | 10 +- .../gregtech/api/objects/GT_UO_DimensionList.java | 37 +- .../java/gregtech/api/objects/GT_UO_Fluid.java | 20 +- src/main/java/gregtech/api/objects/ItemData.java | 10 +- .../java/gregtech/api/objects/MaterialStack.java | 3 +- src/main/java/gregtech/api/objects/ObjMap.java | 2 +- src/main/java/gregtech/api/objects/XSTR.java | 7 +- .../java/gregtech/api/render/TextureFactory.java | 42 +- .../api/threads/GT_Runnable_Cable_Update.java | 28 +- .../threads/GT_Runnable_MachineBlockUpdate.java | 40 +- .../gregtech/api/threads/GT_Runnable_Sound.java | 38 +- .../gregtech/api/util/ColorsMetadataSection.java | 4 +- .../api/util/ColorsMetadataSectionSerializer.java | 20 +- .../java/gregtech/api/util/GT_ApiaryUpgrade.java | 8 +- .../gregtech/api/util/GT_AssemblyLineUtils.java | 89 +- .../gregtech/api/util/GT_Assemblyline_Server.java | 475 +- src/main/java/gregtech/api/util/GT_BaseCrop.java | 95 +- src/main/java/gregtech/api/util/GT_CLS_Compat.java | 64 +- .../gregtech/api/util/GT_ChunkAssociatedData.java | 153 +- .../gregtech/api/util/GT_CircuitryBehavior.java | 74 +- .../gregtech/api/util/GT_ClientPreference.java | 8 +- src/main/java/gregtech/api/util/GT_Config.java | 50 +- .../java/gregtech/api/util/GT_CoverBehavior.java | 90 +- .../gregtech/api/util/GT_CoverBehaviorBase.java | 177 +- .../api/util/GT_ExoticEnergyInputHelper.java | 21 +- src/main/java/gregtech/api/util/GT_FoodStat.java | 38 +- .../java/gregtech/api/util/GT_Forestry_Compat.java | 224 +- src/main/java/gregtech/api/util/GT_GC_Compat.java | 16 +- .../gregtech/api/util/GT_HatchElementBuilder.java | 258 +- .../api/util/GT_ItsNotMyFaultException.java | 2 +- .../java/gregtech/api/util/GT_LanguageManager.java | 50 +- src/main/java/gregtech/api/util/GT_ModHandler.java | 938 ++- .../api/util/GT_Multiblock_Tooltip_Builder.java | 65 +- .../gregtech/api/util/GT_OreDictUnificator.java | 44 +- .../gregtech/api/util/GT_OverclockCalculator.java | 8 +- .../gregtech/api/util/GT_PCBFactoryManager.java | 2 +- .../java/gregtech/api/util/GT_ParallelHelper.java | 22 +- .../java/gregtech/api/util/GT_PlayedSound.java | 4 +- src/main/java/gregtech/api/util/GT_Recipe.java | 6340 ++++++++++---------- .../java/gregtech/api/util/GT_RecipeBuilder.java | 178 +- .../java/gregtech/api/util/GT_RecipeConstants.java | 186 +- .../java/gregtech/api/util/GT_RecipeMapUtil.java | 58 +- .../gregtech/api/util/GT_RecipeRegistrator.java | 641 +- .../java/gregtech/api/util/GT_RenderingWorld.java | 12 +- .../java/gregtech/api/util/GT_Shaped_Recipe.java | 40 +- .../gregtech/api/util/GT_Shapeless_Recipe.java | 40 +- .../gregtech/api/util/GT_Single_Recipe_Check.java | 112 +- .../GT_Single_Recipe_Check_Processing_Array.java | 46 +- .../gregtech/api/util/GT_SpawnEventHandler.java | 10 +- .../gregtech/api/util/GT_StructureUtility.java | 265 +- .../gregtech/api/util/GT_TooltipDataCache.java | 7 +- src/main/java/gregtech/api/util/GT_Util.java | 82 +- src/main/java/gregtech/api/util/GT_Utility.java | 2493 ++++---- .../java/gregtech/api/util/GT_UtilityClient.java | 19 +- .../java/gregtech/api/util/IGT_HatchAdder.java | 2 +- .../java/gregtech/api/util/LightingHelper.java | 1662 +++-- .../api/util/WorldSpawnedEventBuilder.java | 88 +- src/main/java/gregtech/api/world/GT_Worldgen.java | 30 +- .../java/gregtech/api/world/GT_Worldgen_Ore.java | 4 +- .../api/world/GT_Worldgen_Ore_SingleBlock.java | 44 +- .../GT_Worldgen_Ore_SingleBlock_UnderLava.java | 46 +- 253 files changed, 17298 insertions(+), 18998 deletions(-) (limited to 'src/main/java/gregtech/api') diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java index 59fa6776c3..3e0f7fdabe 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -108,8 +108,8 @@ public class GregTech_API { * My Creative Tab */ public static final CreativeTabs TAB_GREGTECH = new GT_CreativeTab("Main", "Main"), - TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"), - TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores"); + TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"), + TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores"); /** * A List of all registered MetaTileEntities *

@@ -173,25 +173,23 @@ public class GregTech_API { * The List of Tools, which can be used. Accepts regular damageable Items and Electric Items */ public static final GT_HashSet sToolList = new GT_HashSet<>(), sCrowbarList = new GT_HashSet<>(), - sScrewdriverList = new GT_HashSet<>(), sWrenchList = new GT_HashSet<>(), - sSoftHammerList = new GT_HashSet<>(), sHardHammerList = new GT_HashSet<>(), - sWireCutterList = new GT_HashSet<>(), sSolderingToolList = new GT_HashSet<>(), - sSolderingMetalList = new GT_HashSet<>(); + sScrewdriverList = new GT_HashSet<>(), sWrenchList = new GT_HashSet<>(), sSoftHammerList = new GT_HashSet<>(), + sHardHammerList = new GT_HashSet<>(), sWireCutterList = new GT_HashSet<>(), + sSolderingToolList = new GT_HashSet<>(), sSolderingMetalList = new GT_HashSet<>(); /** * The List of Hazmat Armors */ public static final GT_HashSet sGasHazmatList = new GT_HashSet<>(), - sBioHazmatList = new GT_HashSet<>(), sFrostHazmatList = new GT_HashSet<>(), - sHeatHazmatList = new GT_HashSet<>(), sRadioHazmatList = new GT_HashSet<>(), - sElectroHazmatList = new GT_HashSet<>(); + sBioHazmatList = new GT_HashSet<>(), sFrostHazmatList = new GT_HashSet<>(), + sHeatHazmatList = new GT_HashSet<>(), sRadioHazmatList = new GT_HashSet<>(), + sElectroHazmatList = new GT_HashSet<>(); - private static final Multimap sRealConfigurationList = Multimaps.newListMultimap( - new TreeMap<>(), - ArrayList::new); + private static final Multimap sRealConfigurationList = Multimaps + .newListMultimap(new TreeMap<>(), ArrayList::new); private static final Map> sConfigurationLists = new ConcurrentHashMap<>(); private static final Map, BiFunction> sRealCircuitProgrammerList = new LinkedHashMap<>(); - public static final Map, BiFunction> sCircuitProgrammerList = Collections.unmodifiableMap( - sRealCircuitProgrammerList); + public static final Map, BiFunction> sCircuitProgrammerList = Collections + .unmodifiableMap(sRealCircuitProgrammerList); /** * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets. @@ -233,11 +231,11 @@ public class GregTech_API { * Implement just the Method run() and everything should work */ public static List sBeforeGTPreload = new ArrayList<>(), sAfterGTPreload = new ArrayList<>(), - sBeforeGTLoad = new ArrayList<>(), sAfterGTLoad = new ArrayList<>(), sBeforeGTPostload = new ArrayList<>(), - sAfterGTPostload = new ArrayList<>(), sFirstWorldTick = new ArrayList<>(), - sBeforeGTServerstart = new ArrayList<>(), sAfterGTServerstart = new ArrayList<>(), - sBeforeGTServerstop = new ArrayList<>(), sAfterGTServerstop = new ArrayList<>(), - sGTBlockIconload = new ArrayList<>(), sGTItemIconload = new ArrayList<>(); + sBeforeGTLoad = new ArrayList<>(), sAfterGTLoad = new ArrayList<>(), sBeforeGTPostload = new ArrayList<>(), + sAfterGTPostload = new ArrayList<>(), sFirstWorldTick = new ArrayList<>(), + sBeforeGTServerstart = new ArrayList<>(), sAfterGTServerstart = new ArrayList<>(), + sBeforeGTServerstop = new ArrayList<>(), sAfterGTServerstop = new ArrayList<>(), + sGTBlockIconload = new ArrayList<>(), sGTItemIconload = new ArrayList<>(); /** * The Icon Registers from Blocks and Items. They will get set right before the corresponding Icon Load Phase as * executed in the Runnable List above. @@ -248,7 +246,7 @@ public class GregTech_API { * The Configuration Objects */ public static GT_Config sRecipeFile = null, sMachineFile = null, sWorldgenFile = null, sMaterialProperties = null, - sMaterialComponents = null, sUnification = null, sSpecialFile = null, sClientDataFile, sOPStuff = null; + sMaterialComponents = null, sUnification = null, sSpecialFile = null, sClientDataFile, sOPStuff = null; public static int TICKS_FOR_LAG_AVERAGING = 25, MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100; /** @@ -257,24 +255,24 @@ public class GregTech_API { public static Block sBlockMachines; public static Block sBlockOres1, sBlockOresUb1, sBlockOresUb2, sBlockOresUb3, - /* sBlockGem, */ - sBlockMetal1, sBlockMetal2, sBlockMetal3, sBlockMetal4, sBlockMetal5, sBlockMetal6, sBlockMetal7, - sBlockMetal8, sBlockMetal9, sBlockGem1, sBlockGem2, sBlockGem3, sBlockReinforced; + /* sBlockGem, */ + sBlockMetal1, sBlockMetal2, sBlockMetal3, sBlockMetal4, sBlockMetal5, sBlockMetal6, sBlockMetal7, sBlockMetal8, + sBlockMetal9, sBlockGem1, sBlockGem2, sBlockGem3, sBlockReinforced; public static Block sBlockGranites, sBlockConcretes, sBlockStones; public static Block sBlockCasings1, sBlockCasings2, sBlockCasings3, sBlockCasings4, sBlockCasings5, sBlockCasings6, - sBlockCasings8, sBlockCasings9, sSolenoidCoilCasings; + sBlockCasings8, sBlockCasings9, sSolenoidCoilCasings; public static Block sBlockLongDistancePipes; /** * Getting assigned by the Config */ public static boolean sTimber = true, sDrinksAlwaysDrinkable = false, sMultiThreadedSounds = false, - sDoShowAllItemsInCreative = false, sColoredGUI = true, sMachineMetalGUI = false, sConstantEnergy = true, - sMachineExplosions = true, sMachineFlammable = true, sMachineNonWrenchExplosions = true, - sMachineRainExplosions = true, sMachineThunderExplosions = true, sMachineFireExplosions = true, - sMachineWireFire = true, mOutputRF = false, mInputRF = false, meIOLoaded = false, mRFExplosions = false, - mServerStarted = false, mIC2Classic = false, mMagneticraft = false, mImmersiveEngineering = false, - mGTPlusPlus = false, mTranslocator = false, mTConstruct = false, mGalacticraft = false, mAE2 = false, - mHodgepodge = false, mEternalSingularity = false; + sDoShowAllItemsInCreative = false, sColoredGUI = true, sMachineMetalGUI = false, sConstantEnergy = true, + sMachineExplosions = true, sMachineFlammable = true, sMachineNonWrenchExplosions = true, + sMachineRainExplosions = true, sMachineThunderExplosions = true, sMachineFireExplosions = true, + sMachineWireFire = true, mOutputRF = false, mInputRF = false, meIOLoaded = false, mRFExplosions = false, + mServerStarted = false, mIC2Classic = false, mMagneticraft = false, mImmersiveEngineering = false, + mGTPlusPlus = false, mTranslocator = false, mTConstruct = false, mGalacticraft = false, mAE2 = false, + mHodgepodge = false, mEternalSingularity = false; public static int mEUtoRF = 360, mRFtoEU = 20; @@ -290,7 +288,7 @@ public class GregTech_API { * Getting assigned by the Mod loading */ public static boolean sUnificationEntriesRegistered = false, sPreloadStarted = false, sPreloadFinished = false, - sLoadStarted = false, sLoadFinished = false, sPostloadStarted = false, sPostloadFinished = false; + sLoadStarted = false, sLoadFinished = false, sPostloadStarted = false, sPostloadFinished = false; private static Class sBaseMetaTileEntityClass = null; @@ -348,10 +346,10 @@ public class GregTech_API { */ public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) { if (!GregTech_API.sPreloadFinished) GT_Log.err.println( - "GregTech_API ERROR: " + aOreStack.getItem() - + "." - + aOreStack.getItemDamage() - + " - OreDict Unification Entries are not registered now, please call it in the postload phase."); + "GregTech_API ERROR: " + aOreStack.getItem() + + "." + + aOreStack.getItemDamage() + + " - OreDict Unification Entries are not registered now, please call it in the postload phase."); return GT_OreDictUnificator.get(true, aOreStack); } @@ -443,335 +441,285 @@ public class GregTech_API { /* Do nothing */ } return new gregtech.api.items.GT_Generic_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + false); } /** * Creates a new Energy Armor Item */ public static Item constructElectricArmorItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, - int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, - int aType, int aArmorIndex) { + int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, + int aType, int aArmorIndex) { try { return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmorIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aCharge, - aTransfer, - aTier, - aDamageEnergyCost, - aSpecials, - aArmorAbsorbtionPercentage, - aChargeProvider, - aType, - aArmorIndex); + .getConstructors()[0].newInstance( + aUnlocalized, + aEnglish, + aCharge, + aTransfer, + aTier, + aDamageEnergyCost, + aSpecials, + aArmorAbsorbtionPercentage, + aChargeProvider, + aType, + aArmorIndex); } catch (Throwable e) { /* Do nothing */ } try { return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aCharge, - aTransfer, - aTier, - aDamageEnergyCost, - aSpecials, - aArmorAbsorbtionPercentage, - aChargeProvider, - aType, - aArmorIndex); + .getConstructors()[0].newInstance( + aUnlocalized, + aEnglish, + aCharge, + aTransfer, + aTier, + aDamageEnergyCost, + aSpecials, + aArmorAbsorbtionPercentage, + aChargeProvider, + aType, + aArmorIndex); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Generic_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + false); } /** * Creates a new Energy Battery Item */ public static Item constructElectricEnergyStorageItem(String aUnlocalized, String aEnglish, int aCharge, - int aTransfer, int aTier, int aEmptyID, int aFullID) { + int aTransfer, int aTier, int aEmptyID, int aFullID) { try { return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStoreIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aCharge, - aTransfer, - aTier, - aEmptyID, - aFullID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID); } catch (Throwable e) { /* Do nothing */ } try { return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStore_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aCharge, - aTransfer, - aTier, - aEmptyID, - aFullID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Generic_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + false); } /** * Creates a new Hard Hammer Item */ public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage) { + int aEntityDamage) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_HardHammer_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new Crowbar Item */ public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage) { + int aEntityDamage) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); } catch (Throwable e) { /* Do nothing */ } try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Crowbar_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new Wrench Item */ public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aDisChargedGTID) { + int aEntityDamage, int aDisChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Wrench_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage, - aDisChargedGTID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new electric Screwdriver Item */ public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aDisChargedGTID) { + int aEntityDamage, int aDisChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage, - aDisChargedGTID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new electric Wrench Item */ public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aDisChargedGTID) { + int aEntityDamage, int aDisChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage, - aDisChargedGTID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new electric Saw Item */ public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, - int aDisChargedGTID) { + int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, + int aDisChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SawIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage, - aToolQuality, - aToolStrength, - aEnergyConsumptionPerBlockBreak, - aDisChargedGTID); + .getConstructors()[0].newInstance( + aUnlocalized, + aEnglish, + aMaxDamage, + aEntityDamage, + aToolQuality, + aToolStrength, + aEnergyConsumptionPerBlockBreak, + aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new electric Drill Item */ public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, - int aDisChargedGTID) { + int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, + int aDisChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_DrillIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage, - aToolQuality, - aToolStrength, - aEnergyConsumptionPerBlockBreak, - aDisChargedGTID); + .getConstructors()[0].newInstance( + aUnlocalized, + aEnglish, + aMaxDamage, + aEntityDamage, + aToolQuality, + aToolStrength, + aEnergyConsumptionPerBlockBreak, + aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new electric Soldering Tool */ public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aEntityDamage, int aDisChargedGTID) { + int aEntityDamage, int aDisChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aEntityDamage, - aDisChargedGTID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - aEntityDamage, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + aEntityDamage, + false); } /** * Creates a new empty electric Tool */ public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, - int aChargedGTID) { + int aChargedGTID) { try { return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item") - .getConstructors()[0].newInstance( - aUnlocalized, - aEnglish, - aMaxDamage, - aChargedGTID); + .getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID); } catch (Throwable e) { /* Do nothing */ } return new gregtech.api.items.GT_Tool_Item( - aUnlocalized, - aEnglish, - "Doesn't work as intended, this is a Bug", - aMaxDamage, - 0, - false); + aUnlocalized, + aEnglish, + "Doesn't work as intended, this is a Bug", + aMaxDamage, + 0, + false); } /** @@ -818,9 +766,9 @@ public class GregTech_API { for (Map.Entry> e : sConfigurationLists.entrySet()) { if (e.getKey() >= minTier) { e.getValue() - .add(stack); + .add(stack); e.getValue() - .sort(getConfigurationCircuitsComparator()); + .sort(getConfigurationCircuitsComparator()); } } } @@ -834,14 +782,14 @@ public class GregTech_API { */ public static List getConfigurationCircuitList(int machineTier) { return Collections.unmodifiableList( - sConfigurationLists.computeIfAbsent( - machineTier, - (t) -> sRealConfigurationList.entries() - .stream() - .filter(e -> e.getKey() <= machineTier) - .map(Map.Entry::getValue) - .sorted(getConfigurationCircuitsComparator()) - .collect(Collectors.toList()))); + sConfigurationLists.computeIfAbsent( + machineTier, + (t) -> sRealConfigurationList.entries() + .stream() + .filter(e -> e.getKey() <= machineTier) + .map(Map.Entry::getValue) + .sorted(getConfigurationCircuitsComparator()) + .collect(Collectors.toList()))); } public static Comparator getConfigurationCircuitsComparator() { @@ -850,12 +798,11 @@ public class GregTech_API { // player is exposed if (GT_Mod.gregtechproxy.mCircuitsOrder.isEmpty()) return is.getItem() instanceof GT_IntegratedCircuit_Item ? 0 : 1; - return GT_Mod.gregtechproxy.mCircuitsOrder.getOrDefault( - String.valueOf(GameRegistry.findUniqueIdentifierFor(is.getItem())), - Integer.MAX_VALUE); + return GT_Mod.gregtechproxy.mCircuitsOrder + .getOrDefault(String.valueOf(GameRegistry.findUniqueIdentifierFor(is.getItem())), Integer.MAX_VALUE); }) - .thenComparing(ItemStack::getUnlocalizedName) - .thenComparing(ItemStack::getItemDamage); + .thenComparing(ItemStack::getUnlocalizedName) + .thenComparing(ItemStack::getItemDamage); } public static void registerCircuitProgrammer(ItemStack stack, boolean ignoreNBT, boolean useContainer) { @@ -864,14 +811,13 @@ public class GregTech_API { public static void registerCircuitProgrammer(Predicate predicate, boolean useContainer) { sRealCircuitProgrammerList.put( - predicate, - useContainer ? (s, p) -> s.getItem() - .getContainerItem(s) - : (s, p) -> s); + predicate, + useContainer ? (s, p) -> s.getItem() + .getContainerItem(s) : (s, p) -> s); } public static void registerCircuitProgrammer(Predicate predicate, - BiFunction doDamage) { + BiFunction doDamage) { sRealCircuitProgrammerList.put(predicate, doDamage); } @@ -881,8 +827,8 @@ public class GregTech_API { public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehaviorBase aBehavior) { if (!sCovers.containsKey(new GT_ItemStack(aStack))) sCovers.put( - new GT_ItemStack(aStack), - aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover); + new GT_ItemStack(aStack), + aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover); if (aBehavior != null) sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior); } @@ -909,7 +855,7 @@ public class GregTech_API { * @param aBehavior can be null */ public static void registerCover(Collection aStackList, ITexture aCover, - GT_CoverBehaviorBase aBehavior) { + GT_CoverBehaviorBase aBehavior) { if (aCover.isValidTexture()) aStackList.forEach(tStack -> GregTech_API.registerCover(tStack, aCover, aBehavior)); } @@ -1058,10 +1004,9 @@ public class GregTech_API { */ public static boolean registerTool(ItemStack aTool, Collection aToolList) { if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) - || (!aTool.getItem() - .isDamageable() - && !GT_ModHandler.isElectricItem(aTool) - && !(aTool.getItem() instanceof IDamagableItem))) + || (!aTool.getItem() + .isDamageable() && !GT_ModHandler.isElectricItem(aTool) + && !(aTool.getItem() instanceof IDamagableItem))) return false; aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool))); sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool))); @@ -1091,7 +1036,7 @@ public class GregTech_API { public static void registerTileEntityConstructor(int meta, IntFunction constructor) { if (meta < 0 || meta > 15 || constructor == null) throw new IllegalArgumentException(); if (teCreators[meta] != null) throw new IllegalStateException( - "previous constructor: " + teCreators[meta] + " new constructor: " + constructor + " meta:" + meta); + "previous constructor: " + teCreators[meta] + " new constructor: " + constructor + " meta:" + meta); teCreators[meta] = constructor; } diff --git a/src/main/java/gregtech/api/damagesources/GT_DamageSources.java b/src/main/java/gregtech/api/damagesources/GT_DamageSources.java index fca4d7fe9f..b8d53f71fb 100644 --- a/src/main/java/gregtech/api/damagesources/GT_DamageSources.java +++ b/src/main/java/gregtech/api/damagesources/GT_DamageSources.java @@ -61,7 +61,7 @@ public class GT_DamageSources { @Override public IChatComponent func_151519_b(EntityLivingBase aTarget) { return new ChatComponentText( - EnumChatFormatting.RED + aTarget.getCommandSenderName() + EnumChatFormatting.WHITE + " got frozen"); + EnumChatFormatting.RED + aTarget.getCommandSenderName() + EnumChatFormatting.WHITE + " got frozen"); } } @@ -75,9 +75,9 @@ public class GT_DamageSources { @Override public IChatComponent func_151519_b(EntityLivingBase aTarget) { return new ChatComponentText( - EnumChatFormatting.RED + aTarget.getCommandSenderName() - + EnumChatFormatting.WHITE - + " was boiled alive"); + EnumChatFormatting.RED + aTarget.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was boiled alive"); } } @@ -108,7 +108,7 @@ public class GT_DamageSources { @Override public IChatComponent func_151519_b(EntityLivingBase aTarget) { return new ChatComponentText( - EnumChatFormatting.RED + aTarget.getCommandSenderName() + EnumChatFormatting.WHITE + " exploded"); + EnumChatFormatting.RED + aTarget.getCommandSenderName() + EnumChatFormatting.WHITE + " exploded"); } } } diff --git a/src/main/java/gregtech/api/enchants/Enchantment_EnderDamage.java b/src/main/java/gregtech/api/enchants/Enchantment_EnderDamage.java index e48b3e5b19..07c13b3509 100644 --- a/src/main/java/gregtech/api/enchants/Enchantment_EnderDamage.java +++ b/src/main/java/gregtech/api/enchants/Enchantment_EnderDamage.java @@ -46,22 +46,22 @@ public class Enchantment_EnderDamage extends EnchantmentDamage { @Override public void func_151367_b(EntityLivingBase aHurtEntity, Entity aDamagingEntity, int aLevel) { if ((aHurtEntity instanceof EntityEnderman || aHurtEntity instanceof EntityDragon - || (aHurtEntity.getClass() - .getName() - .contains(".") - && aHurtEntity.getClass() - .getName() - .substring( - aHurtEntity.getClass() - .getName() - .lastIndexOf(".")) - .contains("Ender")))) { + || (aHurtEntity.getClass() + .getName() + .contains(".") + && aHurtEntity.getClass() + .getName() + .substring( + aHurtEntity.getClass() + .getName() + .lastIndexOf(".")) + .contains("Ender")))) { // Weakness causes Endermen to not be able to teleport with GT being installed. - aHurtEntity.addPotionEffect( - new PotionEffect(Potion.weakness.id, aLevel * 200, Math.max(1, (5 * aLevel) / 7))); + aHurtEntity + .addPotionEffect(new PotionEffect(Potion.weakness.id, aLevel * 200, Math.max(1, (5 * aLevel) / 7))); // They also get Poisoned. If you have this Enchant on an Arrow, you can kill the Ender Dragon easier. - aHurtEntity.addPotionEffect( - new PotionEffect(Potion.poison.id, aLevel * 200, Math.max(1, (5 * aLevel) / 7))); + aHurtEntity + .addPotionEffect(new PotionEffect(Potion.poison.id, aLevel * 200, Math.max(1, (5 * aLevel) / 7))); } } diff --git a/src/main/java/gregtech/api/enchants/Enchantment_Radioactivity.java b/src/main/java/gregtech/api/enchants/Enchantment_Radioactivity.java index bf4cc00be4..e68e55cd6a 100644 --- a/src/main/java/gregtech/api/enchants/Enchantment_Radioactivity.java +++ b/src/main/java/gregtech/api/enchants/Enchantment_Radioactivity.java @@ -19,15 +19,15 @@ public class Enchantment_Radioactivity extends EnchantmentDamage { super(GT_Config.addIDConfig(ConfigCategories.IDs.enchantments, "Radioactivity", 14), 0, -1); GT_LanguageManager.addStringLocalization(getName(), "Radioactivity"); Materials.Plutonium.setEnchantmentForTools(this, 1) - .setEnchantmentForArmors(this, 1); + .setEnchantmentForArmors(this, 1); Materials.Uranium235.setEnchantmentForTools(this, 2) - .setEnchantmentForArmors(this, 2); + .setEnchantmentForArmors(this, 2); Materials.Plutonium241.setEnchantmentForTools(this, 3) - .setEnchantmentForArmors(this, 3); + .setEnchantmentForArmors(this, 3); Materials.NaquadahEnriched.setEnchantmentForTools(this, 4) - .setEnchantmentForArmors(this, 4); + .setEnchantmentForArmors(this, 4); Materials.Naquadria.setEnchantmentForTools(this, 5) - .setEnchantmentForArmors(this, 5); + .setEnchantmentForArmors(this, 5); INSTANCE = this; } diff --git a/src/main/java/gregtech/api/enums/Dyes.java b/src/main/java/gregtech/api/enums/Dyes.java index 3b87e9ff67..2970219145 100644 --- a/src/main/java/gregtech/api/enums/Dyes.java +++ b/src/main/java/gregtech/api/enums/Dyes.java @@ -43,7 +43,7 @@ public enum Dyes implements IColorModulationContainer { MACHINE_METAL(-1, 210, 220, 255, "Machine Metal"); public static final Dyes[] VALUES = { dyeBlack, dyeRed, dyeGreen, dyeBrown, dyeBlue, dyePurple, dyeCyan, - dyeLightGray, dyeGray, dyePink, dyeLime, dyeYellow, dyeLightBlue, dyeMagenta, dyeOrange, dyeWhite }; + dyeLightGray, dyeGray, dyePink, dyeLime, dyeYellow, dyeLightBlue, dyeMagenta, dyeOrange, dyeWhite }; public final byte mIndex; public final String mName; diff --git a/src/main/java/gregtech/api/enums/Element.java b/src/main/java/gregtech/api/enums/Element.java index c66b9630a3..b4bcb01a41 100644 --- a/src/main/java/gregtech/api/enums/Element.java +++ b/src/main/java/gregtech/api/enums/Element.java @@ -296,7 +296,7 @@ public enum Element { * @param aName Name of the Element */ Element(long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, - boolean aIsIsotope) { + boolean aIsIsotope) { mProtons = aProtons; mNeutrons = aNeutrons; mAdditionalMass = aAdditionalMass; diff --git a/src/main/java/gregtech/api/enums/FluidState.java b/src/main/java/gregtech/api/enums/FluidState.java index e84657cc6a..5f6f8824f5 100644 --- a/src/main/java/gregtech/api/enums/FluidState.java +++ b/src/main/java/gregtech/api/enums/FluidState.java @@ -12,6 +12,6 @@ public enum FluidState { public static FluidState fromValue(int stateValue) { return stateValue >= 0 && stateValue < FluidState.VALID_STATES.length ? FluidState.VALID_STATES[stateValue] - : FluidState.LIQUID; + : FluidState.LIQUID; } } diff --git a/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java b/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java index c0a259197e..0b621d4461 100644 --- a/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java +++ b/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java @@ -15,604 +15,604 @@ public class GTNH_ExtraMaterials implements IMaterialHandler { * This Class is for adding new Materials since Java has a Limiation of 64kb per Method / Class header */ public static Materials Signalum = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "Signalum", - "Signalum", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "Signalum", + "Signalum", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Lumium = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "Lumium", - "Lumium", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "Lumium", + "Lumium", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials EnrichedCopper = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "EnrichedCopper", - "Enriched Copper", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "EnrichedCopper", + "Enriched Copper", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials DiamondCopper = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "DiamondCopper", - "Diamond Copper", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "DiamondCopper", + "Diamond Copper", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials TarPitch = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "TarPitch", - "Tar Pitch", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "TarPitch", + "Tar Pitch", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials LimePure = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 255, - 255, - 255, - 0, - "LimePure", - "Pure Lime", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeLime); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 0, + 0, + 255, + 255, + 255, + 0, + "LimePure", + "Pure Lime", + 0, + 0, + -1, + 0, + false, + false, + 1, + 1, + 1, + Dyes.dyeLime); public static Materials Wimalite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 8, - 255, - 255, - 255, - 0, - "Wimalite", - "Wimalite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeYellow); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 8, + 255, + 255, + 255, + 0, + "Wimalite", + "Wimalite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes.dyeYellow); public static Materials Yellorite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 8, - 255, - 255, - 255, - 0, - "Yellorite", - "Yellorite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeYellow); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 8, + 255, + 255, + 255, + 0, + "Yellorite", + "Yellorite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes.dyeYellow); public static Materials Quantum = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 255, - 255, - 255, - 0, - "Quantum", - "Quantum", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeWhite); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 0, + 0, + 255, + 255, + 255, + 0, + "Quantum", + "Quantum", + 0, + 0, + -1, + 0, + false, + false, + 1, + 1, + 1, + Dyes.dyeWhite); public static Materials Turquoise = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1, - 255, - 255, - 255, - 0, - "Turquoise", - "Turquoise", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1, + 255, + 255, + 255, + 0, + "Turquoise", + "Turquoise", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Tapazite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1, - 255, - 255, - 255, - 0, - "Tapazite", - "Tapazite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeGreen); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1, + 255, + 255, + 255, + 0, + "Tapazite", + "Tapazite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes.dyeGreen); public static Materials Thyrium = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1 | 2 | 8, - 255, - 255, - 255, - 0, - "Thyrium", - "Thyrium", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1 | 2 | 8, + 255, + 255, + 255, + 0, + "Thyrium", + "Thyrium", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Tourmaline = new Materials( - -1, - TextureSet.SET_RUBY, - 1.0F, - 0, - 1, - 1, - 255, - 255, - 255, - 0, - "Tourmaline", - "Tourmaline", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_RUBY, + 1.0F, + 0, + 1, + 1, + 255, + 255, + 255, + 0, + "Tourmaline", + "Tourmaline", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Spinel = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 0, - 255, - 255, - 255, - 0, - "Spinel", - "Spinel", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 0, + 255, + 255, + 255, + 0, + "Spinel", + "Spinel", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Starconium = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1 | 2 | 8, - 255, - 255, - 255, - 0, - "Starconium", - "Starconium", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1 | 2 | 8, + 255, + 255, + 255, + 0, + "Starconium", + "Starconium", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Sugilite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1, - 255, - 255, - 255, - 0, - "Sugilite", - "Sugilite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1, + 255, + 255, + 255, + 0, + "Sugilite", + "Sugilite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Prismarine = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 4, - 255, - 255, - 255, - 0, - "Prismarine", - "Prismarine", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 4, + 255, + 255, + 255, + 0, + "Prismarine", + "Prismarine", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials GraveyardDirt = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1, - 255, - 255, - 255, - 0, - "GraveyardDirt", - "Graveyard Dirt", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1, + 255, + 255, + 255, + 0, + "GraveyardDirt", + "Graveyard Dirt", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Tennantite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1, - 255, - 255, - 255, - 0, - "Tennantite", - "Tennantite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1, + 255, + 255, + 255, + 0, + "Tennantite", + "Tennantite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Fairy = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "Fairy", - "Fairy", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "Fairy", + "Fairy", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Ludicrite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 1 | 2, - 255, - 255, - 255, - 0, - "Ludicrite", - "Ludicrite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 1 | 2, + 255, + 255, + 255, + 0, + "Ludicrite", + "Ludicrite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials AquaRegia = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 0, - 255, - 255, - 255, - 0, - "AquaRegia", - "Aqua Regia", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 0, + 255, + 255, + 255, + 0, + "AquaRegia", + "Aqua Regia", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials SolutionBlueVitriol = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 0, - 255, - 255, - 255, - 0, - "SolutionBlueVitriol", - "Blue Vitriol Solution", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 0, + 255, + 255, + 255, + 0, + "SolutionBlueVitriol", + "Blue Vitriol Solution", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials SolutionNickelSulfate = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 2, - 0, - 255, - 255, - 255, - 0, - "SolutionNickelSulfate", - "Nickel Sulfate Solution", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 2, + 0, + 255, + 255, + 255, + 0, + "SolutionNickelSulfate", + "Nickel Sulfate Solution", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes._NULL); public static Materials Lodestone = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1 | 8, - 255, - 255, - 255, - 0, - "Lodestone", - "Lodestone", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes._NULL); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1 | 8, + 255, + 255, + 255, + 0, + "Lodestone", + "Lodestone", + 0, + 0, + -1, + 0, + false, + false, + 1, + 1, + 1, + Dyes._NULL); public static Materials Luminite = new Materials( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 1, - 1 | 8, - 250, - 250, - 250, - 0, - "Luminite", - "Luminite", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeWhite); + -1, + TextureSet.SET_NONE, + 1.0F, + 0, + 1, + 1 | 8, + 250, + 250, + 250, + 0, + "Luminite", + "Luminite", + 0, + 0, + -1, + 0, + false, + false, + 3, + 1, + 1, + Dyes.dyeWhite); private static void initSubTags() { SubTag.METAL.addTo(Signalum, Lumium, EnrichedCopper, DiamondCopper); diff --git a/src/main/java/gregtech/api/enums/GT_HatchElement.java b/src/main/java/gregtech/api/enums/GT_HatchElement.java index ac8dc7c4dd..3a21d5a2eb 100644 --- a/src/main/java/gregtech/api/enums/GT_HatchElement.java +++ b/src/main/java/gregtech/api/enums/GT_HatchElement.java @@ -28,7 +28,7 @@ public enum GT_HatchElement implements IHatchElement adder, - Class... mteClasses) { + Class... mteClasses) { this.mteClasses = Collections.unmodifiableList(Arrays.asList(mteClasses)); this.adder = adder; } diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java index 8aca75c6e1..a6a7d6d45c 100644 --- a/src/main/java/gregtech/api/enums/GT_Values.java +++ b/src/main/java/gregtech/api/enums/GT_Values.java @@ -47,8 +47,8 @@ public class GT_Values { */ @SuppressWarnings("PointlessBitwiseExpression") // Nicer source layout this way public static final int[] B = new int[] { 1 << 0, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7, 1 << 8, - 1 << 9, 1 << 10, 1 << 11, 1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16, 1 << 17, 1 << 18, 1 << 19, 1 << 20, - 1 << 21, 1 << 22, 1 << 23, 1 << 24, 1 << 25, 1 << 26, 1 << 27, 1 << 28, 1 << 29, 1 << 30, 1 << 31 }; + 1 << 9, 1 << 10, 1 << 11, 1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16, 1 << 17, 1 << 18, 1 << 19, 1 << 20, + 1 << 21, 1 << 22, 1 << 23, 1 << 24, 1 << 25, 1 << 26, 1 << 27, 1 << 28, 1 << 29, 1 << 30, 1 << 31 }; /** * Renamed from "MATERIAL_UNIT" to just "M" @@ -78,9 +78,9 @@ public class GT_Values { * The Voltage Tiers. Use this Array instead of the old named Voltage Variables */ public static final long[] V = new long[] { 8L, 32L, 128L, 512L, 2048L, 8192L, 32_768L, 131_072L, 524_288L, - 2_097_152L, 8_388_608L, 33_554_432L, 134_217_728L, 536_870_912L, Integer.MAX_VALUE - 7, - // Error tier to prevent out of bounds errors. Not really a real tier (for now). - 8_589_934_592L }; + 2_097_152L, 8_388_608L, 33_554_432L, 134_217_728L, 536_870_912L, Integer.MAX_VALUE - 7, + // Error tier to prevent out of bounds errors. Not really a real tier (for now). + 8_589_934_592L }; /** * The Voltage Practical. These are recipe voltage you should use if you expect the recipe to use a full amp of that @@ -88,12 +88,12 @@ public class GT_Values { */ // this will correctly map ULV to 7. public static final long[] VP = Arrays.stream(V) - .map( - i -> BigInteger.valueOf(i) - .multiply(BigInteger.valueOf(30)) - .divide(BigInteger.valueOf(32)) - .longValueExact()) - .toArray(); + .map( + i -> BigInteger.valueOf(i) + .multiply(BigInteger.valueOf(30)) + .divide(BigInteger.valueOf(32)) + .longValueExact()) + .toArray(); // Why -7? Mystery of the universe. Something may break if you change this so please do not without extensive // testing. // TODO:Adding that in coremod!!! @@ -117,65 +117,65 @@ public class GT_Values { *

*/ public static final long[] AatV = new long[] { 268435455, 67108863, 16777215, 4194303, 1048575, 262143, 65535, - 16383, 4095, 1023, 255, 63, 15, 3, 1, 1 }; + 16383, 4095, 1023, 255, 63, 15, 3, 1, 1 }; /** * The short Names for the Voltages */ public static final String[] VN = new String[] { "ULV", // 0 - "LV", // 1 - "MV", // 2 - "HV", // 3 - "EV", // 4 - "IV", // 5 - "LuV", // 6 - "ZPM", // 7 - "UV", // 8 - "UHV", // 9 - "UEV", // 10 - "UIV", // 11 - "UMV", // 12 - "UXV", // 13 - "MAX", // 14 - "ERROR VOLTAGE" // 15 + "LV", // 1 + "MV", // 2 + "HV", // 3 + "EV", // 4 + "IV", // 5 + "LuV", // 6 + "ZPM", // 7 + "UV", // 8 + "UHV", // 9 + "UEV", // 10 + "UIV", // 11 + "UMV", // 12 + "UXV", // 13 + "MAX", // 14 + "ERROR VOLTAGE" // 15 }; /** * The long Names for the Voltages */ public static final String[] VOLTAGE_NAMES = new String[] { "Ultra Low Voltage", // 0 - "Low Voltage", // 1 - "Medium Voltage", // 2 - "High Voltage", // 3 - "Extreme Voltage", // 4 - "Insane Voltage", // 5 - "Ludicrous Voltage", // 6 - "ZPM Voltage", // 7 - "Ultimate Voltage", // 8 - "Ultimate High Voltage", // 9 - "Ultimate Extreme Voltage", // 10 - "Ultimate Insane Voltage", // 11 - "Ultimate Mega Voltage", // 12 - "Ultimate Extended Mega Voltage", // 13 - "Maximum Voltage", // 14 - "Error Voltage, report this" // 15 + "Low Voltage", // 1 + "Medium Voltage", // 2 + "High Voltage", // 3 + "Extreme Voltage", // 4 + "Insane Voltage", // 5 + "Ludicrous Voltage", // 6 + "ZPM Voltage", // 7 + "Ultimate Voltage", // 8 + "Ultimate High Voltage", // 9 + "Ultimate Extreme Voltage", // 10 + "Ultimate Insane Voltage", // 11 + "Ultimate Mega Voltage", // 12 + "Ultimate Extended Mega Voltage", // 13 + "Maximum Voltage", // 14 + "Error Voltage, report this" // 15 }; public static final String[] TIER_COLORS = new String[] { EnumChatFormatting.RED.toString(), // ULV, 0 - EnumChatFormatting.GRAY.toString(), // LV, 1 - EnumChatFormatting.GOLD.toString(), // MV, 2 - EnumChatFormatting.YELLOW.toString(), // HV, 3 - EnumChatFormatting.DARK_GRAY.toString(), // EV, 4 - EnumChatFormatting.GREEN.toString(), // IV, 5 - EnumChatFormatting.LIGHT_PURPLE.toString(), // LuV, 6 - EnumChatFormatting.AQUA.toString(), // ZPM, 7 - EnumChatFormatting.DARK_GREEN.toString(), // UV, 8 - EnumChatFormatting.DARK_RED.toString(), // UHV, 9 - EnumChatFormatting.DARK_PURPLE.toString(), // UEV, 10 - EnumChatFormatting.DARK_BLUE.toString() + EnumChatFormatting.BOLD, // UIV, 11 - EnumChatFormatting.RED.toString() + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE, // UMV, 12 - EnumChatFormatting.DARK_RED.toString() + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE, // UXV, 13 - EnumChatFormatting.WHITE.toString() + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE, // MAX, 14 - EnumChatFormatting.OBFUSCATED.toString() // ~~~, 15 + EnumChatFormatting.GRAY.toString(), // LV, 1 + EnumChatFormatting.GOLD.toString(), // MV, 2 + EnumChatFormatting.YELLOW.toString(), // HV, 3 + EnumChatFormatting.DARK_GRAY.toString(), // EV, 4 + EnumChatFormatting.GREEN.toString(), // IV, 5 + EnumChatFormatting.LIGHT_PURPLE.toString(), // LuV, 6 + EnumChatFormatting.AQUA.toString(), // ZPM, 7 + EnumChatFormatting.DARK_GREEN.toString(), // UV, 8 + EnumChatFormatting.DARK_RED.toString(), // UHV, 9 + EnumChatFormatting.DARK_PURPLE.toString(), // UEV, 10 + EnumChatFormatting.DARK_BLUE.toString() + EnumChatFormatting.BOLD, // UIV, 11 + EnumChatFormatting.RED.toString() + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE, // UMV, 12 + EnumChatFormatting.DARK_RED.toString() + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE, // UXV, 13 + EnumChatFormatting.WHITE.toString() + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE, // MAX, 14 + EnumChatFormatting.OBFUSCATED.toString() // ~~~, 15 }; /** @@ -285,64 +285,64 @@ public class GT_Values { public static final class NBT { public static final String COLOR = "gt.color", // Integer - COVERS = "gt.covers", // String - CUSTOM_NAME = "name", // String - DISPAY = "gt.display", // String - TIER = "gt.tier", // Number - FACING = "gt.facing", // Byte - LOCK_UPGRADE = "gt.locked", // Boolean - MATERIAL = "gt.material", // String containing the Material Name. - MODE = "gt.mode", // Number - ALLOWED_MODES = "gt.amode", // Number - MTE_ID = "gt.mte.id", // Containing the MTE ID - MTE_REG = "gt.mte.reg", // Containing the MTE Registry ID - OWNER = "gt.owner", // String - OWNER_UUID = "gt.ownerUuid", // UUID (String) - - // Machines - ACTIVE = "gt.active", // Boolean - FLUID_OUT = "gt.fluidout", // Output Fluid - ITEM_OUT = "gt.itemout", // Output Item - PARALLEL = "gt.parallel", // Number - TANK_CAPACITY = "gt.tankcap", // Number - TANK_IN = "gt.tank.in.", // FluidStack - TANK_OUT = "gt.tank.out.", // FluidStack - TEXTURE = "gt.texture", // String - INV_INPUT_SIZE = "gt.invsize.in", // Number - INV_OUTPUT_SIZE = "gt.invsize.out", // Number - INV_INPUT_LIST = "gt.invlist.in", // NBT List - INV_OUTPUT_LIST = "gt.invlist.out", // NBT List - VOLTAGE = "gt.voltage", // Number - AMPERAGE = "gt.amperage", // Number - STORED_ENERGY = "gt.stored.energy", // Number - MAXIMUM_ENERGY = "gt.maximum.energy", // Number - EUT_CONSUMPTION = "gt.eut.consumption", // Number - BURN_TIME_LEFT = "gt.burn.time.left", // Number - TOTAL_BURN_TIME = "gt.total.burn.time", // Number - ALLOWED_WORK = "gt.allowed.work", // Boolean - - // MultiBlock - STRUCTURE_OK = "gt.structure.ok", ROTATION = "gt.eRotation", FLIP = "gt.eFlip", TARGET = "gt.target", // Boolean - TARGET_X = "gt.target.x", // Number - TARGET_Y = "gt.target.y", // Number - TARGET_Z = "gt.target.z", // Number - LOCKED_INVENTORY = "gt.locked.inventory", // String - LOCKED_INVENTORY_INDEX = "gt.locked.inventory.index", // Number - UPGRADE_INVENTORY_SIZE = "gt.invsize.upg", // String - UPGRADE_INVENTORY_UUID = "gt.invuuid.upg", // String - UPGRADE_INVENTORY_NAME = "gt.invname.upg", // String - UPGRADE_INVENTORIES_INPUT = "gt.invlist.upg.in", // NBT List - UPGRADE_INVENTORIES_OUTPUT = "gt.invlist.upg.out", // NBT List - SEPARATE_INPUTS = "gt.separate.inputs", // Boolean - - // Logic - POWER_LOGIC = "gt.power.logic", // NBT Tag - POWER_LOGIC_STORED_ENERGY = "gt.power.logic.stored.energy", // Number - POWER_LOGIC_ENERGY_CAPACITY = "gt.power.logic.energy.capacity", // Number - POWER_LOGIC_VOLTAGE = "gt.power.logic.voltage", // Number - POWER_LOGIC_AMPERAGE = "gt.power.logic.voltage", // Number - POWER_LOGIC_TYPE = "gt.power.logic.type", // Number - empty_ = ""; + COVERS = "gt.covers", // String + CUSTOM_NAME = "name", // String + DISPAY = "gt.display", // String + TIER = "gt.tier", // Number + FACING = "gt.facing", // Byte + LOCK_UPGRADE = "gt.locked", // Boolean + MATERIAL = "gt.material", // String containing the Material Name. + MODE = "gt.mode", // Number + ALLOWED_MODES = "gt.amode", // Number + MTE_ID = "gt.mte.id", // Containing the MTE ID + MTE_REG = "gt.mte.reg", // Containing the MTE Registry ID + OWNER = "gt.owner", // String + OWNER_UUID = "gt.ownerUuid", // UUID (String) + + // Machines + ACTIVE = "gt.active", // Boolean + FLUID_OUT = "gt.fluidout", // Output Fluid + ITEM_OUT = "gt.itemout", // Output Item + PARALLEL = "gt.parallel", // Number + TANK_CAPACITY = "gt.tankcap", // Number + TANK_IN = "gt.tank.in.", // FluidStack + TANK_OUT = "gt.tank.out.", // FluidStack + TEXTURE = "gt.texture", // String + INV_INPUT_SIZE = "gt.invsize.in", // Number + INV_OUTPUT_SIZE = "gt.invsize.out", // Number + INV_INPUT_LIST = "gt.invlist.in", // NBT List + INV_OUTPUT_LIST = "gt.invlist.out", // NBT List + VOLTAGE = "gt.voltage", // Number + AMPERAGE = "gt.amperage", // Number + STORED_ENERGY = "gt.stored.energy", // Number + MAXIMUM_ENERGY = "gt.maximum.energy", // Number + EUT_CONSUMPTION = "gt.eut.consumption", // Number + BURN_TIME_LEFT = "gt.burn.time.left", // Number + TOTAL_BURN_TIME = "gt.total.burn.time", // Number + ALLOWED_WORK = "gt.allowed.work", // Boolean + + // MultiBlock + STRUCTURE_OK = "gt.structure.ok", ROTATION = "gt.eRotation", FLIP = "gt.eFlip", TARGET = "gt.target", // Boolean + TARGET_X = "gt.target.x", // Number + TARGET_Y = "gt.target.y", // Number + TARGET_Z = "gt.target.z", // Number + LOCKED_INVENTORY = "gt.locked.inventory", // String + LOCKED_INVENTORY_INDEX = "gt.locked.inventory.index", // Number + UPGRADE_INVENTORY_SIZE = "gt.invsize.upg", // String + UPGRADE_INVENTORY_UUID = "gt.invuuid.upg", // String + UPGRADE_INVENTORY_NAME = "gt.invname.upg", // String + UPGRADE_INVENTORIES_INPUT = "gt.invlist.upg.in", // NBT List + UPGRADE_INVENTORIES_OUTPUT = "gt.invlist.upg.out", // NBT List + SEPARATE_INPUTS = "gt.separate.inputs", // Boolean + + // Logic + POWER_LOGIC = "gt.power.logic", // NBT Tag + POWER_LOGIC_STORED_ENERGY = "gt.power.logic.stored.energy", // Number + POWER_LOGIC_ENERGY_CAPACITY = "gt.power.logic.energy.capacity", // Number + POWER_LOGIC_VOLTAGE = "gt.power.logic.voltage", // Number + POWER_LOGIC_AMPERAGE = "gt.power.logic.voltage", // Number + POWER_LOGIC_TYPE = "gt.power.logic.type", // Number + empty_ = ""; } /** The Color White as RGB Short Array. */ @@ -358,8 +358,8 @@ public class GT_Values { // stupidly // mirrored // Texture - SIDE_SOUTH = 3, SIDE_WEST = 4, SIDE_EAST = 5, // Also a Side with a stupidly mirrored Texture - SIDE_ANY = 6, SIDE_UNKNOWN = 6, SIDE_INVALID = 6, SIDE_INSIDE = 6, SIDE_UNDEFINED = 6; + SIDE_SOUTH = 3, SIDE_WEST = 4, SIDE_EAST = 5, // Also a Side with a stupidly mirrored Texture + SIDE_ANY = 6, SIDE_UNKNOWN = 6, SIDE_INVALID = 6, SIDE_INSIDE = 6, SIDE_UNDEFINED = 6; /** Compass alike Array for the proper ordering of North, East, South and West. */ public static final byte[] COMPASS_DIRECTIONS = { SIDE_NORTH, SIDE_EAST, SIDE_SOUTH, SIDE_WEST }; @@ -373,13 +373,13 @@ public class GT_Values { * For Facing Checks. */ public static final boolean[] INVALID_SIDES = { false, false, false, false, false, false, true }, - VALID_SIDES = { true, true, true, true, true, true, false }; + VALID_SIDES = { true, true, true, true, true, true, false }; /** * Side->Offset Mappings. */ public static final byte[] OFFX = { 0, 0, 0, 0, -1, +1, 0 }, OFFY = { -1, +1, 0, 0, 0, 0, 0 }, - OFFZ = { 0, 0, -1, +1, 0, 0, 0 }; + OFFZ = { 0, 0, -1, +1, 0, 0, 0 }; /** * Side->Opposite Mappings. @@ -391,8 +391,8 @@ public class GT_Values { * front, 4 = right, 5 = back, 6 = undefined. */ public static final byte[][] FACING_ROTATIONS = { { 0, 1, 2, 3, 4, 5, 6 }, { 0, 1, 2, 3, 4, 5, 6 }, - { 0, 1, 3, 5, 4, 2, 6 }, { 0, 1, 5, 3, 2, 4, 6 }, { 0, 1, 2, 4, 3, 5, 6 }, { 0, 1, 4, 2, 5, 3, 6 }, - { 0, 1, 2, 3, 4, 5, 6 } }; + { 0, 1, 3, 5, 4, 2, 6 }, { 0, 1, 5, 3, 2, 4, 6 }, { 0, 1, 2, 4, 3, 5, 6 }, { 0, 1, 4, 2, 5, 3, 6 }, + { 0, 1, 2, 3, 4, 5, 6 } }; /** * The Mod Object itself. That is the GT_Mod-Object. It's needed to open GUI's and similar. @@ -530,63 +530,63 @@ public class GT_Values { * Pretty formatting for author names. */ public static final String Colen = "" + EnumChatFormatting.DARK_RED - + EnumChatFormatting.BOLD - + EnumChatFormatting.ITALIC - + EnumChatFormatting.UNDERLINE - + "C" - + EnumChatFormatting.GOLD - + EnumChatFormatting.BOLD - + EnumChatFormatting.ITALIC - + EnumChatFormatting.UNDERLINE - + "o" - + EnumChatFormatting.GREEN - + EnumChatFormatting.BOLD - + EnumChatFormatting.ITALIC - + EnumChatFormatting.UNDERLINE - + "l" - + EnumChatFormatting.DARK_AQUA - + EnumChatFormatting.BOLD - + EnumChatFormatting.ITALIC - + EnumChatFormatting.UNDERLINE - + "e" - + EnumChatFormatting.DARK_PURPLE - + EnumChatFormatting.BOLD - + EnumChatFormatting.ITALIC - + EnumChatFormatting.UNDERLINE - + "n"; + + EnumChatFormatting.BOLD + + EnumChatFormatting.ITALIC + + EnumChatFormatting.UNDERLINE + + "C" + + EnumChatFormatting.GOLD + + EnumChatFormatting.BOLD + + EnumChatFormatting.ITALIC + + EnumChatFormatting.UNDERLINE + + "o" + + EnumChatFormatting.GREEN + + EnumChatFormatting.BOLD + + EnumChatFormatting.ITALIC + + EnumChatFormatting.UNDERLINE + + "l" + + EnumChatFormatting.DARK_AQUA + + EnumChatFormatting.BOLD + + EnumChatFormatting.ITALIC + + EnumChatFormatting.UNDERLINE + + "e" + + EnumChatFormatting.DARK_PURPLE + + EnumChatFormatting.BOLD + + EnumChatFormatting.ITALIC + + EnumChatFormatting.UNDERLINE + + "n"; public static final String AuthorColen = "Author: " + Colen; public static final String AuthorKuba = "Author: " + EnumChatFormatting.DARK_RED - + EnumChatFormatting.BOLD - + "k" - + EnumChatFormatting.RED - + EnumChatFormatting.BOLD - + "u" - + EnumChatFormatting.GOLD - + EnumChatFormatting.BOLD - + "b" - + EnumChatFormatting.YELLOW - + EnumChatFormatting.BOLD - + "a" - + EnumChatFormatting.DARK_GREEN - + EnumChatFormatting.BOLD - + "6" - + EnumChatFormatting.GREEN - + EnumChatFormatting.BOLD - + "0" - + EnumChatFormatting.AQUA - + EnumChatFormatting.BOLD - + "0" - + EnumChatFormatting.DARK_AQUA - + EnumChatFormatting.BOLD - + "0"; + + EnumChatFormatting.BOLD + + "k" + + EnumChatFormatting.RED + + EnumChatFormatting.BOLD + + "u" + + EnumChatFormatting.GOLD + + EnumChatFormatting.BOLD + + "b" + + EnumChatFormatting.YELLOW + + EnumChatFormatting.BOLD + + "a" + + EnumChatFormatting.DARK_GREEN + + EnumChatFormatting.BOLD + + "6" + + EnumChatFormatting.GREEN + + EnumChatFormatting.BOLD + + "0" + + EnumChatFormatting.AQUA + + EnumChatFormatting.BOLD + + "0" + + EnumChatFormatting.DARK_AQUA + + EnumChatFormatting.BOLD + + "0"; public static final String AuthorBlueWeabo = "Author: " + EnumChatFormatting.BLUE - + EnumChatFormatting.BOLD - + "Blue" - + EnumChatFormatting.AQUA - + EnumChatFormatting.BOLD - + "Weabo"; + + EnumChatFormatting.BOLD + + "Blue" + + EnumChatFormatting.AQUA + + EnumChatFormatting.BOLD + + "Weabo"; // 7.5F comes from GT_Tool_Turbine_Large#getBaseDamage() given huge turbines are the most efficient now. public static double getMaxPlasmaTurbineEfficiencyFromMaterial(Materials material) { @@ -613,9 +613,9 @@ public class GT_Values { } private static final long[] EXPLOSION_LOOKUP_V = new long[] { V[0], V[1], V[2], V[3], V[4], V[4] * 2, V[5], V[6], - V[7], V[8], V[8] * 2, V[9], V[10], V[11], V[12], V[12] * 2, V[13], V[14], V[15] }; + V[7], V[8], V[8] * 2, V[9], V[10], V[11], V[12], V[12] * 2, V[13], V[14], V[15] }; private static final float[] EXPLOSION_LOOKUP_POWER = new float[] { 1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F, 8.0F, - 9.0F, 10.0F, 11.0F, 12.0F, 13.0F, 14.0F, 15.0F, 16.0F, 17.0F, 18.0F, 19.0F, 20.0F }; + 9.0F, 10.0F, 11.0F, 12.0F, 13.0F, 14.0F, 15.0F, 16.0F, 17.0F, 18.0F, 19.0F, 20.0F }; public static float getExplosionPowerForVoltage(long voltage) { for (int i = 0; i < EXPLOSION_LOOKUP_V.length; i++) { diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index b855dbc211..59b094c4c0 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -2023,39 +2023,37 @@ public enum ItemList implements IItemContainer { Machine_Multi_TranscendentPlasmaMixer; public static final ItemList[] DYE_ONLY_ITEMS = { Color_00, Color_01, Color_02, Color_03, Color_04, Color_05, - Color_06, Color_07, Color_08, Color_09, Color_10, Color_11, Color_12, Color_13, Color_14, Color_15 }, - SPRAY_CAN_DYES = { Spray_Color_00, Spray_Color_01, Spray_Color_02, Spray_Color_03, Spray_Color_04, - Spray_Color_05, Spray_Color_06, Spray_Color_07, Spray_Color_08, Spray_Color_09, Spray_Color_10, - Spray_Color_11, Spray_Color_12, Spray_Color_13, Spray_Color_14, Spray_Color_15 }, - SPRAY_CAN_DYES_USED = { Spray_Color_Used_00, Spray_Color_Used_01, Spray_Color_Used_02, Spray_Color_Used_03, - Spray_Color_Used_04, Spray_Color_Used_05, Spray_Color_Used_06, Spray_Color_Used_07, - Spray_Color_Used_08, Spray_Color_Used_09, Spray_Color_Used_10, Spray_Color_Used_11, - Spray_Color_Used_12, Spray_Color_Used_13, Spray_Color_Used_14, Spray_Color_Used_15 }, - TRANSFORMERS = { Transformer_LV_ULV, Transformer_MV_LV, Transformer_HV_MV, Transformer_EV_HV, - Transformer_IV_EV, Transformer_LuV_IV, Transformer_ZPM_LuV, Transformer_UV_ZPM, - Transformer_MAX_UV }, - MACHINE_HULLS = { Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, - Hull_MAX }, - HATCHES_DYNAMO = { Hatch_Dynamo_ULV, Hatch_Dynamo_LV, Hatch_Dynamo_MV, Hatch_Dynamo_HV, Hatch_Dynamo_EV, - Hatch_Dynamo_IV, Hatch_Dynamo_LuV, Hatch_Dynamo_ZPM, Hatch_Dynamo_UV, Hatch_Dynamo_MAX }, - HATCHES_ENERGY = { Hatch_Energy_ULV, Hatch_Energy_LV, Hatch_Energy_MV, Hatch_Energy_HV, Hatch_Energy_EV, - Hatch_Energy_IV, Hatch_Energy_LuV, Hatch_Energy_ZPM, Hatch_Energy_UV, Hatch_Energy_MAX }, - HATCHES_INPUT = { Hatch_Input_ULV, Hatch_Input_LV, Hatch_Input_MV, Hatch_Input_HV, Hatch_Input_EV, - Hatch_Input_IV, Hatch_Input_LuV, Hatch_Input_ZPM, Hatch_Input_UV, Hatch_Input_MAX }, - HATCHES_INPUT_BUS = { Hatch_Input_Bus_ULV, Hatch_Input_Bus_LV, Hatch_Input_Bus_MV, Hatch_Input_Bus_HV, - Hatch_Input_Bus_EV, Hatch_Input_Bus_IV, Hatch_Input_Bus_LuV, Hatch_Input_Bus_ZPM, - Hatch_Input_Bus_UV, Hatch_Input_Bus_MAX }, - HATCHES_OUTPUT = { Hatch_Output_ULV, Hatch_Output_LV, Hatch_Output_MV, Hatch_Output_HV, Hatch_Output_EV, - Hatch_Output_IV, Hatch_Output_LuV, Hatch_Output_ZPM, Hatch_Output_UV, Hatch_Output_MAX }, - HATCHES_OUTPUT_BUS = { Hatch_Output_Bus_ULV, Hatch_Output_Bus_LV, Hatch_Output_Bus_MV, Hatch_Output_Bus_HV, - Hatch_Output_Bus_EV, Hatch_Output_Bus_IV, Hatch_Output_Bus_LuV, Hatch_Output_Bus_ZPM, - Hatch_Output_Bus_UV, Hatch_Output_Bus_MAX }, - HATCHES_MUFFLER = { Hatch_Muffler_LV, Hatch_Muffler_LV, Hatch_Muffler_MV, Hatch_Muffler_HV, - Hatch_Muffler_EV, Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, - Hatch_Muffler_MAX }; + Color_06, Color_07, Color_08, Color_09, Color_10, Color_11, Color_12, Color_13, Color_14, Color_15 }, + SPRAY_CAN_DYES = { Spray_Color_00, Spray_Color_01, Spray_Color_02, Spray_Color_03, Spray_Color_04, + Spray_Color_05, Spray_Color_06, Spray_Color_07, Spray_Color_08, Spray_Color_09, Spray_Color_10, + Spray_Color_11, Spray_Color_12, Spray_Color_13, Spray_Color_14, Spray_Color_15 }, + SPRAY_CAN_DYES_USED = { Spray_Color_Used_00, Spray_Color_Used_01, Spray_Color_Used_02, Spray_Color_Used_03, + Spray_Color_Used_04, Spray_Color_Used_05, Spray_Color_Used_06, Spray_Color_Used_07, Spray_Color_Used_08, + Spray_Color_Used_09, Spray_Color_Used_10, Spray_Color_Used_11, Spray_Color_Used_12, Spray_Color_Used_13, + Spray_Color_Used_14, Spray_Color_Used_15 }, + TRANSFORMERS = { Transformer_LV_ULV, Transformer_MV_LV, Transformer_HV_MV, Transformer_EV_HV, Transformer_IV_EV, + Transformer_LuV_IV, Transformer_ZPM_LuV, Transformer_UV_ZPM, Transformer_MAX_UV }, + MACHINE_HULLS = { Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, + Hull_MAX }, + HATCHES_DYNAMO = { Hatch_Dynamo_ULV, Hatch_Dynamo_LV, Hatch_Dynamo_MV, Hatch_Dynamo_HV, Hatch_Dynamo_EV, + Hatch_Dynamo_IV, Hatch_Dynamo_LuV, Hatch_Dynamo_ZPM, Hatch_Dynamo_UV, Hatch_Dynamo_MAX }, + HATCHES_ENERGY = { Hatch_Energy_ULV, Hatch_Energy_LV, Hatch_Energy_MV, Hatch_Energy_HV, Hatch_Energy_EV, + Hatch_Energy_IV, Hatch_Energy_LuV, Hatch_Energy_ZPM, Hatch_Energy_UV, Hatch_Energy_MAX }, + HATCHES_INPUT = { Hatch_Input_ULV, Hatch_Input_LV, Hatch_Input_MV, Hatch_Input_HV, Hatch_Input_EV, + Hatch_Input_IV, Hatch_Input_LuV, Hatch_Input_ZPM, Hatch_Input_UV, Hatch_Input_MAX }, + HATCHES_INPUT_BUS = { Hatch_Input_Bus_ULV, Hatch_Input_Bus_LV, Hatch_Input_Bus_MV, Hatch_Input_Bus_HV, + Hatch_Input_Bus_EV, Hatch_Input_Bus_IV, Hatch_Input_Bus_LuV, Hatch_Input_Bus_ZPM, Hatch_Input_Bus_UV, + Hatch_Input_Bus_MAX }, + HATCHES_OUTPUT = { Hatch_Output_ULV, Hatch_Output_LV, Hatch_Output_MV, Hatch_Output_HV, Hatch_Output_EV, + Hatch_Output_IV, Hatch_Output_LuV, Hatch_Output_ZPM, Hatch_Output_UV, Hatch_Output_MAX }, + HATCHES_OUTPUT_BUS = { Hatch_Output_Bus_ULV, Hatch_Output_Bus_LV, Hatch_Output_Bus_MV, Hatch_Output_Bus_HV, + Hatch_Output_Bus_EV, Hatch_Output_Bus_IV, Hatch_Output_Bus_LuV, Hatch_Output_Bus_ZPM, Hatch_Output_Bus_UV, + Hatch_Output_Bus_MAX }, + HATCHES_MUFFLER = { Hatch_Muffler_LV, Hatch_Muffler_LV, Hatch_Muffler_MV, Hatch_Muffler_HV, Hatch_Muffler_EV, + Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, Hatch_Muffler_MAX }; public static Fluid sOilExtraHeavy, sEpichlorhydrin, sDrillingFluid, sBlueVitriol, sNickelSulfate, sGreenVitriol, - sToluene, sNitrationMixture, sRocketFuel, sHydricSulfur, sIndiumConcentrate, sLeadZincSolution, - sHydrochloricAcid; + sToluene, sNitrationMixture, sRocketFuel, sHydricSulfur, sIndiumConcentrate, sLeadZincSolution, + sHydrochloricAcid; private ItemStack mStack; private boolean mHasNotBeenSet; private boolean mDeprecated; @@ -2164,11 +2162,11 @@ public enum ItemList implements IItemContainer { final String[] tDisplayNameWords = aDisplayName.split("\\W"); for (String tWord : tDisplayNameWords) { if (tWord.length() > 0) tCamelCasedDisplayNameBuilder.append( - tWord.substring(0, 1) - .toUpperCase(Locale.US)); + tWord.substring(0, 1) + .toUpperCase(Locale.US)); if (tWord.length() > 1) tCamelCasedDisplayNameBuilder.append( - tWord.substring(1) - .toLowerCase(Locale.US)); + tWord.substring(1) + .toLowerCase(Locale.US)); } if (tCamelCasedDisplayNameBuilder.length() == 0) { // CamelCased DisplayName is empty, so use hash of aDisplayName diff --git a/src/main/java/gregtech/api/enums/MaterialBuilder.java b/src/main/java/gregtech/api/enums/MaterialBuilder.java index fd131bbc8c..92ae7c07c3 100644 --- a/src/main/java/gregtech/api/enums/MaterialBuilder.java +++ b/src/main/java/gregtech/api/enums/MaterialBuilder.java @@ -43,39 +43,39 @@ public class MaterialBuilder { this.metaItemSubID = metaItemSubID; this.iconSet = iconSet; this.name = defaultLocalName.replace(" ", "") - .replace("-", ""); + .replace("-", ""); this.defaultLocalName = defaultLocalName; } public Materials constructMaterial() { return new Materials( - metaItemSubID, - iconSet, - toolSpeed, - durability, - toolQuality, - types, - r, - g, - b, - a, - name, - defaultLocalName, - fuelType, - fuelPower, - meltingPoint, - blastFurnaceTemp, - blastFurnaceRequired, - transparent, - oreValue, - densityMultiplier, - densityDivider, - color, - extraData, - materialList, - aspects).setHasCorrespondingFluid(hasCorrespondingFluid) - .setHasCorrespondingGas(hasCorrespondingGas) - .setCanBeCracked(canBeCracked); + metaItemSubID, + iconSet, + toolSpeed, + durability, + toolQuality, + types, + r, + g, + b, + a, + name, + defaultLocalName, + fuelType, + fuelPower, + meltingPoint, + blastFurnaceTemp, + blastFurnaceRequired, + transparent, + oreValue, + densityMultiplier, + densityDivider, + color, + extraData, + materialList, + aspects).setHasCorrespondingFluid(hasCorrespondingFluid) + .setHasCorrespondingGas(hasCorrespondingGas) + .setCanBeCracked(canBeCracked); } public MaterialBuilder setName(String name) { diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 3547f8633b..6429756039 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -980,8 +980,8 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public Collection mSubTags = new LinkedHashSet<>(); public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null; public boolean mUnificatable, mBlastFurnaceRequired = false, mAutoGenerateBlastFurnaceRecipes = true, - mAutoGenerateVacuumFreezerRecipes = true, mAutoGenerateRecycleRecipes = true, mTransparent = false, - mHasParentMod = true, mHasPlasma = false, mHasGas = false, mCustomOre = false; + mAutoGenerateVacuumFreezerRecipes = true, mAutoGenerateRecycleRecipes = true, mTransparent = false, + mHasParentMod = true, mHasPlasma = false, mHasGas = false, mCustomOre = false; public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0, mToolQuality = 0; public short mBlastFurnaceTemp = 0; public int mMeltingPoint = 0; @@ -1011,13 +1011,13 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public int processingMaterialTierEU = 0; public long mDensity = M; public float mToolSpeed = 1.0F, mHeatDamage = 0.0F, mSteamMultiplier = 1.0F, mGasMultiplier = 1.0F, - mPlasmaMultiplier = 1.0F; + mPlasmaMultiplier = 1.0F; public String mChemicalFormula = "?", mName, mDefaultLocalName, mCustomID = "null", mConfigSection = "null", - mLocalizedName = "null"; + mLocalizedName = "null"; public Dyes mColor = Dyes._NULL; public Element mElement = null; public Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, - mArcSmeltInto = this, mHandleMaterial = this, mMaterialInto; + mArcSmeltInto = this, mHandleMaterial = this, mMaterialInto; public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null; /** * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, that means 144 is one Material @@ -1029,24 +1029,24 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private Fluid[] hydroCrackedFluids = new Fluid[3], steamCrackedFluids = new Fluid[3]; public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - boolean aUnificatable, String aName, String aDefaultLocalName) { + boolean aUnificatable, String aName, String aDefaultLocalName) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aUnificatable, - aName, - aDefaultLocalName, - "ore", - false, - "null"); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aUnificatable, + aName, + aDefaultLocalName, + "ore", + false, + "null"); } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - boolean aUnificatable, String aName, String aDefaultLocalName, String aConfigSection, boolean aCustomOre, - String aCustomID) { + boolean aUnificatable, String aName, String aDefaultLocalName, String aConfigSection, boolean aCustomOre, + String aCustomID) { mMetaItemSubID = aMetaItemSubID; mDefaultLocalName = aDefaultLocalName; mName = aName; @@ -1074,68 +1074,67 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aTypes, - aR, - aG, - aB, - aA, - aName, - aDefaultLocalName, - aFuelType, - aFuelPower, - aMeltingPoint, - aBlastFurnaceTemp, - aBlastFurnaceRequired, - aTransparent, - aOreValue, - aDensityMultiplier, - aDensityDivider, - aColor, - "ore", - false, - "null"); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aTypes, + aR, + aG, + aB, + aA, + aName, + aDefaultLocalName, + aFuelType, + aFuelPower, + aMeltingPoint, + aBlastFurnaceTemp, + aBlastFurnaceRequired, + aTransparent, + aOreValue, + aDensityMultiplier, + aDensityDivider, + aColor, + "ore", + false, + "null"); } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - String aConfigSection) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aTypes, - aR, - aG, - aB, - aA, - aName, - aDefaultLocalName, - aFuelType, - aFuelPower, - aMeltingPoint, - aBlastFurnaceTemp, - aBlastFurnaceRequired, - aTransparent, - aOreValue, - aDensityMultiplier, - aDensityDivider, - aColor, - aConfigSection, - false, - "null"); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aTypes, + aR, + aG, + aB, + aA, + aName, + aDefaultLocalName, + aFuelType, + aFuelPower, + aMeltingPoint, + aBlastFurnaceTemp, + aBlastFurnaceRequired, + aTransparent, + aOreValue, + aDensityMultiplier, + aDensityDivider, + aColor, + aConfigSection, + false, + "null"); } /** @@ -1159,22 +1158,22 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { * @param aColor Vanilla MC Wool Color which comes the closest to this. */ public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - String aConfigSection, boolean aCustomOre, String aCustomID) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, + boolean aCustomOre, String aCustomID) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - true, - aName, - aDefaultLocalName, - aConfigSection, - aCustomOre, - aCustomID); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + true, + aName, + aDefaultLocalName, + aConfigSection, + aCustomOre, + aCustomID); mMeltingPoint = aMeltingPoint; mBlastFurnaceRequired = aBlastFurnaceRequired; mBlastFurnaceTemp = (short) aBlastFurnaceTemp; @@ -1197,64 +1196,64 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - List aAspects) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, + List aAspects) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aTypes, - aR, - aG, - aB, - aA, - aName, - aDefaultLocalName, - aFuelType, - aFuelPower, - aMeltingPoint, - aBlastFurnaceTemp, - aBlastFurnaceRequired, - aTransparent, - aOreValue, - aDensityMultiplier, - aDensityDivider, - aColor); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aTypes, + aR, + aG, + aB, + aA, + aName, + aDefaultLocalName, + aFuelType, + aFuelPower, + aMeltingPoint, + aBlastFurnaceTemp, + aBlastFurnaceRequired, + aTransparent, + aOreValue, + aDensityMultiplier, + aDensityDivider, + aColor); mAspects.addAll(aAspects); } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - Element aElement, List aAspects) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, + List aAspects) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aTypes, - aR, - aG, - aB, - aA, - aName, - aDefaultLocalName, - aFuelType, - aFuelPower, - aMeltingPoint, - aBlastFurnaceTemp, - aBlastFurnaceRequired, - aTransparent, - aOreValue, - aDensityMultiplier, - aDensityDivider, - aColor); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aTypes, + aR, + aG, + aB, + aA, + aName, + aDefaultLocalName, + aFuelType, + aFuelPower, + aMeltingPoint, + aBlastFurnaceTemp, + aBlastFurnaceRequired, + aTransparent, + aOreValue, + aDensityMultiplier, + aDensityDivider, + aColor); mElement = aElement; mElement.mLinkedMaterials.add(this); if (aElement == Element._NULL) { @@ -1267,74 +1266,74 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - int aExtraData, List aMaterialList) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, + List aMaterialList) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aTypes, - aR, - aG, - aB, - aA, - aName, - aDefaultLocalName, - aFuelType, - aFuelPower, - aMeltingPoint, - aBlastFurnaceTemp, - aBlastFurnaceRequired, - aTransparent, - aOreValue, - aDensityMultiplier, - aDensityDivider, - aColor, - aExtraData, - aMaterialList, - null); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aTypes, + aR, + aG, + aB, + aA, + aName, + aDefaultLocalName, + aFuelType, + aFuelPower, + aMeltingPoint, + aBlastFurnaceTemp, + aBlastFurnaceRequired, + aTransparent, + aOreValue, + aDensityMultiplier, + aDensityDivider, + aColor, + aExtraData, + aMaterialList, + null); } public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, - int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, - int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, - boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, - int aExtraData, List aMaterialList, List aAspects) { + int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, + int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, + int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, + List aMaterialList, List aAspects) { this( - aMetaItemSubID, - aIconSet, - aToolSpeed, - aDurability, - aToolQuality, - aTypes, - aR, - aG, - aB, - aA, - aName, - aDefaultLocalName, - aFuelType, - aFuelPower, - aMeltingPoint, - aBlastFurnaceTemp, - aBlastFurnaceRequired, - aTransparent, - aOreValue, - aDensityMultiplier, - aDensityDivider, - aColor); + aMetaItemSubID, + aIconSet, + aToolSpeed, + aDurability, + aToolQuality, + aTypes, + aR, + aG, + aB, + aA, + aName, + aDefaultLocalName, + aFuelType, + aFuelPower, + aMeltingPoint, + aBlastFurnaceTemp, + aBlastFurnaceRequired, + aTransparent, + aOreValue, + aDensityMultiplier, + aDensityDivider, + aColor); mExtraData = aExtraData; mMaterialList.addAll(aMaterialList); if (mMaterialList.size() == 1) mChemicalFormula = mMaterialList.get(0) - .toString(true); + .toString(true); else mChemicalFormula = mMaterialList.stream() - .map(MaterialStack::toString) - .collect(Collectors.joining()) - .replaceAll("_", "-"); + .map(MaterialStack::toString) + .collect(Collectors.joining()) + .replaceAll("_", "-"); int tAmountOfComponents = 0, tMeltingPoint = 0; for (MaterialStack tMaterial : mMaterialList) { @@ -1356,38 +1355,38 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void setSmeltingInto() { SamariumMagnetic.setSmeltingInto(Samarium) - .setMaceratingInto(Samarium) - .setArcSmeltingInto(Samarium); + .setMaceratingInto(Samarium) + .setArcSmeltingInto(Samarium); NeodymiumMagnetic.setSmeltingInto(Neodymium) - .setMaceratingInto(Neodymium) - .setArcSmeltingInto(Neodymium); + .setMaceratingInto(Neodymium) + .setArcSmeltingInto(Neodymium); SteelMagnetic.setSmeltingInto(Steel) - .setMaceratingInto(Steel) - .setArcSmeltingInto(Steel); + .setMaceratingInto(Steel) + .setArcSmeltingInto(Steel); Iron.setSmeltingInto(Iron) .setMaceratingInto(Iron) .setArcSmeltingInto(WroughtIron); AnyIron.setSmeltingInto(Iron) - .setMaceratingInto(Iron) - .setArcSmeltingInto(WroughtIron); + .setMaceratingInto(Iron) + .setArcSmeltingInto(WroughtIron); PigIron.setSmeltingInto(Iron) - .setMaceratingInto(Iron) - .setArcSmeltingInto(WroughtIron); + .setMaceratingInto(Iron) + .setArcSmeltingInto(WroughtIron); WroughtIron.setSmeltingInto(WroughtIron) - .setMaceratingInto(WroughtIron) - .setArcSmeltingInto(WroughtIron); + .setMaceratingInto(WroughtIron) + .setArcSmeltingInto(WroughtIron); IronMagnetic.setSmeltingInto(Iron) - .setMaceratingInto(Iron) - .setArcSmeltingInto(WroughtIron); + .setMaceratingInto(Iron) + .setArcSmeltingInto(WroughtIron); Copper.setSmeltingInto(Copper) - .setMaceratingInto(Copper) - .setArcSmeltingInto(AnnealedCopper); + .setMaceratingInto(Copper) + .setArcSmeltingInto(AnnealedCopper); AnyCopper.setSmeltingInto(Copper) - .setMaceratingInto(Copper) - .setArcSmeltingInto(AnnealedCopper); + .setMaceratingInto(Copper) + .setArcSmeltingInto(AnnealedCopper); AnnealedCopper.setSmeltingInto(AnnealedCopper) - .setMaceratingInto(AnnealedCopper) - .setArcSmeltingInto(AnnealedCopper); + .setMaceratingInto(AnnealedCopper) + .setArcSmeltingInto(AnnealedCopper); Netherrack.setSmeltingInto(NetherBrick); MeatRaw.setSmeltingInto(MeatCooked); Sand.setSmeltingInto(Glass); @@ -1403,28 +1402,28 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void setDirectSmelting() { Cinnabar.setDirectSmelting(Mercury) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT) - .add(SubTag.SMELTING_TO_GEM); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT) + .add(SubTag.SMELTING_TO_GEM); Tetrahedrite.setDirectSmelting(Copper) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT) - .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT) + .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); Chalcopyrite.setDirectSmelting(Copper) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT) - .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT) + .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); Malachite.setDirectSmelting(Copper) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); Pentlandite.setDirectSmelting(Nickel) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); Sphalerite.setDirectSmelting(Zinc) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); Pyrite.setDirectSmelting(Iron) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); BasalticMineralSand.setDirectSmelting(Iron) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); GraniticMineralSand.setDirectSmelting(Iron) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); YellowLimonite.setDirectSmelting(Iron) - .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); + .add(SubTag.INDUCTIONSMELTING_LOW_OUTPUT); BrownLimonite.setDirectSmelting(Iron); BandedIron.setDirectSmelting(Iron); Magnetite.setDirectSmelting(Iron); @@ -1435,9 +1434,9 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { Cobaltite.setDirectSmelting(Cobalt); Stibnite.setDirectSmelting(Antimony); Cooperite.setDirectSmelting(Platinum) - .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); + .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); Molybdenite.setDirectSmelting(Molybdenum) - .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); + .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); Galena.setDirectSmelting(Lead); RoastedIron.setDirectSmelting(Iron); RoastedAntimony.setDirectSmelting(Antimony); @@ -1451,68 +1450,68 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void setMultipliers() { Amber.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedAir.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedFire.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedEarth.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedWater.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedEntropy.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedOrder.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedVis.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); InfusedDull.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); Salt.setOreMultiplier(2) .setSmeltingMultiplier(2); RockSalt.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); Scheelite.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); Tungstate.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); Cassiterite.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); CassiteriteSand.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); NetherQuartz.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); CertusQuartz.setOreMultiplier(2) - .setSmeltingMultiplier(2); + .setSmeltingMultiplier(2); TricalciumPhosphate.setOreMultiplier(3) - .setSmeltingMultiplier(3); + .setSmeltingMultiplier(3); Saltpeter.setOreMultiplier(4) - .setSmeltingMultiplier(4); + .setSmeltingMultiplier(4); Apatite.setOreMultiplier(4) - .setSmeltingMultiplier(4) - .setByProductMultiplier(2); + .setSmeltingMultiplier(4) + .setByProductMultiplier(2); Electrotine.setOreMultiplier(5) - .setSmeltingMultiplier(5); + .setSmeltingMultiplier(5); Teslatite.setOreMultiplier(5) - .setSmeltingMultiplier(5); + .setSmeltingMultiplier(5); Redstone.setOreMultiplier(5) - .setSmeltingMultiplier(5); + .setSmeltingMultiplier(5); Glowstone.setOreMultiplier(5) - .setSmeltingMultiplier(5); + .setSmeltingMultiplier(5); Lapis.setOreMultiplier(6) - .setSmeltingMultiplier(6) - .setByProductMultiplier(4); + .setSmeltingMultiplier(6) + .setByProductMultiplier(4); Sodalite.setOreMultiplier(6) - .setSmeltingMultiplier(6) - .setByProductMultiplier(4); + .setSmeltingMultiplier(6) + .setByProductMultiplier(4); Lazurite.setOreMultiplier(6) - .setSmeltingMultiplier(6) - .setByProductMultiplier(4); + .setSmeltingMultiplier(6) + .setByProductMultiplier(4); Monazite.setOreMultiplier(8) - .setSmeltingMultiplier(8) - .setByProductMultiplier(2); + .setSmeltingMultiplier(8) + .setByProductMultiplier(2); Cryolite.setOreMultiplier(4) - .setByProductMultiplier(4); + .setByProductMultiplier(4); } private static void setEnchantmentKnockbackTools() { @@ -1702,7 +1701,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { Lepidolite.addOreByProducts(Lithium, Caesium); Andradite.addOreByProducts(GarnetYellow, Iron); Pyrolusite.addOreByProducts(Manganese, Tantalite, Niobium) - .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); + .add(SubTag.DONT_ADD_DEFAULT_BBF_RECIPE); TricalciumPhosphate.addOreByProducts(Apatite, Phosphate, Pyrochlore); Apatite.addOreByProducts(TricalciumPhosphate, Phosphate, Pyrochlore); Pyrochlore.addOreByProducts(Apatite, Calcite, Niobium); @@ -1910,39 +1909,31 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void initSubTags() { SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM.addTo(Bastnasite, Monazite, Forcicium, Forcillium); - SubTag.ELECTROMAGNETIC_SEPERATION_GOLD.addTo( - Magnetite, - VanadiumMagnetite, - BasalticMineralSand, - GraniticMineralSand); + SubTag.ELECTROMAGNETIC_SEPERATION_GOLD + .addTo(Magnetite, VanadiumMagnetite, BasalticMineralSand, GraniticMineralSand); SubTag.NO_RECIPES.addTo(MagnetohydrodynamicallyConstrainedStarMatter); SubTag.ELECTROMAGNETIC_SEPERATION_IRON.addTo( - YellowLimonite, - BrownLimonite, - Pyrite, - BandedIron, - Nickel, - Vermiculite, - Glauconite, - GlauconiteSand, - Pentlandite, - Tin, - Antimony, - Ilmenite, - Manganese, - Chrome, - Chromite, - Andradite); - - SubTag.BLASTFURNACE_CALCITE_DOUBLE.addTo( - Pyrite, - BrownLimonite, - YellowLimonite, - BasalticMineralSand, - GraniticMineralSand, - Magnetite); + YellowLimonite, + BrownLimonite, + Pyrite, + BandedIron, + Nickel, + Vermiculite, + Glauconite, + GlauconiteSand, + Pentlandite, + Tin, + Antimony, + Ilmenite, + Manganese, + Chrome, + Chromite, + Andradite); + + SubTag.BLASTFURNACE_CALCITE_DOUBLE + .addTo(Pyrite, BrownLimonite, YellowLimonite, BasalticMineralSand, GraniticMineralSand, Magnetite); SubTag.BLASTFURNACE_CALCITE_TRIPLE.addTo(Iron, PigIron, DeepIron, ShadowIron, WroughtIron, MeteoricIron); @@ -1952,259 +1943,259 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { SubTag.WASHING_SODIUMPERSULFATE.addTo(Zinc, Nickel, Copper, Cobalt, Cobaltite, Tetrahedrite); SubTag.METAL.addTo( - AnyIron, - AnyCopper, - AnyBronze, - Metal, - Aluminium, - Americium, - Antimony, - Beryllium, - Bismuth, - Caesium, - Cerium, - Chrome, - Cobalt, - Copper, - Dysprosium, - Erbium, - Europium, - Gadolinium, - Gallium, - Gold, - Holmium, - Indium, - Iridium, - Iron, - Lanthanum, - Lead, - Lutetium, - Magnesium, - Manganese, - Mercury, - Niobium, - Molybdenum, - Neodymium, - Neutronium, - Nickel, - Osmium, - Palladium, - Platinum, - Plutonium, - Plutonium241, - Praseodymium, - Promethium, - Rubidium, - Samarium, - Scandium, - Silicon, - Silver, - Tantalum, - Tellurium, - Terbium, - Thorium, - Thulium, - Tin, - Titanium, - Tungsten, - Uranium, - Uranium235, - Vanadium, - Ytterbium, - Yttrium, - Zinc, - Flerovium, - PhasedIron, - PhasedGold, - DarkSteel, - TinAlloy, - ConductiveIron, - ElectricalSteel, - EnergeticAlloy, - VibrantAlloy, - MelodicAlloy, - StellarAlloy, - VividAlloy, - EnergeticSilver, - CrystallinePinkSlime, - CrystallineAlloy, - CrudeSteel, - EndSteel, - PulsatingIron, - DarkThaumium, - Adamantium, - Amordrine, - Angmallen, - Ardite, - Aredrite, - Atlarus, - Carmot, - Celenegil, - Ceruclase, - DarkIron, - Desh, - Desichalkos, - Duranium, - ElectrumFlux, - Enderium, - EnderiumBase, - Eximite, - FierySteel, - Force, - Haderoth, - Hematite, - Hepatizon, - HSLA, - Infuscolium, - InfusedGold, - Inolashite, - Mercassium, - MeteoricIron, - BloodInfusedIron, - Universium, - MagnetohydrodynamicallyConstrainedStarMatter, - MeteoricSteel, - Naquadah, - NaquadahAlloy, - NaquadahEnriched, - Naquadria, - ObsidianFlux, - Orichalcum, - Osmonium, - Oureclase, - Phoenixite, - Prometheum, - Sanguinite, - CosmicNeutronium, - Tartarite, - Ichorium, - Tritanium, - Vulcanite, - Vyroxeres, - Yellorium, - Zectium, - AluminiumBrass, - Osmiridium, - Sunnarium, - AnnealedCopper, - BatteryAlloy, - Brass, - Bronze, - ChromiumDioxide, - Cupronickel, - DeepIron, - Electrum, - Invar, - Kanthal, - Magnalium, - Nichrome, - NiobiumNitride, - NiobiumTitanium, - PigIron, - SolderingAlloy, - StainlessSteel, - Steel, - Ultimet, - VanadiumGallium, - WroughtIron, - YttriumBariumCuprate, - IronWood, - Alumite, - Manyullyn, - ShadowIron, - Shadow, - ShadowSteel, - Steeleaf, - SterlingSilver, - RoseGold, - BlackBronze, - BismuthBronze, - BlackSteel, - RedSteel, - BlueSteel, - DamascusSteel, - TungstenSteel, - TPV, - AstralSilver, - Mithril, - BlueAlloy, - RedAlloy, - CobaltBrass, - Thaumium, - Void, - IronMagnetic, - SteelMagnetic, - NeodymiumMagnetic, - SamariumMagnetic, - Knightmetal, - HSSG, - HSSE, - HSSS, - TungstenCarbide, - HeeEndium, - VanadiumSteel, - Kalendrite, - Ignatius, - Trinium, - Infinity, - InfinityCatalyst, - Realgar, - Chrysotile, - BlackPlutonium, - Alduorite, - Adluorite, - Vinteum, - Rubracium, - Draconium, - DraconiumAwakened, - Pentacadmiummagnesiumhexaoxid, - Titaniumonabariumdecacoppereikosaoxid, - Uraniumtriplatinid, - Vanadiumtriindinid, - Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, - Tetranaquadahdiindiumhexaplatiumosminid, - Longasssuperconductornameforuvwire, - Longasssuperconductornameforuhvwire, - SuperconductorUEVBase, - SuperconductorUIVBase, - SuperconductorUMVBase, - Quantium, - RedstoneAlloy, - Bedrockium, - EnrichedHolmium); + AnyIron, + AnyCopper, + AnyBronze, + Metal, + Aluminium, + Americium, + Antimony, + Beryllium, + Bismuth, + Caesium, + Cerium, + Chrome, + Cobalt, + Copper, + Dysprosium, + Erbium, + Europium, + Gadolinium, + Gallium, + Gold, + Holmium, + Indium, + Iridium, + Iron, + Lanthanum, + Lead, + Lutetium, + Magnesium, + Manganese, + Mercury, + Niobium, + Molybdenum, + Neodymium, + Neutronium, + Nickel, + Osmium, + Palladium, + Platinum, + Plutonium, + Plutonium241, + Praseodymium, + Promethium, + Rubidium, + Samarium, + Scandium, + Silicon, + Silver, + Tantalum, + Tellurium, + Terbium, + Thorium, + Thulium, + Tin, + Titanium, + Tungsten, + Uranium, + Uranium235, + Vanadium, + Ytterbium, + Yttrium, + Zinc, + Flerovium, + PhasedIron, + PhasedGold, + DarkSteel, + TinAlloy, + ConductiveIron, + ElectricalSteel, + EnergeticAlloy, + VibrantAlloy, + MelodicAlloy, + StellarAlloy, + VividAlloy, + EnergeticSilver, + CrystallinePinkSlime, + CrystallineAlloy, + CrudeSteel, + EndSteel, + PulsatingIron, + DarkThaumium, + Adamantium, + Amordrine, + Angmallen, + Ardite, + Aredrite, + Atlarus, + Carmot, + Celenegil, + Ceruclase, + DarkIron, + Desh, + Desichalkos, + Duranium, + ElectrumFlux, + Enderium, + EnderiumBase, + Eximite, + FierySteel, + Force, + Haderoth, + Hematite, + Hepatizon, + HSLA, + Infuscolium, + InfusedGold, + Inolashite, + Mercassium, + MeteoricIron, + BloodInfusedIron, + Universium, + MagnetohydrodynamicallyConstrainedStarMatter, + MeteoricSteel, + Naquadah, + NaquadahAlloy, + NaquadahEnriched, + Naquadria, + ObsidianFlux, + Orichalcum, + Osmonium, + Oureclase, + Phoenixite, + Prometheum, + Sanguinite, + CosmicNeutronium, + Tartarite, + Ichorium, + Tritanium, + Vulcanite, + Vyroxeres, + Yellorium, + Zectium, + AluminiumBrass, + Osmiridium, + Sunnarium, + AnnealedCopper, + BatteryAlloy, + Brass, + Bronze, + ChromiumDioxide, + Cupronickel, + DeepIron, + Electrum, + Invar, + Kanthal, + Magnalium, + Nichrome, + NiobiumNitride, + NiobiumTitanium, + PigIron, + SolderingAlloy, + StainlessSteel, + Steel, + Ultimet, + VanadiumGallium, + WroughtIron, + YttriumBariumCuprate, + IronWood, + Alumite, + Manyullyn, + ShadowIron, + Shadow, + ShadowSteel, + Steeleaf, + SterlingSilver, + RoseGold, + BlackBronze, + BismuthBronze, + BlackSteel, + RedSteel, + BlueSteel, + DamascusSteel, + TungstenSteel, + TPV, + AstralSilver, + Mithril, + BlueAlloy, + RedAlloy, + CobaltBrass, + Thaumium, + Void, + IronMagnetic, + SteelMagnetic, + NeodymiumMagnetic, + SamariumMagnetic, + Knightmetal, + HSSG, + HSSE, + HSSS, + TungstenCarbide, + HeeEndium, + VanadiumSteel, + Kalendrite, + Ignatius, + Trinium, + Infinity, + InfinityCatalyst, + Realgar, + Chrysotile, + BlackPlutonium, + Alduorite, + Adluorite, + Vinteum, + Rubracium, + Draconium, + DraconiumAwakened, + Pentacadmiummagnesiumhexaoxid, + Titaniumonabariumdecacoppereikosaoxid, + Uraniumtriplatinid, + Vanadiumtriindinid, + Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, + Tetranaquadahdiindiumhexaplatiumosminid, + Longasssuperconductornameforuvwire, + Longasssuperconductornameforuhvwire, + SuperconductorUEVBase, + SuperconductorUIVBase, + SuperconductorUMVBase, + Quantium, + RedstoneAlloy, + Bedrockium, + EnrichedHolmium); SubTag.FOOD.addTo( - MeatRaw, - MeatCooked, - Ice, - Water, - Salt, - Chili, - Cocoa, - Cheese, - Coffee, - Chocolate, - Milk, - Honey, - FryingOilHot, - FishOil, - SeedOil, - SeedOilLin, - SeedOilHemp, - Wheat, - Sugar, - FreshWater); + MeatRaw, + MeatCooked, + Ice, + Water, + Salt, + Chili, + Cocoa, + Cheese, + Coffee, + Chocolate, + Milk, + Honey, + FryingOilHot, + FishOil, + SeedOil, + SeedOilLin, + SeedOilHemp, + Wheat, + Sugar, + FreshWater); Wood.add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); WoodSealed.add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.NO_WORKING); Peanutwood.add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING); LiveRoot.add( - SubTag.WOOD, - SubTag.FLAMMABLE, - SubTag.NO_SMELTING, - SubTag.NO_SMASHING, - SubTag.MAGICAL, - SubTag.MORTAR_GRINDABLE); + SubTag.WOOD, + SubTag.FLAMMABLE, + SubTag.NO_SMELTING, + SubTag.NO_SMASHING, + SubTag.MAGICAL, + SubTag.MORTAR_GRINDABLE); IronWood.add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.MAGICAL, SubTag.MORTAR_GRINDABLE); Steeleaf.add(SubTag.WOOD, SubTag.FLAMMABLE, SubTag.MAGICAL, SubTag.MORTAR_GRINDABLE, SubTag.NO_SMELTING); @@ -2248,11 +2239,11 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { ConstructionFoam.add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.EXPLOSIVE, SubTag.NO_SMELTING); ReinforceGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.SMELTING_TO_FLUID); Redstone.add( - SubTag.STONE, - SubTag.NO_SMASHING, - SubTag.UNBURNABLE, - SubTag.SMELTING_TO_FLUID, - SubTag.PULVERIZING_CINNABAR); + SubTag.STONE, + SubTag.NO_SMASHING, + SubTag.UNBURNABLE, + SubTag.SMELTING_TO_FLUID, + SubTag.PULVERIZING_CINNABAR); Glowstone.add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID); Electrotine.add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID); Teslatite.add(SubTag.STONE, SubTag.NO_SMASHING, SubTag.UNBURNABLE, SubTag.SMELTING_TO_FLUID); @@ -2320,22 +2311,14 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { Monazite.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE); Quartzite.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); Quartz.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); - SiliconDioxide.add( - SubTag.CRYSTAL, - SubTag.NO_SMASHING, - SubTag.NO_SMELTING, - SubTag.CRYSTALLISABLE, - SubTag.QUARTZ); + SiliconDioxide + .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); Dilithium.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); NetherQuartz.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); CertusQuartz.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); Fluix.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.QUARTZ); - TricalciumPhosphate.add( - SubTag.CRYSTAL, - SubTag.NO_SMASHING, - SubTag.NO_SMELTING, - SubTag.FLAMMABLE, - SubTag.EXPLOSIVE); + TricalciumPhosphate + .add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.EXPLOSIVE); Phosphate.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.EXPLOSIVE); InfusedAir.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); InfusedFire.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.UNBURNABLE); @@ -2349,14 +2332,14 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { EnderPearl.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.PEARL); EnderEye.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.MAGICAL, SubTag.PEARL); Firestone.add( - SubTag.CRYSTAL, - SubTag.NO_SMASHING, - SubTag.NO_SMELTING, - SubTag.CRYSTALLISABLE, - SubTag.MAGICAL, - SubTag.QUARTZ, - SubTag.UNBURNABLE, - SubTag.BURNING); + SubTag.CRYSTAL, + SubTag.NO_SMASHING, + SubTag.NO_SMELTING, + SubTag.CRYSTALLISABLE, + SubTag.MAGICAL, + SubTag.QUARTZ, + SubTag.UNBURNABLE, + SubTag.BURNING); Forcicium.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.MAGICAL); Forcillium.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.CRYSTALLISABLE, SubTag.MAGICAL); Force.add(SubTag.CRYSTAL, SubTag.MAGICAL, SubTag.UNBURNABLE); @@ -2402,18 +2385,18 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { // materials initMaterialProperties(); // No more material addition or manipulation should be done past this point! MATERIALS_ARRAY = MATERIALS_MAP.values() - .toArray(new Materials[0]); // Generate standard object array. This is a - // lot faster to loop over. + .toArray(new Materials[0]); // Generate standard object array. This is a + // lot faster to loop over. VALUES = Arrays.asList(MATERIALS_ARRAY); if (!NewHorizonsCoreMod.isModLoaded() && !GT_Mod.gregtechproxy.mEnableAllComponents) OrePrefixes.initMaterialComponents(); else { OrePrefixes.ingotHot.mDisabledItems.addAll( - Arrays.stream(Materials.values()) - .parallel() - .filter(OrePrefixes.ingotHot::doGenerateItem) - .filter(m -> m.mBlastFurnaceTemp < 1750 && m.mAutoGenerateBlastFurnaceRecipes) - .collect(Collectors.toSet())); + Arrays.stream(Materials.values()) + .parallel() + .filter(OrePrefixes.ingotHot::doGenerateItem) + .filter(m -> m.mBlastFurnaceTemp < 1750 && m.mAutoGenerateBlastFurnaceRecipes) + .collect(Collectors.toSet())); OrePrefixes.ingotHot.disableComponent(Materials.Reinforced); OrePrefixes.ingotHot.disableComponent(Materials.ConductiveIron); OrePrefixes.ingotHot.disableComponent(Materials.FierySteel); @@ -2455,16 +2438,16 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { if (GregTech_API.sGeneratedMaterials[aMaterial.mMetaItemSubID] == null) { GregTech_API.sGeneratedMaterials[aMaterial.mMetaItemSubID] = aMaterial; } else throw new IllegalArgumentException( - "The Material Index " + aMaterial.mMetaItemSubID - + " for " - + aMaterial.mName - + " is already used!"); - } - } else throw new IllegalArgumentException( - "The Material Index " + aMaterial.mMetaItemSubID + "The Material Index " + aMaterial.mMetaItemSubID + " for " + aMaterial.mName - + " is/over the maximum of 1000"); + + " is already used!"); + } + } else throw new IllegalArgumentException( + "The Material Index " + aMaterial.mMetaItemSubID + + " for " + + aMaterial.mName + + " is/over the maximum of 1000"); } } } @@ -2475,60 +2458,40 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } private static void addTemperatureValues(Materials aMaterial, String aConfigPath) { - aMaterial.mMeltingPoint = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MeltingPoint", - aMaterial.mMeltingPoint); - aMaterial.mBlastFurnaceRequired = GregTech_API.sMaterialProperties.get( - aConfigPath, - "BlastFurnaceRequired", - aMaterial.mBlastFurnaceRequired); - aMaterial.mBlastFurnaceTemp = (short) GregTech_API.sMaterialProperties.get( - aConfigPath, - "BlastFurnaceTemp", - aMaterial.mBlastFurnaceTemp); + aMaterial.mMeltingPoint = GregTech_API.sMaterialProperties + .get(aConfigPath, "MeltingPoint", aMaterial.mMeltingPoint); + aMaterial.mBlastFurnaceRequired = GregTech_API.sMaterialProperties + .get(aConfigPath, "BlastFurnaceRequired", aMaterial.mBlastFurnaceRequired); + aMaterial.mBlastFurnaceTemp = (short) GregTech_API.sMaterialProperties + .get(aConfigPath, "BlastFurnaceTemp", aMaterial.mBlastFurnaceTemp); aMaterial.mGasTemp = GregTech_API.sMaterialProperties.get(aConfigPath, "GasTemp", aMaterial.mGasTemp); aMaterial.setHeatDamage( - (float) GregTech_API.sMaterialProperties.get(aConfigPath, "HeatDamage", aMaterial.mHeatDamage)); + (float) GregTech_API.sMaterialProperties.get(aConfigPath, "HeatDamage", aMaterial.mHeatDamage)); } private static void addDensityValues(Materials aMaterial, String aConfigPath) { - aMaterial.mDensityMultiplier = GregTech_API.sMaterialProperties.get( - aConfigPath, - "DensityMultiplier", - aMaterial.mDensityMultiplier); - aMaterial.mDensityDivider = GregTech_API.sMaterialProperties.get( - aConfigPath, - "DensityDivider", - aMaterial.mDensityDivider); + aMaterial.mDensityMultiplier = GregTech_API.sMaterialProperties + .get(aConfigPath, "DensityMultiplier", aMaterial.mDensityMultiplier); + aMaterial.mDensityDivider = GregTech_API.sMaterialProperties + .get(aConfigPath, "DensityDivider", aMaterial.mDensityDivider); aMaterial.mDensity = (long) GregTech_API.sMaterialProperties.get( - aConfigPath, - "Density", - ((double) M * aMaterial.mDensityMultiplier) - / (aMaterial.mDensityDivider != 0 ? aMaterial.mDensityDivider : 1)); + aConfigPath, + "Density", + ((double) M * aMaterial.mDensityMultiplier) + / (aMaterial.mDensityDivider != 0 ? aMaterial.mDensityDivider : 1)); } private static void addColorValues(Materials aMaterial, String aConfigPath) { - aMaterial.mTransparent = GregTech_API.sMaterialProperties.get( - aConfigPath, - "Transparent", - aMaterial.mTransparent); - String aColor = GregTech_API.sMaterialProperties.get( - aConfigPath, - "DyeColor", - aMaterial.mColor == Dyes._NULL ? "None" : aMaterial.mColor.toString()); + aMaterial.mTransparent = GregTech_API.sMaterialProperties + .get(aConfigPath, "Transparent", aMaterial.mTransparent); + String aColor = GregTech_API.sMaterialProperties + .get(aConfigPath, "DyeColor", aMaterial.mColor == Dyes._NULL ? "None" : aMaterial.mColor.toString()); aMaterial.mColor = aColor.equals("None") ? Dyes._NULL : Dyes.get(aColor); String[] aRGBA = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MatRGBA", - aMaterial.mRGBa[0] + "," - + aMaterial.mRGBa[1] - + "," - + aMaterial.mRGBa[2] - + "," - + aMaterial.mRGBa[3] - + ",") - .split(","); + aConfigPath, + "MatRGBA", + aMaterial.mRGBa[0] + "," + aMaterial.mRGBa[1] + "," + aMaterial.mRGBa[2] + "," + aMaterial.mRGBa[3] + ",") + .split(","); aMaterial.mRGBa[0] = Short.parseShort(aRGBA[0]); aMaterial.mRGBa[1] = Short.parseShort(aRGBA[1]); aMaterial.mRGBa[2] = Short.parseShort(aRGBA[2]); @@ -2536,26 +2499,20 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } private static void addToolValues(Materials aMaterial, String aConfigPath) { - aMaterial.mDurability = GregTech_API.sMaterialProperties.get( - aConfigPath, - "ToolDurability", - aMaterial.mDurability); - aMaterial.mToolSpeed = (float) GregTech_API.sMaterialProperties.get( - aConfigPath, - "ToolSpeed", - aMaterial.mToolSpeed); - aMaterial.mToolQuality = (byte) GregTech_API.sMaterialProperties.get( - aConfigPath, - "ToolQuality", - aMaterial.mToolQuality); + aMaterial.mDurability = GregTech_API.sMaterialProperties + .get(aConfigPath, "ToolDurability", aMaterial.mDurability); + aMaterial.mToolSpeed = (float) GregTech_API.sMaterialProperties + .get(aConfigPath, "ToolSpeed", aMaterial.mToolSpeed); + aMaterial.mToolQuality = (byte) GregTech_API.sMaterialProperties + .get(aConfigPath, "ToolQuality", aMaterial.mToolQuality); // Moved from GT_Proxy? (Not sure) aMaterial.mHandleMaterial = (aMaterial == Desh ? aMaterial.mHandleMaterial - : aMaterial == Diamond || aMaterial == Thaumium ? Wood - : aMaterial.contains(SubTag.BURNING) ? Blaze - : aMaterial.contains(SubTag.MAGICAL) && aMaterial.contains(SubTag.CRYSTAL) - && Thaumcraft.isModLoaded() ? Thaumium - : aMaterial.getMass() > Element.Tc.getMass() * 2 ? TungstenSteel - : aMaterial.getMass() > Element.Tc.getMass() ? Steel : Wood); + : aMaterial == Diamond || aMaterial == Thaumium ? Wood + : aMaterial.contains(SubTag.BURNING) ? Blaze + : aMaterial.contains(SubTag.MAGICAL) && aMaterial.contains(SubTag.CRYSTAL) + && Thaumcraft.isModLoaded() ? Thaumium + : aMaterial.getMass() > Element.Tc.getMass() * 2 ? TungstenSteel + : aMaterial.getMass() > Element.Tc.getMass() ? Steel : Wood); if (aMaterial == Materials.SpaceTime) { aMaterial.mHandleMaterial = Materials.Infinity; @@ -2567,58 +2524,41 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } private static void addEnchantmentValues(Materials aMaterial, String aConfigPath) { - aMaterial.mEnchantmentToolsLevel = (byte) GregTech_API.sMaterialProperties.get( - aConfigPath, - "EnchantmentLevel", - aMaterial.mEnchantmentToolsLevel); + aMaterial.mEnchantmentToolsLevel = (byte) GregTech_API.sMaterialProperties + .get(aConfigPath, "EnchantmentLevel", aMaterial.mEnchantmentToolsLevel); String aEnchantmentName = GregTech_API.sMaterialProperties.get( - aConfigPath, - "Enchantment", - aMaterial.mEnchantmentTools != null ? aMaterial.mEnchantmentTools.getName() : ""); + aConfigPath, + "Enchantment", + aMaterial.mEnchantmentTools != null ? aMaterial.mEnchantmentTools.getName() : ""); if (aMaterial.mEnchantmentTools != null && !aEnchantmentName.equals(aMaterial.mEnchantmentTools.getName())) IntStream.range(0, Enchantment.enchantmentsList.length) - .filter(i -> aEnchantmentName.equals(Enchantment.enchantmentsList[i].getName())) - .forEach(i -> aMaterial.mEnchantmentTools = Enchantment.enchantmentsList[i]); + .filter(i -> aEnchantmentName.equals(Enchantment.enchantmentsList[i].getName())) + .forEach(i -> aMaterial.mEnchantmentTools = Enchantment.enchantmentsList[i]); } private static void addProcessingIntoValues(Materials aMaterial, String aConfigPath) { - aMaterial.mSmeltInto = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialSmeltInto", aMaterial.mSmeltInto.mName)); + aMaterial.mSmeltInto = MATERIALS_MAP + .get(GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialSmeltInto", aMaterial.mSmeltInto.mName)); aMaterial.mMacerateInto = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialMacerateInto", - aMaterial.mMacerateInto.mName)); + GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialMacerateInto", aMaterial.mMacerateInto.mName)); aMaterial.mArcSmeltInto = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialArcSmeltInto", - aMaterial.mArcSmeltInto.mName)); + GregTech_API.sMaterialProperties.get(aConfigPath, "MaterialArcSmeltInto", aMaterial.mArcSmeltInto.mName)); aMaterial.mDirectSmelting = MATERIALS_MAP.get( - GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialDirectSmeltInto", - aMaterial.mDirectSmelting.mName)); - aMaterial.mAutoGenerateBlastFurnaceRecipes = GregTech_API.sMaterialProperties.get( - aConfigPath, - "AutoGenerateBlastFurnaceRecipes", - aMaterial.mAutoGenerateBlastFurnaceRecipes); + GregTech_API.sMaterialProperties + .get(aConfigPath, "MaterialDirectSmeltInto", aMaterial.mDirectSmelting.mName)); + aMaterial.mAutoGenerateBlastFurnaceRecipes = GregTech_API.sMaterialProperties + .get(aConfigPath, "AutoGenerateBlastFurnaceRecipes", aMaterial.mAutoGenerateBlastFurnaceRecipes); } private static void addMultiplierValues(Materials aMaterial, String aConfigPath) { aMaterial.mOreValue = GregTech_API.sMaterialProperties.get(aConfigPath, "OreValue", aMaterial.mOreValue); aMaterial.setOreMultiplier( - GregTech_API.sMaterialProperties.get(aConfigPath, "OreMultiplier", aMaterial.mOreMultiplier)); + GregTech_API.sMaterialProperties.get(aConfigPath, "OreMultiplier", aMaterial.mOreMultiplier)); aMaterial.setSmeltingMultiplier( - GregTech_API.sMaterialProperties.get( - aConfigPath, - "OreSmeltingMultiplier", - aMaterial.mSmeltingMultiplier)); + GregTech_API.sMaterialProperties.get(aConfigPath, "OreSmeltingMultiplier", aMaterial.mSmeltingMultiplier)); aMaterial.setByProductMultiplier( - GregTech_API.sMaterialProperties.get( - aConfigPath, - "OreByProductMultiplier", - aMaterial.mByProductMultiplier)); + GregTech_API.sMaterialProperties + .get(aConfigPath, "OreByProductMultiplier", aMaterial.mByProductMultiplier)); } private static void addHasGasFluid(Materials aMaterial, String aConfigPath) { @@ -2630,44 +2570,32 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { } aMaterial.mHasGas = GregTech_API.sMaterialProperties.get(aConfigPath, "AddGas", aMaterial.mHasGas); if (aMaterial.mHasGas) { - GT_FluidFactory.of( - aMaterial.mName.toLowerCase(), - aMaterial.mDefaultLocalName, - aMaterial, - GAS, - aMaterial.mGasTemp); + GT_FluidFactory + .of(aMaterial.mName.toLowerCase(), aMaterial.mDefaultLocalName, aMaterial, GAS, aMaterial.mGasTemp); } } } private static void addInternalStuff(Materials aMaterial, String aConfigPath) { - aMaterial.mMetaItemSubID = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialID", - aMaterial.mCustomOre ? -1 : aMaterial.mMetaItemSubID); + aMaterial.mMetaItemSubID = GregTech_API.sMaterialProperties + .get(aConfigPath, "MaterialID", aMaterial.mCustomOre ? -1 : aMaterial.mMetaItemSubID); aMaterial.mTypes = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialTypes", - aMaterial.mCustomOre ? 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 : aMaterial.mTypes); - aMaterial.mUnificatable = GregTech_API.sMaterialProperties.get( - aConfigPath, - "Unificatable", - aMaterial.mUnificatable); - aMaterial.mHasParentMod = GregTech_API.sMaterialProperties.get( - aConfigPath, - "HasParentMod", - aMaterial.mHasParentMod); + aConfigPath, + "MaterialTypes", + aMaterial.mCustomOre ? 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 : aMaterial.mTypes); + aMaterial.mUnificatable = GregTech_API.sMaterialProperties + .get(aConfigPath, "Unificatable", aMaterial.mUnificatable); + aMaterial.mHasParentMod = GregTech_API.sMaterialProperties + .get(aConfigPath, "HasParentMod", aMaterial.mHasParentMod); } private static void addLocalisation(Materials aMaterial, String aConfigPath) { aMaterial.mDefaultLocalName = GregTech_API.sMaterialProperties.get( - aConfigPath, - "MaterialName", - aMaterial.mCustomOre ? "CustomOre" + aMaterial.mCustomID : aMaterial.mDefaultLocalName); - aMaterial.mChemicalFormula = GregTech_API.sMaterialProperties.get( - aConfigPath, - "ChemicalFormula", - aMaterial.mChemicalFormula); + aConfigPath, + "MaterialName", + aMaterial.mCustomOre ? "CustomOre" + aMaterial.mCustomID : aMaterial.mDefaultLocalName); + aMaterial.mChemicalFormula = GregTech_API.sMaterialProperties + .get(aConfigPath, "ChemicalFormula", aMaterial.mChemicalFormula); } private static String getConfigPath(Materials aMaterial) { @@ -2678,27 +2606,20 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void addHarvestLevelNerfs(Materials aMaterial, String aConfigPath) { /* Moved the harvest level changes from GT_Mod to have fewer things iterating over MATERIALS_ARRAY */ if (GT_Mod.gregtechproxy.mChangeHarvestLevels && aMaterial.mToolQuality > 0 - && aMaterial.mMetaItemSubID < GT_Mod.gregtechproxy.mHarvestLevel.length - && aMaterial.mMetaItemSubID >= 0) { - GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties.get( - aConfigPath, - "HarvestLevel", - aMaterial.mToolQuality); + && aMaterial.mMetaItemSubID < GT_Mod.gregtechproxy.mHarvestLevel.length + && aMaterial.mMetaItemSubID >= 0) { + GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties + .get(aConfigPath, "HarvestLevel", aMaterial.mToolQuality); } } private static void addHarvestLevels() { - GT_Mod.gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties.get( - "harvestlevel", - "ActivateHarvestLevelChange", - false); - GT_Mod.gregtechproxy.mMaxHarvestLevel = Math.min( - 15, - GregTech_API.sMaterialProperties.get("harvestlevel", "MaxHarvestLevel", 7)); - GT_Mod.gregtechproxy.mGraniteHavestLevel = GregTech_API.sMaterialProperties.get( - "harvestlevel", - "GraniteHarvestLevel", - 3); + GT_Mod.gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties + .get("harvestlevel", "ActivateHarvestLevelChange", false); + GT_Mod.gregtechproxy.mMaxHarvestLevel = Math + .min(15, GregTech_API.sMaterialProperties.get("harvestlevel", "MaxHarvestLevel", 7)); + GT_Mod.gregtechproxy.mGraniteHavestLevel = GregTech_API.sMaterialProperties + .get("harvestlevel", "GraniteHarvestLevel", 3); } public static void initMaterialProperties() { @@ -2731,23 +2652,19 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void aspectCalculation(Materials aMaterial, String aConfigPath) { String aDefaultAspectString = aMaterial.mAspects.stream() - .map(aAspectStack -> aAspectStack.mAspect.toString()) - .collect(Collectors.joining(",", ",", "")); + .map(aAspectStack -> aAspectStack.mAspect.toString()) + .collect(Collectors.joining(",", ",", "")); String aDefaultAspectAmountString = aMaterial.mAspects.stream() - .map(aAspectStack -> String.valueOf(aAspectStack.mAmount)) - .collect(Collectors.joining(",", ",", "")); - - String aConfigAspectString = GregTech_API.sMaterialProperties.get( - aConfigPath, - "ListTCAspects", - aDefaultAspectString); - String aConfigAspectAmountString = GregTech_API.sMaterialProperties.get( - aConfigPath, - "ListTCAspectAmounts", - aDefaultAspectAmountString); + .map(aAspectStack -> String.valueOf(aAspectStack.mAmount)) + .collect(Collectors.joining(",", ",", "")); + + String aConfigAspectString = GregTech_API.sMaterialProperties + .get(aConfigPath, "ListTCAspects", aDefaultAspectString); + String aConfigAspectAmountString = GregTech_API.sMaterialProperties + .get(aConfigPath, "ListTCAspectAmounts", aDefaultAspectAmountString); if (!aConfigAspectString.equals(aDefaultAspectString) - || !aConfigAspectAmountString.equals(aDefaultAspectAmountString)) { + || !aConfigAspectAmountString.equals(aDefaultAspectAmountString)) { aMaterial.mAspects.clear(); if (aConfigAspectString.length() > 0) { String[] aAspects = aConfigAspectString.split(","); @@ -2764,38 +2681,34 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { private static void OreReRegistrationsCalculation(Materials aMaterial, String aConfigPath) { String aDefaultMatReRegString = aMaterial.mOreReRegistrations.stream() - .map(aTag -> aTag.mName) - .collect(Collectors.joining(",", ",", "")); - String aConfigMatMatReRegString = GregTech_API.sMaterialProperties.get( - aConfigPath, - "ListMaterialReRegistrations", - aDefaultMatReRegString); + .map(aTag -> aTag.mName) + .collect(Collectors.joining(",", ",", "")); + String aConfigMatMatReRegString = GregTech_API.sMaterialProperties + .get(aConfigPath, "ListMaterialReRegistrations", aDefaultMatReRegString); if (!aConfigMatMatReRegString.equals(aDefaultMatReRegString)) { aMaterial.mOreReRegistrations.clear(); if (aConfigMatMatReRegString.length() > 0) { Arrays.stream(aConfigMatMatReRegString.split(",")) - .map(MATERIALS_MAP::get) - .filter(Objects::nonNull) - .forEach(aMat -> aMaterial.mOreReRegistrations.add(aMat)); + .map(MATERIALS_MAP::get) + .filter(Objects::nonNull) + .forEach(aMat -> aMaterial.mOreReRegistrations.add(aMat)); } } } private static void OreByProductsCalculation(Materials aMaterial, String aConfigPath) { String aDefaultMatByProString = aMaterial.mOreByProducts.stream() - .map(aTag -> aTag.mName) - .collect(Collectors.joining(",", ",", "")); - String aConfigMatByProString = GregTech_API.sMaterialProperties.get( - aConfigPath, - "ListMaterialByProducts", - aDefaultMatByProString); + .map(aTag -> aTag.mName) + .collect(Collectors.joining(",", ",", "")); + String aConfigMatByProString = GregTech_API.sMaterialProperties + .get(aConfigPath, "ListMaterialByProducts", aDefaultMatByProString); if (!aConfigMatByProString.equals(aDefaultMatByProString)) { aMaterial.mOreByProducts.clear(); if (aConfigMatByProString.length() > 0) { Arrays.stream(aConfigMatByProString.split(",")) - .map(MATERIALS_MAP::get) - .filter(Objects::nonNull) - .forEach(aMat -> aMaterial.mOreByProducts.add(aMat)); + .map(MATERIALS_MAP::get) + .filter(Objects::nonNull) + .forEach(aMat -> aMaterial.mOreByProducts.add(aMat)); } } } @@ -2808,16 +2721,16 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { */ private static void SubTagCalculation(Materials aMaterial, String aConfigPath) { String aDefaultTagString = aMaterial.mSubTags.stream() - .map(aTag -> aTag.mName) - .collect(Collectors.joining(",", ",", "")); + .map(aTag -> aTag.mName) + .collect(Collectors.joining(",", ",", "")); String aConfigTagString = GregTech_API.sMaterialProperties.get(aConfigPath, "ListSubTags", aDefaultTagString); if (!aConfigTagString.equals(aDefaultTagString)) { aMaterial.mSubTags.clear(); if (aConfigTagString.length() > 0) { Arrays.stream(aConfigTagString.split(",")) - .map(SubTag.sSubTags::get) - .filter(Objects::nonNull) - .forEach(aTag -> aMaterial.mSubTags.add(aTag)); + .map(SubTag.sSubTags::get) + .filter(Objects::nonNull) + .forEach(aTag -> aMaterial.mSubTags.add(aTag)); } } } @@ -2911,8 +2824,8 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { if (mElement != null) return mElement.mHalfLifeSeconds >= 0; return mMaterialList.stream() - .map(stack -> stack.mMaterial) - .anyMatch(Materials::isRadioactive); + .map(stack -> stack.mMaterial) + .anyMatch(Materials::isRadioactive); } public long getProtons() { @@ -2968,8 +2881,8 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { if (!aShowQuestionMarks && mChemicalFormula.equals("?")) return ""; if (aMultiplier >= M * 2 && !mMaterialList.isEmpty()) { return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1)) - ? mChemicalFormula - : "(" + mChemicalFormula + ")") + aMultiplier; + ? mChemicalFormula + : "(" + mChemicalFormula + ")") + aMultiplier; } return mChemicalFormula; } @@ -2988,13 +2901,9 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public boolean contains(ItemStack... aStacks) { if (aStacks == null || aStacks.length == 0) return false; return mMaterialItems.stream() - .anyMatch( - tStack -> Arrays.stream(aStacks) - .anyMatch( - aStack -> GT_Utility.areStacksEqual( - aStack, - tStack, - !tStack.hasTagCompound()))); + .anyMatch( + tStack -> Arrays.stream(aStacks) + .anyMatch(aStack -> GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound()))); } /** @@ -3185,18 +3094,18 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public String getDefaultLocalizedNameForItem(String aFormat) { return String.format( - aFormat.replace("%s", "%temp") - .replace("%material", "%s"), - this.mDefaultLocalName) - .replace("%temp", "%s"); + aFormat.replace("%s", "%temp") + .replace("%material", "%s"), + this.mDefaultLocalName) + .replace("%temp", "%s"); } public String getLocalizedNameForItem(String aFormat) { return String.format( - aFormat.replace("%s", "%temp") - .replace("%material", "%s"), - this.mLocalizedName) - .replace("%temp", "%s"); + aFormat.replace("%s", "%temp") + .replace("%material", "%s"), + this.mLocalizedName) + .replace("%temp", "%s"); } public boolean hasCorrespondingFluid() { @@ -3303,7 +3212,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { */ public boolean isProperSolderingFluid() { return mStandardMoltenFluid != null && contains(SubTag.SOLDERING_MATERIAL) - && !(GregTech_API.mUseOnlyGoodSolderingMaterials && !contains(SubTag.SOLDERING_MATERIAL_GOOD)); + && !(GregTech_API.mUseOnlyGoodSolderingMaterials && !contains(SubTag.SOLDERING_MATERIAL_GOOD)); } public ItemStack getCells(int amount) { diff --git a/src/main/java/gregtech/api/enums/MaterialsBotania.java b/src/main/java/gregtech/api/enums/MaterialsBotania.java index d93b941e39..b82d810a19 100644 --- a/src/main/java/gregtech/api/enums/MaterialsBotania.java +++ b/src/main/java/gregtech/api/enums/MaterialsBotania.java @@ -9,207 +9,187 @@ import gregtech.api.enums.TC_Aspects.TC_AspectStack; public class MaterialsBotania { // Botania materials. - public static Materials Manasteel = new MaterialBuilder( - 201, - TextureSet.SET_METALLIC, - "Manasteel").setName("Manasteel") - .setRGBA(150, 219, 252, 255) - .addDustItems() - .addMetalItems() - .addToolHeadItems() - .addGearItems() - .setToolSpeed(8.0F) - .setDurability(5120) - .setToolQuality(4) - .setMeltingPoint(1500) - .setBlastFurnaceTemp(1500) - .setBlastFurnaceRequired(true) - .setAspects( - Arrays.asList( - new TC_AspectStack(TC_Aspects.METALLUM, 3), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) - .constructMaterial(); - public static Materials Terrasteel = new MaterialBuilder( - 202, - TextureSet.SET_METALLIC, - "Terrasteel").setName("Terrasteel") - .setRGBA(76, 191, 38, 255) - .addDustItems() - .addMetalItems() - .addToolHeadItems() - .addGearItems() - .setToolSpeed(32.0F) - .setDurability(10240) - .setToolQuality(5) - .setMeltingPoint(5400) - .setBlastFurnaceTemp(5400) - .setBlastFurnaceRequired(true) - .setAspects( - Arrays.asList( - new TC_AspectStack(TC_Aspects.METALLUM, 2), - new TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) - .constructMaterial(); - public static Materials ElvenElementium = new MaterialBuilder( - 203, - TextureSet.SET_METALLIC, - "Elven Elementium").setName("ElvenElementium") - .setRGBA(219, 37, 205, 255) - .addDustItems() - .addMetalItems() - .addToolHeadItems() - .addGearItems() - .setToolSpeed(20.0F) - .setDurability(32768) - .setToolQuality(7) - .setMeltingPoint(7200) - .setBlastFurnaceTemp(7200) - .setBlastFurnaceRequired(true) - .setAspects( - Arrays.asList( - new TC_AspectStack(TC_Aspects.METALLUM, 3), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 2), - new TC_AspectStack(TC_Aspects.AURAM, 1))) - .constructMaterial(); - public static Materials Livingrock = new MaterialBuilder( - 204, - new TextureSet("Livingrock", true), - "Livingrock").setName("Livingrock") - .addDustItems() - .addToolHeadItems() - .addGearItems() - .setToolSpeed(1.0F) - .setDurability(0) - .setToolQuality(3) - .setOreValue(3) - .setDensityMultiplier(1) - .setDensityDivider(1) - .setAspects( - Arrays.asList( - new TC_AspectStack(TC_Aspects.TERRA, 2), - new TC_AspectStack(TC_Aspects.VICTUS, 2))) - .constructMaterial(); + public static Materials Manasteel = new MaterialBuilder(201, TextureSet.SET_METALLIC, "Manasteel") + .setName("Manasteel") + .setRGBA(150, 219, 252, 255) + .addDustItems() + .addMetalItems() + .addToolHeadItems() + .addGearItems() + .setToolSpeed(8.0F) + .setDurability(5120) + .setToolQuality(4) + .setMeltingPoint(1500) + .setBlastFurnaceTemp(1500) + .setBlastFurnaceRequired(true) + .setAspects( + Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 3), new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) + .constructMaterial(); + public static Materials Terrasteel = new MaterialBuilder(202, TextureSet.SET_METALLIC, "Terrasteel") + .setName("Terrasteel") + .setRGBA(76, 191, 38, 255) + .addDustItems() + .addMetalItems() + .addToolHeadItems() + .addGearItems() + .setToolSpeed(32.0F) + .setDurability(10240) + .setToolQuality(5) + .setMeltingPoint(5400) + .setBlastFurnaceTemp(5400) + .setBlastFurnaceRequired(true) + .setAspects( + Arrays.asList( + new TC_AspectStack(TC_Aspects.METALLUM, 2), + new TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) + .constructMaterial(); + public static Materials ElvenElementium = new MaterialBuilder(203, TextureSet.SET_METALLIC, "Elven Elementium") + .setName("ElvenElementium") + .setRGBA(219, 37, 205, 255) + .addDustItems() + .addMetalItems() + .addToolHeadItems() + .addGearItems() + .setToolSpeed(20.0F) + .setDurability(32768) + .setToolQuality(7) + .setMeltingPoint(7200) + .setBlastFurnaceTemp(7200) + .setBlastFurnaceRequired(true) + .setAspects( + Arrays.asList( + new TC_AspectStack(TC_Aspects.METALLUM, 3), + new TC_AspectStack(TC_Aspects.PRAECANTATIO, 2), + new TC_AspectStack(TC_Aspects.AURAM, 1))) + .constructMaterial(); + public static Materials Livingrock = new MaterialBuilder(204, new TextureSet("Livingrock", true), "Livingrock") + .setName("Livingrock") + .addDustItems() + .addToolHeadItems() + .addGearItems() + .setToolSpeed(1.0F) + .setDurability(0) + .setToolQuality(3) + .setOreValue(3) + .setDensityMultiplier(1) + .setDensityDivider(1) + .setAspects(Arrays.asList(new TC_AspectStack(TC_Aspects.TERRA, 2), new TC_AspectStack(TC_Aspects.VICTUS, 2))) + .constructMaterial(); public static Materials GaiaSpirit = new Materials( - 205, - TextureSet.SET_METALLIC.withBlockTextures("GaiaSpirit"), - 32.0F, - 850000, - 12, - 1 | 2 | 64 | 128, - 255, - 255, - 255, - 0, - "GaiaSpirit", - "Gaia Spirit", - -1, - -1, - 0, - 0, - false, - true, - 2, - 1, - 1, - Dyes._NULL, + 205, + TextureSet.SET_METALLIC.withBlockTextures("GaiaSpirit"), + 32.0F, + 850000, + 12, + 1 | 2 | 64 | 128, + 255, + 255, + 255, + 0, + "GaiaSpirit", + "Gaia Spirit", + -1, + -1, + 0, + 0, + false, + true, + 2, + 1, + 1, + Dyes._NULL, + Arrays.asList( + new TC_AspectStack(TC_Aspects.PRAECANTATIO, 27), + new TC_AspectStack(TC_Aspects.AURAM, 24), + new TC_AspectStack(TC_Aspects.VICTUS, 24), + new TC_AspectStack(TC_Aspects.METALLUM, 1))); + public static Materials Livingwood = new MaterialBuilder(206, new TextureSet("Livingwood", true), "Livingwood") + .setName("Livingwood") + .addDustItems() + .addMetalItems() + .addToolHeadItems() + .addGearItems() + .setToolSpeed(1.0F) + .setDurability(0) + .setToolQuality(3) + .setOreValue(3) + .setDensityMultiplier(1) + .setDensityDivider(1) + .setAspects(Arrays.asList(new TC_AspectStack(TC_Aspects.ARBOR, 4), new TC_AspectStack(TC_Aspects.VICTUS, 2))) + .constructMaterial(); + public static Materials Dreamwood = new MaterialBuilder(207, new TextureSet("Dreamwood", true), "Dreamwood") + .setName("Dreamwood") + .addDustItems() + .addMetalItems() + .addToolHeadItems() + .addGearItems() + .setToolSpeed(1.0F) + .setDurability(0) + .setToolQuality(3) + .setOreValue(3) + .setDensityMultiplier(1) + .setDensityDivider(1) + .setAspects( Arrays.asList( - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 27), - new TC_AspectStack(TC_Aspects.AURAM, 24), - new TC_AspectStack(TC_Aspects.VICTUS, 24), - new TC_AspectStack(TC_Aspects.METALLUM, 1))); - public static Materials Livingwood = new MaterialBuilder( - 206, - new TextureSet("Livingwood", true), - "Livingwood").setName("Livingwood") - .addDustItems() - .addMetalItems() - .addToolHeadItems() - .addGearItems() - .setToolSpeed(1.0F) - .setDurability(0) - .setToolQuality(3) - .setOreValue(3) - .setDensityMultiplier(1) - .setDensityDivider(1) - .setAspects( - Arrays.asList( - new TC_AspectStack(TC_Aspects.ARBOR, 4), - new TC_AspectStack(TC_Aspects.VICTUS, 2))) - .constructMaterial(); - public static Materials Dreamwood = new MaterialBuilder( - 207, - new TextureSet("Dreamwood", true), - "Dreamwood").setName("Dreamwood") - .addDustItems() - .addMetalItems() - .addToolHeadItems() - .addGearItems() - .setToolSpeed(1.0F) - .setDurability(0) - .setToolQuality(3) - .setOreValue(3) - .setDensityMultiplier(1) - .setDensityDivider(1) - .setAspects( - Arrays.asList( - new TC_AspectStack(TC_Aspects.ARBOR, 4), - new TC_AspectStack(TC_Aspects.AURAM, 2), - new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) - .constructMaterial(); + new TC_AspectStack(TC_Aspects.ARBOR, 4), + new TC_AspectStack(TC_Aspects.AURAM, 2), + new TC_AspectStack(TC_Aspects.PRAECANTATIO, 1))) + .constructMaterial(); public static Materials ManaDiamond = new Materials( - 208, - TextureSet.SET_DIAMOND, - 16.0F, - 2560, - 8, - 1 | 4, - 38, - 237, - 224, - 255, - "ManaDiamond", - "Mana Diamond", - -1, - -1, - 0, - 0, - false, - true, - 2, - 1, - 1, - Dyes._NULL, - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4), - new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 4))); + 208, + TextureSet.SET_DIAMOND, + 16.0F, + 2560, + 8, + 1 | 4, + 38, + 237, + 224, + 255, + "ManaDiamond", + "Mana Diamond", + -1, + -1, + 0, + 0, + false, + true, + 2, + 1, + 1, + Dyes._NULL, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 4), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 4))); public static Materials BotaniaDragonstone = new Materials( - 209, - TextureSet.SET_DIAMOND, - 24.0F, - 3840, - 12, - 1 | 4, - 242, - 44, - 239, - 255, - "BotaniaDragonstone", - "Dragonstone", - -1, - -1, - 0, - 0, - false, - true, - 2, - 1, - 1, - Dyes._NULL, - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 6), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6), - new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 4))); + 209, + TextureSet.SET_DIAMOND, + 24.0F, + 3840, + 12, + 1 | 4, + 242, + 44, + 239, + 255, + "BotaniaDragonstone", + "Dragonstone", + -1, + -1, + 0, + 0, + false, + true, + 2, + 1, + 1, + Dyes._NULL, + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTATIO, 6), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 6), + new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 4))); public static void init() { GaiaSpirit.mChemicalFormula = "Gs"; diff --git a/src/main/java/gregtech/api/enums/MaterialsKevlar.java b/src/main/java/gregtech/api/enums/MaterialsKevlar.java index a5c38b0f7a..647fe08ef4 100644 --- a/src/main/java/gregtech/api/enums/MaterialsKevlar.java +++ b/src/main/java/gregtech/api/enums/MaterialsKevlar.java @@ -7,690 +7,590 @@ import gregtech.api.objects.MaterialStack; public class MaterialsKevlar { public static Materials DiphenylmethaneDiisocyanate = new MaterialBuilder( - 796, - TextureSet.SET_DULL, - "4,4'-Diphenylmethane Diisocyanate").setName("DiphenylmethaneDiisocyanate") - .addDustItems() - .setRGB(255, 230, 50) - .setColor(Dyes.dyeYellow) - .setMeltingPoint(310) - .setMaterialList( - new MaterialStack(Materials.Carbon, 15), - new MaterialStack(Materials.Hydrogen, 10), - new MaterialStack(Materials.Nitrogen, 2), - new MaterialStack(Materials.Oxygen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) - .constructMaterial(); // C15H10N2O2 + 796, + TextureSet.SET_DULL, + "4,4'-Diphenylmethane Diisocyanate").setName("DiphenylmethaneDiisocyanate") + .addDustItems() + .setRGB(255, 230, 50) + .setColor(Dyes.dyeYellow) + .setMeltingPoint(310) + .setMaterialList( + new MaterialStack(Materials.Carbon, 15), + new MaterialStack(Materials.Hydrogen, 10), + new MaterialStack(Materials.Nitrogen, 2), + new MaterialStack(Materials.Oxygen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + .constructMaterial(); // C15H10N2O2 public static Materials DiaminodiphenylmethanMixture = new MaterialBuilder( - 795, - TextureSet.SET_FLUID, - "Diaminodiphenylmethane Mixture").setName("DiaminodiphenylmethanMixture") - .addCell() - .addFluid() - .setRGB(255, 243, 122) - .setColor(Dyes.dyeYellow) - .setMeltingPoint(365) - .setMaterialList( - new MaterialStack(Materials.Carbon, 13), - new MaterialStack(Materials.Hydrogen, 14), - new MaterialStack(Materials.Nitrogen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) - .constructMaterial(); // C13H14N2 + 795, + TextureSet.SET_FLUID, + "Diaminodiphenylmethane Mixture").setName("DiaminodiphenylmethanMixture") + .addCell() + .addFluid() + .setRGB(255, 243, 122) + .setColor(Dyes.dyeYellow) + .setMeltingPoint(365) + .setMaterialList( + new MaterialStack(Materials.Carbon, 13), + new MaterialStack(Materials.Hydrogen, 14), + new MaterialStack(Materials.Nitrogen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + .constructMaterial(); // C13H14N2 public static Materials DiphenylmethaneDiisocyanateMixture = new MaterialBuilder( - 794, - TextureSet.SET_FLUID, - "Diphenylmethane Diisocyanate Mixture").setName("DiphenylmethaneDiisocyanateMixture") - .addCell() - .addFluid() - .setRGB(255, 230, 50) - .setColor(Dyes.dyeYellow) - .setMeltingPoint(310) - .setMaterialList( - new MaterialStack(Materials.Carbon, 15), - new MaterialStack(Materials.Hydrogen, 10), - new MaterialStack(Materials.Nitrogen, 2), - new MaterialStack(Materials.Oxygen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack( - TC_Aspects.VENENUM, - 1))) - .constructMaterial(); // C15H10N2O2 - public static Materials Butyraldehyde = new MaterialBuilder( - 793, - TextureSet.SET_FLUID, - "Butyraldehyde").setName("Butyraldehyde") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(176) - .setMaterialList( - new MaterialStack(Materials.Carbon, 4), - new MaterialStack(Materials.Hydrogen, 8), - new MaterialStack(Materials.Oxygen, 1)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) - .constructMaterial(); // C4H8O - public static Materials Isobutyraldehyde = new MaterialBuilder( - 792, - TextureSet.SET_FLUID, - "Isobutyraldehyde").setName("Isobutyraldehyde") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(208) - .setExtraData(1) - .setMaterialList( - new MaterialStack(Materials.Carbon, 4), - new MaterialStack(Materials.Hydrogen, 8), - new MaterialStack(Materials.Oxygen, 1)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) - .constructMaterial(); // C4H8O - public static Materials NickelTetracarbonyl = new MaterialBuilder( - 791, - TextureSet.SET_FLUID, - "Nickel Tetracarbonyl").setName("NickelTetracarbonyl") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(256) - .setMaterialList( - new MaterialStack(Materials.Carbon, 4), - new MaterialStack(Materials.Nickel, 1), - new MaterialStack(Materials.Oxygen, 4)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1))) - .constructMaterial(); // C4NiO4 - public static Materials KevlarCatalyst = new MaterialBuilder( - 790, - TextureSet.SET_DULL, - "Polyurethane Catalyst A").setName("PolyurethaneCatalystADust") - .addDustItems() - .setRGB(50, 50, 50) - .setColor(Dyes.dyeBlack) - .setMeltingPoint(300) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1))) - .constructMaterial(); - public static Materials EthyleneOxide = new MaterialBuilder( - 789, - TextureSet.SET_FLUID, - "Ethylene Oxide").setName("EthyleneOxide") - .addCell() - .addGas() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(160) - .setMaterialList( - new MaterialStack(Materials.Carbon, 2), - new MaterialStack(Materials.Hydrogen, 4), - new MaterialStack(Materials.Oxygen, 1)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) - .constructMaterial(); // C2H4O - public static Materials SiliconOil = new MaterialBuilder( - 788, - TextureSet.SET_FLUID, - "Silicon Oil").setName("SiliconOil") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(473) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1))) - .constructMaterial(); - public static Materials Ethyleneglycol = new MaterialBuilder( - 787, - TextureSet.SET_FLUID, - "Ethylene Glycol").setName("EthyleneGlycol") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(260) - .setMaterialList( - new MaterialStack(Materials.Carbon, 2), - new MaterialStack(Materials.Hydrogen, 6), - new MaterialStack(Materials.Oxygen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) - .constructMaterial(); // C2H6O2 - public static Materials Acetaldehyde = new MaterialBuilder( - 786, - TextureSet.SET_FLUID, - "Acetaldehyde").setName("Acetaldehyde") - .addCell() - .addGas() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(150) - .setMaterialList( - new MaterialStack(Materials.Carbon, 2), - new MaterialStack(Materials.Hydrogen, 4), - new MaterialStack(Materials.Oxygen, 1)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) - .constructMaterial(); // C2H4O - public static Materials Pentaerythritol = new MaterialBuilder( - 785, - TextureSet.SET_DULL, - "Pentaerythritol").setName("Pentaerythritol") - .addDustItems() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(533) - .setMaterialList( - new MaterialStack(Materials.Carbon, 5), - new MaterialStack(Materials.Hydrogen, 12), - new MaterialStack(Materials.Oxygen, 4)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1))) - .constructMaterial(); // C5H12O4 - public static Materials PolyurethaneResin = new MaterialBuilder( - 784, - TextureSet.SET_FLUID, - "Polyurethane Resin").setName("PolyurethaneResin") - .addCell() - .addFluid() - .setRGB(230, 230, 120) - .setColor(Dyes.dyeYellow) - .constructMaterial(); + 794, + TextureSet.SET_FLUID, + "Diphenylmethane Diisocyanate Mixture").setName("DiphenylmethaneDiisocyanateMixture") + .addCell() + .addFluid() + .setRGB(255, 230, 50) + .setColor(Dyes.dyeYellow) + .setMeltingPoint(310) + .setMaterialList( + new MaterialStack(Materials.Carbon, 15), + new MaterialStack(Materials.Hydrogen, 10), + new MaterialStack(Materials.Nitrogen, 2), + new MaterialStack(Materials.Oxygen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + .constructMaterial(); // C15H10N2O2 + public static Materials Butyraldehyde = new MaterialBuilder(793, TextureSet.SET_FLUID, "Butyraldehyde") + .setName("Butyraldehyde") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(176) + .setMaterialList( + new MaterialStack(Materials.Carbon, 4), + new MaterialStack(Materials.Hydrogen, 8), + new MaterialStack(Materials.Oxygen, 1)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + .constructMaterial(); // C4H8O + public static Materials Isobutyraldehyde = new MaterialBuilder(792, TextureSet.SET_FLUID, "Isobutyraldehyde") + .setName("Isobutyraldehyde") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(208) + .setExtraData(1) + .setMaterialList( + new MaterialStack(Materials.Carbon, 4), + new MaterialStack(Materials.Hydrogen, 8), + new MaterialStack(Materials.Oxygen, 1)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + .constructMaterial(); // C4H8O + public static Materials NickelTetracarbonyl = new MaterialBuilder(791, TextureSet.SET_FLUID, "Nickel Tetracarbonyl") + .setName("NickelTetracarbonyl") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(256) + .setMaterialList( + new MaterialStack(Materials.Carbon, 4), + new MaterialStack(Materials.Nickel, 1), + new MaterialStack(Materials.Oxygen, 4)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1))) + .constructMaterial(); // C4NiO4 + public static Materials KevlarCatalyst = new MaterialBuilder(790, TextureSet.SET_DULL, "Polyurethane Catalyst A") + .setName("PolyurethaneCatalystADust") + .addDustItems() + .setRGB(50, 50, 50) + .setColor(Dyes.dyeBlack) + .setMeltingPoint(300) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1))) + .constructMaterial(); + public static Materials EthyleneOxide = new MaterialBuilder(789, TextureSet.SET_FLUID, "Ethylene Oxide") + .setName("EthyleneOxide") + .addCell() + .addGas() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(160) + .setMaterialList( + new MaterialStack(Materials.Carbon, 2), + new MaterialStack(Materials.Hydrogen, 4), + new MaterialStack(Materials.Oxygen, 1)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + .constructMaterial(); // C2H4O + public static Materials SiliconOil = new MaterialBuilder(788, TextureSet.SET_FLUID, "Silicon Oil") + .setName("SiliconOil") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(473) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1))) + .constructMaterial(); + public static Materials Ethyleneglycol = new MaterialBuilder(787, TextureSet.SET_FLUID, "Ethylene Glycol") + .setName("EthyleneGlycol") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(260) + .setMaterialList( + new MaterialStack(Materials.Carbon, 2), + new MaterialStack(Materials.Hydrogen, 6), + new MaterialStack(Materials.Oxygen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + .constructMaterial(); // C2H6O2 + public static Materials Acetaldehyde = new MaterialBuilder(786, TextureSet.SET_FLUID, "Acetaldehyde") + .setName("Acetaldehyde") + .addCell() + .addGas() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(150) + .setMaterialList( + new MaterialStack(Materials.Carbon, 2), + new MaterialStack(Materials.Hydrogen, 4), + new MaterialStack(Materials.Oxygen, 1)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1))) + .constructMaterial(); // C2H4O + public static Materials Pentaerythritol = new MaterialBuilder(785, TextureSet.SET_DULL, "Pentaerythritol") + .setName("Pentaerythritol") + .addDustItems() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(533) + .setMaterialList( + new MaterialStack(Materials.Carbon, 5), + new MaterialStack(Materials.Hydrogen, 12), + new MaterialStack(Materials.Oxygen, 4)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1))) + .constructMaterial(); // C5H12O4 + public static Materials PolyurethaneResin = new MaterialBuilder(784, TextureSet.SET_FLUID, "Polyurethane Resin") + .setName("PolyurethaneResin") + .addCell() + .addFluid() + .setRGB(230, 230, 120) + .setColor(Dyes.dyeYellow) + .constructMaterial(); public static Materials NMethylIIPyrrolidone = new MaterialBuilder( - 783, - TextureSet.SET_FLUID, - "N-Methyl-2-pyrrolidone").setName("NMethylpyrolidone") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(249) - .setMaterialList( - new MaterialStack(Materials.Carbon, 5), - new MaterialStack(Materials.Hydrogen, 9), - new MaterialStack(Materials.Nitrogen, 1), - new MaterialStack(Materials.Oxygen, 1)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) - .constructMaterial(); // C5H9NO + 783, + TextureSet.SET_FLUID, + "N-Methyl-2-pyrrolidone").setName("NMethylpyrolidone") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(249) + .setMaterialList( + new MaterialStack(Materials.Carbon, 5), + new MaterialStack(Materials.Hydrogen, 9), + new MaterialStack(Materials.Nitrogen, 1), + new MaterialStack(Materials.Oxygen, 1)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1))) + .constructMaterial(); // C5H9NO public static Materials TerephthaloylChloride = new MaterialBuilder( - 782, - TextureSet.SET_POWDER, - "Terephthaloyl Chloride").setName("TerephthaloylChloride") - .addDustItems() - .setRGB(0, 255, 12) - .setColor(Dyes.dyeGreen) - .setMeltingPoint(355) - .setMaterialList( - new MaterialStack(Materials.Carbon, 8), - new MaterialStack(Materials.Hydrogen, 4), - new MaterialStack(Materials.Chlorine, 2), - new MaterialStack(Materials.Oxygen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) - .constructMaterial(); // C8H4Cl2O2 + 782, + TextureSet.SET_POWDER, + "Terephthaloyl Chloride").setName("TerephthaloylChloride") + .addDustItems() + .setRGB(0, 255, 12) + .setColor(Dyes.dyeGreen) + .setMeltingPoint(355) + .setMaterialList( + new MaterialStack(Materials.Carbon, 8), + new MaterialStack(Materials.Hydrogen, 4), + new MaterialStack(Materials.Chlorine, 2), + new MaterialStack(Materials.Oxygen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) + .constructMaterial(); // C8H4Cl2O2 public static Materials Acetylene = new MaterialBuilder(781, TextureSet.SET_FLUID, "Acetylene").setName("Acetylene") - .addCell() - .addGas() - .setRGB( - 255, - 255, - 255) - .setColor( - Dyes.dyeWhite) - .setMeltingPoint(192) - .setMaterialList( - new MaterialStack( - Materials.Carbon, - 2), - new MaterialStack( - Materials.Hydrogen, - 2)) - .constructMaterial(); // C2H2 - // TODO - // Add - // to - // JUPITER - // Athmosphere - // and - // Enceladus - // and - // to - // moon - // of - // Saturn - public static Materials IVNitroaniline = new MaterialBuilder( - 780, - TextureSet.SET_FLUID, - "4-Nitroaniline").setName("4Nitroaniline") - .addCell() - .addFluid() - .setRGB(255, 135, 51) - .setColor(Dyes.dyeOrange) - .setMeltingPoint(420) - .setMaterialList( - new MaterialStack(Materials.Carbon, 6), - new MaterialStack(Materials.Hydrogen, 6), - new MaterialStack(Materials.Nitrogen, 2), - new MaterialStack(Materials.Oxygen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) - .constructMaterial(); // C6H6N2O2 + .addCell() + .addGas() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(192) + .setMaterialList(new MaterialStack(Materials.Carbon, 2), new MaterialStack(Materials.Hydrogen, 2)) + .constructMaterial(); // C2H2 + // TODO + // Add + // to + // JUPITER + // Athmosphere + // and + // Enceladus + // and + // to + // moon + // of + // Saturn + public static Materials IVNitroaniline = new MaterialBuilder(780, TextureSet.SET_FLUID, "4-Nitroaniline") + .setName("4Nitroaniline") + .addCell() + .addFluid() + .setRGB(255, 135, 51) + .setColor(Dyes.dyeOrange) + .setMeltingPoint(420) + .setMaterialList( + new MaterialStack(Materials.Carbon, 6), + new MaterialStack(Materials.Hydrogen, 6), + new MaterialStack(Materials.Nitrogen, 2), + new MaterialStack(Materials.Oxygen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) + .constructMaterial(); // C6H6N2O2 public static Materials ParaPhenylenediamine = new MaterialBuilder( - 779, - TextureSet.SET_POWDER, - "para-Phenylenediamine").setName("pPhenylenediamine") - .addDustItems() - .setRGB(251, 236, 93) - .setColor(Dyes.dyeYellow) - .setMeltingPoint(293) - .setMaterialList( - new MaterialStack(Materials.Carbon, 6), - new MaterialStack(Materials.Hydrogen, 8), - new MaterialStack(Materials.Nitrogen, 2)) - .setAspects( - Arrays.asList( - new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), - new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) - .constructMaterial(); // C6H6N2 - public static Materials Methylamine = new MaterialBuilder( - 778, - TextureSet.SET_FLUID, - "Methylamine").setName("Methylamine") - .addCell() - .addGas() - .setRGB(65, 68, 105) - .setColor(Dyes.dyeGray) - .setMeltingPoint(180) - .setExtraData(1) - .setMaterialList( - new MaterialStack(Materials.Carbon, 1), - new MaterialStack(Materials.Hydrogen, 5), - new MaterialStack(Materials.Nitrogen, 1)) - .constructMaterial(); // CH5N - public static Materials Trimethylamine = new MaterialBuilder( - 777, - TextureSet.SET_FLUID, - "Trimethylamine").setName("Trimethylamine") - .addCell() - .addGas() - .setRGB(105, 68, 105) - .setColor(Dyes.dyeGray) - .setMeltingPoint(156) - .setExtraData(1) - .setMaterialList( - new MaterialStack(Materials.Carbon, 3), - new MaterialStack(Materials.Hydrogen, 9), - new MaterialStack(Materials.Nitrogen, 1)) - .constructMaterial(); // C3H9N - public static Materials GammaButyrolactone = new MaterialBuilder( - 776, - TextureSet.SET_FLUID, - "gamma-Butyrolactone").setName("GammaButyrolactone") - .addCell() - .addFluid() - .setRGB(255, 255, 151) - .setColor(Dyes.dyeYellow) - .setMeltingPoint(229) - .setMaterialList( - new MaterialStack(Materials.Carbon, 4), - new MaterialStack(Materials.Hydrogen, 6), - new MaterialStack(Materials.Oxygen, 2)) - .constructMaterial(); // C4H6O2 - public static Materials CalciumCarbide = new MaterialBuilder( - 775, - TextureSet.SET_DULL, - "Calcium Carbide").setName("CacliumCarbide") - .addDustItems() - .setRGB(235, 235, 235) - .setColor(Dyes.dyeGray) - .setMeltingPoint(2430) - .setMaterialList( - new MaterialStack(Materials.Calcium, 1), - new MaterialStack(Materials.Carbon, 2)) - .constructMaterial(); // CaC2 + 779, + TextureSet.SET_POWDER, + "para-Phenylenediamine").setName("pPhenylenediamine") + .addDustItems() + .setRGB(251, 236, 93) + .setColor(Dyes.dyeYellow) + .setMeltingPoint(293) + .setMaterialList( + new MaterialStack(Materials.Carbon, 6), + new MaterialStack(Materials.Hydrogen, 8), + new MaterialStack(Materials.Nitrogen, 2)) + .setAspects( + Arrays.asList( + new TC_Aspects.TC_AspectStack(TC_Aspects.TERRA, 1), + new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1))) + .constructMaterial(); // C6H6N2 + public static Materials Methylamine = new MaterialBuilder(778, TextureSet.SET_FLUID, "Methylamine") + .setName("Methylamine") + .addCell() + .addGas() + .setRGB(65, 68, 105) + .setColor(Dyes.dyeGray) + .setMeltingPoint(180) + .setExtraData(1) + .setMaterialList( + new MaterialStack(Materials.Carbon, 1), + new MaterialStack(Materials.Hydrogen, 5), + new MaterialStack(Materials.Nitrogen, 1)) + .constructMaterial(); // CH5N + public static Materials Trimethylamine = new MaterialBuilder(777, TextureSet.SET_FLUID, "Trimethylamine") + .setName("Trimethylamine") + .addCell() + .addGas() + .setRGB(105, 68, 105) + .setColor(Dyes.dyeGray) + .setMeltingPoint(156) + .setExtraData(1) + .setMaterialList( + new MaterialStack(Materials.Carbon, 3), + new MaterialStack(Materials.Hydrogen, 9), + new MaterialStack(Materials.Nitrogen, 1)) + .constructMaterial(); // C3H9N + public static Materials GammaButyrolactone = new MaterialBuilder(776, TextureSet.SET_FLUID, "gamma-Butyrolactone") + .setName("GammaButyrolactone") + .addCell() + .addFluid() + .setRGB(255, 255, 151) + .setColor(Dyes.dyeYellow) + .setMeltingPoint(229) + .setMaterialList( + new MaterialStack(Materials.Carbon, 4), + new MaterialStack(Materials.Hydrogen, 6), + new MaterialStack(Materials.Oxygen, 2)) + .constructMaterial(); // C4H6O2 + public static Materials CalciumCarbide = new MaterialBuilder(775, TextureSet.SET_DULL, "Calcium Carbide") + .setName("CacliumCarbide") + .addDustItems() + .setRGB(235, 235, 235) + .setColor(Dyes.dyeGray) + .setMeltingPoint(2430) + .setMaterialList(new MaterialStack(Materials.Calcium, 1), new MaterialStack(Materials.Carbon, 2)) + .constructMaterial(); // CaC2 public static Materials LiquidCrystalKevlar = new MaterialBuilder( - 774, - TextureSet.SET_FLUID, - "Liquid Crystal Kevlar").setName("LiquidCrystalKevlar") - .addCell() - .addFluid() - .setRGB(240, 240, 120) - .setColor(Dyes.dyeYellow) - .constructMaterial(); // [-CO-C6H4-CO-NH-C6H4-NH-]n - public static Materials IIButinIIVdiol = new MaterialBuilder( - 773, - TextureSet.SET_POWDER, - "2-Butin-1,4-diol").setName("2Butin14diol") - .addDustItems() - .setRGB(247, 247, 180) - .setColor(Dyes.dyeYellow) - .setMeltingPoint(331) - .setMaterialList( - new MaterialStack(Materials.Carbon, 4), - new MaterialStack(Materials.Hydrogen, 6), - new MaterialStack(Materials.Oxygen, 2)) - .constructMaterial(); // C4H6O2 - public static Materials NickelAluminide = new MaterialBuilder( - 772, - TextureSet.SET_METALLIC, - "Nickel Aluminide").setName("NickelAluminide") - .addDustItems() - .addMetalItems() - .setRGB(230, 230, 230) - .setColor(Dyes.dyeGray) - .setMeltingPoint(1668) - .setBlastFurnaceTemp(1668) - .setBlastFurnaceRequired(true) - .setMaterialList( - new MaterialStack(Materials.Nickel, 1), - new MaterialStack(Materials.Aluminium, 3)) - .constructMaterial() - .disableAutoGeneratedBlastFurnaceRecipes(); // NiAl3 - public static Materials RaneyNickelActivated = new MaterialBuilder( - 771, - TextureSet.SET_POWDER, - "Raney Nickel").setName("RaneyNickelActivated") - .addDustItems() - .setRGB(230, 230, 230) - .setColor(Dyes.dyeGray) - .setMeltingPoint(1955) - .setMaterialList( - new MaterialStack(Materials.Nickel, 1), - new MaterialStack(Materials.Aluminium, 1)) - .constructMaterial(); // NiAl - public static Materials BismuthIIIOxide = new MaterialBuilder( - 769, - TextureSet.SET_POWDER, - "Bismuth Oxide").setName("BismuthIIIOxide") - .addDustItems() - .setRGB(50, 50, 50) - .setColor(Dyes.dyeBlack) - .setMeltingPoint(1090) - .setMaterialList( - new MaterialStack(Materials.Bismuth, 2), - new MaterialStack(Materials.Oxygen, 3)) - .constructMaterial(); // Bi2O3 - public static Materials ThionylChloride = new MaterialBuilder( - 768, - TextureSet.SET_FLUID, - "Thionyl Chloride").setName("ThionylChloride") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .constructMaterial(); // SOCl2 - public static Materials SulfurDichloride = new MaterialBuilder( - 767, - TextureSet.SET_FLUID, - "Sulfur Dichloride").setName("SulfurDichloride") - .addCell() - .addFluid() - .setRGB(200, 0, 0) - .setColor(Dyes.dyeRed) - .constructMaterial(); // SCl2 + 774, + TextureSet.SET_FLUID, + "Liquid Crystal Kevlar").setName("LiquidCrystalKevlar") + .addCell() + .addFluid() + .setRGB(240, 240, 120) + .setColor(Dyes.dyeYellow) + .constructMaterial(); // [-CO-C6H4-CO-NH-C6H4-NH-]n + public static Materials IIButinIIVdiol = new MaterialBuilder(773, TextureSet.SET_POWDER, "2-Butin-1,4-diol") + .setName("2Butin14diol") + .addDustItems() + .setRGB(247, 247, 180) + .setColor(Dyes.dyeYellow) + .setMeltingPoint(331) + .setMaterialList( + new MaterialStack(Materials.Carbon, 4), + new MaterialStack(Materials.Hydrogen, 6), + new MaterialStack(Materials.Oxygen, 2)) + .constructMaterial(); // C4H6O2 + public static Materials NickelAluminide = new MaterialBuilder(772, TextureSet.SET_METALLIC, "Nickel Aluminide") + .setName("NickelAluminide") + .addDustItems() + .addMetalItems() + .setRGB(230, 230, 230) + .setColor(Dyes.dyeGray) + .setMeltingPoint(1668) + .setBlastFurnaceTemp(1668) + .setBlastFurnaceRequired(true) + .setMaterialList(new MaterialStack(Materials.Nickel, 1), new MaterialStack(Materials.Aluminium, 3)) + .constructMaterial() + .disableAutoGeneratedBlastFurnaceRecipes(); // NiAl3 + public static Materials RaneyNickelActivated = new MaterialBuilder(771, TextureSet.SET_POWDER, "Raney Nickel") + .setName("RaneyNickelActivated") + .addDustItems() + .setRGB(230, 230, 230) + .setColor(Dyes.dyeGray) + .setMeltingPoint(1955) + .setMaterialList(new MaterialStack(Materials.Nickel, 1), new MaterialStack(Materials.Aluminium, 1)) + .constructMaterial(); // NiAl + public static Materials BismuthIIIOxide = new MaterialBuilder(769, TextureSet.SET_POWDER, "Bismuth Oxide") + .setName("BismuthIIIOxide") + .addDustItems() + .setRGB(50, 50, 50) + .setColor(Dyes.dyeBlack) + .setMeltingPoint(1090) + .setMaterialList(new MaterialStack(Materials.Bismuth, 2), new MaterialStack(Materials.Oxygen, 3)) + .constructMaterial(); // Bi2O3 + public static Materials ThionylChloride = new MaterialBuilder(768, TextureSet.SET_FLUID, "Thionyl Chloride") + .setName("ThionylChloride") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .constructMaterial(); // SOCl2 + public static Materials SulfurDichloride = new MaterialBuilder(767, TextureSet.SET_FLUID, "Sulfur Dichloride") + .setName("SulfurDichloride") + .addCell() + .addFluid() + .setRGB(200, 0, 0) + .setColor(Dyes.dyeRed) + .constructMaterial(); // SCl2 public static Materials DimethylTerephthalate = new MaterialBuilder( - 766, - TextureSet.SET_FLUID, - "Dimethyl Terephthalate").setName("DimethylTerephthalate") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(415) - .setMaterialList( - new MaterialStack(Materials.Carbon, 10), - new MaterialStack(Materials.Hydrogen, 10), - new MaterialStack(Materials.Oxygen, 4)) - .constructMaterial(); // C10H10O4 + 766, + TextureSet.SET_FLUID, + "Dimethyl Terephthalate").setName("DimethylTerephthalate") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(415) + .setMaterialList( + new MaterialStack(Materials.Carbon, 10), + new MaterialStack(Materials.Hydrogen, 10), + new MaterialStack(Materials.Oxygen, 4)) + .constructMaterial(); // C10H10O4 public static Materials Kevlar = new MaterialBuilder(765, TextureSet.SET_DULL, "Kevlar").setName("Kevlar") - .addDustItems() - .addMetalItems() - .addGearItems() - .setRGB(240, 240, 120) - .setColor(Dyes.dyeYellow) - .constructMaterial(); - public static Materials TerephthalicAcid = new MaterialBuilder( - 764, - TextureSet.SET_FLUID, - "Terephthalic Acid").setName("TerephthalicAcid") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(480) - .setMaterialList( - new MaterialStack(Materials.Carbon, 8L), - new MaterialStack(Materials.Hydrogen, 6), - new MaterialStack(Materials.Oxygen, 4)) - .constructMaterial(); // C9H6O6 - public static Materials IIIDimethylbenzene = new MaterialBuilder( - 763, - TextureSet.SET_FLUID, - "1,3-Dimethylbenzen").addCell() - .addFluid() - .setRGB(112, 146, 74) - .setColor(Dyes.dyeLime) - .setMeltingPoint(225) - .setMaterialList( - new MaterialStack(Materials.Carbon, 8), - new MaterialStack(Materials.Hydrogen, 10)) - .addElectrolyzerRecipe() - .constructMaterial(); // C8H10 - public static Materials IVDimethylbenzene = new MaterialBuilder( - 762, - TextureSet.SET_FLUID, - "1,4-Dimethylbenzen").addCell() - .addFluid() - .setRGB(122, 136, 84) - .setColor(Dyes.dyeLime) - .setMeltingPoint(286) - .setMaterialList( - new MaterialStack(Materials.Carbon, 8), - new MaterialStack(Materials.Hydrogen, 10)) - .addElectrolyzerRecipe() - .constructMaterial(); // C8H10 - public static Materials CobaltIINaphthenate = new MaterialBuilder( - 761, - TextureSet.SET_DULL, - "Cobalt II Naphthenate").setName("Cobalt(II)Naphthenate") - .addDustItems() - .setRGB(143, 95, 39) - .setColor(Dyes.dyeBrown) - .setMeltingPoint(413) - .setMaterialList( - new MaterialStack(Materials.Cobalt, 1), - new MaterialStack(Materials.Carbon, 22), - new MaterialStack(Materials.Hydrogen, 14), - new MaterialStack(Materials.Oxygen, 4)) - .constructMaterial(); // CoC22H14O4 - public static Materials NaphthenicAcid = new MaterialBuilder( - 760, - TextureSet.SET_FLUID, - "Naphthenic Acid").setName("NaphthenicAcid") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setFuelType(MaterialBuilder.SEMIFLUID) - .setFuelPower(80) - .constructMaterial(); - public static Materials CobaltIIHydroxide = new MaterialBuilder( - 759, - TextureSet.SET_POWDER, - "Cobalt II Hydroxide").setName("CobaltIIHydroxide") - .addDustItems() - .setRGB(229, 140, 239) - .setColor(Dyes.dyePurple) - .setMeltingPoint(441) - .setMaterialList( - new MaterialStack(Materials.Cobalt, 1), - new MaterialStack(Materials.Hydrogen, 2), - new MaterialStack(Materials.Oxygen, 2)) - .constructMaterial(); // CoH2O2 - public static Materials CobaltIIAcetate = new MaterialBuilder( - 758, - TextureSet.SET_POWDER, - "Cobalt II Acetate").setName("Cobalt(II)Acetate") - .addDustItems() - .setRGB(219, 162, 229) - .setColor(Dyes.dyePurple) - .setMeltingPoint(413) - .setMaterialList( - new MaterialStack(Materials.Carbon, 4L), - new MaterialStack(Materials.Hydrogen, 6), - new MaterialStack(Materials.Cobalt, 1), - new MaterialStack(Materials.Oxygen, 4)) - .constructMaterial(); // C4H6CoO4 - public static Materials CobaltIINitrate = new MaterialBuilder( - 757, - TextureSet.SET_POWDER, - "Cobalt II Nitrate").setName("Cobalt(II)Nitrate") - .addDustItems() - .setRGB(170, 0, 0) - .setColor(Dyes.dyeRed) - .setMeltingPoint(373) - .setMaterialList( - new MaterialStack(Materials.Cobalt, 1), - new MaterialStack(Materials.Nitrogen, 2), - new MaterialStack(Materials.Oxygen, 6)) - .constructMaterial(); // Co(NO3)2 + .addDustItems() + .addMetalItems() + .addGearItems() + .setRGB(240, 240, 120) + .setColor(Dyes.dyeYellow) + .constructMaterial(); + public static Materials TerephthalicAcid = new MaterialBuilder(764, TextureSet.SET_FLUID, "Terephthalic Acid") + .setName("TerephthalicAcid") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(480) + .setMaterialList( + new MaterialStack(Materials.Carbon, 8L), + new MaterialStack(Materials.Hydrogen, 6), + new MaterialStack(Materials.Oxygen, 4)) + .constructMaterial(); // C9H6O6 + public static Materials IIIDimethylbenzene = new MaterialBuilder(763, TextureSet.SET_FLUID, "1,3-Dimethylbenzen") + .addCell() + .addFluid() + .setRGB(112, 146, 74) + .setColor(Dyes.dyeLime) + .setMeltingPoint(225) + .setMaterialList(new MaterialStack(Materials.Carbon, 8), new MaterialStack(Materials.Hydrogen, 10)) + .addElectrolyzerRecipe() + .constructMaterial(); // C8H10 + public static Materials IVDimethylbenzene = new MaterialBuilder(762, TextureSet.SET_FLUID, "1,4-Dimethylbenzen") + .addCell() + .addFluid() + .setRGB(122, 136, 84) + .setColor(Dyes.dyeLime) + .setMeltingPoint(286) + .setMaterialList(new MaterialStack(Materials.Carbon, 8), new MaterialStack(Materials.Hydrogen, 10)) + .addElectrolyzerRecipe() + .constructMaterial(); // C8H10 + public static Materials CobaltIINaphthenate = new MaterialBuilder(761, TextureSet.SET_DULL, "Cobalt II Naphthenate") + .setName("Cobalt(II)Naphthenate") + .addDustItems() + .setRGB(143, 95, 39) + .setColor(Dyes.dyeBrown) + .setMeltingPoint(413) + .setMaterialList( + new MaterialStack(Materials.Cobalt, 1), + new MaterialStack(Materials.Carbon, 22), + new MaterialStack(Materials.Hydrogen, 14), + new MaterialStack(Materials.Oxygen, 4)) + .constructMaterial(); // CoC22H14O4 + public static Materials NaphthenicAcid = new MaterialBuilder(760, TextureSet.SET_FLUID, "Naphthenic Acid") + .setName("NaphthenicAcid") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setFuelType(MaterialBuilder.SEMIFLUID) + .setFuelPower(80) + .constructMaterial(); + public static Materials CobaltIIHydroxide = new MaterialBuilder(759, TextureSet.SET_POWDER, "Cobalt II Hydroxide") + .setName("CobaltIIHydroxide") + .addDustItems() + .setRGB(229, 140, 239) + .setColor(Dyes.dyePurple) + .setMeltingPoint(441) + .setMaterialList( + new MaterialStack(Materials.Cobalt, 1), + new MaterialStack(Materials.Hydrogen, 2), + new MaterialStack(Materials.Oxygen, 2)) + .constructMaterial(); // CoH2O2 + public static Materials CobaltIIAcetate = new MaterialBuilder(758, TextureSet.SET_POWDER, "Cobalt II Acetate") + .setName("Cobalt(II)Acetate") + .addDustItems() + .setRGB(219, 162, 229) + .setColor(Dyes.dyePurple) + .setMeltingPoint(413) + .setMaterialList( + new MaterialStack(Materials.Carbon, 4L), + new MaterialStack(Materials.Hydrogen, 6), + new MaterialStack(Materials.Cobalt, 1), + new MaterialStack(Materials.Oxygen, 4)) + .constructMaterial(); // C4H6CoO4 + public static Materials CobaltIINitrate = new MaterialBuilder(757, TextureSet.SET_POWDER, "Cobalt II Nitrate") + .setName("Cobalt(II)Nitrate") + .addDustItems() + .setRGB(170, 0, 0) + .setColor(Dyes.dyeRed) + .setMeltingPoint(373) + .setMaterialList( + new MaterialStack(Materials.Cobalt, 1), + new MaterialStack(Materials.Nitrogen, 2), + new MaterialStack(Materials.Oxygen, 6)) + .constructMaterial(); // Co(NO3)2 public static Materials OrganorhodiumCatalyst = new MaterialBuilder( - 756, - TextureSet.SET_POWDER, - "Organorhodium Catalyst").setName("OrganorhodiumCatalyst") - .addDustItems() - .setRGB(170, 0, 0) - .setColor(Dyes.dyeRed) - .setMeltingPoint(373) - .setMaterialList( - new MaterialStack(Materials.Cobalt, 1), - new MaterialStack(Materials.NitricAcid, 2)) - .constructMaterial(); // RhHCO(P(C6H5)3)3 - public static Materials SodiumBorohydride = new MaterialBuilder( - 755, - TextureSet.SET_POWDER, - "Sodium Borohydride").setName("SodiumBorohydride") - .addDustItems() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(673) - .setMaterialList( - new MaterialStack(Materials.Sodium, 1), - new MaterialStack(Materials.Boron, 1), - new MaterialStack(Materials.Hydrogen, 4)) - .constructMaterial(); // NaBH4 - public static Materials RhodiumChloride = new MaterialBuilder( - 754, - TextureSet.SET_POWDER, - "Rhodium Chloride").setName("RhodiumChloride") - .addDustItems() - .setRGB(128, 0, 0) - .setColor(Dyes.dyeRed) - .setMeltingPoint(723) - .constructMaterial(); // RHCL3 - public static Materials Triphenylphosphene = new MaterialBuilder( - 753, - TextureSet.SET_POWDER, - "Triphenylphosphine").setName("Triphenylphosphene") - .addDustItems() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(353) - .setMaterialList( - new MaterialStack(Materials.Carbon, 18L), - new MaterialStack(Materials.Hydrogen, 15L), - new MaterialStack(Materials.Phosphorus, 1L)) - .constructMaterial(); // C18H15P + 756, + TextureSet.SET_POWDER, + "Organorhodium Catalyst").setName("OrganorhodiumCatalyst") + .addDustItems() + .setRGB(170, 0, 0) + .setColor(Dyes.dyeRed) + .setMeltingPoint(373) + .setMaterialList(new MaterialStack(Materials.Cobalt, 1), new MaterialStack(Materials.NitricAcid, 2)) + .constructMaterial(); // RhHCO(P(C6H5)3)3 + public static Materials SodiumBorohydride = new MaterialBuilder(755, TextureSet.SET_POWDER, "Sodium Borohydride") + .setName("SodiumBorohydride") + .addDustItems() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(673) + .setMaterialList( + new MaterialStack(Materials.Sodium, 1), + new MaterialStack(Materials.Boron, 1), + new MaterialStack(Materials.Hydrogen, 4)) + .constructMaterial(); // NaBH4 + public static Materials RhodiumChloride = new MaterialBuilder(754, TextureSet.SET_POWDER, "Rhodium Chloride") + .setName("RhodiumChloride") + .addDustItems() + .setRGB(128, 0, 0) + .setColor(Dyes.dyeRed) + .setMeltingPoint(723) + .constructMaterial(); // RHCL3 + public static Materials Triphenylphosphene = new MaterialBuilder(753, TextureSet.SET_POWDER, "Triphenylphosphine") + .setName("Triphenylphosphene") + .addDustItems() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(353) + .setMaterialList( + new MaterialStack(Materials.Carbon, 18L), + new MaterialStack(Materials.Hydrogen, 15L), + new MaterialStack(Materials.Phosphorus, 1L)) + .constructMaterial(); // C18H15P public static Materials PhosphorusTrichloride = new MaterialBuilder( - 752, - TextureSet.SET_FLUID, - "Phosphorus Trichloride").setName("PhosphorusTrichloride") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(179) - .setMaterialList( - new MaterialStack(Materials.Phosphorus, 1L), - new MaterialStack(Materials.Chlorine, 3L)) - .constructMaterial(); // PCL3 - public static Materials SodiumHydride = new MaterialBuilder( - 751, - TextureSet.SET_POWDER, - "Sodium Hydride").setName("SodiumHydride") - .addDustItems() - .setRGB(192, 192, 192) - .setColor(Dyes.dyeLightGray) - .setMeltingPoint(911) - .setMaterialList( - new MaterialStack(Materials.Sodium, 1L), - new MaterialStack(Materials.Hydrogen, 1L)) - .constructMaterial(); // NaH - public static Materials TrimethylBorate = new MaterialBuilder( - 750, - TextureSet.SET_FLUID, - "Trimethyl Borate").setName("TrimethylBorate") - .addCell() - .addFluid() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(239) - .setMaterialList( - new MaterialStack(Materials.Carbon, 3L), - new MaterialStack(Materials.Hydrogen, 9L), - new MaterialStack(Materials.Boron, 1L), - new MaterialStack(Materials.Oxygen, 3L)) - .constructMaterial(); // C3H9BO3 - public static Materials SodiumMethoxide = new MaterialBuilder( - 749, - TextureSet.SET_POWDER, - "Sodium Methoxide").setName("SodiumMethoxide") - .addDustItems() - .setRGB(255, 255, 255) - .setColor(Dyes.dyeWhite) - .setMeltingPoint(400) - .setMaterialList( - new MaterialStack(Materials.Carbon, 1L), - new MaterialStack(Materials.Hydrogen, 3L), - new MaterialStack(Materials.Oxygen, 1L), - new MaterialStack(Materials.Sodium, 1L)) - .constructMaterial(); // CH3NaO + 752, + TextureSet.SET_FLUID, + "Phosphorus Trichloride").setName("PhosphorusTrichloride") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(179) + .setMaterialList(new MaterialStack(Materials.Phosphorus, 1L), new MaterialStack(Materials.Chlorine, 3L)) + .constructMaterial(); // PCL3 + public static Materials SodiumHydride = new MaterialBuilder(751, TextureSet.SET_POWDER, "Sodium Hydride") + .setName("SodiumHydride") + .addDustItems() + .setRGB(192, 192, 192) + .setColor(Dyes.dyeLightGray) + .setMeltingPoint(911) + .setMaterialList(new MaterialStack(Materials.Sodium, 1L), new MaterialStack(Materials.Hydrogen, 1L)) + .constructMaterial(); // NaH + public static Materials TrimethylBorate = new MaterialBuilder(750, TextureSet.SET_FLUID, "Trimethyl Borate") + .setName("TrimethylBorate") + .addCell() + .addFluid() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(239) + .setMaterialList( + new MaterialStack(Materials.Carbon, 3L), + new MaterialStack(Materials.Hydrogen, 9L), + new MaterialStack(Materials.Boron, 1L), + new MaterialStack(Materials.Oxygen, 3L)) + .constructMaterial(); // C3H9BO3 + public static Materials SodiumMethoxide = new MaterialBuilder(749, TextureSet.SET_POWDER, "Sodium Methoxide") + .setName("SodiumMethoxide") + .addDustItems() + .setRGB(255, 255, 255) + .setColor(Dyes.dyeWhite) + .setMeltingPoint(400) + .setMaterialList( + new MaterialStack(Materials.Carbon, 1L), + new MaterialStack(Materials.Hydrogen, 3L), + new MaterialStack(Materials.Oxygen, 1L), + new MaterialStack(Materials.Sodium, 1L)) + .constructMaterial(); // CH3NaO // H3RhCl6 diff --git a/src/main/java/gregtech/api/enums/MaterialsOreAlum.java b/src/main/java/gregtech/api/enums/MaterialsOreAlum.java index 12c03396fc..270d794f94 100644 --- a/src/main/java/gregtech/api/enums/MaterialsOreAlum.java +++ b/src/main/java/gregtech/api/enums/MaterialsOreAlum.java @@ -2,89 +2,73 @@ package gregtech.api.enums; public class MaterialsOreAlum { - public static Materials BauxiteSlurry = new MaterialBuilder( - 409, - TextureSet.SET_FLUID, - "Bauxite Slurry").setName("BauxiteSlurry") - .addCell() - .addFluid() - .setRGB(37, 67, 168) - .setMeltingPoint(295) - .setColor(Dyes.dyeBlue) - .constructMaterial(); + public static Materials BauxiteSlurry = new MaterialBuilder(409, TextureSet.SET_FLUID, "Bauxite Slurry") + .setName("BauxiteSlurry") + .addCell() + .addFluid() + .setRGB(37, 67, 168) + .setMeltingPoint(295) + .setColor(Dyes.dyeBlue) + .constructMaterial(); public static Materials HeatedBauxiteSlurry = new MaterialBuilder( - 410, - TextureSet.SET_FLUID, - "Heated Bauxite Slurry").setName("HeadedBauxiteSlurry") - .addCell() - .addFluid() - .setRGB(55, 92, 212) - .setLiquidTemperature(533) - .setMeltingPoint(295) - .setColor(Dyes.dyeBlue) - .constructMaterial(); - public static Materials SluiceJuice = new MaterialBuilder( - 411, - TextureSet.SET_FLUID, - "Sluice Juice").setName("SluiceJuice") - .addCell() - .addFluid() - .setRGB(92, 60, 36) - .setLiquidTemperature(295) - .setMeltingPoint(295) - .setColor(Dyes.dyeGray) - .constructMaterial(); - public static Materials SluiceSand = new MaterialBuilder( - 412, - TextureSet.SET_FINE, - "Sluice Sand").setName("SluiceSand") - .addDustItems() - .setRGB(165, 165, 120) - .setColor(Dyes.dyeGray) - .constructMaterial(); - public static Materials BauxiteSlag = new MaterialBuilder( - 413, - TextureSet.SET_FINE, - "Bauxite Slag").setName("BauxiteSlag") - .addDustItems() - .setRGB(110, 31, 31) - .setColor(Dyes.dyeRed) - .constructMaterial(); - public static Materials IlmeniteSlag = new MaterialBuilder( - 414, - TextureSet.SET_FINE, - "Ilmenite Slag").setName("IlmeniteSlag") - .addDustItems() - .setRGB(163, 38, 38) - .setColor(Dyes.dyeBrown) - .constructMaterial(); - public static Materials GreenSapphireJuice = new MaterialBuilder( - 415, - TextureSet.SET_FLUID, - "Green Sapphire Juice").setName("GreenSapphireJuice") - .addCell() - .addFluid() - .setRGB(100, 200, 130) - .setColor(Dyes.dyeGreen) - .constructMaterial(); - public static Materials SapphireJuice = new MaterialBuilder( - 416, - TextureSet.SET_FLUID, - "Sapphire Juice").setName("SapphireJuice") - .addCell() - .addFluid() - .setRGB(100, 100, 200) - .setColor(Dyes.dyeBlue) - .constructMaterial(); - public static Materials RubyJuice = new MaterialBuilder( - 417, - TextureSet.SET_FLUID, - "Ruby Juice").setName("RubyJuice") - .addCell() - .addFluid() - .setRGB(255, 100, 100) - .setColor(Dyes.dyeRed) - .constructMaterial(); + 410, + TextureSet.SET_FLUID, + "Heated Bauxite Slurry").setName("HeadedBauxiteSlurry") + .addCell() + .addFluid() + .setRGB(55, 92, 212) + .setLiquidTemperature(533) + .setMeltingPoint(295) + .setColor(Dyes.dyeBlue) + .constructMaterial(); + public static Materials SluiceJuice = new MaterialBuilder(411, TextureSet.SET_FLUID, "Sluice Juice") + .setName("SluiceJuice") + .addCell() + .addFluid() + .setRGB(92, 60, 36) + .setLiquidTemperature(295) + .setMeltingPoint(295) + .setColor(Dyes.dyeGray) + .constructMaterial(); + public static Materials SluiceSand = new MaterialBuilder(412, TextureSet.SET_FINE, "Sluice Sand") + .setName("SluiceSand") + .addDustItems() + .setRGB(165, 165, 120) + .setColor(Dyes.dyeGray) + .constructMaterial(); + public static Materials BauxiteSlag = new MaterialBuilder(413, TextureSet.SET_FINE, "Bauxite Slag") + .setName("BauxiteSlag") + .addDustItems() + .setRGB(110, 31, 31) + .setColor(Dyes.dyeRed) + .constructMaterial(); + public static Materials IlmeniteSlag = new MaterialBuilder(414, TextureSet.SET_FINE, "Ilmenite Slag") + .setName("IlmeniteSlag") + .addDustItems() + .setRGB(163, 38, 38) + .setColor(Dyes.dyeBrown) + .constructMaterial(); + public static Materials GreenSapphireJuice = new MaterialBuilder(415, TextureSet.SET_FLUID, "Green Sapphire Juice") + .setName("GreenSapphireJuice") + .addCell() + .addFluid() + .setRGB(100, 200, 130) + .setColor(Dyes.dyeGreen) + .constructMaterial(); + public static Materials SapphireJuice = new MaterialBuilder(416, TextureSet.SET_FLUID, "Sapphire Juice") + .setName("SapphireJuice") + .addCell() + .addFluid() + .setRGB(100, 100, 200) + .setColor(Dyes.dyeBlue) + .constructMaterial(); + public static Materials RubyJuice = new MaterialBuilder(417, TextureSet.SET_FLUID, "Ruby Juice") + .setName("RubyJuice") + .addCell() + .addFluid() + .setRGB(255, 100, 100) + .setColor(Dyes.dyeRed) + .constructMaterial(); /** * called by Materials. Can be safely called multiple times. exists to allow Materials ensure this class is diff --git a/src/main/java/gregtech/api/enums/Mods.java b/src/main/java/gregtech/api/enums/Mods.java index fa0b9ed910..cb380cca48 100644 --- a/src/main/java/gregtech/api/enums/Mods.java +++ b/src/main/java/gregtech/api/enums/Mods.java @@ -302,7 +302,7 @@ public enum Mods { public String getResourcePath(String... path) { return this.getResourceLocation(path) - .toString(); + .toString(); } public ResourceLocation getResourceLocation(String... path) { diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 8d3201f6ca..3e5f694d2a 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -27,310 +27,310 @@ public enum OrePrefixes { @Deprecated pulp("Pulps", "", "", false, false, false, false, false, false, false, false, false, false, - B[0] | B[1] | B[2] | B[3], -1, 64, -1), + B[0] | B[1] | B[2] | B[3], -1, 64, -1), @Deprecated leaves("Leaves", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), @Deprecated sapling("Saplings", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), @Deprecated itemDust("Dusts", "", "", false, false, false, false, false, false, false, false, false, false, - B[0] | B[1] | B[2] | B[3], -1, 64, -1), + B[0] | B[1] | B[2] | B[3], -1, 64, -1), /** In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! */ oreBlackgranite("Black Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, - false, true, B[3], -1, 64, -1), + false, true, B[3], -1, 64, -1), /** In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! */ oreRedgranite("Red Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, - true, B[3], -1, 64, -1), + true, B[3], -1, 64, -1), /** In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! */ oreMarble("Marble Ores", "Marble ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), /** In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! */ oreBasalt("Basalt Ores", "Basalt ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), /** Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation! */ oreNetherrack("Netherrack Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, - true, B[3], -1, 64, -1), + true, B[3], -1, 64, -1), /** Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation! */ oreNether("Nether Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), @Deprecated denseore("Dense Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, - -1), + -1), /** Prefix of the Dense-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation! */ oreDense("Dense Ores", "Dense ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, - 64, -1), + 64, -1), /** Prefix of TFC */ oreRich("Rich Ores", "Rich ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, - 64, -1), + 64, -1), /** Prefix of TFC */ oreNormal("Normal Ores", "Normal ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), /** Prefix of Railcraft. */ oreSmall("Small Ores", "Small ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, - 64, 67), + 64, 67), /** Prefix of Railcraft. */ orePoor("Poor Ores", "Poor ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, - 64, -1), + 64, -1), /** In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! */ oreEndstone("Endstone Ores", "End ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), /** In case of an End-Ores Mod. Ore -> Material is a Oneway Operation! */ oreEnd("End Ores", "End ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, - -1), + -1), @Deprecated oreGem("Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), /** Regular Ore Prefix. Ore -> Material is a Oneway Operation! Introduced by Eloraam */ ore("Ores", "", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, 68), crushedCentrifuged("Centrifuged Ores", "Centrifuged ", " Ore", true, true, false, false, false, false, false, true, - false, true, B[3], -1, 64, 7), + false, true, B[3], -1, 64, 7), crushedPurified("Purified Ores", "Purified ", " Ore", true, true, false, false, false, false, false, true, false, - true, B[3], -1, 64, 6), + true, B[3], -1, 64, 6), crushed("Crushed Ores", "Crushed ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], - -1, 64, 5), + -1, 64, 5), /** Introduced by Mekanism */ shard("Crystallised Shards", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, - 64, -1), + 64, -1), clump("Clumps", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1), reduced("Reduced Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, - -1), + -1), crystalline("Crystallised Metals", "", "", true, true, false, false, false, false, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), cleanGravel("Clean Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, - 64, -1), + 64, -1), dirtyGravel("Dirty Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, - 64, -1), + 64, -1), /** A quintuple Ingot. */ ingotQuintuple("5x Ingots", "Quintuple ", " Ingot", true, true, false, false, false, false, true, true, false, - false, B[1], M * 5, 64, 16), + false, B[1], M * 5, 64, 16), /** A quadruple Ingot. */ ingotQuadruple("4x Ingots", "Quadruple ", " Ingot", true, true, false, false, false, false, true, true, false, - false, B[1], M * 4, 64, 15), + false, B[1], M * 4, 64, 15), @Deprecated ingotQuad("4x Ingots", "Quadruple ", " Ingot", false, false, false, false, false, false, false, false, false, false, - B[1], -1, 64, 15), + B[1], -1, 64, 15), /** A triple Ingot. */ ingotTriple("3x Ingots", "Triple ", " Ingot", true, true, false, false, false, false, true, false, false, false, - B[1], M * 3, 64, 14), + B[1], M * 3, 64, 14), /** A double Ingot. Introduced by TerraFirmaCraft */ ingotDouble("2x Ingots", "Double ", " Ingot", true, true, false, false, false, false, true, true, false, false, - B[1], M * 2, 64, 13), + B[1], M * 2, 64, 13), /** A hot Ingot, which has to be cooled down by a Vacuum Freezer. */ ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], - M * 1, 64, 12), + M * 1, 64, 12), /** A regular Ingot. Introduced by Eloraam */ ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, - 11), + 11), /** A regular Gem worth one small Dust. Introduced by TerraFirmaCraft */ gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, - B[2], M / 4, 64, 59), + B[2], M / 4, 64, 59), /** A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft */ gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], - M / 2, 64, 60), + M / 2, 64, 60), /** A regular Gem worth two Dusts. Introduced by TerraFirmaCraft */ gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, - B[2], M * 2, 64, 61), + B[2], M * 2, 64, 61), /** A regular Gem worth four Dusts. Introduced by TerraFirmaCraft */ gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, - false, B[2], M * 4, 64, 62), + false, B[2], M * 4, 64, 62), /** A regular Gem worth one Dust. Introduced by Eloraam */ gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), @Deprecated dustDirty("Impure Dusts", "", "", false, false, false, false, false, false, false, false, false, true, B[3], -1, 64, - 3), + 3), /** 1/9th of a Dust. */ dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, - B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), + B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), /** 1/4th of a Dust. */ dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, - false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), + false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), /** Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material */ dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, - true, B[3], M * 1, 64, 3), + true, B[3], M * 1, 64, 3), dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, - false, true, B[3], M * 1, 64, 2), + false, true, B[3], M * 1, 64, 2), dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, - true, B[3], M * 1, 64, 4), + true, B[3], M * 1, 64, 4), /** Pure Dust worth of one Ingot or Gem. Introduced by Alblaka. */ dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, - B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), + B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), /** A Nugget. Introduced by Eloraam */ nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, - 9), + 9), /** Special Alloys have this prefix. */ plateAlloy("Alloy Plates", "", "", true, false, false, false, false, false, false, false, false, false, B[1], -1, - 64, 17), + 64, 17), plateSteamcraft("Steamcraft Plates", "", "", false, false, false, false, false, false, false, false, false, false, - B[1], -1, 64, 17), + B[1], -1, 64, 17), /** 9 Plates combined in one Item. */ plateDense("Dense Plates", "Dense ", " Plate", true, true, false, false, false, false, true, true, false, false, - B[1], M * 9, 64, 22), + B[1], M * 9, 64, 22), plateQuintuple("5x Plates", "Quintuple ", " Plate", true, true, false, false, false, false, true, true, false, - false, B[1], M * 5, 64, 21), + false, B[1], M * 5, 64, 21), plateQuadruple("4x Plates", "Quadruple ", " Plate", true, true, false, false, false, false, true, true, false, - false, B[1], M * 4, 64, 20), + false, B[1], M * 4, 64, 20), @Deprecated plateQuad("4x Plates", "", "", false, false, false, false, false, false, false, false, false, false, B[1], -1, 64, - 20), + 20), plateTriple("3x Plates", "Triple ", " Plate", true, true, false, false, false, false, true, true, false, false, - B[1], M * 3, 64, 19), + B[1], M * 3, 64, 19), plateDouble("2x Plates", "Double ", " Plate", true, true, false, false, false, false, true, true, false, false, - B[1], M * 2, 64, 18), + B[1], M * 2, 64, 18), /** Regular Plate made of one Ingot/Dust. Introduced by Calclavia */ plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, - 64, 17), + 64, 17), /** Casing made of 1/2 Ingot/Dust */ itemCasing("Casings", "", " Casing", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], - M / 2, 64, 10), + M / 2, 64, 10), /** Foil made of 1/4 Ingot/Dust. */ foil("Foils", "", " Foil", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 29), /** Stick made of an Ingot. */ stickLong("Long Sticks/Rods", "Long ", " Rod", true, true, false, false, false, false, true, true, false, false, - B[1] | B[2], M * 1, 64, 54), + B[1] | B[2], M * 1, 64, 54), /** Stick made of half an Ingot. Introduced by Eloraam */ stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], - M / 2, 64, 23), + M / 2, 64, 23), /** consisting out of one Nugget. */ round("Rounds", "", " Round", true, true, false, false, false, false, true, true, false, false, B[1], M / 9, 64, - 25), + 25), /** consisting out of 1/8 Ingot or 1/4 Stick. */ bolt("Bolts", "", " Bolt", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 8, 64, - 26), + 26), /** contain dusts */ comb("Combs", "", " Comb", false, false, false, false, false, false, false, true, false, false, B[1] | B[2], M, 64, - 101), + 101), /** consisting out of a Bolt. */ screw("Screws", "", " Screw", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 9, - 64, 27), + 64, 27), /** consisting out of 1/2 Stick. */ ring("Rings", "", " Ring", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 28), /** consisting out of 1 Fine Wire. */ springSmall("Small Springs", "Small ", " Spring", true, true, false, false, false, false, true, true, false, false, - B[1], M / 4, 64, 55), + B[1], M / 4, 64, 55), /** consisting out of 2 Sticks. */ spring("Springs", "", " Spring", true, true, false, false, false, false, true, true, false, false, B[1], M * 1, 64, - 56), + 56), /** consisting out of 1/8 Ingot or 1/4 Wire. */ wireFine("Fine Wires", "Fine ", " Wire", true, true, false, false, false, false, true, true, false, false, B[1], - M / 8, 64, 51), + M / 8, 64, 51), /** consisting out of 4 Plates, 1 Ring and 1 Screw. */ rotor("Rotors", "", " Rotor", true, true, false, false, false, false, true, true, false, false, B[7], M * 4 + M / 4, - 64, 53), + 64, 53), gearGtSmall("Small Gears", "Small ", " Gear", true, true, false, false, false, false, true, true, false, false, - B[7], M * 1, 64, 52), + B[7], M * 1, 64, 52), /** Introduced by me because BuildCraft has ruined the gear Prefix... */ gearGt("Gears", "", " Gear", true, true, false, false, false, false, true, true, false, false, B[7], M * 4, 16, 63), /** 3/4 of a Plate or Gem used to shape a Lense. Normally only used on Transparent Materials. */ lens("Lenses", "", " Lens", true, true, false, false, false, false, true, true, false, false, B[2], (M * 3) / 4, 64, - 24), + 24), /** consisting out of 16 Dusts. */ crateGtDust("Crates of Dust", "Crate of ", " Dust", true, true, false, true, false, false, false, true, false, - false, B[0] | B[1] | B[2] | B[3], -1, 64, 96), + false, B[0] | B[1] | B[2] | B[3], -1, 64, 96), /** consisting out of 16 Plates. */ crateGtPlate("Crates of Plates", "Crate of ", " Plate", true, true, false, true, false, false, false, true, false, - false, B[1] | B[2], -1, 64, 99), + false, B[1] | B[2], -1, 64, 99), /** consisting out of 16 Ingots. */ crateGtIngot("Crates of Ingots", "Crate of ", " Ingot", true, true, false, true, false, false, false, true, false, - false, B[1], -1, 64, 97), + false, B[1], -1, 64, 97), /** consisting out of 16 Gems. */ crateGtGem("Crates of Gems", "Crate of ", " Gem", true, true, false, true, false, false, false, true, false, false, - B[2], -1, 64, 98), + B[2], -1, 64, 98), /** Hot Cell full of Plasma, which can be used in the Plasma Generator. */ cellPlasma("Cells of Plasma", "", " Plasma Cell", true, true, true, true, false, false, false, true, false, false, - B[5], M * 1, 64, 31), + B[5], M * 1, 64, 31), /** Hot Cell full of molten stuff, which can be used in the Plasma Generator. */ cellMolten("Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, - false, 0, M * 1, 64, 31), + false, 0, M * 1, 64, 31), /** Regular Gas/Fluid Cell. Introduced by Calclavia */ cell("Cells", "", " Cell", true, true, true, true, false, false, true, true, false, false, B[4] | B[8], M * 1, 64, - 30), + 30), /** A vanilla Iron Bucket filled with the Material. */ bucket("Buckets", "", " Bucket", true, true, true, true, false, false, true, false, false, false, B[4] | B[8], - M * 1, 64, -1), + M * 1, 64, -1), /** An Iguana Tweaks Clay Bucket filled with the Material. */ bucketClay("Clay Buckets", "", " Clay Bucket", true, true, true, true, false, false, true, false, false, false, - B[4] | B[8], M * 1, 64, -1), + B[4] | B[8], M * 1, 64, -1), /** Glass Bottle containing a Fluid. */ bottle("Bottles", "", " Bottle", true, true, true, true, false, false, false, false, false, false, B[4] | B[8], -1, - 64, -1), + 64, -1), capsule("Capsules", "", " Capsule", false, true, true, true, false, false, false, false, false, false, B[4] | B[8], - M * 1, 64, -1), + M * 1, 64, -1), crystal("Crystals", "", " Crystal", false, true, false, false, false, false, true, false, false, false, B[2], M * 1, - 64, -1), + 64, -1), bulletGtSmall("Small Bullets", "Small ", " Bullet", true, true, false, false, true, false, true, false, true, false, - B[6] | B[8], M / 9, 64, -1), + B[6] | B[8], M / 9, 64, -1), bulletGtMedium("Medium Bullets", "Medium ", " Bullet", true, true, false, false, true, false, true, false, true, - false, B[6] | B[8], M / 6, 64, -1), + false, B[6] | B[8], M / 6, 64, -1), bulletGtLarge("Large Bullets", "Large ", " Bullet", true, true, false, false, true, false, true, false, true, false, - B[6] | B[8], M / 3, 64, -1), + B[6] | B[8], M / 3, 64, -1), /** Arrow made of 1/4 Ingot/Dust + Wooden Stick. */ arrowGtWood("Regular Arrows", "", " Arrow", true, true, false, false, true, false, true, false, true, false, B[6], - M / 4, 64, 57), + M / 4, 64, 57), /** Arrow made of 1/4 Ingot/Dust + Plastic Stick. */ arrowGtPlastic("Light Arrows", "Light ", " Arrow", true, true, false, false, true, false, true, false, true, false, - B[6], M / 4, 64, 58), + B[6], M / 4, 64, 58), arrow("Arrows", "", "", false, false, true, false, false, false, false, false, true, false, B[6], -1, 64, 57), /** consisting out of 1/4 Ingot. */ toolHeadArrow("Arrow Heads", "", " Arrow Head", true, true, false, false, false, false, true, true, false, false, - B[6], M / 4, 64, 46), + B[6], M / 4, 64, 46), /** consisting out of 2 Ingots. */ toolHeadSword("Sword Blades", "", " Sword Blade", true, true, false, false, false, false, true, true, false, false, - B[6], M * 2, 64, 32), + B[6], M * 2, 64, 32), /** consisting out of 3 Ingots. */ toolHeadPickaxe("Pickaxe Heads", "", " Pickaxe Head", true, true, false, false, false, false, true, true, false, - false, B[6], M * 3, 64, 33), + false, B[6], M * 3, 64, 33), /** consisting out of 1 Ingots. */ toolHeadShovel("Shovel Heads", "", " Shovel Head", true, true, false, false, false, false, true, true, false, false, - B[6], M * 1, 64, 34), + B[6], M * 1, 64, 34), /** consisting out of 1 Ingots. */ toolHeadUniversalSpade("Universal Spade Heads", "", " Universal Spade Head", true, true, false, false, false, false, - true, true, false, false, B[6], M * 1, 64, 43), + true, true, false, false, B[6], M * 1, 64, 43), /** consisting out of 3 Ingots. */ toolHeadAxe("Axe Heads", "", " Axe Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 3, 64, 35), + M * 3, 64, 35), /** consisting out of 2 Ingots. */ toolHeadHoe("Hoe Heads", "", " Hoe Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 2, 64, 36), + M * 2, 64, 36), /** consisting out of 3 Ingots. */ toolHeadSense("Sense Blades", "", " Sense Blade", true, true, false, false, false, false, true, true, false, false, - B[6], M * 3, 64, 44), + B[6], M * 3, 64, 44), /** consisting out of 2 Ingots. */ toolHeadFile("File Heads", "", " File Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 2, 64, 38), + M * 2, 64, 38), /** consisting out of 6 Ingots. */ toolHeadHammer("Hammer Heads", "", " Hammer Head", true, true, false, false, false, false, true, true, false, false, - B[6], M * 6, 64, 37), + B[6], M * 6, 64, 37), /** consisting out of 4 Ingots. */ toolHeadPlow("Plow Heads", "", " Plow Head", true, true, false, false, false, false, true, true, false, false, B[6], - M * 4, 64, 45), + M * 4, 64, 45), /** consisting out of 2 Ingots. */ toolHeadSaw("Saw Blades", "", " Saw Blade", true, true, false, false, false, false, true, true, false, false, B[6], - M * 2, 64, 39), + M * 2, 64, 39), /** consisting out of 4 Ingots. */ toolHeadBuzzSaw("Buzzsaw Blades", "", " Buzzsaw Blade", true, true, false, false, false, false, true, true, false, - false, B[6], M * 4, 64, 48), + false, B[6], M * 4, 64, 48), /** consisting out of 1 Ingots. */ toolHeadScrewdriver("Screwdriver Tips", "", " Screwdriver Tip", true, true, false, false, false, false, true, false, - false, false, B[6], M * 1, 64, 47), + false, false, B[6], M * 1, 64, 47), /** consisting out of 4 Ingots. */ toolHeadDrill("Drill Tips", "", " Drill Tip", true, true, false, false, false, false, true, true, false, false, - B[6], M * 4, 64, 40), + B[6], M * 4, 64, 40), /** consisting out of 2 Ingots. */ toolHeadChainsaw("Chainsaw Tips", "", " Chainsaw Tip", true, true, false, false, false, false, true, true, false, - false, B[6], M * 2, 64, 41), + false, B[6], M * 2, 64, 41), /** consisting out of 4 Ingots. */ toolHeadWrench("Wrench Tips", "", " Wrench Tip", true, true, false, false, false, false, true, true, false, false, - B[6], M * 4, 64, 42), + B[6], M * 4, 64, 42), /** consisting out of 6 Ingots. */ turbineBlade("Turbine Blades", "", " Turbine Blade", true, true, false, false, false, false, true, true, false, - false, B[6], M * 6, 64, 100), + false, B[6], M * 6, 64, 100), /** vanilly Sword */ toolSword("Swords", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), /** vanilly Pickaxe */ toolPickaxe("Pickaxes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 3, 1, - -1), + -1), /** vanilly Shovel */ toolShovel("Shovels", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 1, 1, - -1), + -1), /** vanilly Axe */ toolAxe("Axes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 3, 1, -1), /** vanilly Hoe */ @@ -343,37 +343,37 @@ public enum OrePrefixes { */ tool("Tools", "", "", false, false, false, false, false, false, false, false, true, false, B[6], -1, 1, -1), compressedCobblestone("9^X Compressed Cobblestones", "", "", false, false, false, false, false, false, false, false, - false, false, 0, -1, 64, -1), + false, false, 0, -1, 64, -1), compressedStone("9^X Compressed Stones", "", "", false, false, false, false, false, false, false, false, false, - false, 0, -1, 64, -1), + false, 0, -1, 64, -1), compressedDirt("9^X Compressed Dirt", "", "", false, false, false, false, false, false, false, false, false, false, - 0, -1, 64, -1), + 0, -1, 64, -1), compressedGravel("9^X Compressed Gravel", "", "", false, false, false, false, false, false, false, false, false, - false, 0, -1, 64, -1), + false, 0, -1, 64, -1), compressedSand("9^X Compressed Sand", "", "", false, false, false, false, false, false, false, false, false, false, - 0, -1, 64, -1), + 0, -1, 64, -1), /** Compressed Material, worth 1 Unit. Introduced by Galacticraft */ compressed("Compressed Materials", "Compressed ", "", true, true, false, false, false, false, true, false, false, - false, 0, M * 3, 64, -1), + false, 0, M * 3, 64, -1), glass("Glasses", "", "", false, false, true, false, true, false, false, false, false, false, 0, -1, 64, -1), paneGlass("Glass Panes", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), blockGlass("Glass Blocks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), blockWool("Wool Blocks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), /** IGNORE */ block_("Random Blocks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), /** Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar */ block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, - 64, 71), + 64, 71), /** Special Prefix used mainly for the Crafting Handler. */ craftingTool("Crafting Tools", "", "", false, false, false, false, false, false, false, false, true, false, 0, -1, - 64, -1), + 64, -1), /** Special Prefix used mainly for the Crafting Handler. */ crafting("Crafting Ingredients", "", "", false, false, false, false, false, false, false, false, false, false, 0, - -1, 64, -1), + -1, 64, -1), /** Special Prefix used mainly for the Crafting Handler. */ craft("Crafting Stuff?", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), /** Prefix used for Logs. Usually as "logWood". Introduced by Eloraam */ log("Logs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), /** Prefix used for Slabs. Usually as "slabWood" or "slabStone". Introduced by SirSengir */ @@ -392,35 +392,35 @@ public enum OrePrefixes { tree("Tree Parts", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), /** Cobblestone Prefix for all Cobblestones. */ stoneCobble("Cobblestones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), /** Smoothstone Prefix. */ stoneSmooth("Smoothstones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), /** Mossy Stone Bricks. */ stoneMossyBricks("mossy Stone Bricks", "", "", false, false, true, false, false, true, false, false, false, false, - 0, -1, 64, -1), + 0, -1, 64, -1), /** Mossy Cobble. */ stoneMossy("Mossy Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), @Deprecated stoneBricksMossy("Mossy Stone Bricks", "", "", false, false, false, false, false, true, false, false, false, false, - 0, -1, 64, -1), + 0, -1, 64, -1), /** Stone Bricks. */ stoneBricks("Stone Bricks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), @Deprecated stoneBrick("Stone Bricks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), /** Cracked Bricks. */ stoneCracked("Cracked Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, - 64, -1), + 64, -1), /** Chiseled Stone. */ stoneChiseled("Chiseled Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, - 64, -1), + 64, -1), /** Prefix to determine which kind of Rock this is. */ stone("Stones", "", "", false, true, true, false, true, true, false, false, false, false, 0, -1, 64, -1), cobblestone("Cobblestones", "", "", false, true, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), /** Prefix to determine which kind of Rock this is. */ rock("Rocks", "", "", false, true, true, false, true, true, false, false, false, false, 0, -1, 64, -1), record("Records", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, 1, -1), @@ -439,69 +439,69 @@ public enum OrePrefixes { dye("Dyes", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, 64, -1), /** Used for the 16 colors of Stained Clay. Introduced by Forge */ stainedClay("Stained Clays", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, - -1), + -1), /** vanilly Helmet */ armorHelmet("Helmets", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 5, 1, - -1), + -1), /** vanilly Chestplate */ armorChestplate("Chestplates", "", "", false, true, false, false, false, false, true, false, true, false, B[6], - M * 8, 1, -1), + M * 8, 1, -1), /** vanilly Pants */ armorLeggings("Leggings", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 7, 1, - -1), + -1), /** vanilly Boots */ armorBoots("Boots", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 4, 1, -1), armor("Armor Parts", "", "", false, false, false, false, false, false, false, false, true, false, B[6], -1, 1, -1), frameGt("Frame Boxes", "", "", true, true, false, false, true, false, true, false, false, false, 0, M * 2, 64, 83), pipeTiny("Tiny Pipes", "Tiny ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, - 64, 78), + 64, 78), pipeSmall("Small Pipes", "Small ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, - M * 1, 64, 79), + M * 1, 64, 79), pipeMedium("Medium Pipes", "Medium ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, - M * 3, 64, 80), + M * 3, 64, 80), pipeLarge("Large pipes", "Large ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, - M * 6, 64, 81), + M * 6, 64, 81), pipeHuge("Huge Pipes", "Huge ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, - M * 12, 64, 82), + M * 12, 64, 82), pipeQuadruple("Quadruple Pipes", "Quadruple ", " Pipe", true, true, false, false, true, false, true, false, false, - false, 0, M * 12, 64, 84), + false, 0, M * 12, 64, 84), pipeNonuple("Nonuple Pipes", "Nonuple ", " Pipe", true, true, false, false, true, false, true, false, false, false, - 0, M * 9, 64, 85), + 0, M * 9, 64, 85), pipeRestrictiveTiny("Tiny Restrictive Pipes", "Tiny Restrictive ", " Pipe", true, true, false, false, true, false, - true, false, false, false, 0, M / 2, 64, 78), + true, false, false, false, 0, M / 2, 64, 78), pipeRestrictiveSmall("Small Restrictive Pipes", "Small Restrictive ", " Pipe", true, true, false, false, true, - false, true, false, false, false, 0, M * 1, 64, 79), + false, true, false, false, false, 0, M * 1, 64, 79), pipeRestrictiveMedium("Medium Restrictive Pipes", "Medium Restrictive ", " Pipe", true, true, false, false, true, - false, true, false, false, false, 0, M * 3, 64, 80), + false, true, false, false, false, 0, M * 3, 64, 80), pipeRestrictiveLarge("Large Restrictive Pipes", "Large Restrictive ", " Pipe", true, true, false, false, true, - false, true, false, false, false, 0, M * 6, 64, 81), + false, true, false, false, false, 0, M * 6, 64, 81), pipeRestrictiveHuge("Huge Restrictive Pipes", "Huge Restrictive ", " Pipe", true, true, false, false, true, false, - true, false, false, false, 0, M * 12, 64, 82), + true, false, false, false, 0, M * 12, 64, 82), pipe("Pipes", "", " Pipe", true, false, false, false, false, false, false, false, false, false, 0, -1, 64, 77), wireGt16("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, - 64, -1), + 64, -1), wireGt12("12x Wires", "12x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 6, - 64, -1), + 64, -1), wireGt08("8x Wires", "8x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 4, - 64, -1), + 64, -1), wireGt04("4x Wires", "4x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 2, - 64, -1), + 64, -1), wireGt02("2x Wires", "2x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 1, - 64, -1), + 64, -1), wireGt01("1x Wires", "1x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M / 2, - 64, -1), + 64, -1), cableGt16("16x Cables", "16x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, - M * 8, 64, -1), + M * 8, 64, -1), cableGt12("12x Cables", "12x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, - M * 6, 64, -1), + M * 6, 64, -1), cableGt08("8x Cables", "8x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 4, - 64, -1), + 64, -1), cableGt04("4x Cables", "4x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 2, - 64, -1), + 64, -1), cableGt02("2x Cables", "2x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 1, - 64, -1), + 64, -1), cableGt01("1x Cables", "1x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M / 2, - 64, -1), + 64, -1), /* * Electric Components. usual Materials for this are: Primitive (Tier 1) Basic (Tier 2) as used by UE as well : IC2 @@ -511,10 +511,10 @@ public enum OrePrefixes { * and Lapotronic Energy Orb Infinite (Cheaty) */ batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, - false, 0, -1, 64, -1), + false, 0, -1, 64, -1), /** Introduced by Calclavia */ battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, - 64, -1), + 64, -1), /** Introduced by Calclavia */ circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), /** Introduced by Buildcraft */ @@ -527,7 +527,7 @@ public enum OrePrefixes { plating("Platings", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), dinosaur("Dinosaurs", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), travelgear("Travel Gear", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), bauble("Baubles", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), cluster("Clusters", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), grafter("Grafters", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), @@ -553,17 +553,17 @@ public enum OrePrefixes { seed("Seeds", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), reed("Reeds", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), sheetDouble("2x Sheets", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), sheet("Sheets", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), crop("Crops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), plant("Plants", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), coin("Coins", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), lumar("Lumars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), ground("Grounded Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), cable("Cables", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), component("Components", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), wax("Waxes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), wall("Walls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), tube("Tubes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), @@ -588,11 +588,11 @@ public enum OrePrefixes { shears("Shears", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), turbine("Turbines", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), fertilizer("Fertilizers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), chest("Chests", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), raw("Raw Things", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), stainedGlass("Stained Glasses", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, - 64, -1), + 64, -1), mystic("Mystic Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), mana("Mana Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), rune("Runes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), @@ -602,13 +602,13 @@ public enum OrePrefixes { soulsand("Soulsands", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), obsidian("Obsidians", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), glowstone("Glowstones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), beans("Beans", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), br("br", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), essence("Essences", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), alloy("Alloys", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), cooking("Cooked Things", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, - -1), + -1), elven("Elven Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), reactor("Reactors", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), mffs("MFFS", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), @@ -619,53 +619,53 @@ public enum OrePrefixes { bar("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), /** Reverse Head consisting out of 6 Ingots. */ toolHeadMallet("Mallet Heads", "", " Mallet Head", true, true, false, false, false, false, true, true, false, false, - B[6], M * 6, 64, 127), + B[6], M * 6, 64, 127), /** Reverse Stick made of half an Ingot. Introduced by Eloraam */ handleMallet("Mallet Handle", "", " Handle", true, true, false, false, false, false, true, true, false, false, - B[1] | B[2], M / 2, 64, 126), + B[1] | B[2], M / 2, 64, 126), // Cracked fluids cellHydroCracked1("Cells", "Lightly Hydro-Cracked ", " Cell", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, 30), + false, false, 0, M * 1, 64, 30), cellHydroCracked2("Cells", "Moderately Hydro-Cracked ", " Cell", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, 30), + false, false, 0, M * 1, 64, 30), cellHydroCracked3("Cells", "Severely Hydro-Cracked ", " Cell", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, 30), + false, false, 0, M * 1, 64, 30), cellSteamCracked1("Cells", "Lightly Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, 30), + false, false, 0, M * 1, 64, 30), cellSteamCracked2("Cells", "Moderately Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, 30), + false, false, 0, M * 1, 64, 30), cellSteamCracked3("Cells", "Severely Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, 30), + false, false, 0, M * 1, 64, 30), componentCircuit("Circuit Parts", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, - 64, -1), + 64, -1), apiaryUpgrade("Industrial Apiary Upgrade", "", "", false, false, true, false, false, false, false, false, false, - false, 0, -1, 64, -1), + false, 0, -1, 64, -1), beeComb("Bee Combs", "", "", true, false, true, false, false, false, false, false, false, false, 0, -1, 64, -1), nanite("Nanites", "", " Nanites", true, true, true, false, false, false, false, false, false, false, 0, -1, 64, 50), // migrated from GT++ milled("Milled Ores", "Milled ", " Ore", true, true, false, false, false, false, false, false, false, true, B[3], - -1, 64, -1), + -1, 64, -1), // migrated from bartworks blockCasing("A Casing block for a Multiblock-Machine", "Bolted ", " Casing", true, true, true, true, false, true, - false, true, false, false, 0, M * 9, 64, -1), + false, true, false, false, 0, M * 9, 64, -1), blockCasingAdvanced("An Advanced Casing block for a Multiblock-Machine", "Rebolted ", " Casing", true, true, true, - true, false, true, false, true, false, false, 0, M * 9, 64, -1), + true, false, true, false, true, false, false, 0, M * 9, 64, -1), capsuleMolten("Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, - false, false, 0, M * 1, 64, -1); + false, false, 0, M * 1, 64, -1); public static final ImmutableList CELL_TYPES = ImmutableList.of( - cell, - cellMolten, - cellPlasma, - cellHydroCracked1, - cellHydroCracked2, - cellHydroCracked3, - cellSteamCracked1, - cellSteamCracked2, - cellSteamCracked3); + cell, + cellMolten, + cellPlasma, + cellHydroCracked1, + cellHydroCracked2, + cellHydroCracked3, + cellSteamCracked1, + cellSteamCracked2, + cellSteamCracked3); public static volatile int VERSION = 509; @@ -687,16 +687,16 @@ public enum OrePrefixes { cellPlasma.mHeatDamage = 6.0F; block.ignoreMaterials( - Materials.Ice, - Materials.Snow, - Materials.Concrete, - Materials.Glass, - Materials.Glowstone, - Materials.DarkIron, - Materials.Marble, - Materials.Quartz, - Materials.CertusQuartz, - Materials.Limestone); + Materials.Ice, + Materials.Snow, + Materials.Concrete, + Materials.Glass, + Materials.Glowstone, + Materials.DarkIron, + Materials.Marble, + Materials.Quartz, + Materials.CertusQuartz, + Materials.Limestone); ingot.ignoreMaterials(Materials.Brick, Materials.NetherBrick); dust.addFamiliarPrefix(dustTiny); @@ -710,10 +710,9 @@ public enum OrePrefixes { nugget.addFamiliarPrefix(ingot); for (OrePrefixes tPrefix1 : values()) if (tPrefix1.name() - .startsWith("ore")) + .startsWith("ore")) for (OrePrefixes tPrefix2 : values()) if (tPrefix2.name() - .startsWith("ore")) - tPrefix1.addFamiliarPrefix(tPrefix2); + .startsWith("ore")) tPrefix1.addFamiliarPrefix(tPrefix2); // These are only the important ones. gem.mNotGeneratedItems.add(Materials.Coal); @@ -864,66 +863,66 @@ public enum OrePrefixes { // ----- toolHeadFile.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); toolHeadSaw.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); toolHeadDrill.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); toolHeadChainsaw.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); toolHeadWrench.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); toolHeadBuzzSaw.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); turbineBlade.mCondition = new ICondition.And<>( - new ICondition.Not<>(SubTag.NO_SMASHING), - new ICondition.Not<>(SubTag.BOUNCY)); + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); rotor.mCondition = new ICondition.Nor<>(SubTag.CRYSTAL, SubTag.STONE, SubTag.BOUNCY); spring.mCondition = new ICondition.Or<>( - SubTag.STRETCHY, - SubTag.BOUNCY, - new ICondition.Not<>(SubTag.NO_SMASHING)); + SubTag.STRETCHY, + SubTag.BOUNCY, + new ICondition.Not<>(SubTag.NO_SMASHING)); springSmall.mCondition = new ICondition.Or<>( - SubTag.STRETCHY, - SubTag.BOUNCY, - new ICondition.Not<>(SubTag.NO_SMASHING)); + SubTag.STRETCHY, + SubTag.BOUNCY, + new ICondition.Not<>(SubTag.NO_SMASHING)); gemChipped.mCondition = new ICondition.And<>( - SubTag.TRANSPARENT, - SubTag.CRYSTAL, - new ICondition.Not<>(SubTag.QUARTZ), - new ICondition.Not<>(SubTag.PEARL), - new ICondition.Not<>(SubTag.MAGICAL)); + SubTag.TRANSPARENT, + SubTag.CRYSTAL, + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); gemFlawed.mCondition = new ICondition.And<>( - SubTag.TRANSPARENT, - SubTag.CRYSTAL, - new ICondition.Not<>(SubTag.QUARTZ), - new ICondition.Not<>(SubTag.PEARL), - new ICondition.Not<>(SubTag.MAGICAL)); + SubTag.TRANSPARENT, + SubTag.CRYSTAL, + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); gemFlawless.mCondition = new ICondition.And<>( - SubTag.TRANSPARENT, - SubTag.CRYSTAL, - new ICondition.Not<>(SubTag.QUARTZ), - new ICondition.Not<>(SubTag.PEARL), - new ICondition.Not<>(SubTag.MAGICAL)); + SubTag.TRANSPARENT, + SubTag.CRYSTAL, + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); gemExquisite.mCondition = new ICondition.And<>( - SubTag.TRANSPARENT, - SubTag.CRYSTAL, - new ICondition.Not<>(SubTag.QUARTZ), - new ICondition.Not<>(SubTag.PEARL), - new ICondition.Not<>(SubTag.MAGICAL)); + SubTag.TRANSPARENT, + SubTag.CRYSTAL, + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); lens.mCondition = new ICondition.Or<>( - SubTag.MAGICAL, - new ICondition.And<>(SubTag.TRANSPARENT, SubTag.HAS_COLOR)); + SubTag.MAGICAL, + new ICondition.And<>(SubTag.TRANSPARENT, SubTag.HAS_COLOR)); plateDouble.mCondition = new ICondition.Or<>(SubTag.PAPER, new ICondition.Not<>(SubTag.NO_SMASHING)); plateTriple.mCondition = new ICondition.Or<>(SubTag.PAPER, new ICondition.Not<>(SubTag.NO_SMASHING)); @@ -954,8 +953,8 @@ public enum OrePrefixes { cableGt01.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount); bucket.mSecondaryMaterial = new MaterialStack(Materials.Iron, ingot.mMaterialAmount * 3); bucketClay.mSecondaryMaterial = new MaterialStack(Materials.Clay, dust.mMaterialAmount * 5); - CELL_TYPES.forEach( - prefix -> prefix.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2)); + CELL_TYPES + .forEach(prefix -> prefix.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2)); oreRedgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteRed, dust.mMaterialAmount); oreBlackgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteBlack, dust.mMaterialAmount); oreNetherrack.mSecondaryMaterial = new MaterialStack(Materials.Netherrack, dust.mMaterialAmount); @@ -973,11 +972,11 @@ public enum OrePrefixes { crushed.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount); toolHeadDrill.mSecondaryMaterial = new MaterialStack(Materials.Steel, plate.mMaterialAmount * 4); toolHeadChainsaw.mSecondaryMaterial = new MaterialStack( - Materials.Steel, - plate.mMaterialAmount * 4 + ring.mMaterialAmount * 2); + Materials.Steel, + plate.mMaterialAmount * 4 + ring.mMaterialAmount * 2); toolHeadWrench.mSecondaryMaterial = new MaterialStack( - Materials.Steel, - ring.mMaterialAmount + screw.mMaterialAmount * 2); + Materials.Steel, + ring.mMaterialAmount + screw.mMaterialAmount * 2); arrowGtWood.mSecondaryMaterial = new MaterialStack(Materials.Wood, stick.mMaterialAmount); arrowGtPlastic.mSecondaryMaterial = new MaterialStack(Materials.Plastic, stick.mMaterialAmount); bulletGtSmall.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 9); @@ -989,7 +988,7 @@ public enum OrePrefixes { public final short mTextureIndex; public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, - mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; + mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; public final List mAspects = new ArrayList<>(); public final Collection mFamiliarPrefixes = new HashSet<>(); /** @@ -999,7 +998,7 @@ public enum OrePrefixes { public final long mMaterialAmount; public final Collection mDisabledItems = new HashSet<>(), mNotGeneratedItems = new HashSet<>(), - mIgnoredMaterials = new HashSet<>(), mGeneratedItems = new HashSet<>(); + mIgnoredMaterials = new HashSet<>(), mGeneratedItems = new HashSet<>(); private final ArrayList mOreProcessing = new ArrayList<>(); public ItemStack mContainerItem = null; public ICondition mCondition = null; @@ -1009,71 +1008,71 @@ public enum OrePrefixes { public float mHeatDamage = 0.0F; // Negative for Frost Damage private final GT_HashSet mContainsTestCache = new GT_HashSet<>(512, 0.5f); public static List mPreventableComponents = new LinkedList<>( - Arrays.asList( - OrePrefixes.gem, - OrePrefixes.ingotHot, - OrePrefixes.ingotDouble, - OrePrefixes.ingotTriple, - OrePrefixes.ingotQuadruple, - OrePrefixes.ingotQuintuple, - OrePrefixes.plate, - OrePrefixes.plateDouble, - OrePrefixes.plateTriple, - OrePrefixes.plateQuadruple, - OrePrefixes.plateQuintuple, - OrePrefixes.plateDense, - OrePrefixes.stick, - OrePrefixes.round, - OrePrefixes.bolt, - OrePrefixes.screw, - OrePrefixes.ring, - OrePrefixes.foil, - OrePrefixes.toolHeadSword, - OrePrefixes.toolHeadPickaxe, - OrePrefixes.toolHeadShovel, - OrePrefixes.toolHeadAxe, - OrePrefixes.toolHeadHoe, - OrePrefixes.toolHeadHammer, - OrePrefixes.toolHeadFile, - OrePrefixes.toolHeadSaw, - OrePrefixes.toolHeadDrill, - OrePrefixes.toolHeadChainsaw, - OrePrefixes.toolHeadWrench, - OrePrefixes.toolHeadUniversalSpade, - OrePrefixes.toolHeadSense, - OrePrefixes.toolHeadPlow, - OrePrefixes.toolHeadArrow, - OrePrefixes.toolHeadBuzzSaw, - OrePrefixes.turbineBlade, - OrePrefixes.wireFine, - OrePrefixes.gearGtSmall, - OrePrefixes.rotor, - OrePrefixes.stickLong, - OrePrefixes.springSmall, - OrePrefixes.spring, - OrePrefixes.arrowGtWood, - OrePrefixes.arrowGtPlastic, - OrePrefixes.gemChipped, - OrePrefixes.gemFlawed, - OrePrefixes.gemFlawless, - OrePrefixes.gemExquisite, - OrePrefixes.gearGt, - OrePrefixes.crateGtDust, - OrePrefixes.crateGtIngot, - OrePrefixes.crateGtGem, - OrePrefixes.crateGtPlate, - OrePrefixes.itemCasing, - OrePrefixes.nanite)); + Arrays.asList( + OrePrefixes.gem, + OrePrefixes.ingotHot, + OrePrefixes.ingotDouble, + OrePrefixes.ingotTriple, + OrePrefixes.ingotQuadruple, + OrePrefixes.ingotQuintuple, + OrePrefixes.plate, + OrePrefixes.plateDouble, + OrePrefixes.plateTriple, + OrePrefixes.plateQuadruple, + OrePrefixes.plateQuintuple, + OrePrefixes.plateDense, + OrePrefixes.stick, + OrePrefixes.round, + OrePrefixes.bolt, + OrePrefixes.screw, + OrePrefixes.ring, + OrePrefixes.foil, + OrePrefixes.toolHeadSword, + OrePrefixes.toolHeadPickaxe, + OrePrefixes.toolHeadShovel, + OrePrefixes.toolHeadAxe, + OrePrefixes.toolHeadHoe, + OrePrefixes.toolHeadHammer, + OrePrefixes.toolHeadFile, + OrePrefixes.toolHeadSaw, + OrePrefixes.toolHeadDrill, + OrePrefixes.toolHeadChainsaw, + OrePrefixes.toolHeadWrench, + OrePrefixes.toolHeadUniversalSpade, + OrePrefixes.toolHeadSense, + OrePrefixes.toolHeadPlow, + OrePrefixes.toolHeadArrow, + OrePrefixes.toolHeadBuzzSaw, + OrePrefixes.turbineBlade, + OrePrefixes.wireFine, + OrePrefixes.gearGtSmall, + OrePrefixes.rotor, + OrePrefixes.stickLong, + OrePrefixes.springSmall, + OrePrefixes.spring, + OrePrefixes.arrowGtWood, + OrePrefixes.arrowGtPlastic, + OrePrefixes.gemChipped, + OrePrefixes.gemFlawed, + OrePrefixes.gemFlawless, + OrePrefixes.gemExquisite, + OrePrefixes.gearGt, + OrePrefixes.crateGtDust, + OrePrefixes.crateGtIngot, + OrePrefixes.crateGtGem, + OrePrefixes.crateGtPlate, + OrePrefixes.itemCasing, + OrePrefixes.nanite)); /** * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check. */ public int mMaterialGenerationBits = 0; OrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, - boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, - boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, - boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, - int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { + boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, + boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, + boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, + int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { mIsUnificatable = aIsUnificatable; mIsMaterialBased = aIsMaterialBased; mIsSelfReferencing = aIsSelfReferencing; @@ -1130,109 +1129,59 @@ public enum OrePrefixes { public static void initMaterialComponents() { boolean enablePerItemSettings = GregTech_API.sMaterialComponents.get("general", "enablePerItemSettings", false); - boolean enableUnusedIngotHot = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedIngotHot", - false); - boolean enableUnusedPlates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedPlates", - false); - boolean enableUnusedDoubleIngots = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedDoubleIngots", - false); - boolean enableUnusedTripleIngots = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedTripleIngots", - false); - boolean enableUnusedQuadIngots = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedQuadIngots", - false); - boolean enableUnusedQuinIngots = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedQuinIngots", - false); - boolean enableUnusedDoublePlates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedDoublePlates", - false); - boolean enableUnusedTriplePlates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedTriplePlates", - false); - boolean enableUnusedQuadPlates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedQuadPlates", - false); - boolean enableUnusedQuinPlates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedQuinPlates", - false); - boolean enableUnusedDensePlates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedDensePlates", - false); - boolean enableUnusedGears = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedGears", - false); - boolean enableUnusedSmallGears = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedSmallGears", - false); - boolean enableUnusedRings = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedRings", - false); - boolean enableUnusedSprings = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedSprings", - false); - boolean enableUnusedSmallSprings = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedSmallSprings", - false); - boolean enableUnusedRounds = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedRounds", - false); - boolean enableUnusedRotors = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedRotors", - false); - boolean enableUnusedFineWires = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedFineWires", - false); + boolean enableUnusedIngotHot = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedIngotHot", false); + boolean enableUnusedPlates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedPlates", false); + boolean enableUnusedDoubleIngots = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedDoubleIngots", false); + boolean enableUnusedTripleIngots = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedTripleIngots", false); + boolean enableUnusedQuadIngots = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedQuadIngots", false); + boolean enableUnusedQuinIngots = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedQuinIngots", false); + boolean enableUnusedDoublePlates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedDoublePlates", false); + boolean enableUnusedTriplePlates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedTriplePlates", false); + boolean enableUnusedQuadPlates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedQuadPlates", false); + boolean enableUnusedQuinPlates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedQuinPlates", false); + boolean enableUnusedDensePlates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedDensePlates", false); + boolean enableUnusedGears = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedGears", false); + boolean enableUnusedSmallGears = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedSmallGears", false); + boolean enableUnusedRings = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedRings", false); + boolean enableUnusedSprings = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedSprings", false); + boolean enableUnusedSmallSprings = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedSmallSprings", false); + boolean enableUnusedRounds = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedRounds", false); + boolean enableUnusedRotors = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedRotors", false); + boolean enableUnusedFineWires = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedFineWires", false); boolean enableUnusedFoil = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedFoil", false); - boolean enableUnusedArrows = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedArrowHeads", - false); - boolean enableUnusedCrates = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedCrates", - false); - boolean enableUnusedBolts = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedBolts", - false); - boolean enableUnusedScrews = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedScrews", - false); + boolean enableUnusedArrows = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedArrowHeads", false); + boolean enableUnusedCrates = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedCrates", false); + boolean enableUnusedBolts = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedBolts", false); + boolean enableUnusedScrews = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedScrews", false); boolean enableUnusedRods = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRods", false); - boolean enableUnusedLongRods = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedLongRods", - false); + boolean enableUnusedLongRods = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedLongRods", false); boolean enableUnusedGems = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedGems", false); - boolean enableUnusedItemCasing = GregTech_API.sMaterialComponents.get( - "globalcomponents", - "enableUnusedItemCasing", - false); + boolean enableUnusedItemCasing = GregTech_API.sMaterialComponents + .get("globalcomponents", "enableUnusedItemCasing", false); // TODO possibly use OrePrefix mNotGeneratedItems/mGeneratedItems instead of a static List for every material // instance? @@ -1248,13 +1197,11 @@ public enum OrePrefixes { if (!enableUnusedSprings && (aMaterial != Materials.Titanium)) spring.mDisabledItems.add(aMaterial); if (!enableUnusedSmallSprings) springSmall.mDisabledItems.add(aMaterial); if (!enableUnusedRounds && !(aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium - || aMaterial == Materials.HSSG)) - round.mDisabledItems.add(aMaterial); + || aMaterial == Materials.HSSG)) round.mDisabledItems.add(aMaterial); if (!enableUnusedCrates) { if (!(aMaterial == Materials.DamascusSteel || aMaterial == Materials.Steel - || aMaterial == Materials.Bronze - || aMaterial == Materials.Manganese)) - crateGtIngot.mDisabledItems.add(aMaterial); + || aMaterial == Materials.Bronze + || aMaterial == Materials.Manganese)) crateGtIngot.mDisabledItems.add(aMaterial); if (!(aMaterial == Materials.Neodymium || aMaterial == Materials.Chrome)) crateGtDust.mDisabledItems.add(aMaterial); crateGtGem.mDisabledItems.add(aMaterial); @@ -1268,36 +1215,36 @@ public enum OrePrefixes { } // Plates if (!enableUnusedPlates && ((aMaterial.mTypes & 0x40) == 0) - && !(aMaterial == Materials.Silicon || aMaterial == Materials.Zinc - || aMaterial == Materials.Europium - || aMaterial == Materials.Americium - || aMaterial == Materials.RedAlloy - || aMaterial == Materials.SolderingAlloy - || aMaterial == Materials.BatteryAlloy - || aMaterial == Materials.AnnealedCopper - || aMaterial == Materials.Firestone - || aMaterial == Materials.VanadiumGallium - || aMaterial == Materials.YttriumBariumCuprate - || aMaterial == Materials.NiobiumTitanium - || aMaterial == Materials.CertusQuartz - || aMaterial == Materials.NetherQuartz - || aMaterial == Materials.Lazurite - || aMaterial == Materials.Lapis - || aMaterial == Materials.Paper - || aMaterial == Materials.Jasper - || aMaterial == Materials.Dilithium - || aMaterial == Materials.Forcicium - || aMaterial == Materials.Forcillium - || aMaterial == Materials.EnderPearl - || aMaterial == Materials.EnderEye - || aMaterial == Materials.Glass - || aMaterial == Materials.Copper - || aMaterial == Materials.Tin - || aMaterial == Materials.Redstone - || aMaterial == Materials.Sodalite - || aMaterial == Materials.Gallium - || aMaterial == Materials.GalliumArsenide - || aMaterial == Materials.IndiumGalliumPhosphide)) + && !(aMaterial == Materials.Silicon || aMaterial == Materials.Zinc + || aMaterial == Materials.Europium + || aMaterial == Materials.Americium + || aMaterial == Materials.RedAlloy + || aMaterial == Materials.SolderingAlloy + || aMaterial == Materials.BatteryAlloy + || aMaterial == Materials.AnnealedCopper + || aMaterial == Materials.Firestone + || aMaterial == Materials.VanadiumGallium + || aMaterial == Materials.YttriumBariumCuprate + || aMaterial == Materials.NiobiumTitanium + || aMaterial == Materials.CertusQuartz + || aMaterial == Materials.NetherQuartz + || aMaterial == Materials.Lazurite + || aMaterial == Materials.Lapis + || aMaterial == Materials.Paper + || aMaterial == Materials.Jasper + || aMaterial == Materials.Dilithium + || aMaterial == Materials.Forcicium + || aMaterial == Materials.Forcillium + || aMaterial == Materials.EnderPearl + || aMaterial == Materials.EnderEye + || aMaterial == Materials.Glass + || aMaterial == Materials.Copper + || aMaterial == Materials.Tin + || aMaterial == Materials.Redstone + || aMaterial == Materials.Sodalite + || aMaterial == Materials.Gallium + || aMaterial == Materials.GalliumArsenide + || aMaterial == Materials.IndiumGalliumPhosphide)) plate.mDisabledItems.add(aMaterial); if (!enableUnusedIngotHot) { ingotHot.mDisabledItems.add(aMaterial); @@ -1308,9 +1255,9 @@ public enum OrePrefixes { if (!enableUnusedQuadIngots) ingotQuadruple.mDisabledItems.add(aMaterial); if (!enableUnusedQuinIngots) ingotQuintuple.mDisabledItems.add(aMaterial); if (!enableUnusedDoublePlates && ((aMaterial.mTypes & 0x40) == 0) - && !(aMaterial == Materials.Paper || aMaterial == Materials.Aluminium - || aMaterial == Materials.Steel - || aMaterial == Materials.TungstenSteel)) + && !(aMaterial == Materials.Paper || aMaterial == Materials.Aluminium + || aMaterial == Materials.Steel + || aMaterial == Materials.TungstenSteel)) plateDouble.mDisabledItems.add(aMaterial); if (!enableUnusedTriplePlates && !(aMaterial == Materials.Paper)) plateTriple.mDisabledItems.add(aMaterial); @@ -1319,217 +1266,212 @@ public enum OrePrefixes { if (!enableUnusedQuinPlates && !(aMaterial == Materials.Paper)) plateQuintuple.mDisabledItems.add(aMaterial); if (!(enableUnusedDensePlates || GregTech_API.mGTPlusPlus) - && !(aMaterial == Materials.Iron || aMaterial == Materials.Copper - || aMaterial == Materials.Lead - || aMaterial == Materials.Paper - || aMaterial == Materials.Thaumium - || aMaterial == Materials.Titanium)) + && !(aMaterial == Materials.Iron || aMaterial == Materials.Copper + || aMaterial == Materials.Lead + || aMaterial == Materials.Paper + || aMaterial == Materials.Thaumium + || aMaterial == Materials.Titanium)) plateDense.mDisabledItems.add(aMaterial); // Rotors if (!enableUnusedRotors && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome + || aMaterial == Materials.Tin + || aMaterial == Materials.Osmium + || aMaterial == Materials.Iridium + || aMaterial == Materials.Bronze + || aMaterial == Materials.Steel + || aMaterial == Materials.StainlessSteel + || aMaterial == Materials.TungstenSteel + || aMaterial == Materials.HSSG + || aMaterial == Materials.HSSE + || aMaterial == Materials.Neutronium)) rotor.mDisabledItems.add(aMaterial); + // Rings + if (!enableUnusedRings && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome + || aMaterial == Materials.Iron + || aMaterial == Materials.Tin + || aMaterial == Materials.Osmium + || aMaterial == Materials.Iridium + || aMaterial == Materials.Bronze + || aMaterial == Materials.WroughtIron + || aMaterial == Materials.Steel + || aMaterial == Materials.StainlessSteel + || aMaterial == Materials.PigIron + || aMaterial == Materials.TungstenSteel + || aMaterial == Materials.Rubber + || aMaterial == Materials.HSSE + || aMaterial == Materials.Neutronium + || aMaterial == Materials.HSSG + || aMaterial == Materials.Aluminium + || aMaterial == Materials.Invar + || aMaterial == Materials.Brass + || aMaterial == Materials.Paper + || aMaterial == Materials.Silicone + || aMaterial == Materials.StyreneButadieneRubber)) ring.mDisabledItems.add(aMaterial); + // Foil + if (!enableUnusedFoil && !(aMaterial == Materials.Zinc || aMaterial == Materials.Aluminium + || aMaterial == Materials.Silicon + || aMaterial == Materials.Gold + || aMaterial == Materials.Electrum + || aMaterial == Materials.Platinum + || aMaterial == Materials.Osmiridium + || aMaterial == Materials.Osmium + || aMaterial == Materials.AnnealedCopper + || aMaterial == Materials.Steel + || aMaterial == Materials.Copper + || aMaterial == Materials.YttriumBariumCuprate + || aMaterial == Materials.VanadiumGallium + || aMaterial == Materials.NiobiumTitanium + || aMaterial == Materials.Naquadah + || aMaterial == Materials.Manganese + || aMaterial == Materials.Plastic + || aMaterial == Materials.Silicone + || aMaterial == Materials.PolyvinylChloride + || aMaterial == Materials.PolyphenyleneSulfide + || aMaterial == Materials.Nichrome + || aMaterial == Materials.BlackSteel + || aMaterial == Materials.Titanium + || aMaterial == Materials.TungstenSteel + || aMaterial == Materials.Tungsten + || aMaterial == Materials.HSSG + || aMaterial == Materials.NaquadahAlloy + || aMaterial == Materials.Duranium + || aMaterial == Materials.Europium + || aMaterial == Materials.Bedrockium)) foil.mDisabledItems.add(aMaterial); + // Fine Wire + if (!enableUnusedFineWires && !(aMaterial == Materials.Steel || aMaterial == Materials.AnnealedCopper + || aMaterial == Materials.Platinum + || aMaterial == Materials.Osmium + || aMaterial == Materials.Tin + || aMaterial == Materials.Lead + || aMaterial == Materials.SolderingAlloy + || aMaterial == Materials.Copper + || aMaterial == Materials.Electrum + || aMaterial == Materials.Gold + || aMaterial == Materials.RedAlloy + || aMaterial == Materials.Graphene + || aMaterial == Materials.NiobiumTitanium + || aMaterial == Materials.YttriumBariumCuprate + || aMaterial == Materials.BloodInfusedIron + || aMaterial == Materials.Universium + || aMaterial == Materials.MagnetohydrodynamicallyConstrainedStarMatter)) + wireFine.mDisabledItems.add(aMaterial); + // Gears + if (!enableUnusedGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium + || aMaterial == Materials.Iron + || aMaterial == Materials.Copper + || aMaterial == Materials.Tin + || aMaterial == Materials.Gold + || aMaterial == Materials.Stone + || aMaterial == Materials.Bronze + || aMaterial == Materials.Steel + || aMaterial == Materials.StainlessSteel + || aMaterial == Materials.TungstenSteel + || aMaterial == Materials.CobaltBrass + || aMaterial == Materials.Diamond + || aMaterial == Materials.Wood + || aMaterial == Materials.HSSG + || aMaterial == Materials.HSSE + || aMaterial == Materials.Neutronium)) gearGt.mDisabledItems.add(aMaterial); + // Small Gears + if (!enableUnusedSmallGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium + || aMaterial == Materials.Steel + || aMaterial == Materials.StainlessSteel + || aMaterial == Materials.TungstenSteel + || aMaterial == Materials.HSSG + || aMaterial == Materials.HSSE + || aMaterial == Materials.Neutronium + || aMaterial == Materials.VanadiumGallium + || aMaterial == Materials.Naquadah)) gearGtSmall.mDisabledItems.add(aMaterial); + // Bolts + if (!enableUnusedBolts && ((aMaterial.mTypes & 0x40) == 0) + && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome + || aMaterial == Materials.Iron || aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium + || aMaterial == Materials.Neutronium || aMaterial == Materials.Bronze + || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel + || aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.HSSG + || aMaterial == Materials.Tungsten || aMaterial == Materials.HSSE - || aMaterial == Materials.Neutronium)) - rotor.mDisabledItems.add(aMaterial); - // Rings - if (!enableUnusedRings && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome + || aMaterial == Materials.HSSG)) + bolt.mDisabledItems.add(aMaterial); + // Screws + if (!enableUnusedScrews && ((aMaterial.mTypes & 0x40) == 0) + && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron || aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium + || aMaterial == Materials.Neutronium || aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel || aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.Rubber || aMaterial == Materials.HSSE - || aMaterial == Materials.Neutronium - || aMaterial == Materials.HSSG - || aMaterial == Materials.Aluminium - || aMaterial == Materials.Invar - || aMaterial == Materials.Brass - || aMaterial == Materials.Paper - || aMaterial == Materials.Silicone - || aMaterial == Materials.StyreneButadieneRubber)) - ring.mDisabledItems.add(aMaterial); - // Foil - if (!enableUnusedFoil && !(aMaterial == Materials.Zinc || aMaterial == Materials.Aluminium - || aMaterial == Materials.Silicon - || aMaterial == Materials.Gold - || aMaterial == Materials.Electrum - || aMaterial == Materials.Platinum - || aMaterial == Materials.Osmiridium + || aMaterial == Materials.HSSG)) + screw.mDisabledItems.add(aMaterial); + // Rods + if (!enableUnusedRods && ((aMaterial.mTypes & 0x40) == 0) + && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome + || aMaterial == Materials.Iron + || aMaterial == Materials.Tin || aMaterial == Materials.Osmium - || aMaterial == Materials.AnnealedCopper + || aMaterial == Materials.Iridium + || aMaterial == Materials.Neutronium + || aMaterial == Materials.Bronze + || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel - || aMaterial == Materials.Copper - || aMaterial == Materials.YttriumBariumCuprate - || aMaterial == Materials.VanadiumGallium - || aMaterial == Materials.NiobiumTitanium - || aMaterial == Materials.Naquadah - || aMaterial == Materials.Manganese - || aMaterial == Materials.Plastic - || aMaterial == Materials.Silicone - || aMaterial == Materials.PolyvinylChloride - || aMaterial == Materials.PolyphenyleneSulfide - || aMaterial == Materials.Nichrome - || aMaterial == Materials.BlackSteel - || aMaterial == Materials.Titanium + || aMaterial == Materials.StainlessSteel + || aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.Tungsten + || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG - || aMaterial == Materials.NaquadahAlloy - || aMaterial == Materials.Duranium + || aMaterial == Materials.Aluminium + || aMaterial == Materials.Copper + || aMaterial == Materials.Neodymium || aMaterial == Materials.Europium - || aMaterial == Materials.Bedrockium)) - foil.mDisabledItems.add(aMaterial); - // Fine Wire - if (!enableUnusedFineWires && !(aMaterial == Materials.Steel || aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Platinum - || aMaterial == Materials.Osmium - || aMaterial == Materials.Tin - || aMaterial == Materials.Lead - || aMaterial == Materials.SolderingAlloy - || aMaterial == Materials.Copper - || aMaterial == Materials.Electrum || aMaterial == Materials.Gold - || aMaterial == Materials.RedAlloy - || aMaterial == Materials.Graphene - || aMaterial == Materials.NiobiumTitanium - || aMaterial == Materials.YttriumBariumCuprate - || aMaterial == Materials.BloodInfusedIron - || aMaterial == Materials.Universium - || aMaterial == Materials.MagnetohydrodynamicallyConstrainedStarMatter)) - wireFine.mDisabledItems.add(aMaterial); - // Gears - if (!enableUnusedGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium - || aMaterial == Materials.Iron - || aMaterial == Materials.Copper - || aMaterial == Materials.Tin - || aMaterial == Materials.Gold - || aMaterial == Materials.Stone - || aMaterial == Materials.Bronze - || aMaterial == Materials.Steel - || aMaterial == Materials.StainlessSteel - || aMaterial == Materials.TungstenSteel + || aMaterial == Materials.Uranium235 + || aMaterial == Materials.Plutonium241 + || aMaterial == Materials.Americium + || aMaterial == Materials.Brass + || aMaterial == Materials.Electrum + || aMaterial == Materials.NaquadahEnriched || aMaterial == Materials.CobaltBrass + || aMaterial == Materials.IronMagnetic + || aMaterial == Materials.SteelMagnetic + || aMaterial == Materials.NeodymiumMagnetic + || aMaterial == Materials.Samarium + || aMaterial == Materials.SamariumMagnetic + || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.Diamond || aMaterial == Materials.Wood - || aMaterial == Materials.HSSG - || aMaterial == Materials.HSSE - || aMaterial == Materials.Neutronium)) - gearGt.mDisabledItems.add(aMaterial); - // Small Gears - if (!enableUnusedSmallGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium - || aMaterial == Materials.Steel - || aMaterial == Materials.StainlessSteel - || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.HSSG - || aMaterial == Materials.HSSE - || aMaterial == Materials.Neutronium - || aMaterial == Materials.VanadiumGallium - || aMaterial == Materials.Naquadah)) - gearGtSmall.mDisabledItems.add(aMaterial); - // Bolts - if (!enableUnusedBolts && ((aMaterial.mTypes & 0x40) == 0) - && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome - || aMaterial == Materials.Iron - || aMaterial == Materials.Tin - || aMaterial == Materials.Osmium - || aMaterial == Materials.Iridium - || aMaterial == Materials.Neutronium - || aMaterial == Materials.Bronze - || aMaterial == Materials.WroughtIron - || aMaterial == Materials.Steel - || aMaterial == Materials.StainlessSteel - || aMaterial == Materials.PigIron - || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.Tungsten - || aMaterial == Materials.HSSE - || aMaterial == Materials.HSSG)) - bolt.mDisabledItems.add(aMaterial); - // Screws - if (!enableUnusedScrews && ((aMaterial.mTypes & 0x40) == 0) - && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome - || aMaterial == Materials.Iron - || aMaterial == Materials.Tin - || aMaterial == Materials.Osmium - || aMaterial == Materials.Iridium - || aMaterial == Materials.Neutronium - || aMaterial == Materials.Bronze - || aMaterial == Materials.WroughtIron - || aMaterial == Materials.Steel - || aMaterial == Materials.StainlessSteel - || aMaterial == Materials.PigIron - || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.HSSE - || aMaterial == Materials.HSSG)) - screw.mDisabledItems.add(aMaterial); - // Rods - if (!enableUnusedRods && ((aMaterial.mTypes & 0x40) == 0) - && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome - || aMaterial == Materials.Iron - || aMaterial == Materials.Tin - || aMaterial == Materials.Osmium - || aMaterial == Materials.Iridium - || aMaterial == Materials.Neutronium - || aMaterial == Materials.Bronze - || aMaterial == Materials.WroughtIron - || aMaterial == Materials.Steel - || aMaterial == Materials.StainlessSteel - || aMaterial == Materials.PigIron - || aMaterial == Materials.TungstenSteel - || aMaterial == Materials.HSSE - || aMaterial == Materials.HSSG - || aMaterial == Materials.Aluminium - || aMaterial == Materials.Copper - || aMaterial == Materials.Neodymium - || aMaterial == Materials.Europium - || aMaterial == Materials.Platinum - || aMaterial == Materials.Gold - || aMaterial == Materials.Uranium235 - || aMaterial == Materials.Plutonium241 - || aMaterial == Materials.Americium - || aMaterial == Materials.Brass - || aMaterial == Materials.Electrum - || aMaterial == Materials.NaquadahEnriched - || aMaterial == Materials.CobaltBrass - || aMaterial == Materials.IronMagnetic - || aMaterial == Materials.SteelMagnetic - || aMaterial == Materials.NeodymiumMagnetic - || aMaterial == Materials.Samarium - || aMaterial == Materials.SamariumMagnetic - || aMaterial == Materials.VanadiumGallium - || aMaterial == Materials.Diamond - || aMaterial == Materials.Wood - || aMaterial == Materials.Plastic - || aMaterial == Materials.Lead - || aMaterial == Materials.SolderingAlloy - || aMaterial == Materials.Lapis - || aMaterial == Materials.Lazurite - || aMaterial == Materials.Sodalite - || aMaterial == Materials.PolyvinylChloride)) + || aMaterial == Materials.Plastic + || aMaterial == Materials.Lead + || aMaterial == Materials.SolderingAlloy + || aMaterial == Materials.Lapis + || aMaterial == Materials.Lazurite + || aMaterial == Materials.Sodalite + || aMaterial == Materials.PolyvinylChloride)) stick.mDisabledItems.add(aMaterial); // Long Rods if (!enableUnusedLongRods && ((aMaterial.mTypes & 0x40) == 0) - && !(aMaterial == Materials.Titanium || aMaterial == Materials.NeodymiumMagnetic - || aMaterial == Materials.SamariumMagnetic - || aMaterial == Materials.HSSG - || aMaterial == Materials.HSSE - || aMaterial == Materials.Neutronium - || aMaterial == Materials.Americium - || aMaterial == Materials.WroughtIron - || aMaterial == Materials.Magnalium - || aMaterial == Materials.TungstenSteel)) + && !(aMaterial == Materials.Titanium || aMaterial == Materials.NeodymiumMagnetic + || aMaterial == Materials.SamariumMagnetic + || aMaterial == Materials.HSSG + || aMaterial == Materials.HSSE + || aMaterial == Materials.Neutronium + || aMaterial == Materials.Americium + || aMaterial == Materials.WroughtIron + || aMaterial == Materials.Magnalium + || aMaterial == Materials.TungstenSteel)) stickLong.mDisabledItems.add(aMaterial); if (!enableUnusedGems && ((aMaterial.mTypes & 0x04) == 0)) { @@ -1554,15 +1496,13 @@ public enum OrePrefixes { if (enablePerItemSettings) { StringBuilder aConfigPathSB = new StringBuilder(); aConfigPathSB.append("materialcomponents.") - .append(aMaterial.mConfigSection) - .append(".") - .append(aMaterial.mName); + .append(aMaterial.mConfigSection) + .append(".") + .append(aMaterial.mName); String aConfigPath = aConfigPathSB.toString(); for (OrePrefixes aPrefix : mPreventableComponents) { - boolean aEnableComponent = GregTech_API.sMaterialComponents.get( - aConfigPath, - aPrefix.toString(), - !aPrefix.mDisabledItems.contains(aMaterial)); + boolean aEnableComponent = GregTech_API.sMaterialComponents + .get(aConfigPath, aPrefix.toString(), !aPrefix.mDisabledItems.contains(aMaterial)); if (!aEnableComponent) { // Disable component if false and is not already in disabled list aPrefix.disableComponent(aMaterial); } else { // Enable component if true and is not already in enabled list @@ -1665,10 +1605,10 @@ public enum OrePrefixes { public boolean doGenerateItem(Materials aMaterial) { return aMaterial != null && aMaterial != Materials._NULL - && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) - && !mNotGeneratedItems.contains(aMaterial) - && !mDisabledItems.contains(aMaterial) - && (mCondition == null || mCondition.isTrue(aMaterial)); + && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) + && !mNotGeneratedItems.contains(aMaterial) + && !mDisabledItems.contains(aMaterial) + && (mCondition == null || mCondition.isTrue(aMaterial)); } public boolean ignoreMaterials(Materials... aMaterials) { @@ -1702,17 +1642,17 @@ public enum OrePrefixes { } if ((aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) - && GT_Utility.isStackValid(aStack)) { + && GT_Utility.isStackValid(aStack)) { // if (Materials.mPreventableComponents.contains(this) && !this.mDynamicItems.contains(aMaterial)) return; for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { if (D2) GT_Log.ore.println( - "Processing '" + aOreDictName - + "' with the Prefix '" - + name() - + "' and the Material '" - + aMaterial.mName - + "' at " - + GT_Utility.getClassName(tRegistrator)); + "Processing '" + aOreDictName + + "' with the Prefix '" + + name() + + "' and the Material '" + + aMaterial.mName + + "' at " + + GT_Utility.getClassName(tRegistrator)); tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); } } diff --git a/src/main/java/gregtech/api/enums/SoundResource.java b/src/main/java/gregtech/api/enums/SoundResource.java index 5d24abaea0..23887aebbf 100644 --- a/src/main/java/gregtech/api/enums/SoundResource.java +++ b/src/main/java/gregtech/api/enums/SoundResource.java @@ -305,9 +305,9 @@ public enum SoundResource { static { EnumSet.allOf(SoundResource.class) - .forEach(sound -> { if (sound.id >= 0) ID_SOUND_MAP.put(sound.id, sound); }); + .forEach(sound -> { if (sound.id >= 0) ID_SOUND_MAP.put(sound.id, sound); }); EnumSet.allOf(SoundResource.class) - .forEach(sound -> RESOURCE_STR_SOUND_MAP.put(sound.resourceLocation.toString(), sound)); + .forEach(sound -> RESOURCE_STR_SOUND_MAP.put(sound.resourceLocation.toString(), sound)); } /** diff --git a/src/main/java/gregtech/api/enums/SubTag.java b/src/main/java/gregtech/api/enums/SubTag.java index 1298e74f34..337a171d57 100644 --- a/src/main/java/gregtech/api/enums/SubTag.java +++ b/src/main/java/gregtech/api/enums/SubTag.java @@ -32,7 +32,7 @@ public final class SubTag implements ICondition { * listed are: Iron, Pyrite, PigIron, DeepIron, ShadowIron, WroughtIron and MeteoricIron. */ public static final SubTag BLASTFURNACE_CALCITE_DOUBLE = getNewSubTag("BLASTFURNACE_CALCITE_DOUBLE"), - BLASTFURNACE_CALCITE_TRIPLE = getNewSubTag("BLASTFURNACE_CALCITE_TRIPLE"); + BLASTFURNACE_CALCITE_TRIPLE = getNewSubTag("BLASTFURNACE_CALCITE_TRIPLE"); /** * Add this to a material with Direct Smelting to prevent the automatic generation of a Bricked/Bronze Blast Furnace @@ -72,7 +72,7 @@ public final class SubTag implements ICondition { * Add this to your Material if you want to have its Ore electromagnetically separated to give Neodymium. */ public static final SubTag ELECTROMAGNETIC_SEPERATION_NEODYMIUM = getNewSubTag( - "ELECTROMAGNETIC_SEPERATION_NEODYMIUM"); + "ELECTROMAGNETIC_SEPERATION_NEODYMIUM"); /** * Add this to your Material if you want to have its Ore giving Cinnabar Crystals on Pulverization. Already listed * are: Redstone diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java index 78829ca01f..3fb15656e5 100644 --- a/src/main/java/gregtech/api/enums/TextureSet.java +++ b/src/main/java/gregtech/api/enums/TextureSet.java @@ -8,70 +8,66 @@ public class TextureSet { private static final String aTextVoidDir = "/void"; private static final TextureType[] IS_BLOCK_TEXTURE = new TextureType[] { TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, - TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, - TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, - TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, - TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, - TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, - TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, - TextureType.ITEM, }; + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, + TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, + TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, + TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, + TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, + TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, + TextureType.BLOCK, TextureType.BLOCK, TextureType.BLOCK, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, + TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, TextureType.ITEM, }; private static final String[] SUFFIXES = new String[] { "/dustTiny", "/dustSmall", "/dust", "/dustImpure", - "/dustPure", "/crushed", "/crushedPurified", "/crushedCentrifuged", "/gem", "/nugget", "/casingSmall", - "/ingot", "/ingotHot", "/ingotDouble", "/ingotTriple", "/ingotQuadruple", "/ingotQuintuple", "/plate", - "/plateDouble", "/plateTriple", "/plateQuadruple", "/plateQuintuple", "/plateDense", "/stick", "/lens", - "/round", "/bolt", "/screw", "/ring", "/foil", "/cell", "/cellPlasma", "/toolHeadSword", "/toolHeadPickaxe", - "/toolHeadShovel", "/toolHeadAxe", "/toolHeadHoe", "/toolHeadHammer", "/toolHeadFile", "/toolHeadSaw", - "/toolHeadDrill", "/toolHeadChainsaw", "/toolHeadWrench", "/toolHeadUniversalSpade", "/toolHeadSense", - "/toolHeadPlow", "/toolHeadArrow", "/toolHeadScrewdriver", "/toolHeadBuzzSaw", "/toolHeadSoldering", - "/nanites", "/wireFine", "/gearGtSmall", "/rotor", "/stickLong", "/springSmall", "/spring", "/arrowGtWood", - "/arrowGtPlastic", "/gemChipped", "/gemFlawed", "/gemFlawless", "/gemExquisite", "/gearGt", aTextVoidDir, - aTextVoidDir, aTextVoidDir, "/oreSmall", "/ore", "/wire", "/foil", "/block1", "/block2", "/block3", - "/block4", "/block5", "/block6", "/pipeSide", "/pipeTiny", "/pipeSmall", "/pipeMedium", "/pipeLarge", - "/pipeHuge", "/frameGt", "/pipeQuadruple", "/pipeNonuple", aTextVoidDir, aTextVoidDir, aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, - "/crateGtDust", "/crateGtIngot", "/crateGtGem", "/crateGtPlate", "/turbineBlade", aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, - aTextVoidDir, aTextVoidDir, aTextVoidDir, "/handleMallet", "/toolHeadMallet", }; + "/dustPure", "/crushed", "/crushedPurified", "/crushedCentrifuged", "/gem", "/nugget", "/casingSmall", "/ingot", + "/ingotHot", "/ingotDouble", "/ingotTriple", "/ingotQuadruple", "/ingotQuintuple", "/plate", "/plateDouble", + "/plateTriple", "/plateQuadruple", "/plateQuintuple", "/plateDense", "/stick", "/lens", "/round", "/bolt", + "/screw", "/ring", "/foil", "/cell", "/cellPlasma", "/toolHeadSword", "/toolHeadPickaxe", "/toolHeadShovel", + "/toolHeadAxe", "/toolHeadHoe", "/toolHeadHammer", "/toolHeadFile", "/toolHeadSaw", "/toolHeadDrill", + "/toolHeadChainsaw", "/toolHeadWrench", "/toolHeadUniversalSpade", "/toolHeadSense", "/toolHeadPlow", + "/toolHeadArrow", "/toolHeadScrewdriver", "/toolHeadBuzzSaw", "/toolHeadSoldering", "/nanites", "/wireFine", + "/gearGtSmall", "/rotor", "/stickLong", "/springSmall", "/spring", "/arrowGtWood", "/arrowGtPlastic", + "/gemChipped", "/gemFlawed", "/gemFlawless", "/gemExquisite", "/gearGt", aTextVoidDir, aTextVoidDir, + aTextVoidDir, "/oreSmall", "/ore", "/wire", "/foil", "/block1", "/block2", "/block3", "/block4", "/block5", + "/block6", "/pipeSide", "/pipeTiny", "/pipeSmall", "/pipeMedium", "/pipeLarge", "/pipeHuge", "/frameGt", + "/pipeQuadruple", "/pipeNonuple", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, "/crateGtDust", "/crateGtIngot", + "/crateGtGem", "/crateGtPlate", "/turbineBlade", aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, + aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, aTextVoidDir, "/handleMallet", "/toolHeadMallet", }; public boolean is_custom = false; public static final TextureSet SET_NONE = new TextureSet("NONE"), SET_DULL = new TextureSet("DULL"), - SET_RUBY = new TextureSet("RUBY"), SET_OPAL = new TextureSet("OPAL"), SET_LEAF = new TextureSet("LEAF"), - SET_WOOD = new TextureSet("WOOD"), SET_SAND = new TextureSet("SAND"), SET_FINE = new TextureSet("FINE"), - SET_FIERY = new TextureSet("FIERY"), SET_FLUID = new TextureSet("FLUID"), - SET_ROUGH = new TextureSet("ROUGH"), SET_PAPER = new TextureSet("PAPER"), - SET_GLASS = new TextureSet("GLASS"), SET_FLINT = new TextureSet("FLINT"), - SET_LAPIS = new TextureSet("LAPIS"), SET_SHINY = new TextureSet("SHINY"), - SET_SHARDS = new TextureSet("SHARDS"), SET_POWDER = new TextureSet("POWDER"), - SET_QUARTZ = new TextureSet("QUARTZ"), SET_EMERALD = new TextureSet("EMERALD"), - SET_DIAMOND = new TextureSet("DIAMOND"), SET_LIGNITE = new TextureSet("LIGNITE"), - SET_MAGNETIC = new TextureSet("MAGNETIC"), SET_METALLIC = new TextureSet("METALLIC"), - SET_NETHERSTAR = new TextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL"), - SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL"); + SET_RUBY = new TextureSet("RUBY"), SET_OPAL = new TextureSet("OPAL"), SET_LEAF = new TextureSet("LEAF"), + SET_WOOD = new TextureSet("WOOD"), SET_SAND = new TextureSet("SAND"), SET_FINE = new TextureSet("FINE"), + SET_FIERY = new TextureSet("FIERY"), SET_FLUID = new TextureSet("FLUID"), SET_ROUGH = new TextureSet("ROUGH"), + SET_PAPER = new TextureSet("PAPER"), SET_GLASS = new TextureSet("GLASS"), SET_FLINT = new TextureSet("FLINT"), + SET_LAPIS = new TextureSet("LAPIS"), SET_SHINY = new TextureSet("SHINY"), SET_SHARDS = new TextureSet("SHARDS"), + SET_POWDER = new TextureSet("POWDER"), SET_QUARTZ = new TextureSet("QUARTZ"), + SET_EMERALD = new TextureSet("EMERALD"), SET_DIAMOND = new TextureSet("DIAMOND"), + SET_LIGNITE = new TextureSet("LIGNITE"), SET_MAGNETIC = new TextureSet("MAGNETIC"), + SET_METALLIC = new TextureSet("METALLIC"), SET_NETHERSTAR = new TextureSet("NETHERSTAR"), + SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL"); /** * For the Indices of OrePrefixes you need to look into the OrePrefix Enum. */ public static final short INDEX_wire = 69, INDEX_foil = 70, INDEX_block1 = 71, INDEX_block2 = 72, INDEX_block3 = 73, - INDEX_block4 = 74, INDEX_block5 = 75, INDEX_block6 = 76; + INDEX_block4 = 74, INDEX_block5 = 75, INDEX_block6 = 76; public final IIconContainer[] mTextures = new IIconContainer[128]; public final String mSetName; diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index f554ee852c..fc2f0bb8e0 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -1354,302 +1354,295 @@ public class Textures { * Icons for Hardened CFoam 0 = No Color 1 - 16 = Colors */ public static final ITexture[][] HARDENEDFOAMS = { - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa) }, - new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa) } }; + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa) }, + new ITexture[] { TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa) } }; /** * Machine Casings by Tier 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV */ public static final IIconContainer[] MACHINECASINGS_SIDE = { MACHINE_8V_SIDE, MACHINE_LV_SIDE, MACHINE_MV_SIDE, - MACHINE_HV_SIDE, MACHINE_EV_SIDE, MACHINE_IV_SIDE, MACHINE_LuV_SIDE, MACHINE_ZPM_SIDE, MACHINE_UV_SIDE, - MACHINE_MAX_SIDE, MACHINE_UEV_SIDE, MACHINE_UIV_SIDE, MACHINE_UMV_SIDE, MACHINE_UXV_SIDE, - MACHINE_MAXV_SIDE, }, - MACHINECASINGS_TOP = { MACHINE_8V_TOP, MACHINE_LV_TOP, MACHINE_MV_TOP, MACHINE_HV_TOP, MACHINE_EV_TOP, - MACHINE_IV_TOP, MACHINE_LuV_TOP, MACHINE_ZPM_TOP, MACHINE_UV_TOP, MACHINE_MAX_TOP, - MACHINE_UEV_TOP, MACHINE_UIV_TOP, MACHINE_UMV_TOP, MACHINE_UXV_TOP, MACHINE_MAXV_TOP, }, - MACHINECASINGS_BOTTOM = { MACHINE_8V_BOTTOM, MACHINE_LV_BOTTOM, MACHINE_MV_BOTTOM, MACHINE_HV_BOTTOM, - MACHINE_EV_BOTTOM, MACHINE_IV_BOTTOM, MACHINE_LuV_BOTTOM, MACHINE_ZPM_BOTTOM, MACHINE_UV_BOTTOM, - MACHINE_MAX_BOTTOM, MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM, MACHINE_UMV_BOTTOM, - MACHINE_UXV_BOTTOM, MACHINE_MAXV_BOTTOM, }, - GRANITES = { GRANITE_BLACK_STONE, GRANITE_BLACK_COBBLE, GRANITE_BLACK_COBBLE_MOSSY, - GRANITE_BLACK_BRICKS, GRANITE_BLACK_BRICKS_CRACKED, GRANITE_BLACK_BRICKS_MOSSY, - GRANITE_BLACK_BRICKS_CHISELED, GRANITE_BLACK_SMOOTH, GRANITE_RED_STONE, GRANITE_RED_COBBLE, - GRANITE_RED_COBBLE_MOSSY, GRANITE_RED_BRICKS, GRANITE_RED_BRICKS_CRACKED, - GRANITE_RED_BRICKS_MOSSY, GRANITE_RED_BRICKS_CHISELED, GRANITE_RED_SMOOTH, }, - CONCRETES = { CONCRETE_DARK_STONE, CONCRETE_DARK_COBBLE, CONCRETE_DARK_COBBLE_MOSSY, - CONCRETE_DARK_BRICKS, CONCRETE_DARK_BRICKS_CRACKED, CONCRETE_DARK_BRICKS_MOSSY, - CONCRETE_DARK_BRICKS_CHISELED, CONCRETE_DARK_SMOOTH, CONCRETE_LIGHT_STONE, - CONCRETE_LIGHT_COBBLE, CONCRETE_LIGHT_COBBLE_MOSSY, CONCRETE_LIGHT_BRICKS, - CONCRETE_LIGHT_BRICKS_CRACKED, CONCRETE_LIGHT_BRICKS_MOSSY, CONCRETE_LIGHT_BRICKS_CHISELED, - CONCRETE_LIGHT_SMOOTH, }, - STONES = { MARBLE_STONE, MARBLE_COBBLE, MARBLE_COBBLE_MOSSY, MARBLE_BRICKS, MARBLE_BRICKS_CRACKED, - MARBLE_BRICKS_MOSSY, MARBLE_BRICKS_CHISELED, MARBLE_SMOOTH, BASALT_STONE, BASALT_COBBLE, - BASALT_COBBLE_MOSSY, BASALT_BRICKS, BASALT_BRICKS_CRACKED, BASALT_BRICKS_MOSSY, - BASALT_BRICKS_CHISELED, BASALT_SMOOTH, }, - TURBINE = { LARGETURBINE_ST1, LARGETURBINE_ST2, LARGETURBINE_ST3, LARGETURBINE_ST4, LARGETURBINE_ST5, - LARGETURBINE_ST6, LARGETURBINE_ST7, LARGETURBINE_ST8, LARGETURBINE_ST9 }, - TURBINE_ACTIVE = { LARGETURBINE_ST_ACTIVE1, LARGETURBINE_ST_ACTIVE2, LARGETURBINE_ST_ACTIVE3, - LARGETURBINE_ST_ACTIVE4, LARGETURBINE_ST_ACTIVE5, LARGETURBINE_ST_ACTIVE6, - LARGETURBINE_ST_ACTIVE7, LARGETURBINE_ST_ACTIVE8, LARGETURBINE_ST_ACTIVE9 }, - TURBINE_EMPTY = { LARGETURBINE_ST_EMPTY1, LARGETURBINE_ST_EMPTY2, LARGETURBINE_ST_EMPTY3, - LARGETURBINE_ST_EMPTY4, LARGETURBINE_ST_EMPTY5, LARGETURBINE_ST_EMPTY6, LARGETURBINE_ST_EMPTY7, - LARGETURBINE_ST_EMPTY8, LARGETURBINE_ST_EMPTY9 }, - TURBINE_NEW = { LARGETURBINE_NEW1, LARGETURBINE_NEW2, LARGETURBINE_NEW3, LARGETURBINE_NEW4, - LARGETURBINE_NEW5, LARGETURBINE_NEW6, LARGETURBINE_NEW7, LARGETURBINE_NEW8, LARGETURBINE_NEW9 }, - TURBINE_NEW_ACTIVE = { LARGETURBINE_NEW_ACTIVE1, LARGETURBINE_NEW_ACTIVE2, LARGETURBINE_NEW_ACTIVE3, - LARGETURBINE_NEW_ACTIVE4, LARGETURBINE_NEW_ACTIVE5, LARGETURBINE_NEW_ACTIVE6, - LARGETURBINE_NEW_ACTIVE7, LARGETURBINE_NEW_ACTIVE8, LARGETURBINE_NEW_ACTIVE9 }, - TURBINE_NEW_EMPTY = { LARGETURBINE_NEW_EMPTY1, LARGETURBINE_NEW_EMPTY2, LARGETURBINE_NEW_EMPTY3, - LARGETURBINE_NEW_EMPTY4, LARGETURBINE_NEW_EMPTY5, LARGETURBINE_NEW_EMPTY6, - LARGETURBINE_NEW_EMPTY7, LARGETURBINE_NEW_EMPTY8, LARGETURBINE_NEW_EMPTY9 }, - TURBINE1 = { LARGETURBINE_SS1, LARGETURBINE_SS2, LARGETURBINE_SS3, LARGETURBINE_SS4, LARGETURBINE_SS5, - LARGETURBINE_SS6, LARGETURBINE_SS7, LARGETURBINE_SS8, LARGETURBINE_SS9 }, - TURBINE_ACTIVE1 = { LARGETURBINE_SS_ACTIVE1, LARGETURBINE_SS_ACTIVE2, LARGETURBINE_SS_ACTIVE3, - LARGETURBINE_SS_ACTIVE4, LARGETURBINE_SS_ACTIVE5, LARGETURBINE_SS_ACTIVE6, - LARGETURBINE_SS_ACTIVE7, LARGETURBINE_SS_ACTIVE8, LARGETURBINE_SS_ACTIVE9 }, - TURBINE_EMPTY1 = { LARGETURBINE_SS_EMPTY1, LARGETURBINE_SS_EMPTY2, LARGETURBINE_SS_EMPTY3, - LARGETURBINE_SS_EMPTY4, LARGETURBINE_SS_EMPTY5, LARGETURBINE_SS_EMPTY6, LARGETURBINE_SS_EMPTY7, - LARGETURBINE_SS_EMPTY8, LARGETURBINE_SS_EMPTY9 }, - TURBINE2 = { LARGETURBINE_TI1, LARGETURBINE_TI2, LARGETURBINE_TI3, LARGETURBINE_TI4, LARGETURBINE_TI5, - LARGETURBINE_TI6, LARGETURBINE_TI7, LARGETURBINE_TI8, LARGETURBINE_TI9 }, - TURBINE_ACTIVE2 = { LARGETURBINE_TI_ACTIVE1, LARGETURBINE_TI_ACTIVE2, LARGETURBINE_TI_ACTIVE3, - LARGETURBINE_TI_ACTIVE4, LARGETURBINE_TI_ACTIVE5, LARGETURBINE_TI_ACTIVE6, - LARGETURBINE_TI_ACTIVE7, LARGETURBINE_TI_ACTIVE8, LARGETURBINE_TI_ACTIVE9 }, - TURBINE_EMPTY2 = { LARGETURBINE_TI_EMPTY1, LARGETURBINE_TI_EMPTY2, LARGETURBINE_TI_EMPTY3, - LARGETURBINE_TI_EMPTY4, LARGETURBINE_TI_EMPTY5, LARGETURBINE_TI_EMPTY6, LARGETURBINE_TI_EMPTY7, - LARGETURBINE_TI_EMPTY8, LARGETURBINE_TI_EMPTY9 }, - TURBINE3 = { LARGETURBINE_TU1, LARGETURBINE_TU2, LARGETURBINE_TU3, LARGETURBINE_TU4, LARGETURBINE_TU5, - LARGETURBINE_TU6, LARGETURBINE_TU7, LARGETURBINE_TU8, LARGETURBINE_TU9 }, - TURBINE_ACTIVE3 = { LARGETURBINE_TU_ACTIVE1, LARGETURBINE_TU_ACTIVE2, LARGETURBINE_TU_ACTIVE3, - LARGETURBINE_TU_ACTIVE4, LARGETURBINE_TU_ACTIVE5, LARGETURBINE_TU_ACTIVE6, - LARGETURBINE_TU_ACTIVE7, LARGETURBINE_TU_ACTIVE8, LARGETURBINE_TU_ACTIVE9 }, - TURBINE_EMPTY3 = { LARGETURBINE_TU_EMPTY1, LARGETURBINE_TU_EMPTY2, LARGETURBINE_TU_EMPTY3, - LARGETURBINE_TU_EMPTY4, LARGETURBINE_TU_EMPTY5, LARGETURBINE_TU_EMPTY6, LARGETURBINE_TU_EMPTY7, - LARGETURBINE_TU_EMPTY8, LARGETURBINE_TU_EMPTY9 }, - TURBINEADVGAS = { LARGETURBINE_ADVGAS1, LARGETURBINE_ADVGAS2, LARGETURBINE_ADVGAS3, - LARGETURBINE_ADVGAS4, LARGETURBINE_ADVGAS5, LARGETURBINE_ADVGAS6, LARGETURBINE_ADVGAS7, - LARGETURBINE_ADVGAS8, LARGETURBINE_ADVGAS9 }, - TURBINE_ADVGASACTIVE = { LARGETURBINE_ADVGAS_ACTIVE1, LARGETURBINE_ADVGAS_ACTIVE2, - LARGETURBINE_ADVGAS_ACTIVE3, LARGETURBINE_ADVGAS_ACTIVE4, LARGETURBINE_ADVGAS_ACTIVE5, - LARGETURBINE_ADVGAS_ACTIVE6, LARGETURBINE_ADVGAS_ACTIVE7, LARGETURBINE_ADVGAS_ACTIVE8, - LARGETURBINE_ADVGAS_ACTIVE9 }, - TURBINE_ADVGASEMPTY = { LARGETURBINE_ADVGAS_EMPTY1, LARGETURBINE_ADVGAS_EMPTY2, - LARGETURBINE_ADVGAS_EMPTY3, LARGETURBINE_ADVGAS_EMPTY4, LARGETURBINE_ADVGAS_EMPTY5, - LARGETURBINE_ADVGAS_EMPTY6, LARGETURBINE_ADVGAS_EMPTY7, LARGETURBINE_ADVGAS_EMPTY8, - LARGETURBINE_ADVGAS_EMPTY9 }, - CONNECTED_HULLS = { CONCRETE_DARK_STONE, FUSIONI_1, FUSIONI_2, FUSIONI_3, FUSIONI_4, FUSIONI_5, - FUSIONI_6, FUSIONI_7, FUSIONI_8, FUSIONI_9, FUSIONI_10, FUSIONI_11, FUSIONI_12, FUSIONII_1, - FUSIONII_2, FUSIONII_3, FUSIONII_4, FUSIONII_5, FUSIONII_6, FUSIONII_7, FUSIONII_8, FUSIONII_9, - FUSIONII_10, FUSIONII_11, FUSIONII_12, }, - STORAGE_BLOCKS1 = { BLOCK_ADAMANTIUM, BLOCK_ALUMINIUM, BLOCK_AMERICIUM, BLOCK_ANNEALEDCOPPER, - BLOCK_ANTIMONY, BLOCK_ARSENIC, BLOCK_ASTRALSILVER, BLOCK_BATTERYALLOY, BLOCK_BERYLLIUM, - BLOCK_BISMUTH, BLOCK_BISMUTHBRONZE, BLOCK_BLACKBRONZE, BLOCK_BLACKSTEEL, BLOCK_BLUEALLOY, - BLOCK_BLUESTEEL, BLOCK_BRASS }, - STORAGE_BLOCKS2 = { BLOCK_BRONZE, BLOCK_CAESIUM, BLOCK_CERIUM, BLOCK_CHROME, BLOCK_CHROMIUMDIOXIDE, - BLOCK_COBALT, BLOCK_COBALTBRASS, BLOCK_COPPER, BLOCK_CUPRONICKEL, BLOCK_DAMASCUSSTEEL, - BLOCK_DARKIRON, BLOCK_DEEPIRON, BLOCK_DESH, BLOCK_DURANIUM, BLOCK_DYSPROSIUM, BLOCK_ELECTRUM }, - STORAGE_BLOCKS3 = { BLOCK_ELECTRUMFLUX, BLOCK_ENDERIUM, BLOCK_ERBIUM, BLOCK_EUROPIUM, BLOCK_FIERYSTEEL, - BLOCK_GADOLINIUM, BLOCK_GALLIUM, BLOCK_HOLMIUM, BLOCK_HSLA, BLOCK_INDIUM, BLOCK_INFUSEDGOLD, - BLOCK_INVAR, BLOCK_IRIDIUM, BLOCK_IRONMAGNETIC, BLOCK_IRONWOOD, BLOCK_KANTHAL }, - STORAGE_BLOCKS4 = { BLOCK_KNIGHTMETAL, BLOCK_LANTHANUM, BLOCK_LEAD, BLOCK_LUTETIUM, BLOCK_MAGNALIUM, - BLOCK_MAGNESIUM, BLOCK_MANGANESE, BLOCK_METEORICIRON, BLOCK_METEORICSTEEL, BLOCK_TRINIUM, - BLOCK_MITHRIL, BLOCK_MOLYBDENUM, BLOCK_NAQUADAH, BLOCK_NAQUADAHALLOY, BLOCK_NAQUADAHENRICHED, - BLOCK_NAQUADRIA }, - STORAGE_BLOCKS5 = { BLOCK_NEODYMIUM, BLOCK_NEODYMIUMMAGNETIC, BLOCK_NEUTRONIUM, BLOCK_NICHROME, - BLOCK_NICKEL, BLOCK_NIOBIUM, BLOCK_NIOBIUMNITRIDE, BLOCK_NIOBIUMTITANIUM, BLOCK_OSMIRIDIUM, - BLOCK_OSMIUM, BLOCK_PALLADIUM, BLOCK_PIGIRON, BLOCK_PLATINUM, BLOCK_PLUTONIUM, - BLOCK_PLUTONIUM241, BLOCK_PRASEODYMIUM }, - STORAGE_BLOCKS6 = { BLOCK_PROMETHIUM, BLOCK_REDALLOY, BLOCK_REDSTEEL, BLOCK_ROSEGOLD, BLOCK_RUBIDIUM, - BLOCK_SAMARIUM, BLOCK_SCANDIUM, BLOCK_SHADOWIRON, BLOCK_SHADOWSTEEL, BLOCK_SILICON, - BLOCK_SILVER, BLOCK_SOLDERINGALLOY, BLOCK_STAINLESSSTEEL, BLOCK_STEEL, BLOCK_STEELMAGNETIC, - BLOCK_STERLINGSILVER }, - STORAGE_BLOCKS7 = { BLOCK_SUNNARIUM, BLOCK_TANTALUM, BLOCK_TELLURIUM, BLOCK_TERBIUM, BLOCK_THAUMIUM, - BLOCK_THORIUM, BLOCK_THULIUM, BLOCK_TIN, BLOCK_TINALLOY, BLOCK_TITANIUM, BLOCK_TRITANIUM, - BLOCK_TUNGSTEN, BLOCK_TUNGSTENSTEEL, BLOCK_ULTIMET, BLOCK_URANIUM, BLOCK_URANIUM235 }, - STORAGE_BLOCKS8 = { BLOCK_VANADIUM, BLOCK_VANADIUMGALLIUM, BLOCK_WROUGHTIRON, BLOCK_YTTRBIUM, - BLOCK_YTTRIUM, BLOCK_YTTRIUMBARIUMCUPRATE, BLOCK_ZINC, BLOCK_TUNGSTENCARBIDE, - BLOCK_VANADIUMSTEEL, BLOCK_HSSG, BLOCK_HSSE, BLOCK_HSSS, BLOCK_STEELEAF, BLOCK_ICHORIUM, - BLOCK_FIRESTONE, BLOCK_SHADOW }, - STORAGE_BLOCKS9 = { BLOCK_AERCRYSTAL, BLOCK_AMBER, BLOCK_AMETHYST, BLOCK_AQUACRYSTAL, BLOCK_BLUETOPAZ, - BLOCK_CERTUSQUARTZ, BLOCK_DILITHIUM, BLOCK_ENDEREYE, BLOCK_ENDERPEARL, BLOCK_FOOLSRUBY, - BLOCK_FORCE, BLOCK_FORCICIUM, BLOCK_FORCILLIUM, BLOCK_GREENSAPPHIRE, BLOCK_IGNISCRYSTAL, - BLOCK_JASPER }, - STORAGE_BLOCKS10 = { BLOCK_LAZURITE, BLOCK_LIGNITE, BLOCK_MONAZITE, BLOCK_NITER, BLOCK_OLIVINE, - BLOCK_OPAL, BLOCK_ORDOCRYSTAL, BLOCK_PERDITIOCRYSTAL, BLOCK_PHOSPHORUS, BLOCK_QUARTZITE, - BLOCK_REDGARNET, BLOCK_RUBY, BLOCK_SAPPHIRE, BLOCK_SODALITE, BLOCK_TANZANITE, - BLOCK_TERRACRYSTAL }, - STORAGE_BLOCKS11 = { BLOCK_TOPAZ, BLOCK_VINTEUM, BLOCK_YELLOWGARNET, BLOCK_NETHERSTAR, BLOCK_CHARCOAL, - BLOCK_BLAZE }, - STORAGE_BLOCKS12 = { BLOCK_CRYOLITE, BLOCK_SILICONSG, BLOCK_NICKELALUMINIUM, BLOCK_SPACETIME, - BLOCK_TRANSCENDENTMETAL, BLOCK_ORIHARUKON, BLOCK_WHITEDWARFMATTER, BLOCK_BLACKDWARFMATTER, - BLOCK_UNIVERSIUM }; + MACHINE_HV_SIDE, MACHINE_EV_SIDE, MACHINE_IV_SIDE, MACHINE_LuV_SIDE, MACHINE_ZPM_SIDE, MACHINE_UV_SIDE, + MACHINE_MAX_SIDE, MACHINE_UEV_SIDE, MACHINE_UIV_SIDE, MACHINE_UMV_SIDE, MACHINE_UXV_SIDE, + MACHINE_MAXV_SIDE, }, + MACHINECASINGS_TOP = { MACHINE_8V_TOP, MACHINE_LV_TOP, MACHINE_MV_TOP, MACHINE_HV_TOP, MACHINE_EV_TOP, + MACHINE_IV_TOP, MACHINE_LuV_TOP, MACHINE_ZPM_TOP, MACHINE_UV_TOP, MACHINE_MAX_TOP, MACHINE_UEV_TOP, + MACHINE_UIV_TOP, MACHINE_UMV_TOP, MACHINE_UXV_TOP, MACHINE_MAXV_TOP, }, + MACHINECASINGS_BOTTOM = { MACHINE_8V_BOTTOM, MACHINE_LV_BOTTOM, MACHINE_MV_BOTTOM, MACHINE_HV_BOTTOM, + MACHINE_EV_BOTTOM, MACHINE_IV_BOTTOM, MACHINE_LuV_BOTTOM, MACHINE_ZPM_BOTTOM, MACHINE_UV_BOTTOM, + MACHINE_MAX_BOTTOM, MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM, MACHINE_UMV_BOTTOM, MACHINE_UXV_BOTTOM, + MACHINE_MAXV_BOTTOM, }, + GRANITES = { GRANITE_BLACK_STONE, GRANITE_BLACK_COBBLE, GRANITE_BLACK_COBBLE_MOSSY, GRANITE_BLACK_BRICKS, + GRANITE_BLACK_BRICKS_CRACKED, GRANITE_BLACK_BRICKS_MOSSY, GRANITE_BLACK_BRICKS_CHISELED, + GRANITE_BLACK_SMOOTH, GRANITE_RED_STONE, GRANITE_RED_COBBLE, GRANITE_RED_COBBLE_MOSSY, + GRANITE_RED_BRICKS, GRANITE_RED_BRICKS_CRACKED, GRANITE_RED_BRICKS_MOSSY, GRANITE_RED_BRICKS_CHISELED, + GRANITE_RED_SMOOTH, }, + CONCRETES = { CONCRETE_DARK_STONE, CONCRETE_DARK_COBBLE, CONCRETE_DARK_COBBLE_MOSSY, CONCRETE_DARK_BRICKS, + CONCRETE_DARK_BRICKS_CRACKED, CONCRETE_DARK_BRICKS_MOSSY, CONCRETE_DARK_BRICKS_CHISELED, + CONCRETE_DARK_SMOOTH, CONCRETE_LIGHT_STONE, CONCRETE_LIGHT_COBBLE, CONCRETE_LIGHT_COBBLE_MOSSY, + CONCRETE_LIGHT_BRICKS, CONCRETE_LIGHT_BRICKS_CRACKED, CONCRETE_LIGHT_BRICKS_MOSSY, + CONCRETE_LIGHT_BRICKS_CHISELED, CONCRETE_LIGHT_SMOOTH, }, + STONES = { MARBLE_STONE, MARBLE_COBBLE, MARBLE_COBBLE_MOSSY, MARBLE_BRICKS, MARBLE_BRICKS_CRACKED, + MARBLE_BRICKS_MOSSY, MARBLE_BRICKS_CHISELED, MARBLE_SMOOTH, BASALT_STONE, BASALT_COBBLE, + BASALT_COBBLE_MOSSY, BASALT_BRICKS, BASALT_BRICKS_CRACKED, BASALT_BRICKS_MOSSY, BASALT_BRICKS_CHISELED, + BASALT_SMOOTH, }, + TURBINE = { LARGETURBINE_ST1, LARGETURBINE_ST2, LARGETURBINE_ST3, LARGETURBINE_ST4, LARGETURBINE_ST5, + LARGETURBINE_ST6, LARGETURBINE_ST7, LARGETURBINE_ST8, LARGETURBINE_ST9 }, + TURBINE_ACTIVE = { LARGETURBINE_ST_ACTIVE1, LARGETURBINE_ST_ACTIVE2, LARGETURBINE_ST_ACTIVE3, + LARGETURBINE_ST_ACTIVE4, LARGETURBINE_ST_ACTIVE5, LARGETURBINE_ST_ACTIVE6, LARGETURBINE_ST_ACTIVE7, + LARGETURBINE_ST_ACTIVE8, LARGETURBINE_ST_ACTIVE9 }, + TURBINE_EMPTY = { LARGETURBINE_ST_EMPTY1, LARGETURBINE_ST_EMPTY2, LARGETURBINE_ST_EMPTY3, + LARGETURBINE_ST_EMPTY4, LARGETURBINE_ST_EMPTY5, LARGETURBINE_ST_EMPTY6, LARGETURBINE_ST_EMPTY7, + LARGETURBINE_ST_EMPTY8, LARGETURBINE_ST_EMPTY9 }, + TURBINE_NEW = { LARGETURBINE_NEW1, LARGETURBINE_NEW2, LARGETURBINE_NEW3, LARGETURBINE_NEW4, + LARGETURBINE_NEW5, LARGETURBINE_NEW6, LARGETURBINE_NEW7, LARGETURBINE_NEW8, LARGETURBINE_NEW9 }, + TURBINE_NEW_ACTIVE = { LARGETURBINE_NEW_ACTIVE1, LARGETURBINE_NEW_ACTIVE2, LARGETURBINE_NEW_ACTIVE3, + LARGETURBINE_NEW_ACTIVE4, LARGETURBINE_NEW_ACTIVE5, LARGETURBINE_NEW_ACTIVE6, LARGETURBINE_NEW_ACTIVE7, + LARGETURBINE_NEW_ACTIVE8, LARGETURBINE_NEW_ACTIVE9 }, + TURBINE_NEW_EMPTY = { LARGETURBINE_NEW_EMPTY1, LARGETURBINE_NEW_EMPTY2, LARGETURBINE_NEW_EMPTY3, + LARGETURBINE_NEW_EMPTY4, LARGETURBINE_NEW_EMPTY5, LARGETURBINE_NEW_EMPTY6, LARGETURBINE_NEW_EMPTY7, + LARGETURBINE_NEW_EMPTY8, LARGETURBINE_NEW_EMPTY9 }, + TURBINE1 = { LARGETURBINE_SS1, LARGETURBINE_SS2, LARGETURBINE_SS3, LARGETURBINE_SS4, LARGETURBINE_SS5, + LARGETURBINE_SS6, LARGETURBINE_SS7, LARGETURBINE_SS8, LARGETURBINE_SS9 }, + TURBINE_ACTIVE1 = { LARGETURBINE_SS_ACTIVE1, LARGETURBINE_SS_ACTIVE2, LARGETURBINE_SS_ACTIVE3, + LARGETURBINE_SS_ACTIVE4, LARGETURBINE_SS_ACTIVE5, LARGETURBINE_SS_ACTIVE6, LARGETURBINE_SS_ACTIVE7, + LARGETURBINE_SS_ACTIVE8, LARGETURBINE_SS_ACTIVE9 }, + TURBINE_EMPTY1 = { LARGETURBINE_SS_EMPTY1, LARGETURBINE_SS_EMPTY2, LARGETURBINE_SS_EMPTY3, + LARGETURBINE_SS_EMPTY4, LARGETURBINE_SS_EMPTY5, LARGETURBINE_SS_EMPTY6, LARGETURBINE_SS_EMPTY7, + LARGETURBINE_SS_EMPTY8, LARGETURBINE_SS_EMPTY9 }, + TURBINE2 = { LARGETURBINE_TI1, LARGETURBINE_TI2, LARGETURBINE_TI3, LARGETURBINE_TI4, LARGETURBINE_TI5, + LARGETURBINE_TI6, LARGETURBINE_TI7, LARGETURBINE_TI8, LARGETURBINE_TI9 }, + TURBINE_ACTIVE2 = { LARGETURBINE_TI_ACTIVE1, LARGETURBINE_TI_ACTIVE2, LARGETURBINE_TI_ACTIVE3, + LARGETURBINE_TI_ACTIVE4, LARGETURBINE_TI_ACTIVE5, LARGETURBINE_TI_ACTIVE6, LARGETURBINE_TI_ACTIVE7, + LARGETURBINE_TI_ACTIVE8, LARGETURBINE_TI_ACTIVE9 }, + TURBINE_EMPTY2 = { LARGETURBINE_TI_EMPTY1, LARGETURBINE_TI_EMPTY2, LARGETURBINE_TI_EMPTY3, + LARGETURBINE_TI_EMPTY4, LARGETURBINE_TI_EMPTY5, LARGETURBINE_TI_EMPTY6, LARGETURBINE_TI_EMPTY7, + LARGETURBINE_TI_EMPTY8, LARGETURBINE_TI_EMPTY9 }, + TURBINE3 = { LARGETURBINE_TU1, LARGETURBINE_TU2, LARGETURBINE_TU3, LARGETURBINE_TU4, LARGETURBINE_TU5, + LARGETURBINE_TU6, LARGETURBINE_TU7, LARGETURBINE_TU8, LARGETURBINE_TU9 }, + TURBINE_ACTIVE3 = { LARGETURBINE_TU_ACTIVE1, LARGETURBINE_TU_ACTIVE2, LARGETURBINE_TU_ACTIVE3, + LARGETURBINE_TU_ACTIVE4, LARGETURBINE_TU_ACTIVE5, LARGETURBINE_TU_ACTIVE6, LARGETURBINE_TU_ACTIVE7, + LARGETURBINE_TU_ACTIVE8, LARGETURBINE_TU_ACTIVE9 }, + TURBINE_EMPTY3 = { LARGETURBINE_TU_EMPTY1, LARGETURBINE_TU_EMPTY2, LARGETURBINE_TU_EMPTY3, + LARGETURBINE_TU_EMPTY4, LARGETURBINE_TU_EMPTY5, LARGETURBINE_TU_EMPTY6, LARGETURBINE_TU_EMPTY7, + LARGETURBINE_TU_EMPTY8, LARGETURBINE_TU_EMPTY9 }, + TURBINEADVGAS = { LARGETURBINE_ADVGAS1, LARGETURBINE_ADVGAS2, LARGETURBINE_ADVGAS3, LARGETURBINE_ADVGAS4, + LARGETURBINE_ADVGAS5, LARGETURBINE_ADVGAS6, LARGETURBINE_ADVGAS7, LARGETURBINE_ADVGAS8, + LARGETURBINE_ADVGAS9 }, + TURBINE_ADVGASACTIVE = { LARGETURBINE_ADVGAS_ACTIVE1, LARGETURBINE_ADVGAS_ACTIVE2, + LARGETURBINE_ADVGAS_ACTIVE3, LARGETURBINE_ADVGAS_ACTIVE4, LARGETURBINE_ADVGAS_ACTIVE5, + LARGETURBINE_ADVGAS_ACTIVE6, LARGETURBINE_ADVGAS_ACTIVE7, LARGETURBINE_ADVGAS_ACTIVE8, + LARGETURBINE_ADVGAS_ACTIVE9 }, + TURBINE_ADVGASEMPTY = { LARGETURBINE_ADVGAS_EMPTY1, LARGETURBINE_ADVGAS_EMPTY2, LARGETURBINE_ADVGAS_EMPTY3, + LARGETURBINE_ADVGAS_EMPTY4, LARGETURBINE_ADVGAS_EMPTY5, LARGETURBINE_ADVGAS_EMPTY6, + LARGETURBINE_ADVGAS_EMPTY7, LARGETURBINE_ADVGAS_EMPTY8, LARGETURBINE_ADVGAS_EMPTY9 }, + CONNECTED_HULLS = { CONCRETE_DARK_STONE, FUSIONI_1, FUSIONI_2, FUSIONI_3, FUSIONI_4, FUSIONI_5, FUSIONI_6, + FUSIONI_7, FUSIONI_8, FUSIONI_9, FUSIONI_10, FUSIONI_11, FUSIONI_12, FUSIONII_1, FUSIONII_2, FUSIONII_3, + FUSIONII_4, FUSIONII_5, FUSIONII_6, FUSIONII_7, FUSIONII_8, FUSIONII_9, FUSIONII_10, FUSIONII_11, + FUSIONII_12, }, + STORAGE_BLOCKS1 = { BLOCK_ADAMANTIUM, BLOCK_ALUMINIUM, BLOCK_AMERICIUM, BLOCK_ANNEALEDCOPPER, + BLOCK_ANTIMONY, BLOCK_ARSENIC, BLOCK_ASTRALSILVER, BLOCK_BATTERYALLOY, BLOCK_BERYLLIUM, BLOCK_BISMUTH, + BLOCK_BISMUTHBRONZE, BLOCK_BLACKBRONZE, BLOCK_BLACKSTEEL, BLOCK_BLUEALLOY, BLOCK_BLUESTEEL, + BLOCK_BRASS }, + STORAGE_BLOCKS2 = { BLOCK_BRONZE, BLOCK_CAESIUM, BLOCK_CERIUM, BLOCK_CHROME, BLOCK_CHROMIUMDIOXIDE, + BLOCK_COBALT, BLOCK_COBALTBRASS, BLOCK_COPPER, BLOCK_CUPRONICKEL, BLOCK_DAMASCUSSTEEL, BLOCK_DARKIRON, + BLOCK_DEEPIRON, BLOCK_DESH, BLOCK_DURANIUM, BLOCK_DYSPROSIUM, BLOCK_ELECTRUM }, + STORAGE_BLOCKS3 = { BLOCK_ELECTRUMFLUX, BLOCK_ENDERIUM, BLOCK_ERBIUM, BLOCK_EUROPIUM, BLOCK_FIERYSTEEL, + BLOCK_GADOLINIUM, BLOCK_GALLIUM, BLOCK_HOLMIUM, BLOCK_HSLA, BLOCK_INDIUM, BLOCK_INFUSEDGOLD, + BLOCK_INVAR, BLOCK_IRIDIUM, BLOCK_IRONMAGNETIC, BLOCK_IRONWOOD, BLOCK_KANTHAL }, + STORAGE_BLOCKS4 = { BLOCK_KNIGHTMETAL, BLOCK_LANTHANUM, BLOCK_LEAD, BLOCK_LUTETIUM, BLOCK_MAGNALIUM, + BLOCK_MAGNESIUM, BLOCK_MANGANESE, BLOCK_METEORICIRON, BLOCK_METEORICSTEEL, BLOCK_TRINIUM, BLOCK_MITHRIL, + BLOCK_MOLYBDENUM, BLOCK_NAQUADAH, BLOCK_NAQUADAHALLOY, BLOCK_NAQUADAHENRICHED, BLOCK_NAQUADRIA }, + STORAGE_BLOCKS5 = { BLOCK_NEODYMIUM, BLOCK_NEODYMIUMMAGNETIC, BLOCK_NEUTRONIUM, BLOCK_NICHROME, + BLOCK_NICKEL, BLOCK_NIOBIUM, BLOCK_NIOBIUMNITRIDE, BLOCK_NIOBIUMTITANIUM, BLOCK_OSMIRIDIUM, + BLOCK_OSMIUM, BLOCK_PALLADIUM, BLOCK_PIGIRON, BLOCK_PLATINUM, BLOCK_PLUTONIUM, BLOCK_PLUTONIUM241, + BLOCK_PRASEODYMIUM }, + STORAGE_BLOCKS6 = { BLOCK_PROMETHIUM, BLOCK_REDALLOY, BLOCK_REDSTEEL, BLOCK_ROSEGOLD, BLOCK_RUBIDIUM, + BLOCK_SAMARIUM, BLOCK_SCANDIUM, BLOCK_SHADOWIRON, BLOCK_SHADOWSTEEL, BLOCK_SILICON, BLOCK_SILVER, + BLOCK_SOLDERINGALLOY, BLOCK_STAINLESSSTEEL, BLOCK_STEEL, BLOCK_STEELMAGNETIC, BLOCK_STERLINGSILVER }, + STORAGE_BLOCKS7 = { BLOCK_SUNNARIUM, BLOCK_TANTALUM, BLOCK_TELLURIUM, BLOCK_TERBIUM, BLOCK_THAUMIUM, + BLOCK_THORIUM, BLOCK_THULIUM, BLOCK_TIN, BLOCK_TINALLOY, BLOCK_TITANIUM, BLOCK_TRITANIUM, + BLOCK_TUNGSTEN, BLOCK_TUNGSTENSTEEL, BLOCK_ULTIMET, BLOCK_URANIUM, BLOCK_URANIUM235 }, + STORAGE_BLOCKS8 = { BLOCK_VANADIUM, BLOCK_VANADIUMGALLIUM, BLOCK_WROUGHTIRON, BLOCK_YTTRBIUM, BLOCK_YTTRIUM, + BLOCK_YTTRIUMBARIUMCUPRATE, BLOCK_ZINC, BLOCK_TUNGSTENCARBIDE, BLOCK_VANADIUMSTEEL, BLOCK_HSSG, + BLOCK_HSSE, BLOCK_HSSS, BLOCK_STEELEAF, BLOCK_ICHORIUM, BLOCK_FIRESTONE, BLOCK_SHADOW }, + STORAGE_BLOCKS9 = { BLOCK_AERCRYSTAL, BLOCK_AMBER, BLOCK_AMETHYST, BLOCK_AQUACRYSTAL, BLOCK_BLUETOPAZ, + BLOCK_CERTUSQUARTZ, BLOCK_DILITHIUM, BLOCK_ENDEREYE, BLOCK_ENDERPEARL, BLOCK_FOOLSRUBY, BLOCK_FORCE, + BLOCK_FORCICIUM, BLOCK_FORCILLIUM, BLOCK_GREENSAPPHIRE, BLOCK_IGNISCRYSTAL, BLOCK_JASPER }, + STORAGE_BLOCKS10 = { BLOCK_LAZURITE, BLOCK_LIGNITE, BLOCK_MONAZITE, BLOCK_NITER, BLOCK_OLIVINE, BLOCK_OPAL, + BLOCK_ORDOCRYSTAL, BLOCK_PERDITIOCRYSTAL, BLOCK_PHOSPHORUS, BLOCK_QUARTZITE, BLOCK_REDGARNET, + BLOCK_RUBY, BLOCK_SAPPHIRE, BLOCK_SODALITE, BLOCK_TANZANITE, BLOCK_TERRACRYSTAL }, + STORAGE_BLOCKS11 = { BLOCK_TOPAZ, BLOCK_VINTEUM, BLOCK_YELLOWGARNET, BLOCK_NETHERSTAR, BLOCK_CHARCOAL, + BLOCK_BLAZE }, + STORAGE_BLOCKS12 = { BLOCK_CRYOLITE, BLOCK_SILICONSG, BLOCK_NICKELALUMINIUM, BLOCK_SPACETIME, + BLOCK_TRANSCENDENTMETAL, BLOCK_ORIHARUKON, BLOCK_WHITEDWARFMATTER, BLOCK_BLACKDWARFMATTER, + BLOCK_UNIVERSIUM }; public static final ITexture[] HIDDEN_TEXTURE = { TextureFactory.builder() - .addIcon(HIDDEN_FACE) - .stdOrient() - .build() }; + .addIcon(HIDDEN_FACE) + .stdOrient() + .build() }; public static final ITexture[] ERROR_RENDERING = { TextureFactory.of(RENDERING_ERROR) }; public static final ITexture[] OVERLAYS_ENERGY_IN = { - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 180, 180, 180, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 220, 220, 220, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 255, 100, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 255, 255, 30, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 128, 128, 128, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 240, 240, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 220, 220, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 200, 200, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 180, 180, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 160, 160, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 140, 140, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 120, 120, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 100, 100, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 80, 80, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 60, 60, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 40, 40, 245, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 180, 180, 180, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 220, 220, 220, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 255, 100, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 255, 255, 30, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 128, 128, 128, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 240, 240, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 220, 220, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 200, 200, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 180, 180, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 160, 160, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 140, 140, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 120, 120, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 100, 100, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 80, 80, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 60, 60, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN, new short[] { 40, 40, 245, 0 }), }; public static ITexture[] OVERLAYS_ENERGY_OUT = { - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 180, 180, 180, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 220, 220, 220, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 255, 100, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 255, 255, 30, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 128, 128, 128, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 240, 240, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 220, 220, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 200, 200, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 180, 180, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 160, 160, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 140, 140, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 120, 120, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 100, 100, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 80, 80, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 60, 60, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 40, 40, 245, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 180, 180, 180, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 220, 220, 220, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 255, 100, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 255, 255, 30, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 128, 128, 128, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 240, 240, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 220, 220, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 200, 200, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 180, 180, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 160, 160, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 140, 140, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 120, 120, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 100, 100, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 80, 80, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 60, 60, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT, new short[] { 40, 40, 245, 0 }), }; public static final ITexture[] OVERLAYS_ENERGY_IN_MULTI = { - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 180, 180, 180, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 220, 220, 220, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 255, 100, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 255, 255, 30, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 128, 128, 128, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 240, 240, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 220, 220, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 200, 200, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 180, 180, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 160, 160, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 140, 140, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 120, 120, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 100, 100, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 80, 80, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 60, 60, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 40, 40, 245, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 180, 180, 180, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 220, 220, 220, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 255, 100, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 255, 255, 30, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 128, 128, 128, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 240, 240, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 220, 220, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 200, 200, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 180, 180, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 160, 160, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 140, 140, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 120, 120, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 100, 100, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 80, 80, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 60, 60, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[] { 40, 40, 245, 0 }), }; public static final ITexture[] OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON = { - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), - TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 255, 255, 255, 0 }), }; public static final ITexture[] OVERLAYS_ENERGY_IN_MULTI_WIRELESS_OFF = { - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[] { 0, 0, 0, 0 }), }; public static final ITexture[] OVERLAYS_ENERGY_OUT_MULTI = { - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 180, 180, 180, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 220, 220, 220, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 255, 100, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 255, 255, 30, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 128, 128, 128, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 240, 240, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 220, 220, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 200, 200, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 180, 180, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 160, 160, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 140, 140, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 120, 120, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 100, 100, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 80, 80, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 60, 60, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 40, 40, 245, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 180, 180, 180, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 220, 220, 220, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 255, 100, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 255, 255, 30, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 128, 128, 128, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 240, 240, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 220, 220, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 200, 200, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 180, 180, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 160, 160, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 140, 140, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 120, 120, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 100, 100, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 80, 80, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 60, 60, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[] { 40, 40, 245, 0 }), }; public static final ITexture[] OVERLAYS_ENERGY_IN_POWER = { - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 180, 180, 180, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 220, 220, 220, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 255, 100, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 255, 255, 30, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 128, 128, 128, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 240, 240, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 220, 220, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 200, 200, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 180, 180, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 160, 160, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 140, 140, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 120, 120, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 100, 100, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 80, 80, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 60, 60, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 40, 40, 245, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 180, 180, 180, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 220, 220, 220, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 255, 100, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 255, 255, 30, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 128, 128, 128, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 240, 240, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 220, 220, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 200, 200, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 180, 180, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 160, 160, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 140, 140, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 120, 120, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 100, 100, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 80, 80, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 60, 60, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[] { 40, 40, 245, 0 }), }; public static final ITexture[] OVERLAYS_ENERGY_OUT_POWER = { - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 180, 180, 180, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 220, 220, 220, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 255, 100, 0, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 255, 255, 30, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 128, 128, 128, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 240, 240, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 220, 220, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 200, 200, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 180, 180, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 160, 160, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 140, 140, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 120, 120, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 100, 100, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 80, 80, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 60, 60, 245, 0 }), - TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 40, 40, 245, 0 }), }; + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 180, 180, 180, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 220, 220, 220, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 255, 100, 0, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 255, 255, 30, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 128, 128, 128, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 240, 240, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 220, 220, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 200, 200, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 180, 180, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 160, 160, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 140, 140, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 120, 120, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 100, 100, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 80, 80, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 60, 60, 245, 0 }), + TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[] { 40, 40, 245, 0 }), }; public static final ITexture[] LOCKERS = { TextureFactory.of(OVERLAY_LOCKER_000), - TextureFactory.of(OVERLAY_LOCKER_001), TextureFactory.of(OVERLAY_LOCKER_002), - TextureFactory.of(OVERLAY_LOCKER_003), TextureFactory.of(OVERLAY_LOCKER_004), - TextureFactory.of(OVERLAY_LOCKER_005), TextureFactory.of(OVERLAY_LOCKER_006), - TextureFactory.of(OVERLAY_LOCKER_007), TextureFactory.of(OVERLAY_LOCKER_008), - TextureFactory.of(OVERLAY_LOCKER_009), TextureFactory.of(OVERLAY_LOCKER_010), - TextureFactory.of(OVERLAY_LOCKER_011), TextureFactory.of(OVERLAY_LOCKER_012), - TextureFactory.of(OVERLAY_LOCKER_013), }; + TextureFactory.of(OVERLAY_LOCKER_001), TextureFactory.of(OVERLAY_LOCKER_002), + TextureFactory.of(OVERLAY_LOCKER_003), TextureFactory.of(OVERLAY_LOCKER_004), + TextureFactory.of(OVERLAY_LOCKER_005), TextureFactory.of(OVERLAY_LOCKER_006), + TextureFactory.of(OVERLAY_LOCKER_007), TextureFactory.of(OVERLAY_LOCKER_008), + TextureFactory.of(OVERLAY_LOCKER_009), TextureFactory.of(OVERLAY_LOCKER_010), + TextureFactory.of(OVERLAY_LOCKER_011), TextureFactory.of(OVERLAY_LOCKER_012), + TextureFactory.of(OVERLAY_LOCKER_013), }; /** * USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0] */ @@ -1671,10 +1664,10 @@ public class Textures { static { for (byte i = 0; i < MACHINE_CASINGS.length; i++) for (byte j = 0; j < MACHINE_CASINGS[i].length; j++) MACHINE_CASINGS[i][j] = TextureFactory.of( - MACHINECASINGS_BOTTOM[i], - MACHINECASINGS_TOP[i], - MACHINECASINGS_SIDE[i], - Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa)); + MACHINECASINGS_BOTTOM[i], + MACHINECASINGS_TOP[i], + MACHINECASINGS_SIDE[i], + Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa)); casingTexturePages[0] = new ITexture[128]; // adds some known pages, modders also can do it... GT_Utility.addTexturePage((byte) 1); @@ -1820,10 +1813,10 @@ public class Textures { HALO_FUZZY; public static final IIconContainer[] DURABILITY_BAR = { DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, - DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, - DURABILITY_BAR_8, }, - ENERGY_BAR = { ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, - ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, }; + DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, DURABILITY_BAR_6, DURABILITY_BAR_7, + DURABILITY_BAR_8, }, + ENERGY_BAR = { ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, + ENERGY_BAR_6, ENERGY_BAR_7, ENERGY_BAR_8, }; public static final ITexture[] ERROR_RENDERING = { TextureFactory.of(RENDERING_ERROR) }; diff --git a/src/main/java/gregtech/api/enums/Tier.java b/src/main/java/gregtech/api/enums/Tier.java index 3af005750b..870e8dafbb 100644 --- a/src/main/java/gregtech/api/enums/Tier.java +++ b/src/main/java/gregtech/api/enums/Tier.java @@ -8,440 +8,440 @@ import static gregtech.api.enums.GT_Values.V; public class Tier { public static final Tier[] ELECTRIC = new Tier[] { - new Tier( - SubTag.ENERGY_ELECTRICITY, - 0, - V[0], - 1, - 1, - 1, - Materials.WroughtIron, - ItemList.Hull_ULV, - OrePrefixes.cableGt01.get(Materials.Lead), - OrePrefixes.cableGt04.get(Materials.Lead), - OrePrefixes.circuit.get(Materials.Primitive), - OrePrefixes.circuit.get(Materials.Basic)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 1, - V[1], - 1, - 1, - 1, - Materials.Steel, - ItemList.Hull_LV, - OrePrefixes.cableGt01.get(Materials.Tin), - OrePrefixes.cableGt04.get(Materials.Tin), - OrePrefixes.circuit.get(Materials.Basic), - OrePrefixes.circuit.get(Materials.Good)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 2, - V[2], - 1, - 1, - 1, - Materials.Aluminium, - ItemList.Hull_MV, - OrePrefixes.cableGt01.get(Materials.AnyCopper), - OrePrefixes.cableGt04.get(Materials.AnyCopper), - OrePrefixes.circuit.get(Materials.Good), - OrePrefixes.circuit.get(Materials.Advanced)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 3, - V[3], - 1, - 1, - 1, - Materials.StainlessSteel, - ItemList.Hull_HV, - OrePrefixes.cableGt01.get(Materials.Gold), - OrePrefixes.cableGt04.get(Materials.Gold), - OrePrefixes.circuit.get(Materials.Advanced), - OrePrefixes.circuit.get(Materials.Data)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 4, - V[4], - 1, - 1, - 1, - Materials.Titanium, - ItemList.Hull_EV, - OrePrefixes.cableGt01.get(Materials.Aluminium), - OrePrefixes.cableGt04.get(Materials.Aluminium), - OrePrefixes.circuit.get(Materials.Data), - OrePrefixes.circuit.get(Materials.Elite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 5, - V[5], - 1, - 1, - 1, - Materials.TungstenSteel, - ItemList.Hull_IV, - OrePrefixes.cableGt01.get(Materials.Platinum), - OrePrefixes.cableGt04.get(Materials.Platinum), - OrePrefixes.circuit.get(Materials.Elite), - OrePrefixes.circuit.get(Materials.Master)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 6, - V[6], - 1, - 1, - 1, - Materials.Chrome, - ItemList.Hull_LuV, - OrePrefixes.cableGt01.get(Materials.NiobiumTitanium), - OrePrefixes.cableGt04.get(Materials.NiobiumTitanium), - OrePrefixes.circuit.get(Materials.Master), - OrePrefixes.circuit.get(Materials.Ultimate)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 7, - V[7], - 1, - 1, - 1, - Materials.Iridium, - ItemList.Hull_ZPM, - OrePrefixes.cableGt01.get(Materials.Naquadah), - OrePrefixes.cableGt04.get(Materials.Naquadah), - OrePrefixes.circuit.get(Materials.Ultimate), - OrePrefixes.circuit.get(Materials.Superconductor)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 8, - V[8], - 1, - 1, - 1, - Materials.Osmium, - ItemList.Hull_UV, - OrePrefixes.cableGt04.get(Materials.NaquadahAlloy), - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Superconductor), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 9, - V[9], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 10, - V[10], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 11, - V[11], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 12, - V[12], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 13, - V[13], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 14, - V[14], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), - new Tier( - SubTag.ENERGY_ELECTRICITY, - 15, - V[15], - 1, - 1, - 1, - Materials.Neutronium, - ItemList.Hull_MAX, - OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), - OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), - OrePrefixes.circuit.get(Materials.Infinite), - OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 0, + V[0], + 1, + 1, + 1, + Materials.WroughtIron, + ItemList.Hull_ULV, + OrePrefixes.cableGt01.get(Materials.Lead), + OrePrefixes.cableGt04.get(Materials.Lead), + OrePrefixes.circuit.get(Materials.Primitive), + OrePrefixes.circuit.get(Materials.Basic)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 1, + V[1], + 1, + 1, + 1, + Materials.Steel, + ItemList.Hull_LV, + OrePrefixes.cableGt01.get(Materials.Tin), + OrePrefixes.cableGt04.get(Materials.Tin), + OrePrefixes.circuit.get(Materials.Basic), + OrePrefixes.circuit.get(Materials.Good)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 2, + V[2], + 1, + 1, + 1, + Materials.Aluminium, + ItemList.Hull_MV, + OrePrefixes.cableGt01.get(Materials.AnyCopper), + OrePrefixes.cableGt04.get(Materials.AnyCopper), + OrePrefixes.circuit.get(Materials.Good), + OrePrefixes.circuit.get(Materials.Advanced)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 3, + V[3], + 1, + 1, + 1, + Materials.StainlessSteel, + ItemList.Hull_HV, + OrePrefixes.cableGt01.get(Materials.Gold), + OrePrefixes.cableGt04.get(Materials.Gold), + OrePrefixes.circuit.get(Materials.Advanced), + OrePrefixes.circuit.get(Materials.Data)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 4, + V[4], + 1, + 1, + 1, + Materials.Titanium, + ItemList.Hull_EV, + OrePrefixes.cableGt01.get(Materials.Aluminium), + OrePrefixes.cableGt04.get(Materials.Aluminium), + OrePrefixes.circuit.get(Materials.Data), + OrePrefixes.circuit.get(Materials.Elite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 5, + V[5], + 1, + 1, + 1, + Materials.TungstenSteel, + ItemList.Hull_IV, + OrePrefixes.cableGt01.get(Materials.Platinum), + OrePrefixes.cableGt04.get(Materials.Platinum), + OrePrefixes.circuit.get(Materials.Elite), + OrePrefixes.circuit.get(Materials.Master)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 6, + V[6], + 1, + 1, + 1, + Materials.Chrome, + ItemList.Hull_LuV, + OrePrefixes.cableGt01.get(Materials.NiobiumTitanium), + OrePrefixes.cableGt04.get(Materials.NiobiumTitanium), + OrePrefixes.circuit.get(Materials.Master), + OrePrefixes.circuit.get(Materials.Ultimate)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 7, + V[7], + 1, + 1, + 1, + Materials.Iridium, + ItemList.Hull_ZPM, + OrePrefixes.cableGt01.get(Materials.Naquadah), + OrePrefixes.cableGt04.get(Materials.Naquadah), + OrePrefixes.circuit.get(Materials.Ultimate), + OrePrefixes.circuit.get(Materials.Superconductor)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 8, + V[8], + 1, + 1, + 1, + Materials.Osmium, + ItemList.Hull_UV, + OrePrefixes.cableGt04.get(Materials.NaquadahAlloy), + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Superconductor), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 9, + V[9], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 10, + V[10], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 11, + V[11], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 12, + V[12], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 13, + V[13], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 14, + V[14], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), + new Tier( + SubTag.ENERGY_ELECTRICITY, + 15, + V[15], + 1, + 1, + 1, + Materials.Neutronium, + ItemList.Hull_MAX, + OrePrefixes.wireGt01.get(Materials.SuperconductorUHV), + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV), + OrePrefixes.circuit.get(Materials.Infinite), + OrePrefixes.circuit.get(Materials.Infinite)), - // READ GT_VALUES CLASS BEFORE YOU START ADDING STUFF TO TIERS 8+ - and probably dont do it in - // GT but in GTNH core mod - that way we shouldnt need to set the tier class + // READ GT_VALUES CLASS BEFORE YOU START ADDING STUFF TO TIERS 8+ - and probably dont do it in + // GT but in GTNH core mod - that way we shouldnt need to set the tier class }, ROTATIONAL = new Tier[] { + new Tier( + SubTag.ENERGY_ROTATIONAL, + 1, + 32, + 1, + 1, + 1, + Materials.Wood, + OrePrefixes.frameGt.get(Materials.Wood), + OrePrefixes.stick.get(Materials.Wood), + OrePrefixes.ingot.get(Materials.Wood), + OrePrefixes.gearGt.get(Materials.Wood), + OrePrefixes.gearGt.get(Materials.Stone)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 1, + 32, + 1, + 2, + 2, + Materials.WoodSealed, + OrePrefixes.frameGt.get(Materials.WoodSealed), + OrePrefixes.stick.get(Materials.WoodSealed), + OrePrefixes.ingot.get(Materials.WoodSealed), + OrePrefixes.gearGt.get(Materials.WoodSealed), + OrePrefixes.gearGt.get(Materials.Stone)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 2, + 128, + 1, + 1, + 1, + Materials.Stone, + OrePrefixes.frameGt.get(Materials.Stone), + OrePrefixes.stick.get(Materials.Stone), + OrePrefixes.ingot.get(Materials.Stone), + OrePrefixes.gearGt.get(Materials.Stone), + OrePrefixes.gearGt.get(Materials.Bronze)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 2, + 128, + 1, + 2, + 2, + Materials.IronWood, + OrePrefixes.frameGt.get(Materials.IronWood), + OrePrefixes.stick.get(Materials.IronWood), + OrePrefixes.ingot.get(Materials.IronWood), + OrePrefixes.gearGt.get(Materials.IronWood), + OrePrefixes.gearGt.get(Materials.Bronze)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 3, + 512, + 1, + 1, + 1, + Materials.Bronze, + OrePrefixes.frameGt.get(Materials.Bronze), + OrePrefixes.stick.get(Materials.Bronze), + OrePrefixes.ingot.get(Materials.Bronze), + OrePrefixes.gearGt.get(Materials.Bronze), + OrePrefixes.gearGt.get(Materials.Steel)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 3, + 512, + 1, + 2, + 2, + Materials.Brass, + OrePrefixes.frameGt.get(Materials.Brass), + OrePrefixes.stick.get(Materials.Brass), + OrePrefixes.ingot.get(Materials.Brass), + OrePrefixes.gearGt.get(Materials.Brass), + OrePrefixes.gearGt.get(Materials.Steel)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 4, + 2048, + 1, + 1, + 1, + Materials.Steel, + OrePrefixes.frameGt.get(Materials.Steel), + OrePrefixes.stick.get(Materials.Steel), + OrePrefixes.ingot.get(Materials.Steel), + OrePrefixes.gearGt.get(Materials.Steel), + OrePrefixes.gearGt.get(Materials.TungstenSteel)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 4, + 2048, + 1, + 2, + 2, + Materials.Titanium, + OrePrefixes.frameGt.get(Materials.Titanium), + OrePrefixes.stick.get(Materials.Titanium), + OrePrefixes.ingot.get(Materials.Titanium), + OrePrefixes.gearGt.get(Materials.Titanium), + OrePrefixes.gearGt.get(Materials.TungstenSteel)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 5, + 8192, + 1, + 1, + 1, + Materials.TungstenSteel, + OrePrefixes.frameGt.get(Materials.TungstenSteel), + OrePrefixes.stick.get(Materials.TungstenSteel), + OrePrefixes.ingot.get(Materials.TungstenSteel), + OrePrefixes.gearGt.get(Materials.TungstenSteel), + OrePrefixes.gearGt.get(Materials.Iridium)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 6, + 32768, + 1, + 1, + 1, + Materials.Iridium, + OrePrefixes.frameGt.get(Materials.Iridium), + OrePrefixes.stick.get(Materials.Iridium), + OrePrefixes.ingot.get(Materials.Iridium), + OrePrefixes.gearGt.get(Materials.Iridium), + OrePrefixes.gearGt.get(Materials.Neutronium)), + new Tier( + SubTag.ENERGY_ROTATIONAL, + 9, + Integer.MAX_VALUE - 7, + 1, + 1, + 1, + Materials.Neutronium, + OrePrefixes.frameGt.get(Materials.Neutronium), + OrePrefixes.stick.get(Materials.Neutronium), + OrePrefixes.ingot.get(Materials.Neutronium), + OrePrefixes.gearGt.get(Materials.Neutronium), + OrePrefixes.gearGt.get(Materials.Neutronium)), }, + STEAM = new Tier[] { new Tier( - SubTag.ENERGY_ROTATIONAL, - 1, - 32, - 1, - 1, - 1, - Materials.Wood, - OrePrefixes.frameGt.get(Materials.Wood), - OrePrefixes.stick.get(Materials.Wood), - OrePrefixes.ingot.get(Materials.Wood), - OrePrefixes.gearGt.get(Materials.Wood), - OrePrefixes.gearGt.get(Materials.Stone)), - new Tier( - SubTag.ENERGY_ROTATIONAL, - 1, - 32, - 1, - 2, - 2, - Materials.WoodSealed, - OrePrefixes.frameGt.get(Materials.WoodSealed), - OrePrefixes.stick.get(Materials.WoodSealed), - OrePrefixes.ingot.get(Materials.WoodSealed), - OrePrefixes.gearGt.get(Materials.WoodSealed), - OrePrefixes.gearGt.get(Materials.Stone)), - new Tier( - SubTag.ENERGY_ROTATIONAL, - 2, - 128, - 1, - 1, - 1, - Materials.Stone, - OrePrefixes.frameGt.get(Materials.Stone), - OrePrefixes.stick.get(Materials.Stone), - OrePrefixes.ingot.get(Materials.Stone), - OrePrefixes.gearGt.get(Materials.Stone), - OrePrefixes.gearGt.get(Materials.Bronze)), - new Tier( - SubTag.ENERGY_ROTATIONAL, - 2, - 128, - 1, - 2, - 2, - Materials.IronWood, - OrePrefixes.frameGt.get(Materials.IronWood), - OrePrefixes.stick.get(Materials.IronWood), - OrePrefixes.ingot.get(Materials.IronWood), - OrePrefixes.gearGt.get(Materials.IronWood), - OrePrefixes.gearGt.get(Materials.Bronze)), - new Tier( - SubTag.ENERGY_ROTATIONAL, - 3, - 512, - 1, - 1, - 1, - Materials.Bronze, - OrePrefixes.frameGt.get(Materials.Bronze), - OrePrefixes.stick.get(Materials.Bronze), - OrePrefixes.ingot.get(Materials.Bronze), - OrePrefixes.gearGt.get(Materials.Bronze), - OrePrefixes.gearGt.get(Materials.Steel)), - new Tier( - SubTag.ENERGY_ROTATIONAL, - 3, - 512, - 1, - 2, - 2, - Materials.Brass, - OrePrefixes.frameGt.get(Materials.Brass), - OrePrefixes.stick.get(Materials.Brass), - OrePrefixes.ingot.get(Materials.Brass), - OrePrefixes.gearGt.get(Materials.Brass), - OrePrefixes.gearGt.get(Materials.Steel)), + SubTag.ENERGY_STEAM, + 1, + 32, + 1, + 1, + 1, + Materials.Bronze, + OrePrefixes.frameGt.get(Materials.Bronze), + OrePrefixes.pipeMedium.get(Materials.Bronze), + OrePrefixes.pipeHuge.get(Materials.Bronze), + OrePrefixes.pipeMedium.get(Materials.Bronze), + OrePrefixes.pipeLarge.get(Materials.Bronze)), new Tier( - SubTag.ENERGY_ROTATIONAL, - 4, - 2048, - 1, - 1, - 1, - Materials.Steel, - OrePrefixes.frameGt.get(Materials.Steel), - OrePrefixes.stick.get(Materials.Steel), - OrePrefixes.ingot.get(Materials.Steel), - OrePrefixes.gearGt.get(Materials.Steel), - OrePrefixes.gearGt.get(Materials.TungstenSteel)), + SubTag.ENERGY_STEAM, + 2, + 128, + 1, + 1, + 1, + Materials.Steel, + OrePrefixes.frameGt.get(Materials.Steel), + OrePrefixes.pipeMedium.get(Materials.Steel), + OrePrefixes.pipeHuge.get(Materials.Steel), + OrePrefixes.pipeMedium.get(Materials.Steel), + OrePrefixes.pipeLarge.get(Materials.Steel)), new Tier( - SubTag.ENERGY_ROTATIONAL, - 4, - 2048, - 1, - 2, - 2, - Materials.Titanium, - OrePrefixes.frameGt.get(Materials.Titanium), - OrePrefixes.stick.get(Materials.Titanium), - OrePrefixes.ingot.get(Materials.Titanium), - OrePrefixes.gearGt.get(Materials.Titanium), - OrePrefixes.gearGt.get(Materials.TungstenSteel)), + SubTag.ENERGY_STEAM, + 3, + 512, + 1, + 1, + 1, + Materials.Titanium, + OrePrefixes.frameGt.get(Materials.Titanium), + OrePrefixes.pipeMedium.get(Materials.Titanium), + OrePrefixes.pipeHuge.get(Materials.Titanium), + OrePrefixes.pipeMedium.get(Materials.Titanium), + OrePrefixes.pipeLarge.get(Materials.Titanium)), new Tier( - SubTag.ENERGY_ROTATIONAL, - 5, - 8192, - 1, - 1, - 1, - Materials.TungstenSteel, - OrePrefixes.frameGt.get(Materials.TungstenSteel), - OrePrefixes.stick.get(Materials.TungstenSteel), - OrePrefixes.ingot.get(Materials.TungstenSteel), - OrePrefixes.gearGt.get(Materials.TungstenSteel), - OrePrefixes.gearGt.get(Materials.Iridium)), + SubTag.ENERGY_STEAM, + 4, + 2048, + 1, + 1, + 1, + Materials.TungstenSteel, + OrePrefixes.frameGt.get(Materials.TungstenSteel), + OrePrefixes.pipeMedium.get(Materials.TungstenSteel), + OrePrefixes.pipeHuge.get(Materials.TungstenSteel), + OrePrefixes.pipeMedium.get(Materials.TungstenSteel), + OrePrefixes.pipeLarge.get(Materials.TungstenSteel)), new Tier( - SubTag.ENERGY_ROTATIONAL, - 6, - 32768, - 1, - 1, - 1, - Materials.Iridium, - OrePrefixes.frameGt.get(Materials.Iridium), - OrePrefixes.stick.get(Materials.Iridium), - OrePrefixes.ingot.get(Materials.Iridium), - OrePrefixes.gearGt.get(Materials.Iridium), - OrePrefixes.gearGt.get(Materials.Neutronium)), + SubTag.ENERGY_STEAM, + 5, + 8192, + 1, + 1, + 1, + Materials.Iridium, + OrePrefixes.frameGt.get(Materials.Iridium), + OrePrefixes.pipeMedium.get(Materials.Iridium), + OrePrefixes.pipeHuge.get(Materials.Iridium), + OrePrefixes.pipeMedium.get(Materials.Iridium), + OrePrefixes.pipeLarge.get(Materials.Iridium)), new Tier( - SubTag.ENERGY_ROTATIONAL, - 9, - Integer.MAX_VALUE - 7, - 1, - 1, - 1, - Materials.Neutronium, - OrePrefixes.frameGt.get(Materials.Neutronium), - OrePrefixes.stick.get(Materials.Neutronium), - OrePrefixes.ingot.get(Materials.Neutronium), - OrePrefixes.gearGt.get(Materials.Neutronium), - OrePrefixes.gearGt.get(Materials.Neutronium)), }, - STEAM = new Tier[] { - new Tier( - SubTag.ENERGY_STEAM, - 1, - 32, - 1, - 1, - 1, - Materials.Bronze, - OrePrefixes.frameGt.get(Materials.Bronze), - OrePrefixes.pipeMedium.get(Materials.Bronze), - OrePrefixes.pipeHuge.get(Materials.Bronze), - OrePrefixes.pipeMedium.get(Materials.Bronze), - OrePrefixes.pipeLarge.get(Materials.Bronze)), - new Tier( - SubTag.ENERGY_STEAM, - 2, - 128, - 1, - 1, - 1, - Materials.Steel, - OrePrefixes.frameGt.get(Materials.Steel), - OrePrefixes.pipeMedium.get(Materials.Steel), - OrePrefixes.pipeHuge.get(Materials.Steel), - OrePrefixes.pipeMedium.get(Materials.Steel), - OrePrefixes.pipeLarge.get(Materials.Steel)), - new Tier( - SubTag.ENERGY_STEAM, - 3, - 512, - 1, - 1, - 1, - Materials.Titanium, - OrePrefixes.frameGt.get(Materials.Titanium), - OrePrefixes.pipeMedium.get(Materials.Titanium), - OrePrefixes.pipeHuge.get(Materials.Titanium), - OrePrefixes.pipeMedium.get(Materials.Titanium), - OrePrefixes.pipeLarge.get(Materials.Titanium)), - new Tier( - SubTag.ENERGY_STEAM, - 4, - 2048, - 1, - 1, - 1, - Materials.TungstenSteel, - OrePrefixes.frameGt.get(Materials.TungstenSteel), - OrePrefixes.pipeMedium.get(Materials.TungstenSteel), - OrePrefixes.pipeHuge.get(Materials.TungstenSteel), - OrePrefixes.pipeMedium.get(Materials.TungstenSteel), - OrePrefixes.pipeLarge.get(Materials.TungstenSteel)), - new Tier( - SubTag.ENERGY_STEAM, - 5, - 8192, - 1, - 1, - 1, - Materials.Iridium, - OrePrefixes.frameGt.get(Materials.Iridium), - OrePrefixes.pipeMedium.get(Materials.Iridium), - OrePrefixes.pipeHuge.get(Materials.Iridium), - OrePrefixes.pipeMedium.get(Materials.Iridium), - OrePrefixes.pipeLarge.get(Materials.Iridium)), - new Tier( - SubTag.ENERGY_STEAM, - 9, - Integer.MAX_VALUE - 7, - 1, - 1, - 1, - Materials.Neutronium, - OrePrefixes.frameGt.get(Materials.Neutronium), - OrePrefixes.pipeMedium.get(Materials.Neutronium), - OrePrefixes.pipeHuge.get(Materials.Neutronium), - OrePrefixes.pipeMedium.get(Materials.Neutronium), - OrePrefixes.pipeLarge.get(Materials.Neutronium)), }; + SubTag.ENERGY_STEAM, + 9, + Integer.MAX_VALUE - 7, + 1, + 1, + 1, + Materials.Neutronium, + OrePrefixes.frameGt.get(Materials.Neutronium), + OrePrefixes.pipeMedium.get(Materials.Neutronium), + OrePrefixes.pipeHuge.get(Materials.Neutronium), + OrePrefixes.pipeMedium.get(Materials.Neutronium), + OrePrefixes.pipeLarge.get(Materials.Neutronium)), }; /** * Used for Crafting Recipes */ @@ -453,8 +453,8 @@ public class Tier { private final Materials mMaterial; public Tier(SubTag aType, int aRank, long aPrimaryValue, long aSecondaryValue, long aSpeedMultiplier, - long aEnergyCostMultiplier, Materials aMaterial, Object aHullObject, Object aConductingObject, - Object aLargerConductingObject, Object aManagingObject, Object aBetterManagingObject) { + long aEnergyCostMultiplier, Materials aMaterial, Object aHullObject, Object aConductingObject, + Object aLargerConductingObject, Object aManagingObject, Object aBetterManagingObject) { mType = aType; mRank = (byte) aRank; mPrimaryValue = aPrimaryValue; diff --git a/src/main/java/gregtech/api/enums/ToolDictNames.java b/src/main/java/gregtech/api/enums/ToolDictNames.java index bc27fe6923..e4a8ee8444 100644 --- a/src/main/java/gregtech/api/enums/ToolDictNames.java +++ b/src/main/java/gregtech/api/enums/ToolDictNames.java @@ -35,7 +35,7 @@ public enum ToolDictNames { if (!aName.startsWith("craftingTool")) return false; for (ToolDictNames tool : ToolDictNames.values()) { if (tool.toString() - .equals(aName)) { + .equals(aName)) { return true; } } diff --git a/src/main/java/gregtech/api/events/BlockScanningEvent.java b/src/main/java/gregtech/api/events/BlockScanningEvent.java index 9d7500a8b0..27eb375a6f 100644 --- a/src/main/java/gregtech/api/events/BlockScanningEvent.java +++ b/src/main/java/gregtech/api/events/BlockScanningEvent.java @@ -27,8 +27,7 @@ public class BlockScanningEvent extends WorldEvent { public int mEUCost = 0; public BlockScanningEvent(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, byte aSide, int aScanLevel, - Block aBlock, TileEntity aTileEntity, ArrayList aList, float aClickX, float aClickY, - float aClickZ) { + Block aBlock, TileEntity aTileEntity, ArrayList aList, float aClickX, float aClickY, float aClickZ) { super(aWorld); mPlayer = aPlayer; mScanLevel = aScanLevel; diff --git a/src/main/java/gregtech/api/fluid/FluidTankGT.java b/src/main/java/gregtech/api/fluid/FluidTankGT.java index 0d21d7dd49..801354ac86 100644 --- a/src/main/java/gregtech/api/fluid/FluidTankGT.java +++ b/src/main/java/gregtech/api/fluid/FluidTankGT.java @@ -194,16 +194,15 @@ public class FluidTankGT implements IFluidTank { return mVoidExcess ? aFluid.amount : (int) tFilled; } return saturatedCast( - isEmpty() ? mVoidExcess ? aFluid.amount : Math.min(capacity(aFluid), aFluid.amount) - : contains(aFluid) - ? mVoidExcess ? aFluid.amount : Math.min(capacity(aFluid) - mAmount, aFluid.amount) - : 0); + isEmpty() ? mVoidExcess ? aFluid.amount : Math.min(capacity(aFluid), aFluid.amount) + : contains(aFluid) ? mVoidExcess ? aFluid.amount : Math.min(capacity(aFluid) - mAmount, aFluid.amount) + : 0); } public boolean canFillAll(FluidStack aFluid) { return aFluid == null || aFluid.amount <= 0 - || (isEmpty() ? mVoidExcess || aFluid.amount <= capacity(aFluid) - : contains(aFluid) && (mVoidExcess || mAmount + aFluid.amount <= capacity(aFluid))); + || (isEmpty() ? mVoidExcess || aFluid.amount <= capacity(aFluid) + : contains(aFluid) && (mVoidExcess || mAmount + aFluid.amount <= capacity(aFluid))); } public boolean canFillAll(long aAmount) { @@ -366,7 +365,7 @@ public class FluidTankGT implements IFluidTank { final Long tSize = mAdjustableCapacity.get(aFluid); return tSize == null ? Math.max(mAmount, mCapacity) - : Math.max(tSize * mAdjustableMultiplier, Math.max(mAmount, mCapacity)); + : Math.max(tSize * mAdjustableMultiplier, Math.max(mAmount, mCapacity)); } public boolean isHalf() { @@ -419,8 +418,8 @@ public class FluidTankGT implements IFluidTank { public String name() { return mFluid == null ? null - : mFluid.getFluid() - .getName(); + : mFluid.getFluid() + .getName(); } public FluidStack get() { diff --git a/src/main/java/gregtech/api/fluid/GT_FluidFactory.java b/src/main/java/gregtech/api/fluid/GT_FluidFactory.java index ae57f47430..7ffc824a79 100644 --- a/src/main/java/gregtech/api/fluid/GT_FluidFactory.java +++ b/src/main/java/gregtech/api/fluid/GT_FluidFactory.java @@ -53,12 +53,12 @@ public class GT_FluidFactory { * @return the registered {@link Fluid} */ public static Fluid of(final String fluidName, final String localizedName, final Materials material, - final FluidState state, final int temperature) { + final FluidState state, final int temperature) { return builder(fluidName).withLocalizedName(localizedName) - .withStateAndTemperature(state, temperature) - .buildAndRegister() - .configureMaterials(material) - .asFluid(); + .withStateAndTemperature(state, temperature) + .buildAndRegister() + .configureMaterials(material) + .asFluid(); } /** @@ -71,11 +71,11 @@ public class GT_FluidFactory { * @return the registered {@link Fluid} */ public static Fluid of(final String fluidName, final String localizedName, final FluidState state, - final int temperature) { + final int temperature) { return builder(fluidName).withLocalizedName(localizedName) - .withStateAndTemperature(state, temperature) - .buildAndRegister() - .asFluid(); + .withStateAndTemperature(state, temperature) + .buildAndRegister() + .asFluid(); } /** diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java index b64020f33d..bbdfa40a10 100644 --- a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java +++ b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java @@ -50,7 +50,7 @@ public abstract class GenerateNodeMap { // gets the next node protected void generateNextNode(BaseMetaPipeEntity aPipe, Node aPipeNode, byte aInvalidSide, int aNextNodeValue, - ArrayList tConsumers, HashSet tNodeMap) { + ArrayList tConsumers, HashSet tNodeMap) { final MetaPipeEntity tMetaPipe = (MetaPipeEntity) aPipe.getMetaTileEntity(); for (byte side : ALL_VALID_SIDES) { if (side == aInvalidSide) { @@ -62,13 +62,13 @@ public abstract class GenerateNodeMap { final Pair nextTileEntity = getNextValidTileEntity(tNextTileEntity, tNewPipes, side, tNodeMap); if (nextTileEntity != null) { final Node tNextNode = generateNode( - nextTileEntity.mTileEntity, - aPipeNode, - aNextNodeValue + 1, - tNewPipes, - nextTileEntity.mSide, - tConsumers, - tNodeMap); + nextTileEntity.mTileEntity, + aPipeNode, + aNextNodeValue + 1, + tNewPipes, + nextTileEntity.mSide, + tConsumers, + tNodeMap); if (tNextNode != null) { aNextNodeValue = tNextNode.mHighestNodeValue; aPipeNode.mHighestNodeValue = tNextNode.mHighestNodeValue; @@ -84,7 +84,7 @@ public abstract class GenerateNodeMap { // on a valid tile entity create a new node protected Node generateNode(TileEntity aTileEntity, Node aPreviousNode, int aNextNodeValue, - ArrayList aPipes, int aSide, ArrayList aConsumers, HashSet aNodeMap) { + ArrayList aPipes, int aSide, ArrayList aConsumers, HashSet aNodeMap) { if (aTileEntity.isInvalid()) return null; final byte tSideOp = getOppositeSide(aSide); final byte tInvalidSide = aPreviousNode == null ? -1 : tSideOp; @@ -130,7 +130,7 @@ public abstract class GenerateNodeMap { // go over the pipes until we see a valid tile entity that needs a node protected Pair getNextValidTileEntity(TileEntity aTileEntity, ArrayList aPipes, byte aSide, - HashSet aNodeMap) { + HashSet aNodeMap) { if (isPipe(aTileEntity)) { final BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) aTileEntity; final MetaPipeEntity tMetaPipe = (MetaPipeEntity) tPipe.getMetaTileEntity(); @@ -168,14 +168,14 @@ public abstract class GenerateNodeMap { // checks if the tile entity is a consumer and add to the list protected abstract boolean addConsumer(TileEntity aTileEntity, byte aSide, int aNodeValue, - ArrayList aConsumers); + ArrayList aConsumers); // get correct pathClass that you need for your node network protected abstract NodePath getNewPath(MetaPipeEntity[] aPipes); // used for if you need to use dead ends for something can be null protected Node getEmptyNode(int aNodeValue, byte aSide, TileEntity aTileEntity, - ArrayList aConsumers) { + ArrayList aConsumers) { return null; } diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java index 67591040e9..f2a2e95df8 100644 --- a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java +++ b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java @@ -33,12 +33,12 @@ public class GenerateNodeMapPower extends GenerateNodeMap { @Override protected boolean isPipe(TileEntity aTileEntity) { return super.isPipe(aTileEntity) - && ((BaseMetaPipeEntity) aTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable; + && ((BaseMetaPipeEntity) aTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable; } @Override protected boolean addConsumer(TileEntity aTileEntity, byte aSide, int aNodeValue, - ArrayList aConsumers) { + ArrayList aConsumers) { if (aTileEntity instanceof BaseMetaTileEntity tBaseTileEntity) { if (tBaseTileEntity.inputEnergyFrom(aSide, false)) { ConsumerNode tConsumerNode = new NodeGTBaseMetaTile(aNodeValue, tBaseTileEntity, aSide, aConsumers); @@ -61,25 +61,25 @@ public class GenerateNodeMapPower extends GenerateNodeMap { boolean crossesChuncks = dX >> 4 != aTileEntity.xCoord >> 4 || dZ >> 4 != aTileEntity.zCoord >> 4; TileEntity tNextTo = null; if (!crossesChuncks || !aTileEntity.getWorldObj() - .blockExists(dX, dY, dZ)) + .blockExists(dX, dY, dZ)) tNextTo = aTileEntity.getWorldObj() - .getTileEntity(dX, dY, dZ); + .getTileEntity(dX, dY, dZ); if (((IEnergySink) aTileEntity).acceptsEnergyFrom(tNextTo, ForgeDirection.getOrientation(aSide))) { ConsumerNode tConsumerNode = new NodeEnergySink( - aNodeValue, - (IEnergySink) aTileEntity, - aSide, - aConsumers); + aNodeValue, + (IEnergySink) aTileEntity, + aSide, + aConsumers); aConsumers.add(tConsumerNode); return true; } } else if (GregTech_API.mOutputRF && aTileEntity instanceof IEnergyReceiver) { ConsumerNode tConsumerNode = new NodeEnergyReceiver( - aNodeValue, - (IEnergyReceiver) aTileEntity, - aSide, - aConsumers); + aNodeValue, + (IEnergyReceiver) aTileEntity, + aSide, + aConsumers); aConsumers.add(tConsumerNode); return true; } @@ -94,7 +94,7 @@ public class GenerateNodeMapPower extends GenerateNodeMap { // used to apply voltage on dead ends @Override protected Node getEmptyNode(int aNodeValue, byte aSide, TileEntity aTileEntity, - ArrayList aConsumers) { + ArrayList aConsumers) { ConsumerNode tNode = new EmptyPowerConsumer(aNodeValue, aTileEntity, aSide, aConsumers); aConsumers.add(tNode); return tNode; diff --git a/src/main/java/gregtech/api/graphs/Node.java b/src/main/java/gregtech/api/graphs/Node.java index 005b32a5b7..9afe009d3e 100644 --- a/src/main/java/gregtech/api/graphs/Node.java +++ b/src/main/java/gregtech/api/graphs/Node.java @@ -18,7 +18,7 @@ public class Node { mHighestNodeValue = aNodeValue; // you don't want to generate map multiple times in the same tick mCreationTime = MinecraftServer.getServer() - .getTickCounter(); + .getTickCounter(); } public final TileEntity mTileEntity; diff --git a/src/main/java/gregtech/api/graphs/PowerNodes.java b/src/main/java/gregtech/api/graphs/PowerNodes.java index 22f1e02add..be94d2312a 100644 --- a/src/main/java/gregtech/api/graphs/PowerNodes.java +++ b/src/main/java/gregtech/api/graphs/PowerNodes.java @@ -16,7 +16,7 @@ public class PowerNodes { // check if the looked for node is next to or get the next node that is closer to it public static long powerNode(Node aCurrentNode, Node aPreviousNode, NodeList aConsumers, long aVoltage, - long aMaxAmps) { + long aMaxAmps) { long tAmpsUsed = 0; ConsumerNode tConsumer = (ConsumerNode) aConsumers.getNode(); int tLoopProtection = 0; @@ -33,12 +33,12 @@ public class PowerNodes { } else { if (aPreviousNode == tNextNode) return tAmpsUsed; tAmpsUsed += processNextNode( - aCurrentNode, - tNextNode, - aConsumers, - j, - aMaxAmps - tAmpsUsed, - aVoltage); + aCurrentNode, + tNextNode, + aConsumers, + j, + aMaxAmps - tAmpsUsed, + aVoltage); tConsumer = (ConsumerNode) aConsumers.getNode(); } break; @@ -52,12 +52,12 @@ public class PowerNodes { if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTargetNodeValue) { if (tNextNode == aPreviousNode) return tAmpsUsed; tAmpsUsed += processNextNodeAbove( - aCurrentNode, - tNextNode, - aConsumers, - side, - aMaxAmps - tAmpsUsed, - aVoltage); + aCurrentNode, + tNextNode, + aConsumers, + side, + aMaxAmps - tAmpsUsed, + aVoltage); tConsumer = (ConsumerNode) aConsumers.getNode(); break; } else if (tNextNode.mNodeValue == tTargetNodeValue) { @@ -80,7 +80,7 @@ public class PowerNodes { // checking if target node is next to it or has a higher value then current node value // these functions are different to either go down or up the stack protected static long powerNodeAbove(Node aCurrentNode, Node aPreviousNode, NodeList aConsumers, long aVoltage, - long aMaxAmps) { + long aMaxAmps) { long tAmpsUsed = 0; int tLoopProtection = 0; ConsumerNode tConsumer = (ConsumerNode) aConsumers.getNode(); @@ -95,12 +95,12 @@ public class PowerNodes { if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTargetNodeValue) { if (tNextNode == aPreviousNode) return tAmpsUsed; tAmpsUsed += processNextNodeAbove( - aCurrentNode, - tNextNode, - aConsumers, - side, - aMaxAmps - tAmpsUsed, - aVoltage); + aCurrentNode, + tNextNode, + aConsumers, + side, + aMaxAmps - tAmpsUsed, + aVoltage); tConsumer = (ConsumerNode) aConsumers.getNode(); break; } else if (tNextNode.mNodeValue == tTargetNodeValue) { @@ -121,7 +121,7 @@ public class PowerNodes { } protected static long processNextNode(Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, - long aMaxAmps, long aVoltage) { + long aMaxAmps, long aVoltage) { if (aCurrentNode.locks[aSide].isLocked()) { aConsumers.getNextNode(); return 0; @@ -142,7 +142,7 @@ public class PowerNodes { } protected static long processNextNodeAbove(Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, - long aMaxAmps, long aVoltage) { + long aMaxAmps, long aVoltage) { if (aCurrentNode.locks[aSide].isLocked()) { aConsumers.getNextNode(); return 0; @@ -163,7 +163,7 @@ public class PowerNodes { } protected static long processNodeInject(Node aCurrentNode, ConsumerNode aConsumer, int aSide, long aMaxAmps, - long aVoltage) { + long aVoltage) { if (aCurrentNode.locks[aSide].isLocked()) return 0; final PowerNodePath tPath = (PowerNodePath) aCurrentNode.mNodePaths[aSide]; final PowerNodePath tSelfPath = (PowerNodePath) aCurrentNode.mSelfPath; diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java index bd2087de84..65dd50f9df 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java @@ -9,7 +9,7 @@ import gregtech.api.interfaces.tileentity.IEnergyConnected; public class NodeEnergyConnected extends ConsumerNode { public NodeEnergyConnected(int aNodeValue, IEnergyConnected aTileEntity, byte aSide, - ArrayList aConsumers) { + ArrayList aConsumers) { super(aNodeValue, (TileEntity) aTileEntity, aSide, aConsumers); } diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java index fec34c9d66..4e84b04e2a 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java @@ -22,7 +22,7 @@ public class NodeEnergyReceiver extends ConsumerNode { int mRestRF = 0; public NodeEnergyReceiver(int aNodeValue, IEnergyReceiver aTileEntity, byte aSide, - ArrayList aConsumers) { + ArrayList aConsumers) { super(aNodeValue, (TileEntity) aTileEntity, aSide, aConsumers); } @@ -41,7 +41,7 @@ public class NodeEnergyReceiver extends ConsumerNode { return ampsUsed; } if (GregTech_API.mRFExplosions && GregTech_API.sMachineExplosions - && ((IEnergyReceiver) mTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600L) { + && ((IEnergyReceiver) mTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600L) { explode(rfOut); } return 0; @@ -55,15 +55,14 @@ public class NodeEnergyReceiver extends ConsumerNode { World tWorld = mTileEntity.getWorldObj(); GT_Utility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1, tX, tY, tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); - if (GregTech_API.sMachineExplosions) if (GT_Mod.gregtechproxy.mPollution) GT_Pollution.addPollution( - tWorld.getChunkFromBlockCoords(tX, tZ), - GT_Mod.gregtechproxy.mPollutionOnExplosion); + if (GregTech_API.sMachineExplosions) if (GT_Mod.gregtechproxy.mPollution) GT_Pollution + .addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), GT_Mod.gregtechproxy.mPollutionOnExplosion); new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setStrength(tStrength) - .setSmoking(true) - .setPosition(tX + 0.5, tY + 0.5, tZ + 0.5) - .setWorld(tWorld) - .run(); + .setSmoking(true) + .setPosition(tX + 0.5, tY + 0.5, tZ + 0.5) + .setWorld(tWorld) + .run(); } } } diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java index 16b8f99939..d978a99d0b 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java @@ -23,8 +23,8 @@ public class NodeEnergySink extends ConsumerNode { public int injectEnergy(long aVoltage, long aMaxAmps) { int tUsedAmps = 0; while (aMaxAmps > tUsedAmps && ((IEnergySink) mTileEntity).getDemandedEnergy() > 0 - && ((IEnergySink) mTileEntity).injectEnergy(ForgeDirection.getOrientation(mSide), aVoltage, aVoltage) - < aVoltage) + && ((IEnergySink) mTileEntity).injectEnergy(ForgeDirection.getOrientation(mSide), aVoltage, aVoltage) + < aVoltage) tUsedAmps++; return tUsedAmps; } diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java b/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java index 19a2478c07..ec75468db5 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java @@ -9,7 +9,7 @@ import gregtech.api.metatileentity.BaseMetaTileEntity; public class NodeGTBaseMetaTile extends ConsumerNode { public NodeGTBaseMetaTile(int aNodeValue, BaseMetaTileEntity aTileEntity, byte aSide, - ArrayList aConsumers) { + ArrayList aConsumers) { super(aNodeValue, aTileEntity, aSide, aConsumers); } diff --git a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java index 97edd5757c..a232822b26 100644 --- a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java +++ b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java @@ -28,7 +28,7 @@ public class PowerNodePath extends NodePath { public void applyVoltage(long aVoltage, boolean aCountUp) { int tNewTime = MinecraftServer.getServer() - .getTickCounter(); + .getTickCounter(); if (mTick != tNewTime) { reset(tNewTime - mTick); mTick = tNewTime; @@ -78,8 +78,7 @@ public class PowerNodePath extends NodePath { // but still allow the player to see if activity is happening public long getAmps() { int tTime = MinecraftServer.getServer() - .getTickCounter() - - 10; + .getTickCounter() - 10; if (mTick < tTime) { reset(tTime - mTick); mTick = tTime; diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java index 819171ae02..e2ef6fd658 100644 --- a/src/main/java/gregtech/api/gui/GT_Container.java +++ b/src/main/java/gregtech/api/gui/GT_Container.java @@ -140,9 +140,9 @@ public class GT_Container extends Container { } if (aMouseclick == 1) { aPlayer.dropPlayerItemWithRandomChoice( - aPlayerInventory.getItemStack() - .splitStack(1), - true); + aPlayerInventory.getItemStack() + .splitStack(1), + true); if (aPlayerInventory.getItemStack().stackSize == 0) { aPlayerInventory.setItemStack(null); } @@ -155,8 +155,7 @@ public class GT_Container extends Container { if (tTempStack != null) { rStack = GT_Utility.copyOrNull(tTempStack); if (aSlot.getStack() != null && aSlot.getStack() - .getItem() - == tTempStack.getItem()) { + .getItem() == tTempStack.getItem()) { slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } } @@ -195,8 +194,8 @@ public class GT_Container extends Container { aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); } else if (aSlot.isItemValid(mouseStack)) { if (tTempStack.getItem() == mouseStack.getItem() - && tTempStack.getItemDamage() == mouseStack.getItemDamage() - && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { + && tTempStack.getItemDamage() == mouseStack.getItemDamage() + && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { tTempStackSize = aMouseclick == 0 ? mouseStack.stackSize : 1; if (tTempStackSize > aSlot.getSlotStackLimit() - tTempStack.stackSize) { tTempStackSize = aSlot.getSlotStackLimit() - tTempStack.stackSize; @@ -214,23 +213,23 @@ public class GT_Container extends Container { aPlayerInventory.setItemStack(tTempStack); } } else if (tTempStack.getItem() == mouseStack.getItem() && mouseStack.getMaxStackSize() > 1 - && (!tTempStack.getHasSubtypes() - || tTempStack.getItemDamage() == mouseStack.getItemDamage()) - && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { - tTempStackSize = tTempStack.stackSize; - - if (tTempStackSize > 0 - && tTempStackSize + mouseStack.stackSize <= mouseStack.getMaxStackSize()) { - mouseStack.stackSize += tTempStackSize; - tTempStack = aSlot.decrStackSize(tTempStackSize); - - if (tTempStack.stackSize == 0) { - aSlot.putStack(null); - } - - aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); + && (!tTempStack.getHasSubtypes() + || tTempStack.getItemDamage() == mouseStack.getItemDamage()) + && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { + tTempStackSize = tTempStack.stackSize; + + if (tTempStackSize > 0 + && tTempStackSize + mouseStack.stackSize <= mouseStack.getMaxStackSize()) { + mouseStack.stackSize += tTempStackSize; + tTempStack = aSlot.decrStackSize(tTempStackSize); + + if (tTempStack.stackSize == 0) { + aSlot.putStack(null); } + + aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); } + } } aSlot.onSlotChanged(); } @@ -245,7 +244,7 @@ public class GT_Container extends Container { // get the stack at the specified hotbar slot. tTempStack = aPlayerInventory.getStackInSlot(aMouseclick); boolean canSwap = tTempStack == null - || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack); + || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack); tTempStackSize = -1; if (!canSwap) { @@ -275,15 +274,15 @@ public class GT_Container extends Container { } } } else if (aShifthold == 3 && aPlayer.capabilities.isCreativeMode - && aPlayerInventory.getItemStack() == null - && aSlotIndex >= 0) { - aSlot = this.inventorySlots.get(aSlotIndex); - if (aSlot != null && aSlot.getHasStack()) { - tTempStack = GT_Utility.copyOrNull(aSlot.getStack()); - tTempStack.stackSize = tTempStack.getMaxStackSize(); - aPlayerInventory.setItemStack(tTempStack); - } + && aPlayerInventory.getItemStack() == null + && aSlotIndex >= 0) { + aSlot = this.inventorySlots.get(aSlotIndex); + if (aSlot != null && aSlot.getHasStack()) { + tTempStack = GT_Utility.copyOrNull(aSlot.getStack()); + tTempStack.stackSize = tTempStack.getMaxStackSize(); + aPlayerInventory.setItemStack(tTempStack); } + } return rStack; } @@ -296,8 +295,8 @@ public class GT_Container extends Container { // null checks and checks if the item can be stacked (maxStackSize > 1) if (getSlotCount() > 0 && slotObject != null - && slotObject.getHasStack() - && !(slotObject instanceof GT_Slot_Holo)) { + && slotObject.getHasStack() + && !(slotObject instanceof GT_Slot_Holo)) { ItemStack stackInSlot = slotObject.getStack(); stack = GT_Utility.copyOrNull(stackInSlot); @@ -309,12 +308,12 @@ public class GT_Container extends Container { } // Player -> TileEntity } else if (!mergeItemStack( - stackInSlot, - getShiftClickStartIndex(), - getShiftClickStartIndex() + getShiftClickSlotCount(), - false)) { - return null; - } + stackInSlot, + getShiftClickStartIndex(), + getShiftClickStartIndex() + getShiftClickSlotCount(), + false)) { + return null; + } if (stackInSlot.stackSize == 0) { slotObject.putStack(null); @@ -344,15 +343,15 @@ public class GT_Container extends Container { if (aStack.isStackable()) { while (aStack.stackSize > 0 - && (!reverseOrder && slotIndex < aSlotCount || reverseOrder && slotIndex >= aStartIndex)) { + && (!reverseOrder && slotIndex < aSlotCount || reverseOrder && slotIndex >= aStartIndex)) { slot = this.inventorySlots.get(slotIndex); itemStack = slot.getStack(); if (!(slot instanceof GT_Slot_Holo) && !(slot instanceof GT_Slot_Output) - && slot.isItemValid(aStack) - && itemStack != null - && itemStack.getItem() == aStack.getItem() - && (!aStack.getHasSubtypes() || aStack.getItemDamage() == itemStack.getItemDamage()) - && ItemStack.areItemStackTagsEqual(aStack, itemStack)) { + && slot.isItemValid(aStack) + && itemStack != null + && itemStack.getItem() == aStack.getItem() + && (!aStack.getHasSubtypes() || aStack.getItemDamage() == itemStack.getItemDamage()) + && ItemStack.areItemStackTagsEqual(aStack, itemStack)) { int combinedStackSize = itemStack.stackSize + aStack.stackSize; if (itemStack.stackSize < mTileEntity.getInventoryStackLimit()) { if (combinedStackSize <= aStack.getMaxStackSize()) { @@ -598,7 +597,7 @@ public class GT_Container extends Container { } protected static ItemStack handleFluidSlotClick(IFluidAccess aFluidAccess, EntityPlayer aPlayer, - boolean aProcessFullStack, boolean aCanDrain, boolean aCanFill) { + boolean aProcessFullStack, boolean aCanDrain, boolean aCanFill) { ItemStack tStackHeld = aPlayer.inventory.getItemStack(); ItemStack tStackSizedOne = GT_Utility.copyAmount(1, tStackHeld); if (tStackSizedOne == null || tStackHeld.stackSize == 0) return null; @@ -669,11 +668,10 @@ public class GT_Container extends Container { } protected static ItemStack fillFluid(IFluidAccess aFluidAccess, EntityPlayer aPlayer, FluidStack aFluidHeld, - boolean aProcessFullStack) { + boolean aProcessFullStack) { // we are not using aMachine.fill() here any more, so we need to check for fluid type here ourselves if (aFluidAccess.get() != null && !aFluidAccess.get() - .isFluidEqual(aFluidHeld)) - return null; + .isFluidEqual(aFluidHeld)) return null; ItemStack tStackHeld = aPlayer.inventory.getItemStack(); ItemStack tStackSizedOne = GT_Utility.copyAmount(1, tStackHeld); if (tStackSizedOne == null) return null; diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java index 3f2b45064d..af1393cbfb 100644 --- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java @@ -22,10 +22,10 @@ import gregtech.api.util.GT_Utility; public class GT_ContainerMetaTile_Machine extends GT_Container { public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mEnergy = 0, mSteam = 0, mSteamStorage = 0, - mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; + mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; public long mEnergyLong = 0, mStorageLong = 0; private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oEnergy = 0, oSteam = 0, oSteamStorage = 0, - oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0; + oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0; private long oEnergyLong = 0, oStorageLong = 0; protected int mTimer = 0; protected Runnable circuitSlotClickCallback; @@ -45,7 +45,7 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { } public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - boolean doesBindInventory) { + boolean doesBindInventory) { super(aInventoryPlayer, aTileEntity); mTileEntity = aTileEntity; @@ -61,10 +61,10 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { protected void addCircuitSlot() { if (mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport ccs) { GT_Slot_Render slotCircuit = new GT_Slot_Render( - mTileEntity, - ccs.getCircuitSlot(), - ccs.getCircuitSlotX(), - ccs.getCircuitSlotY()); + mTileEntity, + ccs.getCircuitSlot(), + ccs.getCircuitSlotX(), + ccs.getCircuitSlotY()); addSlotToContainer(slotCircuit); slotCircuit.setEnabled(ccs.allowSelectCircuit()); } @@ -222,9 +222,8 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { List tCircuits = ccs.getConfigurationCircuits(); int index = GT_Utility.findMatchingStackInList(tCircuits, cursorStack); if (index < 0) { - int curIndex = GT_Utility.findMatchingStackInList( - tCircuits, - machine.getStackInSlot(ccs.getCircuitSlot())) + 1; + int curIndex = GT_Utility + .findMatchingStackInList(tCircuits, machine.getStackInSlot(ccs.getCircuitSlot())) + 1; if (aMouseclick == 0) { curIndex += 1; } else { diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java index 976d7e8127..479c021d89 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java @@ -217,7 +217,7 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { } default -> { if (aSlotNumber == OTHER_SLOT_COUNT + 1 + machine.mInputSlotCount + machine.mOutputItems.length - && aMouseclick < 2) { + && aMouseclick < 2) { GT_MetaTileEntity_BasicTank tTank = (GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity(); if (mTileEntity.isClientSide()) { // see parent class slotClick for an explanation on why doing this @@ -228,11 +228,11 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { GT_Recipe_Map recipes = machine.getRecipeList(); // If the machine has recipes but no fluid inputs, disallow filling this slot with fluids. ItemStack tToken = handleFluidSlotClick( - tFillableAccess, - aPlayer, - aMouseclick == 0, - true, - (recipes == null || recipes.hasFluidInputs())); + tFillableAccess, + aPlayer, + aMouseclick == 0, + true, + (recipes == null || recipes.hasFluidInputs())); if (mTileEntity.isServerSide() && tToken != null) mTileEntity.markInventoryBeenModified(); return tToken; } else { diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java index f463b35f7c..08e8e6eb00 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java @@ -56,11 +56,11 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine { } IFluidAccess tDrainableAccess = constructFluidAccess(tTank, false); return handleFluidSlotClick( - tDrainableAccess, - aPlayer, - aMouseclick == 0, - true, - !tTank.isDrainableStackSeparate()); + tDrainableAccess, + aPlayer, + aMouseclick == 0, + true, + !tTank.isDrainableStackSeparate()); } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } diff --git a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java index bcc9219d5e..142b84e008 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java @@ -18,7 +18,7 @@ public class GT_Container_MultiMachine extends GT_ContainerMetaTile_Machine { } public GT_Container_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - boolean bindInventory) { + boolean bindInventory) { super(aInventoryPlayer, aTileEntity, bindInventory); } diff --git a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java b/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java index 7c6328bb34..85e56d9b52 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java +++ b/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java @@ -22,27 +22,22 @@ public class GT_GUIColorOverride { private static final Object NOT_FOUND = new Object(); private static final LoadingCache cache = CacheBuilder.newBuilder() - .softValues() - .build(new CacheLoader<>() { - - @Override - public Object load( - @Nonnull ResourceLocation key) - throws Exception { - IResource ir = Minecraft.getMinecraft() - .getResourceManager() - .getResource( - key); - if (ir.hasMetadata()) - return ir.getMetadata( - "colors"); - // return a dummy - // object because - // LoadingCache - // doesn't like null - return NOT_FOUND; - } - }); + .softValues() + .build(new CacheLoader<>() { + + @Override + public Object load(@Nonnull ResourceLocation key) throws Exception { + IResource ir = Minecraft.getMinecraft() + .getResourceManager() + .getResource(key); + if (ir.hasMetadata()) return ir.getMetadata("colors"); + // return a dummy + // object because + // LoadingCache + // doesn't like null + return NOT_FOUND; + } + }); private static final GT_GUIColorOverride FALLBACK = new GT_GUIColorOverride(); private ColorsMetadataSection cmSection; diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index cbccdc5385..a72e9737ee 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -47,20 +47,20 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements // Cover Tabs support. Subclasses can override display position, style and visuals by overriding setupCoverTabs public GT_GuiCoverTabLine coverTabs; private static final int COVER_TAB_LEFT = -16, COVER_TAB_TOP = 1, COVER_TAB_HEIGHT = 20, COVER_TAB_WIDTH = 18, - COVER_TAB_SPACING = 2; + COVER_TAB_SPACING = 2; private static final DisplayStyle COVER_TAB_X_DIR = DisplayStyle.NONE, COVER_TAB_Y_DIR = DisplayStyle.NORMAL; private static final GT_GuiTabIconSet TAB_ICONSET = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL, - GT_GuiIcon.TAB_HIGHLIGHT, - GT_GuiIcon.TAB_DISABLED); + GT_GuiIcon.TAB_NORMAL, + GT_GuiIcon.TAB_HIGHLIGHT, + GT_GuiIcon.TAB_DISABLED); public GT_GUIContainerMetaTile_Machine(GT_ContainerMetaTile_Machine aContainer, String aGUIbackground) { super(aContainer, aGUIbackground); mContainer = aContainer; DisplayStyle preferredDisplayStyle = GT_Mod.gregtechproxy.mCoverTabsVisible - ? (GT_Mod.gregtechproxy.mCoverTabsFlipped ? DisplayStyle.INVERSE : DisplayStyle.NORMAL) - : DisplayStyle.NONE; + ? (GT_Mod.gregtechproxy.mCoverTabsFlipped ? DisplayStyle.INVERSE : DisplayStyle.NORMAL) + : DisplayStyle.NONE; setupCoverTabs(preferredDisplayStyle); // Only setup tooltips if they're currently enabled. @@ -73,7 +73,7 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements } public GT_GUIContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - String aGUIbackground) { + String aGUIbackground) { this(new GT_ContainerMetaTile_Machine(aInventoryPlayer, aTileEntity), aGUIbackground); } @@ -82,18 +82,18 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements */ protected void setupCoverTabs(DisplayStyle preferredDisplayStyle) { coverTabs = new GT_GuiCoverTabLine( - this, - COVER_TAB_LEFT, - COVER_TAB_TOP, - COVER_TAB_HEIGHT, - COVER_TAB_WIDTH, - COVER_TAB_SPACING, - COVER_TAB_X_DIR, - COVER_TAB_Y_DIR, - preferredDisplayStyle, - getTabBackground(), - getMachine().getBaseMetaTileEntity(), - getColorization()); + this, + COVER_TAB_LEFT, + COVER_TAB_TOP, + COVER_TAB_HEIGHT, + COVER_TAB_WIDTH, + COVER_TAB_SPACING, + COVER_TAB_X_DIR, + COVER_TAB_Y_DIR, + preferredDisplayStyle, + getTabBackground(), + getMachine().getBaseMetaTileEntity(), + getColorization()); } @Override @@ -182,9 +182,9 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements protected void setupTooltips() { if (mContainer.mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport ccs) { if (ccs.allowSelectCircuit()) addToolTip( - new GT_GuiSlotTooltip( - mContainer.getSlot(ccs.getCircuitGUISlot()), - mTooltipCache.getData(GHOST_CIRCUIT_TOOLTIP))); + new GT_GuiSlotTooltip( + mContainer.getSlot(ccs.getCircuitGUISlot()), + mTooltipCache.getData(GHOST_CIRCUIT_TOOLTIP))); } } @@ -234,7 +234,7 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements if (mContainer.mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport ccs) { Slot slotCircuit = mContainer.getSlot(ccs.getCircuitGUISlot()); if (slotCircuit != null - && func_146978_c(slotCircuit.xDisplayPosition, slotCircuit.yDisplayPosition, 16, 16, mx, my)) { + && func_146978_c(slotCircuit.xDisplayPosition, slotCircuit.yDisplayPosition, 16, 16, mx, my)) { // emulate click handleMouseClick(slotCircuit, -1, delta > 0 ? 1 : 0, 0); return; @@ -248,13 +248,13 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) machine; List circuits = ccs.getConfigurationCircuits(); mc.displayGuiScreen( - new GT_GUIDialogSelectItem( - StatCollector.translateToLocal("GT5U.machines.select_circuit"), - machine.getStackForm(0), - this, - this::onCircuitSelected, - circuits, - GT_Utility.findMatchingStackInList(circuits, machine.getStackInSlot(ccs.getCircuitSlot())))); + new GT_GUIDialogSelectItem( + StatCollector.translateToLocal("GT5U.machines.select_circuit"), + machine.getStackForm(0), + this, + this::onCircuitSelected, + circuits, + GT_Utility.findMatchingStackInList(circuits, machine.getStackInSlot(ccs.getCircuitSlot())))); } private void onCircuitSelected(ItemStack selected) { diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java index 1d82fa8274..5bd44668c5 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_1by1 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_1by1(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "1by1.png")); + new GT_Container_1by1(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "1by1.png")); mName = aName; } public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_1by1(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "1by1.png")); + new GT_Container_1by1(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "1by1.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java index 5d65ca1344..107bcc3859 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_2by2 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_2by2(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "2by2.png")); + new GT_Container_2by2(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "2by2.png")); mName = aName; } public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_2by2(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "2by2.png")); + new GT_Container_2by2(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "2by2.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java index 2ba68decf6..0c8b63664a 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_3by3 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_3by3(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "3by3.png")); + new GT_Container_3by3(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "3by3.png")); mName = aName; } public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_3by3(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "3by3.png")); + new GT_Container_3by3(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "3by3.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java index f1933897c7..9e5d7f7155 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_4by4 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_4by4(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "4by4.png")); + new GT_Container_4by4(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "4by4.png")); mName = aName; } public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_4by4(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "4by4.png")); + new GT_Container_4by4(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "4by4.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java index 6e6ce4c1d0..f610f6cf14 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java @@ -28,40 +28,39 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin private static final int NEEDS_STEAM_VENTING = 64; private static final GT_GuiTabIconSet TAB_ICONSET_BRONZE = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL_BRONZE, - GT_GuiIcon.TAB_HIGHLIGHT_BRONZE, - GT_GuiIcon.TAB_DISABLED_BRONZE); + GT_GuiIcon.TAB_NORMAL_BRONZE, + GT_GuiIcon.TAB_HIGHLIGHT_BRONZE, + GT_GuiIcon.TAB_DISABLED_BRONZE); private static final GT_GuiTabIconSet TAB_ICONSET_STEEL = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL_STEEL, - GT_GuiIcon.TAB_HIGHLIGHT_STEEL, - GT_GuiIcon.TAB_DISABLED_STEEL); + GT_GuiIcon.TAB_NORMAL_STEEL, + GT_GuiIcon.TAB_HIGHLIGHT_STEEL, + GT_GuiIcon.TAB_DISABLED_STEEL); private final int textColor = this.getTextColorOrDefault("title", 0x404040); public final String mName, mNEI; public final byte mProgressBarDirection, mProgressBarAmount; // Tooltip localization keys private static final String BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", - BATTERY_SLOT_TOOLTIP_ALT = "GT5U.machines.battery_slot.tooltip.alternative", - UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", - SPECIAL_SLOT_TOOLTIP = "GT5U.machines.special_slot.tooltip", - FLUID_INPUT_TOOLTIP = "GT5U.machines.fluid_input_slot.tooltip", - FLUID_OUTPUT_TOOLTIP = "GT5U.machines.fluid_output_slot.tooltip", - STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", - STALLED_VENT_TOOLTIP = "GT5U.machines.stalled_vent.tooltip", - FLUID_TRANSFER_TOOLTIP = "GT5U.machines.fluid_transfer.tooltip", - ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", - POWER_SOURCE_KEY = "GT5U.machines.powersource."; + BATTERY_SLOT_TOOLTIP_ALT = "GT5U.machines.battery_slot.tooltip.alternative", + UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", + SPECIAL_SLOT_TOOLTIP = "GT5U.machines.special_slot.tooltip", + FLUID_INPUT_TOOLTIP = "GT5U.machines.fluid_input_slot.tooltip", + FLUID_OUTPUT_TOOLTIP = "GT5U.machines.fluid_output_slot.tooltip", + STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", + STALLED_VENT_TOOLTIP = "GT5U.machines.stalled_vent.tooltip", + FLUID_TRANSFER_TOOLTIP = "GT5U.machines.fluid_transfer.tooltip", + ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", POWER_SOURCE_KEY = "GT5U.machines.powersource."; public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aTextureFile, String aNEI) { + String aTextureFile, String aNEI) { this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1); } public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { + String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { super( - new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "basicmachines", aTextureFile)); + new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "basicmachines", aTextureFile)); mProgressBarDirection = aProgressBarDirection; mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount); mName = aName; @@ -84,10 +83,10 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin batterySlotTooltipKey = UNUSED_SLOT_TOOLTIP; batterySlotTooltipArgs = new String[0]; addToolTip( - new GT_GuiSmartTooltip( - tProblemArea, - () -> hasErrorCode(NEEDS_STEAM_VENTING), - mTooltipCache.getData(STALLED_VENT_TOOLTIP))); + new GT_GuiSmartTooltip( + tProblemArea, + () -> hasErrorCode(NEEDS_STEAM_VENTING), + mTooltipCache.getData(STALLED_VENT_TOOLTIP))); } else { String pTier1 = powerTierName(machine.mTier); if (machine.mTier == GT_Values.VN.length - 1) { @@ -98,44 +97,41 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin batterySlotTooltipArgs = new String[] { pTier1, powerTierName((byte) (machine.mTier + 1)) }; } addToolTip( - new GT_GuiSlotTooltip( - container.slotFluidTransferToggle, - mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))); + new GT_GuiSlotTooltip( + container.slotFluidTransferToggle, + mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))); addToolTip( - new GT_GuiSlotTooltip( - container.slotItemTransferToggle, - mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); + new GT_GuiSlotTooltip(container.slotItemTransferToggle, mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); } if (recipes != null && recipes.hasFluidInputs()) { addToolTip( - new GT_GuiSlotTooltip( - container.slotFluidInput, - mTooltipCache.getData(FLUID_INPUT_TOOLTIP, machine.getCapacity()))); + new GT_GuiSlotTooltip( + container.slotFluidInput, + mTooltipCache.getData(FLUID_INPUT_TOOLTIP, machine.getCapacity()))); } if (recipes != null && recipes.hasFluidOutputs()) { addToolTip( - new GT_GuiSlotTooltip( - container.slotFluidOutput, - mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, machine.getCapacity()))); + new GT_GuiSlotTooltip( + container.slotFluidOutput, + mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, machine.getCapacity()))); } addToolTip( - new GT_GuiSlotTooltip( - getContainer().slotBattery, - mTooltipCache.getData(batterySlotTooltipKey, batterySlotTooltipArgs))); + new GT_GuiSlotTooltip( + getContainer().slotBattery, + mTooltipCache.getData(batterySlotTooltipKey, batterySlotTooltipArgs))); addToolTip( - new GT_GuiSlotTooltip( - container.slotSpecial, - mTooltipCache.getData( - recipes != null && recipes.usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP - : UNUSED_SLOT_TOOLTIP))); + new GT_GuiSlotTooltip( + container.slotSpecial, + mTooltipCache.getData( + recipes != null && recipes.usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP : UNUSED_SLOT_TOOLTIP))); addToolTip( - new GT_GuiSmartTooltip( - tProblemArea, - () -> container.mStuttering && !hasErrorCode(NEEDS_STEAM_VENTING), - mTooltipCache.getData( - STALLED_STUTTERING_TOOLTIP, - StatCollector.translateToLocal( - POWER_SOURCE_KEY + (machine.isSteampowered() ? "steam" : "power"))))); + new GT_GuiSmartTooltip( + tProblemArea, + () -> container.mStuttering && !hasErrorCode(NEEDS_STEAM_VENTING), + mTooltipCache.getData( + STALLED_STUTTERING_TOOLTIP, + StatCollector + .translateToLocal(POWER_SOURCE_KEY + (machine.isSteampowered() ? "steam" : "power"))))); } /** @@ -174,31 +170,30 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin if (mContainer.mMaxProgressTime > 0) { int tSize = mProgressBarDirection < 2 ? 20 : 18; int tProgress = Math.max( - 1, - Math.min( - tSize * mProgressBarAmount, - (mContainer.mProgressTime > 0 ? 1 : 0) + mContainer.mProgressTime * tSize - * mProgressBarAmount - / mContainer.mMaxProgressTime)) - % (tSize + 1); + 1, + Math.min( + tSize * mProgressBarAmount, + (mContainer.mProgressTime > 0 ? 1 : 0) + + mContainer.mProgressTime * tSize * mProgressBarAmount / mContainer.mMaxProgressTime)) + % (tSize + 1); switch (mProgressBarDirection) { // yes, my OCD was mad at me before I did the Tabs. case 0 -> drawTexturedModalRect(x + 78, y + 24, 176, 0, tProgress, 18); case 1 -> drawTexturedModalRect( - x + 78 + 20 - tProgress, - y + 24, - 176 + 20 - tProgress, - 0, - tProgress, - 18); + x + 78 + 20 - tProgress, + y + 24, + 176 + 20 - tProgress, + 0, + tProgress, + 18); case 2 -> drawTexturedModalRect(x + 78, y + 24, 176, 0, 20, tProgress); case 3 -> drawTexturedModalRect( - x + 78, - y + 24 + 18 - tProgress, - 176, - 18 - tProgress, - 20, - tProgress); + x + 78, + y + 24 + 18 - tProgress, + 176, + 18 - tProgress, + 20, + tProgress); case 4 -> { tProgress = 20 - tProgress; drawTexturedModalRect(x + 78, y + 24, 176, 0, tProgress, 18); @@ -224,7 +219,7 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin protected GT_GuiTabIconSet getTabBackground() { if (getMachine().isSteampowered()) { return getMachine() instanceof GT_MetaTileEntity_BasicMachine_Steel ? TAB_ICONSET_STEEL - : TAB_ICONSET_BRONZE; + : TAB_ICONSET_BRONZE; } return super.getTabBackground(); } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java index a8e965cf28..54aa42d2a3 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java @@ -12,31 +12,28 @@ public class GT_GUIContainer_BasicTank extends GT_GUIContainerMetaTile_Machine { private final String mName; private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0x404040), - textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); public GT_GUIContainer_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_BasicTank(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "BasicTank.png")); + new GT_Container_BasicTank(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "BasicTank.png")); mName = aName; } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - fontRendererObj.drawString( - StatCollector.translateToLocal("container.inventory"), - 8, - ySize - 96 + 2, - textColorTitle); + fontRendererObj + .drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); fontRendererObj.drawString(mName, 8, 6, textColorTitle); if (mContainer != null) { fontRendererObj.drawString("Liquid Amount", 10, 20, textColor); fontRendererObj.drawString( - GT_Utility.parseNumberToString(((GT_Container_BasicTank) mContainer).mContent), - 10, - 30, - textColorValue); + GT_Utility.parseNumberToString(((GT_Container_BasicTank) mContainer).mContent), + 10, + 30, + textColorValue); } } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java index 8378c5e8cf..66c5156190 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java @@ -22,17 +22,17 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin String mName; private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); + textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); public GT_GUIContainer_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aTextureFile) { + String aTextureFile) { super( - new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath( - "textures", - "gui", - "multimachines", - aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); + new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath( + "textures", + "gui", + "multimachines", + aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); mName = aName; } @@ -69,7 +69,7 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin current_line.append(str); } else { current_line.append(" ") - .append(str); + .append(str); } index++; } @@ -98,90 +98,60 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin } if ((mContainer.mDisplayErrorCode & 8) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("135", "Platings are dented."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("135", "Platings are dented."), 10, line_counter, textColor); line_counter += 8; } if ((mContainer.mDisplayErrorCode & 16) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("136", "Circuitry burned out."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("136", "Circuitry burned out."), 10, line_counter, textColor); line_counter += 8; } if ((mContainer.mDisplayErrorCode & 32) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("137", "That doesn't belong there."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("137", "That doesn't belong there."), 10, line_counter, textColor); line_counter += 8; } if ((mContainer.mDisplayErrorCode & 64) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("138", "Incomplete Structure."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("138", "Incomplete Structure."), 10, line_counter, textColor); line_counter += 8; } if (mContainer.mDisplayErrorCode == 0) { if (mContainer.mActive == 0) { - fontRendererObj.drawString( - GT_Utility.trans("139", "Hit with Soft Mallet"), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("139", "Hit with Soft Mallet"), 10, line_counter, textColor); line_counter += 8; - fontRendererObj.drawString( - GT_Utility.trans("140", "to (re-)start the Machine"), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("140", "to (re-)start the Machine"), 10, line_counter, textColor); line_counter += 8; - fontRendererObj.drawString( - GT_Utility.trans("141", "if it doesn't start."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("141", "if it doesn't start."), 10, line_counter, textColor); } else { - fontRendererObj.drawString( - GT_Utility.trans("142", "Running perfectly."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("142", "Running perfectly."), 10, line_counter, textColor); } line_counter += 8; if (mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DrillerBase) { ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity() - .getStackInSlot(1); + .getStackInSlot(1); if (tItem == null - || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))) { - fontRendererObj.drawString( - GT_Utility.trans("143", "Missing Mining Pipe"), - 10, - line_counter, - textColor); + || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))) { + fontRendererObj + .drawString(GT_Utility.trans("143", "Missing Mining Pipe"), 10, line_counter, textColor); } } else if (mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) { ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity() - .getStackInSlot(1); + .getStackInSlot(1); if (tItem == null - || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170 - && tItem.getItemDamage() <= 177)) { - fontRendererObj.drawString( - GT_Utility.trans("144", "Missing Turbine Rotor"), - 10, - line_counter, - textColor); + || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170 + && tItem.getItemDamage() <= 177)) { + fontRendererObj + .drawString(GT_Utility.trans("144", "Missing Turbine Rotor"), 10, line_counter, textColor); } } } diff --git a/src/main/java/gregtech/api/gui/GT_GUICover.java b/src/main/java/gregtech/api/gui/GT_GUICover.java index 2bd981c6b1..791bcc0c73 100644 --- a/src/main/java/gregtech/api/gui/GT_GUICover.java +++ b/src/main/java/gregtech/api/gui/GT_GUICover.java @@ -40,13 +40,13 @@ public abstract class GT_GUICover extends GT_GUIScreen { // If this cover was given a guiId, tell the server to open it for us when this GUI closes. if (parentGuiId != -1 && tile.isUseableByPlayer(mc.thePlayer)) { GT_Values.NW.sendToServer( - new GT_Packet_GtTileEntityGuiRequest( - tile.getXCoord(), - tile.getYCoord(), - tile.getZCoord(), - parentGuiId, - tile.getWorld().provider.dimensionId, - mc.thePlayer.getEntityId())); + new GT_Packet_GtTileEntityGuiRequest( + tile.getXCoord(), + tile.getYCoord(), + tile.getZCoord(), + parentGuiId, + tile.getWorld().provider.dimensionId, + mc.thePlayer.getEntityId())); } else { this.mc.displayGuiScreen(null); this.mc.setIngameFocus(); diff --git a/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java b/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java index 1f95def197..03a6fb2a70 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java +++ b/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java @@ -28,11 +28,8 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { // all slots not including btnCurrent private final List slots = new ArrayList<>(); // the currently selected slot content - private final GT_GuiFakeItemButton btnCurrent = new GT_GuiFakeItemButton( - this, - 8, - 25, - GT_GuiIcon.SLOT_DARKGRAY).setMimicSlot(true); + private final GT_GuiFakeItemButton btnCurrent = new GT_GuiFakeItemButton(this, 8, 25, GT_GuiIcon.SLOT_DARKGRAY) + .setMimicSlot(true); private final boolean noDeselect; private int selected; private int scroll = 0; @@ -40,12 +37,12 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { private GT_GuiIconButton btnDown; public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, - Consumer selectedCallback, List stacks) { + Consumer selectedCallback, List stacks) { this(header, headerItem, parent, selectedCallback, stacks, UNSELECTED); } public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, - Consumer selectedCallback, List stacks, int selected) { + Consumer selectedCallback, List stacks, int selected) { this(header, headerItem, parent, selectedCallback, stacks, selected, false); } @@ -64,7 +61,7 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { * is guaranteed to be called with a nonnull stack */ public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, - Consumer selectedCallback, List stacks, int selected, boolean noDeselect) { + Consumer selectedCallback, List stacks, int selected, boolean noDeselect) { super(176, 107, header); this.noDeselect = noDeselect; if (headerItem != null) this.headerIcon.setItem(headerItem); @@ -80,8 +77,7 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { slots.add( - new GT_GuiFakeItemButton(this, 8 + 18 * j, 44 + 18 * i, GT_GuiIcon.SLOT_GRAY).setMimicSlot( - true)); + new GT_GuiFakeItemButton(this, 8 + 18 * j, 44 + 18 * i, GT_GuiIcon.SLOT_GRAY).setMimicSlot(true)); } } @@ -91,8 +87,8 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { @Override protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { - btnCurrent.setX( - 8 + 2 + fontRendererObj.getStringWidth(StatCollector.translateToLocal("GT5U.gui.select.current"))); + btnCurrent + .setX(8 + 2 + fontRendererObj.getStringWidth(StatCollector.translateToLocal("GT5U.gui.select.current"))); } @Override @@ -129,7 +125,7 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { int mx = x - guiLeft, my = y - guiTop; if (button == 0) { if (btnCurrent.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { ensureSelectedDisplayed(); return; } @@ -137,20 +133,20 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { for (int i = 0, slotsSize = slots.size(); i < slotsSize; i++) { GT_GuiFakeItemButton slot = slots.get(i); if (slot.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { setSelected(slotIndexToListIndex(i)); return; } } } else if (button == 1 && getSelected() >= 0) { if (btnCurrent.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { setSelected(UNSELECTED); return; } GT_GuiFakeItemButton slot = getSlot(listIndexToSlotIndex(getSelected())); if (slot != null && slot.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { setSelected(UNSELECTED); } } @@ -166,8 +162,8 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { private void fillSlots() { for (int i = 0, j = scroll * cols; i < slots.size(); i++, j++) { slots.get(i) - .setItem(getCandidate(j)) - .setBgIcon(j == getSelected() ? GT_GuiIcon.SLOT_DARKGRAY : GT_GuiIcon.SLOT_GRAY); + .setItem(getCandidate(j)) + .setBgIcon(j == getSelected() ? GT_GuiIcon.SLOT_DARKGRAY : GT_GuiIcon.SLOT_GRAY); } } diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Armor.java b/src/main/java/gregtech/api/gui/GT_Slot_Armor.java index 9b4b81a31d..1c48b01430 100644 --- a/src/main/java/gregtech/api/gui/GT_Slot_Armor.java +++ b/src/main/java/gregtech/api/gui/GT_Slot_Armor.java @@ -24,7 +24,7 @@ public class GT_Slot_Armor extends Slot { @Override public boolean isItemValid(ItemStack aStack) { return aStack != null && aStack.getItem() != null - && aStack.getItem() - .isValidArmor(aStack, mArmorType, mPlayer); + && aStack.getItem() + .isValidArmor(aStack, mArmorType, mPlayer); } } diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Holo.java b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java index a01b91cefb..47bd5ceef3 100644 --- a/src/main/java/gregtech/api/gui/GT_Slot_Holo.java +++ b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java @@ -16,7 +16,7 @@ public class GT_Slot_Holo extends Slot { public int mMaxStacksize = 127; public GT_Slot_Holo(IInventory inventory, int slotIndex, int xPos, int yPos, boolean aCanInsertItem, - boolean aCanStackItem, int aMaxStacksize) { + boolean aCanStackItem, int aMaxStacksize) { super(inventory, slotIndex, xPos, yPos); mCanInsertItem = aCanInsertItem; mCanStackItem = aCanStackItem; diff --git a/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java b/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java index 43b7210758..83a9d0f725 100644 --- a/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java +++ b/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java @@ -56,8 +56,8 @@ public class FallbackableSteamTexture { } else { try { Minecraft.getMinecraft() - .getResourceManager() - .getResource(candidate.get(steamVariant).location); + .getResourceManager() + .getResource(candidate.get(steamVariant).location); useFallback = false; } catch (IOException e) { useFallback = true; diff --git a/src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java b/src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java index 65a61ad951..62a933cfa6 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java +++ b/src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java @@ -23,7 +23,7 @@ public class GT_CoverUIBuildContext extends UIBuildContext { * @param guiColorization The color used to render machine's GUI */ public GT_CoverUIBuildContext(EntityPlayer player, int coverID, byte side, ICoverable tile, boolean anotherWindow, - int guiColorization) { + int guiColorization) { super(player); this.coverID = coverID; this.side = side; diff --git a/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java b/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java index 4d004429b0..b132f33d63 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java +++ b/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java @@ -36,46 +36,31 @@ public class GT_UIInfos { * Do NOT run {@link UIBuilder#build} on-the-fly, otherwise MP client won't register UIs. Instead, store to static * field, just like {@link #GTTileEntityDefaultUI}. Such mistake can be easily overlooked by testing only SP. */ - public static final Function> GTTileEntityUIFactory = containerConstructor -> UIBuilder.of() - .container( - (player, world, - x, - y, - z) -> { - TileEntity te = world.getTileEntity( - x, - y, - z); - if (te instanceof ITileWithModularUI) { - return createTileEntityContainer( - player, - ((ITileWithModularUI) te)::createWindow, - te::markDirty, - containerConstructor); - } - return null; - }) - .gui( - ((player, - world, - x, - y, - z) -> { - if (!world.isRemote) - return null; - TileEntity te = world.getTileEntity( - x, - y, - z); - if (te instanceof ITileWithModularUI) { - return createTileEntityGuiContainer( - player, - ((ITileWithModularUI) te)::createWindow, - containerConstructor); - } - return null; - })) - .build(); + public static final Function> GTTileEntityUIFactory = containerConstructor -> UIBuilder + .of() + .container((player, world, x, y, z) -> { + TileEntity te = world.getTileEntity(x, y, z); + if (te instanceof ITileWithModularUI) { + return createTileEntityContainer( + player, + ((ITileWithModularUI) te)::createWindow, + te::markDirty, + containerConstructor); + } + return null; + }) + .gui(((player, world, x, y, z) -> { + if (!world.isRemote) return null; + TileEntity te = world.getTileEntity(x, y, z); + if (te instanceof ITileWithModularUI) { + return createTileEntityGuiContainer( + player, + ((ITileWithModularUI) te)::createWindow, + containerConstructor); + } + return null; + })) + .build(); private static final UIInfo GTTileEntityDefaultUI = GTTileEntityUIFactory.apply(ModularUIContainer::new); @@ -85,33 +70,33 @@ public class GT_UIInfos { for (byte i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { final byte side = i; coverUI.put( - side, - UIBuilder.of() - .container((player, world, x, y, z) -> { - final TileEntity te = world.getTileEntity(x, y, z); - if (!(te instanceof ICoverable gtTileEntity)) return null; - GT_CoverBehaviorBase cover = gtTileEntity.getCoverBehaviorAtSideNew(side); - return createCoverContainer( - player, - cover::createWindow, - te::markDirty, - gtTileEntity.getCoverIDAtSide(side), - side, - gtTileEntity); - }) - .gui((player, world, x, y, z) -> { - if (!world.isRemote) return null; - final TileEntity te = world.getTileEntity(x, y, z); - if (!(te instanceof ICoverable gtTileEntity)) return null; - final GT_CoverBehaviorBase cover = gtTileEntity.getCoverBehaviorAtSideNew(side); - return createCoverGuiContainer( - player, - cover::createWindow, - gtTileEntity.getCoverIDAtSide(side), - side, - gtTileEntity); - }) - .build()); + side, + UIBuilder.of() + .container((player, world, x, y, z) -> { + final TileEntity te = world.getTileEntity(x, y, z); + if (!(te instanceof ICoverable gtTileEntity)) return null; + GT_CoverBehaviorBase cover = gtTileEntity.getCoverBehaviorAtSideNew(side); + return createCoverContainer( + player, + cover::createWindow, + te::markDirty, + gtTileEntity.getCoverIDAtSide(side), + side, + gtTileEntity); + }) + .gui((player, world, x, y, z) -> { + if (!world.isRemote) return null; + final TileEntity te = world.getTileEntity(x, y, z); + if (!(te instanceof ICoverable gtTileEntity)) return null; + final GT_CoverBehaviorBase cover = gtTileEntity.getCoverBehaviorAtSideNew(side); + return createCoverGuiContainer( + player, + cover::createWindow, + gtTileEntity.getCoverIDAtSide(side), + side, + gtTileEntity); + }) + .build()); } } @@ -121,11 +106,11 @@ public class GT_UIInfos { public static void openGTTileEntityUI(IHasWorldObjectAndCoords aTileEntity, EntityPlayer aPlayer) { if (aTileEntity.isClientSide()) return; GTTileEntityDefaultUI.open( - aPlayer, - aTileEntity.getWorld(), - aTileEntity.getXCoord(), - aTileEntity.getYCoord(), - aTileEntity.getZCoord()); + aPlayer, + aTileEntity.getWorld(), + aTileEntity.getXCoord(), + aTileEntity.getYCoord(), + aTileEntity.getZCoord()); } /** @@ -135,20 +120,20 @@ public class GT_UIInfos { if (tileEntity.isClientSide()) return; GT_Values.NW.sendToPlayer( - new GT_Packet_SendCoverData( - side, - tileEntity.getCoverIDAtSide(side), - tileEntity.getComplexCoverDataAtSide(side), - tileEntity), - (EntityPlayerMP) player); + new GT_Packet_SendCoverData( + side, + tileEntity.getCoverIDAtSide(side), + tileEntity.getComplexCoverDataAtSide(side), + tileEntity), + (EntityPlayerMP) player); coverUI.get(side) - .open( - player, - tileEntity.getWorld(), - tileEntity.getXCoord(), - tileEntity.getYCoord(), - tileEntity.getZCoord()); + .open( + player, + tileEntity.getWorld(), + tileEntity.getXCoord(), + tileEntity.getYCoord(), + tileEntity.getZCoord()); } /** @@ -161,8 +146,8 @@ public class GT_UIInfos { } private static ModularUIContainer createTileEntityContainer(EntityPlayer player, - Function windowCreator, Runnable onWidgetUpdate, - ContainerConstructor containerCreator) { + Function windowCreator, Runnable onWidgetUpdate, + ContainerConstructor containerCreator) { final UIBuildContext buildContext = new UIBuildContext(player); final ModularWindow window = windowCreator.apply(buildContext); if (window == null) return null; @@ -171,19 +156,19 @@ public class GT_UIInfos { @SideOnly(Side.CLIENT) private static ModularGui createTileEntityGuiContainer(EntityPlayer player, - Function windowCreator, ContainerConstructor containerConstructor) { + Function windowCreator, ContainerConstructor containerConstructor) { final ModularUIContainer container = createTileEntityContainer( - player, - windowCreator, - null, - containerConstructor); + player, + windowCreator, + null, + containerConstructor); if (container == null) return null; return new ModularGui(container); } private static ModularUIContainer createCoverContainer(EntityPlayer player, - Function windowCreator, Runnable onWidgetUpdate, int coverID, - byte side, ICoverable tile) { + Function windowCreator, Runnable onWidgetUpdate, int coverID, byte side, + ICoverable tile) { final GT_CoverUIBuildContext buildContext = new GT_CoverUIBuildContext(player, coverID, side, tile, false); final ModularWindow window = windowCreator.apply(buildContext); if (window == null) return null; @@ -192,7 +177,7 @@ public class GT_UIInfos { @SideOnly(Side.CLIENT) private static ModularGui createCoverGuiContainer(EntityPlayer player, - Function windowCreator, int coverID, byte side, ICoverable tile) { + Function windowCreator, int coverID, byte side, ICoverable tile) { final ModularUIContainer container = createCoverContainer(player, windowCreator, null, coverID, side, tile); if (container == null) { return null; diff --git a/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java b/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java index ff05f23d25..e8c9f192a6 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java +++ b/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java @@ -13,182 +13,120 @@ public class GT_UITextures { public static final UITexture TRANSPARENT = UITexture.fullImage(GregTech.ID, "gui/picture/transparent"); - public static final AdaptableUITexture BACKGROUND_SINGLEBLOCK_DEFAULT = AdaptableUITexture.of( - GregTech.ID, - "gui/background/singleblock_default", - 176, - 166, - 4); - public static final SteamTexture BACKGROUND_STEAM = SteamTexture.adaptableTexture( - GregTech.ID, - "gui/background/%s", - 176, - 166, - 4); - public static final UITexture BACKGROUND_FUSION_COMPUTER = UITexture.fullImage( - GregTech.ID, - "gui/background/fusion_computer"); - public static final AdaptableUITexture BACKGROUND_TEXT_FIELD = AdaptableUITexture.of( - GregTech.ID, - "gui/background/text_field", - 142, - 28, - 1); - public static final AdaptableUITexture BACKGROUND_TEXT_FIELD_LIGHT_GRAY = AdaptableUITexture.of( - GregTech.ID, - "gui/background/text_field_light_gray", - 61, - 12, - 1); + public static final AdaptableUITexture BACKGROUND_SINGLEBLOCK_DEFAULT = AdaptableUITexture + .of(GregTech.ID, "gui/background/singleblock_default", 176, 166, 4); + public static final SteamTexture BACKGROUND_STEAM = SteamTexture + .adaptableTexture(GregTech.ID, "gui/background/%s", 176, 166, 4); + public static final UITexture BACKGROUND_FUSION_COMPUTER = UITexture + .fullImage(GregTech.ID, "gui/background/fusion_computer"); + public static final AdaptableUITexture BACKGROUND_TEXT_FIELD = AdaptableUITexture + .of(GregTech.ID, "gui/background/text_field", 142, 28, 1); + public static final AdaptableUITexture BACKGROUND_TEXT_FIELD_LIGHT_GRAY = AdaptableUITexture + .of(GregTech.ID, "gui/background/text_field_light_gray", 61, 12, 1); public static final SteamTexture SLOT_ITEM_STEAM = SteamTexture.fullImage(GregTech.ID, "gui/slot/item_%s"); public static final SteamTexture SLOT_FLUID_STEAM = SteamTexture.fullImage(GregTech.ID, "gui/slot/fluid_%s"); - public static final AdaptableUITexture SLOT_DARK_GRAY = AdaptableUITexture.of( - GregTech.ID, - "gui/slot/dark_gray", - 18, - 18, - 1); - public static final AdaptableUITexture SLOT_MAINTENANCE = AdaptableUITexture.of( - GregTech.ID, - "gui/slot/maintenance", - 20, - 20, - 1); - public static final AdaptableUITexture SLOT_UPLIFTED = AdaptableUITexture.of( - GregTech.ID, - "gui/slot/uplifted", - 18, - 18, - 1); + public static final AdaptableUITexture SLOT_DARK_GRAY = AdaptableUITexture + .of(GregTech.ID, "gui/slot/dark_gray", 18, 18, 1); + public static final AdaptableUITexture SLOT_MAINTENANCE = AdaptableUITexture + .of(GregTech.ID, "gui/slot/maintenance", 20, 20, 1); + public static final AdaptableUITexture SLOT_UPLIFTED = AdaptableUITexture + .of(GregTech.ID, "gui/slot/uplifted", 18, 18, 1); public static final UITexture OVERLAY_SLOT_ARROW_ME = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/arrow_me"); public static final UITexture OVERLAY_SLOT_BEAKER_1 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/beaker_1"); public static final UITexture OVERLAY_SLOT_BEAKER_2 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/beaker_2"); - public static final UITexture OVERLAY_SLOT_BEE_DRONE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/bee_drone"); - public static final UITexture OVERLAY_SLOT_BEE_QUEEN = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/bee_queen"); + public static final UITexture OVERLAY_SLOT_BEE_DRONE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/bee_drone"); + public static final UITexture OVERLAY_SLOT_BEE_QUEEN = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/bee_queen"); public static final UITexture OVERLAY_SLOT_BENDER = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/bender"); public static final UITexture OVERLAY_SLOT_BOX = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/box"); public static final UITexture OVERLAY_SLOT_BOXED = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/boxed"); public static final UITexture OVERLAY_SLOT_CANISTER = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/canister"); - public static final SteamTexture OVERLAY_SLOT_CANISTER_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/canister_%s"); + public static final SteamTexture OVERLAY_SLOT_CANISTER_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/canister_%s"); public static final UITexture OVERLAY_SLOT_CANNER = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/canner"); public static final UITexture OVERLAY_SLOT_CAULDRON = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/cauldron"); - public static final UITexture OVERLAY_SLOT_CENTRIFUGE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/centrifuge"); - public static final UITexture OVERLAY_SLOT_CENTRIFUGE_FLUID = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/centrifuge_fluid"); - public static final SteamTexture OVERLAY_SLOT_CENTRIFUGE_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/centrifuge_%s"); + public static final UITexture OVERLAY_SLOT_CENTRIFUGE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/centrifuge"); + public static final UITexture OVERLAY_SLOT_CENTRIFUGE_FLUID = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/centrifuge_fluid"); + public static final SteamTexture OVERLAY_SLOT_CENTRIFUGE_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/centrifuge_%s"); public static final UITexture OVERLAY_SLOT_CHARGER = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/charger"); - public static final UITexture OVERLAY_SLOT_CHARGER_FLUID = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/charger_fluid"); + public static final UITexture OVERLAY_SLOT_CHARGER_FLUID = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/charger_fluid"); public static final UITexture OVERLAY_SLOT_CIRCUIT = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/circuit"); - public static final SteamTexture OVERLAY_SLOT_COAL_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/coal_%s"); - public static final UITexture OVERLAY_SLOT_COMPRESSOR = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/compressor"); - public static final SteamTexture OVERLAY_SLOT_COMPRESSOR_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/compressor_%s"); - public static final UITexture OVERLAY_SLOT_CRUSHED_ORE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/crushed_ore"); - public static final SteamTexture OVERLAY_SLOT_CRUSHED_ORE_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/crushed_ore_%s"); - public static final UITexture OVERLAY_SLOT_CUTTER_SLICED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/cutter_sliced"); + public static final SteamTexture OVERLAY_SLOT_COAL_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/coal_%s"); + public static final UITexture OVERLAY_SLOT_COMPRESSOR = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/compressor"); + public static final SteamTexture OVERLAY_SLOT_COMPRESSOR_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/compressor_%s"); + public static final UITexture OVERLAY_SLOT_CRUSHED_ORE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/crushed_ore"); + public static final SteamTexture OVERLAY_SLOT_CRUSHED_ORE_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/crushed_ore_%s"); + public static final UITexture OVERLAY_SLOT_CUTTER_SLICED = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/cutter_sliced"); public static final UITexture OVERLAY_SLOT_DATA_ORB = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/data_orb"); - public static final UITexture OVERLAY_SLOT_DATA_STICK = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/data_stick"); + public static final UITexture OVERLAY_SLOT_DATA_STICK = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/data_stick"); public static final UITexture OVERLAY_SLOT_DUST = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/dust"); - public static final SteamTexture OVERLAY_SLOT_DUST_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/dust_%s"); - public static final SteamTexture OVERLAY_SLOT_BLOCK_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/block_%s"); - public static final UITexture OVERLAY_SLOT_EXPLOSIVE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/explosive"); - public static final UITexture OVERLAY_SLOT_EXTRUDER_SHAPE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/extruder_shape"); + public static final SteamTexture OVERLAY_SLOT_DUST_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/dust_%s"); + public static final SteamTexture OVERLAY_SLOT_BLOCK_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/block_%s"); + public static final UITexture OVERLAY_SLOT_EXPLOSIVE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/explosive"); + public static final UITexture OVERLAY_SLOT_EXTRUDER_SHAPE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/extruder_shape"); public static final UITexture OVERLAY_SLOT_FURNACE = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/furnace"); - public static final SteamTexture OVERLAY_SLOT_FURNACE_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/furnace_%s"); + public static final SteamTexture OVERLAY_SLOT_FURNACE_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/furnace_%s"); public static final UITexture OVERLAY_SLOT_GEM = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/gem"); public static final UITexture OVERLAY_SLOT_HAMMER = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/hammer"); - public static final SteamTexture OVERLAY_SLOT_HAMMER_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/hammer_%s"); + public static final SteamTexture OVERLAY_SLOT_HAMMER_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/hammer_%s"); public static final UITexture OVERLAY_SLOT_HEATER_1 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/heater_1"); public static final UITexture OVERLAY_SLOT_HEATER_2 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/heater_2"); - public static final UITexture OVERLAY_SLOT_IMPLOSION = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/implosion"); + public static final UITexture OVERLAY_SLOT_IMPLOSION = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/implosion"); public static final UITexture OVERLAY_SLOT_IN = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/in"); - public static final SteamTexture OVERLAY_SLOT_IN_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/in_%s"); - public static final SteamTexture OVERLAY_SLOT_INGOT_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/ingot_%s"); - public static final UITexture OVERLAY_SLOT_INT_CIRCUIT = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/int_circuit"); + public static final SteamTexture OVERLAY_SLOT_IN_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/in_%s"); + public static final SteamTexture OVERLAY_SLOT_INGOT_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/ingot_%s"); + public static final UITexture OVERLAY_SLOT_INT_CIRCUIT = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/int_circuit"); public static final UITexture OVERLAY_SLOT_LENS = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/lens"); - public static final UITexture OVERLAY_SLOT_MICROSCOPE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/microscope"); + public static final UITexture OVERLAY_SLOT_MICROSCOPE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/microscope"); public static final UITexture OVERLAY_SLOT_MOLD = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/mold"); - public static final UITexture OVERLAY_SLOT_MOLECULAR_1 = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/molecular_1"); - public static final UITexture OVERLAY_SLOT_MOLECULAR_2 = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/molecular_2"); - public static final UITexture OVERLAY_SLOT_MOLECULAR_3 = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/molecular_3"); + public static final UITexture OVERLAY_SLOT_MOLECULAR_1 = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/molecular_1"); + public static final UITexture OVERLAY_SLOT_MOLECULAR_2 = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/molecular_2"); + public static final UITexture OVERLAY_SLOT_MOLECULAR_3 = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/molecular_3"); public static final UITexture OVERLAY_SLOT_OUT = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/out"); - public static final SteamTexture OVERLAY_SLOT_OUT_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/overlay_slot/out_%s"); - public static final UITexture OVERLAY_SLOT_PAGE_BLANK = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/page_blank"); - public static final UITexture OVERLAY_SLOT_PAGE_PRINTED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/page_printed"); + public static final SteamTexture OVERLAY_SLOT_OUT_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/overlay_slot/out_%s"); + public static final UITexture OVERLAY_SLOT_PAGE_BLANK = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/page_blank"); + public static final UITexture OVERLAY_SLOT_PAGE_PRINTED = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/page_printed"); public static final UITexture OVERLAY_SLOT_PRESS_1 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/press_1"); public static final UITexture OVERLAY_SLOT_PRESS_2 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/press_2"); public static final UITexture OVERLAY_SLOT_PRESS_3 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/press_3"); public static final UITexture OVERLAY_SLOT_RECYCLE = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/recycle"); public static final UITexture OVERLAY_SLOT_ROD_1 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/rod_1"); public static final UITexture OVERLAY_SLOT_ROD_2 = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/rod_2"); - public static final UITexture OVERLAY_SLOT_SLICE_SHAPE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/slice_shape"); - public static final UITexture OVERLAY_SLOT_SLICER_SLICED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/slicer_sliced"); + public static final UITexture OVERLAY_SLOT_SLICE_SHAPE = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/slice_shape"); + public static final UITexture OVERLAY_SLOT_SLICER_SLICED = UITexture + .fullImage(GregTech.ID, "gui/overlay_slot/slicer_sliced"); public static final UITexture OVERLAY_SLOT_SQUARE = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/square"); public static final UITexture OVERLAY_SLOT_UUA = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/uua"); public static final UITexture OVERLAY_SLOT_UUM = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/uum"); @@ -197,82 +135,60 @@ public class GT_UITextures { public static final UITexture OVERLAY_SLOT_WIREMILL = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/wiremill"); public static final UITexture OVERLAY_SLOT_WRENCH = UITexture.fullImage(GregTech.ID, "gui/overlay_slot/wrench"); public static final UITexture[] OVERLAY_SLOTS_NUMBER = IntStream.range(0, 12) - .mapToObj( - i -> UITexture.fullImage( - GregTech.ID, - "gui/overlay_slot/number_" + i)) - .collect(Collectors.toList()) - .toArray(new UITexture[0]); + .mapToObj(i -> UITexture.fullImage(GregTech.ID, "gui/overlay_slot/number_" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); public static final UITexture PROGRESSBAR_ARROW = UITexture.fullImage(GregTech.ID, "gui/progressbar/arrow"); - public static final SteamTexture PROGRESSBAR_ARROW_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/arrow_%s"); - public static final SteamTexture PROGRESSBAR_ARROW_2_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/arrow_2_%s"); - public static final UITexture PROGRESSBAR_ARROW_MULTIPLE = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/arrow_multiple"); + public static final SteamTexture PROGRESSBAR_ARROW_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/arrow_%s"); + public static final SteamTexture PROGRESSBAR_ARROW_2_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/arrow_2_%s"); + public static final UITexture PROGRESSBAR_ARROW_MULTIPLE = UITexture + .fullImage(GregTech.ID, "gui/progressbar/arrow_multiple"); public static final UITexture PROGRESSBAR_ASSEMBLE = UITexture.fullImage(GregTech.ID, "gui/progressbar/assemble"); - public static final UITexture PROGRESSBAR_ASSEMBLY_LINE_1 = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/assemblyline_1"); - public static final UITexture PROGRESSBAR_ASSEMBLY_LINE_2 = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/assemblyline_2"); - public static final UITexture PROGRESSBAR_ASSEMBLY_LINE_3 = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/assemblyline_3"); + public static final UITexture PROGRESSBAR_ASSEMBLY_LINE_1 = UITexture + .fullImage(GregTech.ID, "gui/progressbar/assemblyline_1"); + public static final UITexture PROGRESSBAR_ASSEMBLY_LINE_2 = UITexture + .fullImage(GregTech.ID, "gui/progressbar/assemblyline_2"); + public static final UITexture PROGRESSBAR_ASSEMBLY_LINE_3 = UITexture + .fullImage(GregTech.ID, "gui/progressbar/assemblyline_3"); public static final UITexture PROGRESSBAR_BATH = UITexture.fullImage(GregTech.ID, "gui/progressbar/bath"); public static final UITexture PROGRESSBAR_BENDING = UITexture.fullImage(GregTech.ID, "gui/progressbar/bending"); - public static final SteamTexture PROGRESSBAR_BOILER_EMPTY_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/boiler_empty_%s"); - public static final UITexture PROGRESSBAR_BOILER_HEAT = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/boiler_heat"); - public static final UITexture PROGRESSBAR_BOILER_STEAM = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/boiler_steam"); - public static final UITexture PROGRESSBAR_BOILER_WATER = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/boiler_water"); + public static final SteamTexture PROGRESSBAR_BOILER_EMPTY_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/boiler_empty_%s"); + public static final UITexture PROGRESSBAR_BOILER_HEAT = UITexture + .fullImage(GregTech.ID, "gui/progressbar/boiler_heat"); + public static final UITexture PROGRESSBAR_BOILER_STEAM = UITexture + .fullImage(GregTech.ID, "gui/progressbar/boiler_steam"); + public static final UITexture PROGRESSBAR_BOILER_WATER = UITexture + .fullImage(GregTech.ID, "gui/progressbar/boiler_water"); public static final UITexture PROGRESSBAR_CANNER = UITexture.fullImage(GregTech.ID, "gui/progressbar/canner"); - public static final UITexture PROGRESSBAR_CIRCUIT_ASSEMBLER = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/circuit_assembler"); + public static final UITexture PROGRESSBAR_CIRCUIT_ASSEMBLER = UITexture + .fullImage(GregTech.ID, "gui/progressbar/circuit_assembler"); public static final UITexture PROGRESSBAR_COMPRESS = UITexture.fullImage(GregTech.ID, "gui/progressbar/compress"); - public static final SteamTexture PROGRESSBAR_COMPRESS_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/compress_%s"); + public static final SteamTexture PROGRESSBAR_COMPRESS_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/compress_%s"); public static final UITexture PROGRESSBAR_CUT = UITexture.fullImage(GregTech.ID, "gui/progressbar/cut"); public static final UITexture PROGRESSBAR_EXTRACT = UITexture.fullImage(GregTech.ID, "gui/progressbar/extract"); - public static final SteamTexture PROGRESSBAR_EXTRACT_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/extract_%s"); + public static final SteamTexture PROGRESSBAR_EXTRACT_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/extract_%s"); public static final UITexture PROGRESSBAR_EXTRUDE = UITexture.fullImage(GregTech.ID, "gui/progressbar/extrude"); - public static final SteamTexture PROGRESSBAR_FUEL_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/fuel_%s"); + public static final SteamTexture PROGRESSBAR_FUEL_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/fuel_%s"); public static final UITexture PROGRESSBAR_HAMMER = UITexture.fullImage(GregTech.ID, "gui/progressbar/hammer"); - public static final UITexture PROGRESSBAR_HAMMER_BASE = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/hammer_base"); - public static final SteamTexture PROGRESSBAR_HAMMER_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/hammer_%s"); - public static final SteamTexture PROGRESSBAR_HAMMER_BASE_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/hammer_base_%s"); + public static final UITexture PROGRESSBAR_HAMMER_BASE = UITexture + .fullImage(GregTech.ID, "gui/progressbar/hammer_base"); + public static final SteamTexture PROGRESSBAR_HAMMER_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/hammer_%s"); + public static final SteamTexture PROGRESSBAR_HAMMER_BASE_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/hammer_base_%s"); public static final UITexture PROGRESSBAR_LATHE = UITexture.fullImage(GregTech.ID, "gui/progressbar/lathe"); - public static final UITexture PROGRESSBAR_LATHE_BASE = UITexture.fullImage( - GregTech.ID, - "gui/progressbar/lathe_base"); + public static final UITexture PROGRESSBAR_LATHE_BASE = UITexture + .fullImage(GregTech.ID, "gui/progressbar/lathe_base"); public static final UITexture PROGRESSBAR_MACERATE = UITexture.fullImage(GregTech.ID, "gui/progressbar/macerate"); - public static final SteamTexture PROGRESSBAR_MACERATE_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/progressbar/macerate_%s"); + public static final SteamTexture PROGRESSBAR_MACERATE_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/progressbar/macerate_%s"); public static final UITexture PROGRESSBAR_MAGNET = UITexture.fullImage(GregTech.ID, "gui/progressbar/magnet"); public static final UITexture PROGRESSBAR_MIXER = UITexture.fullImage(GregTech.ID, "gui/progressbar/mixer"); public static final UITexture PROGRESSBAR_RECYCLE = UITexture.fullImage(GregTech.ID, "gui/progressbar/recycle"); @@ -284,347 +200,242 @@ public class GT_UITextures { public static final UITexture TAB_COVER_NORMAL = UITexture.fullImage(GregTech.ID, "gui/tab/cover_normal"); public static final UITexture TAB_COVER_HIGHLIGHT = UITexture.fullImage(GregTech.ID, "gui/tab/cover_highlight"); public static final UITexture TAB_COVER_DISABLED = UITexture.fullImage(GregTech.ID, "gui/tab/cover_disabled"); - public static final SteamTexture TAB_COVER_STEAM_NORMAL = SteamTexture.fullImage( - GregTech.ID, - "gui/tab/cover_%s_normal"); - public static final SteamTexture TAB_COVER_STEAM_HIGHLIGHT = SteamTexture.fullImage( - GregTech.ID, - "gui/tab/cover_%s_highlight"); - public static final SteamTexture TAB_COVER_STEAM_DISABLED = SteamTexture.fullImage( - GregTech.ID, - "gui/tab/cover_%s_disabled"); + public static final SteamTexture TAB_COVER_STEAM_NORMAL = SteamTexture + .fullImage(GregTech.ID, "gui/tab/cover_%s_normal"); + public static final SteamTexture TAB_COVER_STEAM_HIGHLIGHT = SteamTexture + .fullImage(GregTech.ID, "gui/tab/cover_%s_highlight"); + public static final SteamTexture TAB_COVER_STEAM_DISABLED = SteamTexture + .fullImage(GregTech.ID, "gui/tab/cover_%s_disabled"); public static final AdaptableUITexture TAB_TITLE = AdaptableUITexture.of(GregTech.ID, "gui/tab/title", 28, 28, 4); - public static final AdaptableUITexture TAB_TITLE_DARK = AdaptableUITexture.of( - GregTech.ID, - "gui/tab/title_dark", - 28, - 28, - 4); - public static final SteamTexture TAB_TITLE_STEAM = SteamTexture.adaptableTexture( - GregTech.ID, - "gui/tab/title_%s", - 28, - 28, - 4); - public static final SteamTexture TAB_TITLE_DARK_STEAM = SteamTexture.adaptableTexture( - GregTech.ID, - "gui/tab/title_dark_%s", - 28, - 28, - 4); - public static final AdaptableUITexture TAB_TITLE_ANGULAR = AdaptableUITexture.of( - GregTech.ID, - "gui/tab/title_angular", - 28, - 28, - 4); - public static final SteamTexture TAB_TITLE_ANGULAR_STEAM = SteamTexture.adaptableTexture( - GregTech.ID, - "gui/tab/title_angular_%s", - 28, - 28, - 4); + public static final AdaptableUITexture TAB_TITLE_DARK = AdaptableUITexture + .of(GregTech.ID, "gui/tab/title_dark", 28, 28, 4); + public static final SteamTexture TAB_TITLE_STEAM = SteamTexture + .adaptableTexture(GregTech.ID, "gui/tab/title_%s", 28, 28, 4); + public static final SteamTexture TAB_TITLE_DARK_STEAM = SteamTexture + .adaptableTexture(GregTech.ID, "gui/tab/title_dark_%s", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_ANGULAR = AdaptableUITexture + .of(GregTech.ID, "gui/tab/title_angular", 28, 28, 4); + public static final SteamTexture TAB_TITLE_ANGULAR_STEAM = SteamTexture + .adaptableTexture(GregTech.ID, "gui/tab/title_angular_%s", 28, 28, 4); - public static final UITexture BUTTON_STANDARD = AdaptableUITexture.of( - GregTech.ID, - "gui/button/standard", - 18, - 18, - 1); - public static final UITexture BUTTON_STANDARD_DISABLED = AdaptableUITexture.of( - GregTech.ID, - "gui/button/standard_disabled", - 18, - 18, - 1); - public static final UITexture BUTTON_STANDARD_TOGGLE = AdaptableUITexture.of( - GregTech.ID, - "gui/button/standard_toggle", - 18, - 18, - 1); - public static final UITexture BUTTON_STANDARD_TOGGLE_DISABLED = AdaptableUITexture.of( - GregTech.ID, - "gui/button/standard_toggle_disabled", - 18, - 18, - 1); + public static final UITexture BUTTON_STANDARD = AdaptableUITexture + .of(GregTech.ID, "gui/button/standard", 18, 18, 1); + public static final UITexture BUTTON_STANDARD_DISABLED = AdaptableUITexture + .of(GregTech.ID, "gui/button/standard_disabled", 18, 18, 1); + public static final UITexture BUTTON_STANDARD_TOGGLE = AdaptableUITexture + .of(GregTech.ID, "gui/button/standard_toggle", 18, 18, 1); + public static final UITexture BUTTON_STANDARD_TOGGLE_DISABLED = AdaptableUITexture + .of(GregTech.ID, "gui/button/standard_toggle_disabled", 18, 18, 1); public static final UITexture BUTTON_COVER_NORMAL = UITexture.fullImage(GregTech.ID, "gui/button/cover_normal"); - public static final UITexture BUTTON_COVER_NORMAL_HOVERED = UITexture.fullImage( - GregTech.ID, - "gui/button/cover_normal_hovered"); - public static final UITexture BUTTON_COVER_NORMAL_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/button/cover_normal_disabled"); + public static final UITexture BUTTON_COVER_NORMAL_HOVERED = UITexture + .fullImage(GregTech.ID, "gui/button/cover_normal_hovered"); + public static final UITexture BUTTON_COVER_NORMAL_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/button/cover_normal_disabled"); - public static final UITexture OVERLAY_BUTTON_DISABLE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/disable"); - public static final UITexture OVERLAY_BUTTON_REDSTONE_OFF = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/redstone_off"); - public static final UITexture OVERLAY_BUTTON_REDSTONE_ON = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/redstone_on"); - public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_ON = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/power_switch_on"); - public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/power_switch_off"); - public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_ON = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/void_excess_on"); - public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/void_excess_on_disabled"); - public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_OFF = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/void_excess_off"); - public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/void_excess_off_disabled"); - public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_ON = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/input_separation_on"); - public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/input_separation_on_disabled"); - public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_OFF = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/input_separation_off"); - public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/input_separation_off_disabled"); - public static final UITexture OVERLAY_BUTTON_RECIPE_LOCKED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/recipe_locked"); - public static final UITexture OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/recipe_locked_disabled"); - public static final UITexture OVERLAY_BUTTON_RECIPE_UNLOCKED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/recipe_unlocked"); - public static final UITexture OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/recipe_unlocked_disabled"); - public static final UITexture OVERLAY_BUTTON_BATCH_MODE_ON = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/batch_mode_on"); - public static final UITexture OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/batch_mode_on_disabled"); - public static final UITexture OVERLAY_BUTTON_BATCH_MODE_OFF = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/batch_mode_off"); - public static final UITexture OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/batch_mode_off_disabled"); - public static final UITexture OVERLAY_BUTTON_DOWN_TIERING_ON = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/down_tiering_on"); - public static final UITexture OVERLAY_BUTTON_DOWN_TIERING_OFF = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/down_tiering_off"); - public static final UITexture OVERLAY_BUTTON_CHECKMARK = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/checkmark"); + public static final UITexture OVERLAY_BUTTON_DISABLE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/disable"); + public static final UITexture OVERLAY_BUTTON_REDSTONE_OFF = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/redstone_off"); + public static final UITexture OVERLAY_BUTTON_REDSTONE_ON = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/redstone_on"); + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_ON = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/power_switch_on"); + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/power_switch_off"); + public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_ON = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/void_excess_on"); + public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/void_excess_on_disabled"); + public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_OFF = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/void_excess_off"); + public static final UITexture OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/void_excess_off_disabled"); + public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_ON = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/input_separation_on"); + public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/input_separation_on_disabled"); + public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_OFF = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/input_separation_off"); + public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/input_separation_off_disabled"); + public static final UITexture OVERLAY_BUTTON_RECIPE_LOCKED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/recipe_locked"); + public static final UITexture OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/recipe_locked_disabled"); + public static final UITexture OVERLAY_BUTTON_RECIPE_UNLOCKED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/recipe_unlocked"); + public static final UITexture OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/recipe_unlocked_disabled"); + public static final UITexture OVERLAY_BUTTON_BATCH_MODE_ON = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/batch_mode_on"); + public static final UITexture OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/batch_mode_on_disabled"); + public static final UITexture OVERLAY_BUTTON_BATCH_MODE_OFF = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/batch_mode_off"); + public static final UITexture OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/batch_mode_off_disabled"); + public static final UITexture OVERLAY_BUTTON_DOWN_TIERING_ON = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/down_tiering_on"); + public static final UITexture OVERLAY_BUTTON_DOWN_TIERING_OFF = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/down_tiering_off"); + public static final UITexture OVERLAY_BUTTON_CHECKMARK = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/checkmark"); public static final UITexture OVERLAY_BUTTON_CROSS = UITexture.fullImage(GregTech.ID, "gui/overlay_button/cross"); - public static final UITexture OVERLAY_BUTTON_WHITELIST = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/whitelist"); - public static final UITexture OVERLAY_BUTTON_BLACKLIST = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/blacklist"); - public static final UITexture OVERLAY_BUTTON_PROGRESS = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/progress"); + public static final UITexture OVERLAY_BUTTON_WHITELIST = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/whitelist"); + public static final UITexture OVERLAY_BUTTON_BLACKLIST = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/blacklist"); + public static final UITexture OVERLAY_BUTTON_PROGRESS = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/progress"); public static final UITexture OVERLAY_BUTTON_EXPORT = UITexture.fullImage(GregTech.ID, "gui/overlay_button/export"); public static final UITexture OVERLAY_BUTTON_IMPORT = UITexture.fullImage(GregTech.ID, "gui/overlay_button/import"); - public static final UITexture OVERLAY_BUTTON_AUTOOUTPUT_ITEM = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/autooutput_item"); - public static final UITexture OVERLAY_BUTTON_AUTOOUTPUT_FLUID = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/autooutput_fluid"); - public static final UITexture OVERLAY_BUTTON_ALLOW_INPUT = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/allow_input"); - public static final UITexture OVERLAY_BUTTON_AUTOPULL_ME = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/auto_pull_me"); - public static final UITexture OVERLAY_BUTTON_AUTOPULL_ME_DISABLED = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/auto_pull_me_disabled"); - public static final UITexture OVERLAY_BUTTON_BLOCK_INPUT = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/block_input"); - public static final UITexture OVERLAY_BUTTON_ARROW_GREEN_UP = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/arrow_green_up"); - public static final UITexture OVERLAY_BUTTON_ARROW_GREEN_DOWN = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/arrow_green_down"); + public static final UITexture OVERLAY_BUTTON_AUTOOUTPUT_ITEM = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/autooutput_item"); + public static final UITexture OVERLAY_BUTTON_AUTOOUTPUT_FLUID = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/autooutput_fluid"); + public static final UITexture OVERLAY_BUTTON_ALLOW_INPUT = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/allow_input"); + public static final UITexture OVERLAY_BUTTON_AUTOPULL_ME = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/auto_pull_me"); + public static final UITexture OVERLAY_BUTTON_AUTOPULL_ME_DISABLED = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/auto_pull_me_disabled"); + public static final UITexture OVERLAY_BUTTON_BLOCK_INPUT = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/block_input"); + public static final UITexture OVERLAY_BUTTON_ARROW_GREEN_UP = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/arrow_green_up"); + public static final UITexture OVERLAY_BUTTON_ARROW_GREEN_DOWN = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/arrow_green_down"); public static final UITexture OVERLAY_BUTTON_CYCLIC = UITexture.fullImage(GregTech.ID, "gui/overlay_button/cyclic"); - public static final UITexture OVERLAY_BUTTON_EMIT_ENERGY = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/emit_energy"); - public static final UITexture OVERLAY_BUTTON_EMIT_REDSTONE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/emit_redstone"); - public static final UITexture OVERLAY_BUTTON_INVERT_REDSTONE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/invert_redstone"); - public static final UITexture OVERLAY_BUTTON_STOCKING_MODE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/stocking_mode"); - public static final UITexture OVERLAY_BUTTON_INVERT_FILTER = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/invert_filter"); + public static final UITexture OVERLAY_BUTTON_EMIT_ENERGY = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/emit_energy"); + public static final UITexture OVERLAY_BUTTON_EMIT_REDSTONE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/emit_redstone"); + public static final UITexture OVERLAY_BUTTON_INVERT_REDSTONE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/invert_redstone"); + public static final UITexture OVERLAY_BUTTON_STOCKING_MODE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/stocking_mode"); + public static final UITexture OVERLAY_BUTTON_INVERT_FILTER = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/invert_filter"); public static final UITexture OVERLAY_BUTTON_NBT = UITexture.fullImage(GregTech.ID, "gui/overlay_button/nbt"); public static final UITexture OVERLAY_BUTTON_PRINT = UITexture.fullImage(GregTech.ID, "gui/overlay_button/print"); - public static final UITexture OVERLAY_BUTTON_TRANSPOSE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/transpose"); - public static final UITexture OVERLAY_BUTTON_BOUNDING_BOX = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/bounding_box"); - public static final UITexture OVERLAY_BUTTON_MINUS_SMALL = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/minus_small"); - public static final UITexture OVERLAY_BUTTON_MINUS_LARGE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/minus_large"); - public static final UITexture OVERLAY_BUTTON_PLUS_SMALL = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/plus_small"); - public static final UITexture OVERLAY_BUTTON_PLUS_LARGE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/plus_large"); - public static final UITexture OVERLAY_BUTTON_GATE_AND = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/gate_and"); - public static final UITexture OVERLAY_BUTTON_GATE_NAND = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/gate_nand"); - public static final UITexture OVERLAY_BUTTON_GATE_OR = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/gate_or"); - public static final UITexture OVERLAY_BUTTON_GATE_NOR = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/gate_nor"); + public static final UITexture OVERLAY_BUTTON_TRANSPOSE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/transpose"); + public static final UITexture OVERLAY_BUTTON_BOUNDING_BOX = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/bounding_box"); + public static final UITexture OVERLAY_BUTTON_MINUS_SMALL = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/minus_small"); + public static final UITexture OVERLAY_BUTTON_MINUS_LARGE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/minus_large"); + public static final UITexture OVERLAY_BUTTON_PLUS_SMALL = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/plus_small"); + public static final UITexture OVERLAY_BUTTON_PLUS_LARGE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/plus_large"); + public static final UITexture OVERLAY_BUTTON_GATE_AND = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/gate_and"); + public static final UITexture OVERLAY_BUTTON_GATE_NAND = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/gate_nand"); + public static final UITexture OVERLAY_BUTTON_GATE_OR = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/gate_or"); + public static final UITexture OVERLAY_BUTTON_GATE_NOR = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/gate_nor"); public static final UITexture OVERLAY_BUTTON_ANALOG = UITexture.fullImage(GregTech.ID, "gui/overlay_button/analog"); public static final UITexture OVERLAY_BUTTON_LOCK = UITexture.fullImage(GregTech.ID, "gui/overlay_button/lock"); - public static final UITexture OVERLAY_BUTTON_INPUT_FROM_OUTPUT_SIDE = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/input_from_output_side"); - public static final UITexture OVERLAY_BUTTON_VOID_EXCESS = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/void_excess"); - public static final UITexture OVERLAY_BUTTON_VOID_ALL = UITexture.fullImage( - GregTech.ID, - "gui/overlay_button/void_all"); + public static final UITexture OVERLAY_BUTTON_INPUT_FROM_OUTPUT_SIDE = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/input_from_output_side"); + public static final UITexture OVERLAY_BUTTON_VOID_EXCESS = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/void_excess"); + public static final UITexture OVERLAY_BUTTON_VOID_ALL = UITexture + .fullImage(GregTech.ID, "gui/overlay_button/void_all"); public static final UITexture OVERLAY_BUTTON_NEI = UITexture.fullImage(GregTech.ID, "gui/overlay_button/nei"); /** * Can adjust size as needed. */ - public static final AdaptableUITexture PICTURE_SCREEN_BLACK = AdaptableUITexture.of( - GregTech.ID, - "gui/picture/screen_black", - 16, - 16, - 2); + public static final AdaptableUITexture PICTURE_SCREEN_BLACK = AdaptableUITexture + .of(GregTech.ID, "gui/picture/screen_black", 16, 16, 2); - public static final UITexture PICTURE_RADIATION_WARNING = UITexture.fullImage( - GregTech.ID, - "gui/picture/radiation_warning"); - public static final UITexture PICTURE_GT_LOGO_17x17_TRANSPARENT = UITexture.fullImage( - GregTech.ID, - "gui/picture/gt_logo_17x17_transparent"); - public static final UITexture PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY = UITexture.fullImage( - GregTech.ID, - "gui/picture/gt_logo_17x17_transparent_gray"); - public static final SteamTexture PICTURE_GT_LOGO_17x17_TRANSPARENT_STEAM = SteamTexture.fullImage( - GregTech.ID, - "gui/picture/gt_logo_17x17_transparent_%s"); + public static final UITexture PICTURE_RADIATION_WARNING = UITexture + .fullImage(GregTech.ID, "gui/picture/radiation_warning"); + public static final UITexture PICTURE_GT_LOGO_17x17_TRANSPARENT = UITexture + .fullImage(GregTech.ID, "gui/picture/gt_logo_17x17_transparent"); + public static final UITexture PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY = UITexture + .fullImage(GregTech.ID, "gui/picture/gt_logo_17x17_transparent_gray"); + public static final SteamTexture PICTURE_GT_LOGO_17x17_TRANSPARENT_STEAM = SteamTexture + .fullImage(GregTech.ID, "gui/picture/gt_logo_17x17_transparent_%s"); public static final UITexture PICTURE_GT_LOGO_18x18 = UITexture.fullImage(GregTech.ID, "gui/picture/gt_logo_18x18"); public static final UITexture PICTURE_GT_LOGO_19x19 = UITexture.fullImage(GregTech.ID, "gui/picture/gt_logo_19x19"); public static final UITexture PICTURE_INFORMATION = UITexture.fullImage(GregTech.ID, "gui/picture/information"); - public static final UITexture PICTURE_STALLED_ELECTRICITY = UITexture.fullImage( - GregTech.ID, - "gui/picture/stalled_electricity"); + public static final UITexture PICTURE_STALLED_ELECTRICITY = UITexture + .fullImage(GregTech.ID, "gui/picture/stalled_electricity"); public static final UITexture PICTURE_STALLED_STEAM = UITexture.fullImage(GregTech.ID, "gui/picture/stalled_steam"); - public static final BiFunction PICTURE_ARROW_22_RED = (width, - fromRight) -> UITexture.partly( - GregTech.ID, - "gui/picture/arrow_22_red", - 87, - 22, - fromRight ? 87 - width : 0, - 0, - fromRight ? 87 : width, - 22); - public static final BiFunction PICTURE_ARROW_22_BLUE = (width, - fromRight) -> UITexture.partly( - GregTech.ID, - "gui/picture/arrow_22_blue", - 87, - 22, - fromRight ? 87 - width : 0, - 0, - fromRight ? 87 : width, - 22); - public static final BiFunction PICTURE_ARROW_22_WHITE = (width, - fromRight) -> UITexture.partly( - GregTech.ID, - "gui/picture/arrow_22_white", - 87, - 22, - fromRight ? 87 - width : 0, - 0, - fromRight ? 87 : width, - 22); - public static final BiFunction PICTURE_ARROW_24_RED = (width, - fromRight) -> UITexture.partly( - GregTech.ID, - "gui/picture/arrow_24_red", - 69, - 24, - fromRight ? 69 - width : 0, - 0, - fromRight ? 69 : width, - 24); - public static final BiFunction PICTURE_ARROW_24_BLUE = (width, - fromRight) -> UITexture.partly( - GregTech.ID, - "gui/picture/arrow_24_blue", - 69, - 24, - fromRight ? 69 - width : 0, - 0, - fromRight ? 69 : width, - 24); - public static final BiFunction PICTURE_ARROW_24_WHITE = (width, - fromRight) -> UITexture.partly( - GregTech.ID, - "gui/picture/arrow_24_white", - 69, - 24, - fromRight ? 69 - width : 0, - 0, - fromRight ? 69 : width, - 24); + public static final BiFunction PICTURE_ARROW_22_RED = (width, fromRight) -> UITexture + .partly( + GregTech.ID, + "gui/picture/arrow_22_red", + 87, + 22, + fromRight ? 87 - width : 0, + 0, + fromRight ? 87 : width, + 22); + public static final BiFunction PICTURE_ARROW_22_BLUE = (width, fromRight) -> UITexture + .partly( + GregTech.ID, + "gui/picture/arrow_22_blue", + 87, + 22, + fromRight ? 87 - width : 0, + 0, + fromRight ? 87 : width, + 22); + public static final BiFunction PICTURE_ARROW_22_WHITE = (width, fromRight) -> UITexture + .partly( + GregTech.ID, + "gui/picture/arrow_22_white", + 87, + 22, + fromRight ? 87 - width : 0, + 0, + fromRight ? 87 : width, + 22); + public static final BiFunction PICTURE_ARROW_24_RED = (width, fromRight) -> UITexture + .partly( + GregTech.ID, + "gui/picture/arrow_24_red", + 69, + 24, + fromRight ? 69 - width : 0, + 0, + fromRight ? 69 : width, + 24); + public static final BiFunction PICTURE_ARROW_24_BLUE = (width, fromRight) -> UITexture + .partly( + GregTech.ID, + "gui/picture/arrow_24_blue", + 69, + 24, + fromRight ? 69 - width : 0, + 0, + fromRight ? 69 : width, + 24); + public static final BiFunction PICTURE_ARROW_24_WHITE = (width, fromRight) -> UITexture + .partly( + GregTech.ID, + "gui/picture/arrow_24_white", + 69, + 24, + fromRight ? 69 - width : 0, + 0, + fromRight ? 69 : width, + 24); public static final UITexture PICTURE_FLUID_WINDOW = UITexture.fullImage(GregTech.ID, "gui/picture/fluid_window"); public static final UITexture PICTURE_FLUID_TANK = UITexture.fullImage(GregTech.ID, "gui/picture/fluid_tank"); - public static final UITexture PICTURE_SLOTS_HOLO_3BY3 = UITexture.fullImage( - GregTech.ID, - "gui/picture/slots_holo_3by3"); + public static final UITexture PICTURE_SLOTS_HOLO_3BY3 = UITexture + .fullImage(GregTech.ID, "gui/picture/slots_holo_3by3"); public static final UITexture PICTURE_ARROW_DOUBLE = UITexture.fullImage(GregTech.ID, "gui/picture/arrow_double"); public static final UITexture PICTURE_SUPER_BUFFER = UITexture.fullImage(GregTech.ID, "gui/picture/super_buffer"); - public static final UITexture PICTURE_SQUARE_LIGHT_GRAY = UITexture.fullImage( - GregTech.ID, - "gui/picture/square_light_gray"); + public static final UITexture PICTURE_SQUARE_LIGHT_GRAY = UITexture + .fullImage(GregTech.ID, "gui/picture/square_light_gray"); public static final UITexture PICTURE_GAUGE = UITexture.fullImage(GregTech.ID, "gui/picture/gauge"); public static final UITexture PICTURE_ITEM_IN = UITexture.fullImage(GregTech.ID, "gui/picture/item_in"); public static final UITexture PICTURE_ITEM_OUT = UITexture.fullImage(GregTech.ID, "gui/picture/item_out"); diff --git a/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java b/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java index 2799738344..09f31d9c69 100644 --- a/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java +++ b/src/main/java/gregtech/api/gui/modularui/GUITextureSet.java @@ -28,46 +28,30 @@ public class GUITextureSet { private AdaptableUITexture titleTabAngular; private UITexture gregtechLogo; - public static final GUITextureSet DEFAULT = new GUITextureSet().setMainBackground( - GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) - .setItemSlot(ModularUITextures.ITEM_SLOT) - .setFluidSlot(ModularUITextures.FLUID_SLOT) - .setCoverTab( - GT_UITextures.TAB_COVER_NORMAL, - GT_UITextures.TAB_COVER_HIGHLIGHT, - GT_UITextures.TAB_COVER_DISABLED) - .setTitleTab( - GT_UITextures.TAB_TITLE, - GT_UITextures.TAB_TITLE_DARK, - GT_UITextures.TAB_TITLE_ANGULAR) - .setGregTechLogo( - GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); - - public static final Function STEAM = steamVariant -> new GUITextureSet().setMainBackground( - GT_UITextures.BACKGROUND_STEAM.get(steamVariant)) - .setItemSlot( - GT_UITextures.SLOT_ITEM_STEAM.get( - steamVariant)) - .setFluidSlot( - GT_UITextures.SLOT_FLUID_STEAM.get( - steamVariant)) - .setCoverTab( - GT_UITextures.TAB_COVER_STEAM_NORMAL.get( - steamVariant), - GT_UITextures.TAB_COVER_STEAM_HIGHLIGHT.get( - steamVariant), - GT_UITextures.TAB_COVER_STEAM_DISABLED.get( - steamVariant)) - .setTitleTab( - GT_UITextures.TAB_TITLE_STEAM.getAdaptable( - steamVariant), - GT_UITextures.TAB_TITLE_DARK_STEAM.getAdaptable( - steamVariant), - GT_UITextures.TAB_TITLE_ANGULAR_STEAM.getAdaptable( - steamVariant)) - .setGregTechLogo( - GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_STEAM.get( - steamVariant)); + public static final GUITextureSet DEFAULT = new GUITextureSet() + .setMainBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT) + .setItemSlot(ModularUITextures.ITEM_SLOT) + .setFluidSlot(ModularUITextures.FLUID_SLOT) + .setCoverTab( + GT_UITextures.TAB_COVER_NORMAL, + GT_UITextures.TAB_COVER_HIGHLIGHT, + GT_UITextures.TAB_COVER_DISABLED) + .setTitleTab(GT_UITextures.TAB_TITLE, GT_UITextures.TAB_TITLE_DARK, GT_UITextures.TAB_TITLE_ANGULAR) + .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT); + + public static final Function STEAM = steamVariant -> new GUITextureSet() + .setMainBackground(GT_UITextures.BACKGROUND_STEAM.get(steamVariant)) + .setItemSlot(GT_UITextures.SLOT_ITEM_STEAM.get(steamVariant)) + .setFluidSlot(GT_UITextures.SLOT_FLUID_STEAM.get(steamVariant)) + .setCoverTab( + GT_UITextures.TAB_COVER_STEAM_NORMAL.get(steamVariant), + GT_UITextures.TAB_COVER_STEAM_HIGHLIGHT.get(steamVariant), + GT_UITextures.TAB_COVER_STEAM_DISABLED.get(steamVariant)) + .setTitleTab( + GT_UITextures.TAB_TITLE_STEAM.getAdaptable(steamVariant), + GT_UITextures.TAB_TITLE_DARK_STEAM.getAdaptable(steamVariant), + GT_UITextures.TAB_TITLE_ANGULAR_STEAM.getAdaptable(steamVariant)) + .setGregTechLogo(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_STEAM.get(steamVariant)); public GUITextureSet() {} @@ -99,7 +83,7 @@ public class GUITextureSet { } public GUITextureSet setTitleTab(AdaptableUITexture titleNormal, AdaptableUITexture titleDark, - AdaptableUITexture titleTabAngular) { + AdaptableUITexture titleTabAngular) { this.titleTabNormal = titleNormal; this.titleTabDark = titleDark; this.titleTabAngular = titleTabAngular; diff --git a/src/main/java/gregtech/api/gui/modularui/SteamTexture.java b/src/main/java/gregtech/api/gui/modularui/SteamTexture.java index 7cebd957f2..1d713bc9b8 100644 --- a/src/main/java/gregtech/api/gui/modularui/SteamTexture.java +++ b/src/main/java/gregtech/api/gui/modularui/SteamTexture.java @@ -21,32 +21,20 @@ public class SteamTexture { public static SteamTexture fullImage(String mod, String location) { return new SteamTexture( - UITexture.fullImage(mod, String.format(location, SteamVariant.BRONZE)), - UITexture.fullImage(mod, String.format(location, SteamVariant.STEEL)), - UITexture.fullImage(mod, String.format(location, SteamVariant.PRIMITIVE))); + UITexture.fullImage(mod, String.format(location, SteamVariant.BRONZE)), + UITexture.fullImage(mod, String.format(location, SteamVariant.STEEL)), + UITexture.fullImage(mod, String.format(location, SteamVariant.PRIMITIVE))); } public static SteamTexture adaptableTexture(String mod, String location, int imageWidth, int imageHeight, - int borderWidthPixel) { + int borderWidthPixel) { return new SteamTexture( - AdaptableUITexture.of( - mod, - String.format(location, SteamVariant.BRONZE), - imageWidth, - imageHeight, - borderWidthPixel), - AdaptableUITexture.of( - mod, - String.format(location, SteamVariant.STEEL), - imageWidth, - imageHeight, - borderWidthPixel), - AdaptableUITexture.of( - mod, - String.format(location, SteamVariant.PRIMITIVE), - imageWidth, - imageHeight, - borderWidthPixel)); + AdaptableUITexture + .of(mod, String.format(location, SteamVariant.BRONZE), imageWidth, imageHeight, borderWidthPixel), + AdaptableUITexture + .of(mod, String.format(location, SteamVariant.STEEL), imageWidth, imageHeight, borderWidthPixel), + AdaptableUITexture + .of(mod, String.format(location, SteamVariant.PRIMITIVE), imageWidth, imageHeight, borderWidthPixel)); } public UITexture get(SteamVariant variant) { diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java index 5cbee74335..9694316bee 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java @@ -26,8 +26,8 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { // Names of the block a cover could be on private static final String[] SIDES = new String[] { "GT5U.interface.coverTabs.down", "GT5U.interface.coverTabs.up", - "GT5U.interface.coverTabs.north", "GT5U.interface.coverTabs.south", "GT5U.interface.coverTabs.west", - "GT5U.interface.coverTabs.east" }; + "GT5U.interface.coverTabs.north", "GT5U.interface.coverTabs.south", "GT5U.interface.coverTabs.west", + "GT5U.interface.coverTabs.east" }; // Not sure there's a point in JIT translation but that's what this is private String[] translatedSides; @@ -53,8 +53,8 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { * @param colorization The colorization of the GUI we are adding tabs to */ public GT_GuiCoverTabLine(GT_GUIContainerMetaTile_Machine gui, int tabLineLeft, int tabLineTop, int tabHeight, - int tabWidth, int tabSpacing, DisplayStyle xDir, DisplayStyle yDir, DisplayStyle displayMode, - GT_GuiTabIconSet tabBackground, IGregTechTileEntity tile, int colorization) { + int tabWidth, int tabSpacing, DisplayStyle xDir, DisplayStyle yDir, DisplayStyle displayMode, + GT_GuiTabIconSet tabBackground, IGregTechTileEntity tile, int colorization) { super(gui, 6, tabLineLeft, tabLineTop, tabHeight, tabWidth, tabSpacing, xDir, yDir, displayMode, tabBackground); this.tile = tile; this.colorization = colorization; @@ -78,9 +78,9 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { protected void drawBackground(float parTicks, int mouseX, int mouseY) { // Apply this tile's coloration to draw the background GL11.glColor3ub( - (byte) ((colorization >> 16) & 0xFF), - (byte) ((colorization >> 8) & 0xFF), - (byte) (colorization & 0xFF)); + (byte) ((colorization >> 16) & 0xFF), + (byte) ((colorization >> 8) & 0xFF), + (byte) (colorization & 0xFF)); super.drawBackground(parTicks, mouseX, mouseY); } @@ -88,14 +88,14 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { protected void tabClicked(int tabId, int mouseButton) { if (mouseButton == 0 && mTabs[tabId].enabled) { GT_Values.NW.sendToServer( - new GT_Packet_GtTileEntityGuiRequest( - this.tile.getXCoord(), - this.tile.getYCoord(), - this.tile.getZCoord(), - tabId + GT_Proxy.GUI_ID_COVER_SIDE_BASE, - this.tile.getWorld().provider.dimensionId, - Minecraft.getMinecraft().thePlayer.getEntityId(), - 0)); + new GT_Packet_GtTileEntityGuiRequest( + this.tile.getXCoord(), + this.tile.getYCoord(), + this.tile.getZCoord(), + tabId + GT_Proxy.GUI_ID_COVER_SIDE_BASE, + this.tile.getWorld().provider.dimensionId, + Minecraft.getMinecraft().thePlayer.getEntityId(), + 0)); } } @@ -107,7 +107,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { */ private void addCoverToTabs(byte side, ItemStack cover) { final boolean enabled = this.tile.getCoverBehaviorAtSideNew(side) - .hasCoverGUI(); + .hasCoverGUI(); this.setTab(side, cover, null, getTooltipForCoverTab(side, cover, enabled)); this.setTabEnabled(side, enabled); } @@ -123,10 +123,10 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { private String[] getTooltipForCoverTab(byte side, ItemStack cover, boolean enabled) { final List tooltip = cover.getTooltip(Minecraft.getMinecraft().thePlayer, true); tooltip.set( - 0, - (enabled ? EnumChatFormatting.UNDERLINE : EnumChatFormatting.DARK_GRAY) + getSideDescription(side) - + (enabled ? EnumChatFormatting.RESET + ": " : ": " + EnumChatFormatting.RESET) - + tooltip.get(0)); + 0, + (enabled ? EnumChatFormatting.UNDERLINE : EnumChatFormatting.DARK_GRAY) + getSideDescription(side) + + (enabled ? EnumChatFormatting.RESET + ": " : ": " + EnumChatFormatting.RESET) + + tooltip.get(0)); return tooltip.toArray(new String[0]); } @@ -161,7 +161,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { } for (int i = 0; i < tabLine.mTabs.length; i++) { if (tabLine.mTabs[i] != null && tabLine.mTabs[i].getBounds() - .intersects(neiSlotArea)) { + .intersects(neiSlotArea)) { return true; } } diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiFakeItemButton.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiFakeItemButton.java index 6d9b1c5db3..0f6a1c9f41 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiFakeItemButton.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiFakeItemButton.java @@ -117,13 +117,13 @@ public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement { GL11.glEnable(GL12.GL_RESCALE_NORMAL); } gui.getItemRenderer() - .renderItemAndEffectIntoGUI( - gui.getFontRenderer(), - Minecraft.getMinecraft() - .getTextureManager(), - item, - xPosition, - yPosition); + .renderItemAndEffectIntoGUI( + gui.getFontRenderer(), + Minecraft.getMinecraft() + .getTextureManager(), + item, + xPosition, + yPosition); if (item.getItem() instanceof ItemBlock) GL11.glPopAttrib(); } diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java index a1876dcc8f..46d213f0f6 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java @@ -61,8 +61,8 @@ public enum GT_GuiIcon implements IGuiIcon { private static final int T_SIZE = 256; private static ResourceLocation[] TEXTURES = { new ResourceLocation(GregTech.ID, "textures/gui/GuiButtons.png"), - new ResourceLocation(GregTech.ID, "textures/gui/GuiCover.png"), - new ResourceLocation(GregTech.ID, "textures/gui/GuiTabs.png"), }; + new ResourceLocation(GregTech.ID, "textures/gui/GuiCover.png"), + new ResourceLocation(GregTech.ID, "textures/gui/GuiTabs.png"), }; public final int x, y, width, height; public final IGuiIcon overlay; @@ -86,12 +86,12 @@ public enum GT_GuiIcon implements IGuiIcon { } public static void render(IGuiIcon icon, double x, double y, double width, double height, double zLevel, - boolean doDraw) { + boolean doDraw) { render(icon, x, y, width, height, zLevel, doDraw, false); } public static void render(IGuiIcon icon, double x, double y, double width, double height, double zLevel, - boolean doDraw, boolean flipHoritontally) { + boolean doDraw, boolean flipHoritontally) { Tessellator tess = Tessellator.instance; if (doDraw) { Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURES[icon.getTexId()]); diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java index 01bbccc599..555d063a3b 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java @@ -48,8 +48,8 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen if (this.visible) { // moused over this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition - && mouseX < this.xPosition + width - && mouseY < this.yPosition + height; + && mouseX < this.xPosition + width + && mouseY < this.yPosition + height; mouseDragged(mc, mouseX, mouseY); diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java index 636ff0bc26..5b5007fef3 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java @@ -15,7 +15,7 @@ public class GT_GuiIconCheckButton extends GT_GuiIconButton { } public GT_GuiIconCheckButton(IGuiScreen gui, int id, int x, int y, GT_GuiIcon checkedIcon, GT_GuiIcon normalIcon, - String checkedTooltip, String normalTooltip) { + String checkedTooltip, String normalTooltip) { super(gui, id, x, y, normalIcon); this.checkedIcon = checkedIcon; this.normalIcon = normalIcon; diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java index b2430f7b76..ef5348cf77 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java @@ -47,15 +47,15 @@ public class GT_GuiIntegerTextBox extends GuiTextField implements IGuiScreen.IGu @Override public boolean textboxKeyTyped(char c, int key) { if (validChar(c, key) || c == 1 - || c == 3 - || c == 22 - || c == 24 - || key == 14 - || key == 199 - || key == 203 - || key == 205 - || key == 207 - || key == 211) { + || c == 3 + || c == 22 + || c == 24 + || key == 14 + || key == 199 + || key == 203 + || key == 205 + || key == 207 + || key == 211) { return super.textboxKeyTyped(c, key); } return false; diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiTab.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiTab.java index a434be47d3..556de34395 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTab.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTab.java @@ -43,7 +43,7 @@ public class GT_GuiTab { * @param flipHorizontally whether to draw this tab on the right side of the IGregTechTileEntity */ public GT_GuiTab(GT_ITabRenderer gui, int id, Rectangle bounds, GT_GuiTabIconSet tabBackground, ItemStack item, - IGuiIcon overlay, String[] tooltipText, boolean flipHorizontally) { + IGuiIcon overlay, String[] tooltipText, boolean flipHorizontally) { this.gui = gui; this.bounds = bounds; this.item = item; @@ -92,14 +92,14 @@ public class GT_GuiTab { public void drawBackground(int mouseX, int mouseY, float parTicks) { if (this.visible) { GT_GuiIcon.render( - getBackgroundTexture(), - bounds.x, - bounds.y, - bounds.width, - bounds.height, - 1, - true, - this.flipHorizontally); + getBackgroundTexture(), + bounds.x, + bounds.y, + bounds.width, + bounds.height, + 1, + true, + this.flipHorizontally); } } @@ -131,13 +131,13 @@ public class GT_GuiTab { } int margin = (bounds.height - SLOT_SIZE); gui.getItemRenderer() - .renderItemAndEffectIntoGUI( - gui.getFontRenderer(), - Minecraft.getMinecraft() - .getTextureManager(), - item, - bounds.x + (this.flipHorizontally ? 0 : margin), - bounds.y + margin); + .renderItemAndEffectIntoGUI( + gui.getFontRenderer(), + Minecraft.getMinecraft() + .getTextureManager(), + item, + bounds.x + (this.flipHorizontally ? 0 : margin), + bounds.y + margin); if (item.getItem() instanceof ItemBlock) GL11.glPopAttrib(); diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiTabLine.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiTabLine.java index 01a0f3c8b1..bc9f4437d7 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTabLine.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTabLine.java @@ -104,8 +104,8 @@ public class GT_GuiTabLine { * @param tabBackground the set of textures used to draw this tab line's tab backgrounds */ public GT_GuiTabLine(GT_ITabRenderer gui, int numTabs, int tabLineLeft, int tabLineTop, int tabHeight, int tabWidth, - int tabSpacing, DisplayStyle xDir, DisplayStyle yDir, DisplayStyle displayMode, - GT_GuiTabIconSet tabBackground) { + int tabSpacing, DisplayStyle xDir, DisplayStyle yDir, DisplayStyle displayMode, + GT_GuiTabIconSet tabBackground) { this.gui = gui; this.mTabs = new GT_GuiTab[numTabs]; this.tabLineLeft = tabLineLeft; @@ -130,14 +130,14 @@ public class GT_GuiTabLine { */ public void setTab(int tabId, ItemStack item, IGuiIcon overlay, String[] text) { mTabs[tabId] = new GT_GuiTab( - this.gui, - tabId, - getBoundsForTab(tabId), - this.tabBackground, - item, - overlay, - text, - this.flipHorizontally); + this.gui, + tabId, + getBoundsForTab(tabId), + this.tabBackground, + item, + overlay, + text, + this.flipHorizontally); } /** @@ -221,7 +221,7 @@ public class GT_GuiTabLine { public void onMouseClicked(int mouseX, int mouseY, int mouseButton) { for (int tabId = 0; tabId < mTabs.length; tabId++) { if (mTabs[tabId] != null && mTabs[tabId].getBounds() - .contains(mouseX, mouseY)) { + .contains(mouseX, mouseY)) { tabClicked(tabId, mouseButton); return; } @@ -255,7 +255,7 @@ public class GT_GuiTabLine { */ private int getTabX(int tabId) { return this.gui.getGuiLeft() + (flipHorizontally ? (gui.getXSize() - tabLineLeft - tabWidth) : tabLineLeft) - + (tabId * (tabWidth + tabSpacing) * xDir.getValue()); + + (tabId * (tabWidth + tabSpacing) * xDir.getValue()); } /** diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java index 81566de014..4304ca14fc 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java @@ -50,8 +50,8 @@ public class GT_GuiTooltipManager { // Give the tooltip the opportunity to decide whether they should be enabled tip.onTick(); if (tip.enabled && (!tip.isDelayed() || mouseStopped > DELAY) - && tip.getBounds() - .contains(mouseX, mouseY)) { + && tip.getBounds() + .contains(mouseX, mouseY)) { tip.updateText(); drawTooltip(tip, mouseX, mouseY, render); break; @@ -67,7 +67,7 @@ public class GT_GuiTooltipManager { int maxWidth = 0; for (String s : text) { int w = render.getFontRenderer() - .getStringWidth(s); + .getStringWidth(s); if (w > maxWidth) { maxWidth = w; } diff --git a/src/main/java/gregtech/api/interfaces/IDragAndDropSupport.java b/src/main/java/gregtech/api/interfaces/IDragAndDropSupport.java index 7364dec050..b516db5bad 100644 --- a/src/main/java/gregtech/api/interfaces/IDragAndDropSupport.java +++ b/src/main/java/gregtech/api/interfaces/IDragAndDropSupport.java @@ -34,7 +34,7 @@ public interface IDragAndDropSupport extends INEIGuiHandler { * @return True if success */ boolean handleDragAndDropGT(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button, - boolean isGhost); + boolean isGhost); default boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) { return handleDragAndDropGT(gui, mousex, mousey, draggedStack, button, NEIClientUtils.getHeldItem() == null); diff --git a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java index 970b536a2c..98fe106f24 100644 --- a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java +++ b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java @@ -26,9 +26,9 @@ public interface IGlobalWirelessEnergy { default void strongCheckOrAddUser(EntityPlayer user) { strongCheckOrAddUser( - user.getUniqueID() - .toString(), - user.getDisplayName()); + user.getUniqueID() + .toString(), + user.getDisplayName()); } default void strongCheckOrAddUser(UUID user_uuid, String user_name) { @@ -46,7 +46,7 @@ public interface IGlobalWirelessEnergy { // If the username linked to the users fixed uuid is not equal to their current name then remove it. // This indicates that their username has changed. if (!(GlobalEnergyName.getOrDefault(user_uuid, "") - .equals(user_name))) { + .equals(user_name))) { String old_name = GlobalEnergyName.get(user_uuid); GlobalEnergyName.remove(old_name); } @@ -146,7 +146,7 @@ public interface IGlobalWirelessEnergy { // UUID and username of the owner. final String UUID = machine.getOwnerUuid() - .toString(); + .toString(); final String name = machine.getOwnerName(); strongCheckOrAddUser(UUID, name); diff --git a/src/main/java/gregtech/api/interfaces/IHatchElement.java b/src/main/java/gregtech/api/interfaces/IHatchElement.java index 5b825880ae..09f3385729 100644 --- a/src/main/java/gregtech/api/interfaces/IHatchElement.java +++ b/src/main/java/gregtech/api/interfaces/IHatchElement.java @@ -60,34 +60,34 @@ public interface IHatchElement { default IStructureElement newAny(int aCasingIndex, int aDot) { if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); return GT_StructureUtility.buildHatchAdder() - .anyOf(this) - .casingIndex(aCasingIndex) - .dot(aDot) - .continueIfSuccess() - .build(); + .anyOf(this) + .casingIndex(aCasingIndex) + .dot(aDot) + .continueIfSuccess() + .build(); } default IStructureElement newAny(int aCasingIndex, int aDot, ForgeDirection... allowedFacings) { if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); return GT_StructureUtility.buildHatchAdder() - .anyOf(this) - .casingIndex(aCasingIndex) - .dot(aDot) - .continueIfSuccess() - .allowOnly(allowedFacings) - .build(); + .anyOf(this) + .casingIndex(aCasingIndex) + .dot(aDot) + .continueIfSuccess() + .allowOnly(allowedFacings) + .build(); } default IStructureElement newAny(int aCasingIndex, int aDot, - BiPredicate aShouldSkip) { + BiPredicate aShouldSkip) { if (aCasingIndex < 0 || aDot < 0 || aShouldSkip == null) throw new IllegalArgumentException(); return GT_StructureUtility.buildHatchAdder() - .anyOf(this) - .casingIndex(aCasingIndex) - .dot(aDot) - .shouldSkip(aShouldSkip) - .continueIfSuccess() - .build(); + .anyOf(this) + .casingIndex(aCasingIndex) + .dot(aDot) + .shouldSkip(aShouldSkip) + .continueIfSuccess() + .build(); } default IHatchElement or(IHatchElement fallback) { @@ -109,18 +109,18 @@ class HatchElementEither implements IHatchElement { @Override public List> mteClasses() { if (mMteClasses == null) mMteClasses = ImmutableList.>builder() - .addAll(first.mteClasses()) - .addAll(second.mteClasses()) - .build(); + .addAll(first.mteClasses()) + .addAll(second.mteClasses()) + .build(); return mMteClasses; } @Override public IGT_HatchAdder adder() { return ((t, te, i) -> first.adder() - .apply(t, te, i) - || second.adder() - .apply(t, te, i)); + .apply(t, te, i) + || second.adder() + .apply(t, te, i)); } @Override @@ -144,7 +144,7 @@ class HatchElement implements IHatchElement { private final ToLongFunction mCount; public HatchElement(List> aMteClasses, IGT_HatchAdder aAdder, - String aName, ToLongFunction aCount, IHatchElement aBacking) { + String aName, ToLongFunction aCount, IHatchElement aBacking) { this.mClasses = aMteClasses; this.mAdder = aAdder; this.mName = aName; diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java index 33e5db783a..1f67b9c1a8 100644 --- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java +++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java @@ -19,10 +19,10 @@ public interface IItemBehaviour { boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity); boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, - float hitX, float hitY, float hitZ); + float hitX, float hitY, float hitZ); boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ); + int aSide, float hitX, float hitY, float hitZ); ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer); @@ -39,8 +39,8 @@ public interface IItemBehaviour { boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack); EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, - double aZ); + double aZ); EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, - float aSpeed); + float aSpeed); } diff --git a/src/main/java/gregtech/api/interfaces/IProjectileItem.java b/src/main/java/gregtech/api/interfaces/IProjectileItem.java index a1cfb7f4d1..64782bf04c 100644 --- a/src/main/java/gregtech/api/interfaces/IProjectileItem.java +++ b/src/main/java/gregtech/api/interfaces/IProjectileItem.java @@ -25,5 +25,5 @@ public interface IProjectileItem { * EntityArrow */ EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, - float aSpeed); + float aSpeed); } diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java index 91c8564a51..4d9a4f0775 100644 --- a/src/main/java/gregtech/api/interfaces/IToolStats.java +++ b/src/main/java/gregtech/api/interfaces/IToolStats.java @@ -153,7 +153,7 @@ public interface IToolStats { * @return the Amount of modified Items. */ int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, - int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent); + int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent); /** * @return Returns a broken Version of the Item. @@ -175,5 +175,5 @@ public interface IToolStats { short[] getRGBa(boolean aIsToolHead, ItemStack aStack); float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, - int aY, int aZ); + int aY, int aZ); } diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGT_FluidBuilder.java b/src/main/java/gregtech/api/interfaces/fluid/IGT_FluidBuilder.java index 00bfd6dbe8..f15b148fcb 100644 --- a/src/main/java/gregtech/api/interfaces/fluid/IGT_FluidBuilder.java +++ b/src/main/java/gregtech/api/interfaces/fluid/IGT_FluidBuilder.java @@ -76,7 +76,7 @@ public interface IGT_FluidBuilder { */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value IGT_FluidBuilder withTextures(final ResourceLocation stillIconResourceLocation, - final ResourceLocation flowingIconResourceLocation); + final ResourceLocation flowingIconResourceLocation); /** * Builds the {@link IGT_Fluid} diff --git a/src/main/java/gregtech/api/interfaces/fluid/IGT_RegisteredFluid.java b/src/main/java/gregtech/api/interfaces/fluid/IGT_RegisteredFluid.java index e7c220607a..181824874c 100644 --- a/src/main/java/gregtech/api/interfaces/fluid/IGT_RegisteredFluid.java +++ b/src/main/java/gregtech/api/interfaces/fluid/IGT_RegisteredFluid.java @@ -19,7 +19,7 @@ public interface IGT_RegisteredFluid { */ @SuppressWarnings("UnusedReturnValue") // Last call in chain, may not use this returned value IGT_RegisteredFluid registerContainers(final ItemStack fullContainer, final ItemStack emptyContainer, - final int containerSize); + final int containerSize); /** * Registers the bucket-sized 1000L containers in the {@link FluidContainerRegistry} for this diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java index 149600b426..f43159568b 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java @@ -14,7 +14,7 @@ public interface IGT_RecipeAdder { */ @Deprecated boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aFusionDurationInTicks, - int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); /** * Adds a FusionreactorRecipe @@ -29,7 +29,7 @@ public interface IGT_RecipeAdder { */ @Deprecated boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, - int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); /** * Adds a Fusion Reactor Recipe @@ -42,7 +42,7 @@ public interface IGT_RecipeAdder { * @return true if the recipe got added, otherwise false. */ boolean addFusionReactorRecipe(FluidStack[] FluidInputArray, FluidStack[] FluidOutputArray, - int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); /** * Adds a Centrifuge Recipe @@ -55,10 +55,10 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 */ boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration); + ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration); boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); + ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); /** * Adds a Centrifuge Recipe @@ -71,12 +71,12 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 */ boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, - ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, + ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, - ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); + ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, + ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); /** * @param aInput1 must be != null @@ -98,7 +98,7 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0 */ boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); + ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); /** * Adds a Electrolyzer Recipe @@ -112,8 +112,8 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0 */ boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, - ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, + ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); /** * Adds a Chemical Recipe @@ -136,7 +136,7 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 */ boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput, int aDuration); + ItemStack aOutput, int aDuration); /** * Adds a Chemical Recipe Only use this when the recipe conflicts in MultiBlock! @@ -148,7 +148,7 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 */ boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, - FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); + FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); /** * Adds a Chemical Recipe @@ -160,7 +160,7 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 */ boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput, ItemStack aOutput2, int aDuration); + ItemStack aOutput, ItemStack aOutput2, int aDuration); /** * Adds Recipes for creating a radically polymerized polymer from a base Material (for example Ethylene -> @@ -182,10 +182,10 @@ public interface IGT_RecipeAdder { * @param aEUtick must be > 0 */ boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput, int aDuration, int aEUtick); + ItemStack aOutput, int aDuration, int aEUtick); boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom); + ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom); /** * Adds a Chemical Recipe @@ -198,7 +198,7 @@ public interface IGT_RecipeAdder { * @param aEUtick must be > 0 */ boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); + ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); /** * Adds a Chemical Recipe that only exists in the Large Chemical Reactor @@ -214,7 +214,7 @@ public interface IGT_RecipeAdder { * */ boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, int aDuration, int aEUtick); + ItemStack[] aOutputs, int aDuration, int aEUtick); /** * Adds a Blast Furnace Recipe @@ -229,7 +229,7 @@ public interface IGT_RecipeAdder { */ @Deprecated boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, - int aEUt, int aLevel); + int aEUt, int aLevel); /** * Adds a Blast Furnace Recipe @@ -243,11 +243,11 @@ public interface IGT_RecipeAdder { * @param aLevel should be > 0 is the minimum Heat Level needed for this Recipe */ boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, - ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, - FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - ItemStack aOutput4, int aDuration, int aEUt, int aLevel); + FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, + ItemStack aOutput4, int aDuration, int aEUt, int aLevel); /** * Adds a Plasma Forge Recipe @@ -261,10 +261,10 @@ public interface IGT_RecipeAdder { * @param coil_heat_level Should be > 0. Heat of the coils used. */ boolean addPlasmaForgeRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] OutputItemArray, - FluidStack[] FluidOutputArray, int aDuration, int aEUt, int coil_heat_level); + FluidStack[] FluidOutputArray, int aDuration, int aEUt, int coil_heat_level); boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, - ItemStack aOutput2, int aDuration); + ItemStack aOutput2, int aDuration); /** * Adds a Canning Machine Recipe @@ -275,7 +275,7 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0, 1 EU/t is standard. */ boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, - int aEUt); + int aEUt); /** * Adds an Alloy Smelter Recipe @@ -289,7 +289,7 @@ public interface IGT_RecipeAdder { boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, - boolean hidden); + boolean hidden); /** * Adds a CNC-Machine Recipe @@ -322,7 +322,7 @@ public interface IGT_RecipeAdder { * */ boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, - int aEUt); + int aEUt); /** * Adds an Assembler Recipe @@ -333,19 +333,19 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0 */ boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, - int aDuration, int aEUt); + int aDuration, int aEUt); boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, - ItemStack aOutput1, int aDuration, int aEUt); + ItemStack aOutput1, int aDuration, int aEUt); boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, - ItemStack aOutput1, int aDuration, int aEUt); + ItemStack aOutput1, int aDuration, int aEUt); boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, - int aDuration, int aEUt, boolean aCleanroom); + int aDuration, int aEUt, boolean aCleanroom); boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, - boolean aCleanroom); + boolean aCleanroom); /** * Adds an Circuit Assembler Recipe @@ -357,10 +357,10 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0 */ boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, - int aEUt); + int aEUt); boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, - int aEUt, boolean aCleanroom); + int aEUt, boolean aCleanroom); /** * Adds an Assemblyline Recipe @@ -372,7 +372,7 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0 */ boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, - FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); + FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Assemblyline Recipe @@ -381,7 +381,7 @@ public interface IGT_RecipeAdder { * {OreDict, amount} for oredict. */ boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, - FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); + FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Forge Hammer Recipe @@ -395,7 +395,7 @@ public interface IGT_RecipeAdder { // Allows fluids as well as multiple items. boolean addForgeHammerRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] ItemOutputArray, - FluidStack[] FluidOutputArray, int aDuration, int aEUt); + FluidStack[] FluidOutputArray, int aDuration, int aEUt); /** * Adds a Wiremill Recipe @@ -462,10 +462,10 @@ public interface IGT_RecipeAdder { * @return */ boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - FluidStack aFluidInput, int aDuration, int aEUt); + FluidStack aFluidInput, int aDuration, int aEUt); boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - FluidStack aFluidInput, int[] aChances, int aDuration, int aEUt); + FluidStack aFluidInput, int[] aChances, int aDuration, int aEUt); /** * Adds an Implosion Compressor Recipe @@ -488,7 +488,7 @@ public interface IGT_RecipeAdder { * @param aOutput4 can be null */ boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4); + ItemStack aOutput3, ItemStack aOutput4); /** * Adds a Distillation Tower Recipe @@ -498,25 +498,25 @@ public interface IGT_RecipeAdder { * @param aOutput2 can be null */ boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, - int aEUt); + int aEUt); boolean addDistillationTowerRecipe(FluidStack aInput, ItemStack[] aCircuit, FluidStack[] aOutputs, - ItemStack aOutput2, int aDuration, int aEUt); + ItemStack aOutput2, int aDuration, int aEUt); boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, - int aDuration, int aEUt); + int aDuration, int aEUt); boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, - int aDuration, int aEUt); + int aDuration, int aEUt); boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, - FluidStack aFluidPutput, int[] aChances, int aDuration, int aEUt); + FluidStack aFluidPutput, int[] aChances, int aDuration, int aEUt); /** * Adds a Distillation Tower Recipe */ boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); + ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); /** * Adds a Lathe Machine Recipe @@ -527,7 +527,7 @@ public interface IGT_RecipeAdder { * Adds a Cutter Recipe */ boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, - int aDuration, int aEUt); + int aDuration, int aEUt); /** * Adds Cutter Recipes with default Lubricants @@ -535,13 +535,13 @@ public interface IGT_RecipeAdder { boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, - boolean aCleanroom); + boolean aCleanroom); boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, - int aEUt); + int aEUt); boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, - int aEUt, boolean aCleanroom); + int aEUt, boolean aCleanroom); boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial); @@ -560,16 +560,16 @@ public interface IGT_RecipeAdder { * @return */ boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - int aDuration, int aEUt); + int aDuration, int aEUt); boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - int[] aChances, int aDuration, int aEUt); + int[] aChances, int aDuration, int aEUt); /** * Adds an Unboxing Recipe */ boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, - int aEUt); + int aEUt); /** * Adds a Vacuum Freezer Recipe @@ -585,7 +585,7 @@ public interface IGT_RecipeAdder { boolean addVacuumFreezerRecipe(FluidStack aInput1, FluidStack aOutput1, int aDuration, int aEUt); boolean addVacuumFreezerRecipe(ItemStack[] aItemInput, FluidStack[] aFluidInput, ItemStack[] aItemOutput, - FluidStack[] aFluidOutput, int aDuration, int aEUt); + FluidStack[] aFluidOutput, int aDuration, int aEUt); /** * Adds a Fuel for My Generators @@ -610,10 +610,10 @@ public interface IGT_RecipeAdder { boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden); boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, - boolean aHidden); + boolean aHidden); boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, - int aEUt, boolean aHidden); + int aEUt, boolean aHidden); /** * Adds a Recipe for the Fermenter @@ -633,16 +633,16 @@ public interface IGT_RecipeAdder { * Adds a Recipe for the Distillery */ boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, - int aDuration, int aEUt, boolean aHidden); + int aDuration, int aEUt, boolean aHidden); boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, - boolean aHidden); + boolean aHidden); boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, - int aDuration, int aEUt, boolean aHidden); + int aDuration, int aEUt, boolean aHidden); boolean addDistilleryRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, - boolean aHidden); + boolean aHidden); /** * Adds a Recipe for the Fluid Solidifier @@ -653,26 +653,26 @@ public interface IGT_RecipeAdder { * Adds a Recipe for the Fluid Solidifier */ boolean addFluidSolidifierRecipe(final ItemStack[] itemInputs, final FluidStack[] fluidInputs, - final ItemStack[] itemOutputs, final FluidStack[] fluidOutputs, final int EUPerTick, - final int aDurationInTicks); + final ItemStack[] itemOutputs, final FluidStack[] fluidOutputs, final int EUPerTick, + final int aDurationInTicks); /** * Adds a Recipe for Fluid Smelting */ boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, - int aEUt); + int aEUt); /** * Adds a Recipe for Fluid Smelting */ boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, - int aEUt, boolean hidden); + int aEUt, boolean hidden); /** * Adds a Recipe for Fluid Extraction */ boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, - int aDuration, int aEUt); + int aDuration, int aEUt); /** * Adds a Recipe for the Fluid Canner @@ -680,22 +680,22 @@ public interface IGT_RecipeAdder { boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput); boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, - int aDuration, int aEUt); + int aDuration, int aEUt); /** * Adds a Recipe for the Chemical Bath */ boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, FluidStack aFluidOutput, - ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Electromagnetic Separator */ boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Extractor @@ -706,72 +706,72 @@ public interface IGT_RecipeAdder { * Adds a Recipe for the Printer */ boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, - int aDuration, int aEUt); + int aDuration, int aEUt); /** * Adds a Recipe for the Autoclave */ boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, - int aEUt); + int aEUt); boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, - int aEUt, boolean aCleanroom); + int aEUt, boolean aCleanroom); boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, - int aDuration, int aEUt, boolean aCleanroom); + int aDuration, int aEUt, boolean aCleanroom); boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, FluidStack aFluidOut, - ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom); + ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom); boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, - int aEUt, boolean aCleanroom); + int aEUt, boolean aCleanroom); boolean addAutoclaveSpaceRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, - int aChance, int aDuration, int aEUt, boolean aCleanroom); + int aChance, int aDuration, int aEUt, boolean aCleanroom); boolean addAutoclave4Recipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluidIn, FluidStack aFluidOut, - ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); + ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); /** * Adds a Recipe for the Mixer */ @Deprecated boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, - FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); + FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); @Deprecated boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, - ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, - int aDuration, int aEUt); + ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, + int aDuration, int aEUt); @Deprecated boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, - ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, - FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); + ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, + FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); @Deprecated boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, - ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, - FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - ItemStack aOutput4, int aDuration, int aEUt); + ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, + FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, + ItemStack aOutput4, int aDuration, int aEUt); // Use me only from now on! boolean addMixerRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] ItemOutputArray, - FluidStack[] FluidOutputArray, int aDuration, int aEUt); + FluidStack[] FluidOutputArray, int aDuration, int aEUt); /** * Adds a Recipe for the Laser Engraver. */ @Deprecated boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, - int aEUt); + int aEUt); /** * Adds a Recipe for the Laser Engraver. */ @Deprecated boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, - int aEUt, boolean aCleanroom); + int aEUt, boolean aCleanroom); /** * Adds a Generalised Laser Engraver Recipe. @@ -785,13 +785,13 @@ public interface IGT_RecipeAdder { * @param aCleanroom Boolean for usage of cleanroom in recipe. */ boolean addLaserEngraverRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, - ItemStack[] OutputItemArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt, boolean aCleanroom); + ItemStack[] OutputItemArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt, boolean aCleanroom); /** * Adds a Recipe for the Forming Press */ boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, - int aEUt); + int aEUt); // Allows more than 2 inputs and multiple outputs boolean addFormingPressRecipe(ItemStack[] ItemInputArray, ItemStack[] OutputItemArray, int aDuration, int aEUt); @@ -814,7 +814,7 @@ public interface IGT_RecipeAdder { * @param aCleanroom Boolean for usage of cleanroom in recipe. */ boolean addSifterRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] OutputItemArray, - FluidStack[] FluidOutputArray, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); + FluidStack[] FluidOutputArray, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); /** * Adds a Recipe for the Arc Furnace. (up to 4 Outputs) @@ -825,7 +825,7 @@ public interface IGT_RecipeAdder { * Adds a Recipe for the Arc Furnace. (up to 4 Outputs) */ boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, - boolean hidden); + boolean hidden); /** * Adds a Recipe for the GT Pulveriser. (up to 4 Outputs) @@ -836,7 +836,7 @@ public interface IGT_RecipeAdder { * Adds a Recipe for the GT Pulveriser. (up to 4 Outputs) */ boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, - boolean hidden); + boolean hidden); /** * Adds a Distillation Tower Recipe Every Fluid also gets separate distillation recipes @@ -846,10 +846,10 @@ public interface IGT_RecipeAdder { * @param aOutput2 can be null */ boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, - int aEUt); + int aEUt); boolean addUniversalDistillationRecipewithCircuit(FluidStack aInput, ItemStack[] aCircuit, FluidStack[] aOutputs, - ItemStack aOutput2, int aDuration, int aEUt); + ItemStack aOutput2, int aDuration, int aEUt); /** * Adds Pyrolyse Recipe @@ -862,7 +862,7 @@ public interface IGT_RecipeAdder { * @param aEUt */ boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, - FluidStack aFluidOutput, int aDuration, int aEUt); + FluidStack aFluidOutput, int aDuration, int aEUt); /** * Adds Oil Cracking Recipe @@ -886,7 +886,7 @@ public interface IGT_RecipeAdder { * @param aEUt */ boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, - int aDuration, int aEUt); + int aDuration, int aEUt); /** * Adds a Sound to the Sonictron9001 you should NOT call this in the preInit-Phase! @@ -898,7 +898,7 @@ public interface IGT_RecipeAdder { boolean addSonictronSound(ItemStack aItemStack, String aSoundName); boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, - ItemStack aOutput3, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt); + ItemStack aOutput3, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt); /** * Add a Nano Forge Recipe. The Nano Forge's main use is to make nanites/nanorobots. Tier 1 Nano Forge - Can make @@ -916,7 +916,7 @@ public interface IGT_RecipeAdder { * */ boolean addNanoForgeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, int[] aChances, int aDuration, int aEUt, int aSpecialValue); + FluidStack[] aFluidOutputs, int[] aChances, int aDuration, int aEUt, int aSpecialValue); /** * Add a Board Manufacturer Recipe. The Board Manufacturer's main use is to make the circuit boards needed to make @@ -930,7 +930,7 @@ public interface IGT_RecipeAdder { * @param aSpecialValue = defines the tier of the board manufacturer required. */ boolean addPCBFactoryRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, int aDuration, - int aEUt, int aSpecialValue); + int aEUt, int aSpecialValue); /** * Add a breeder cell. @@ -944,7 +944,7 @@ public interface IGT_RecipeAdder { * @return added fake recipe */ GT_Recipe addIC2ReactorBreederCell(ItemStack input, ItemStack output, boolean reflector, int heatStep, - int heatMultiplier, int requiredPulses); + int heatMultiplier, int requiredPulses); /** * Add a fuel cell. @@ -960,7 +960,7 @@ public interface IGT_RecipeAdder { * @return added fake recipe */ GT_Recipe addIC2ReactorFuelCell(ItemStack input, ItemStack output, boolean aMox, float aHeat, float aEnergy, - int aCells); + int aCells); GT_RecipeBuilder stdBuilder(); } diff --git a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java index 1178d87298..5d99f83689 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java +++ b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java @@ -12,21 +12,19 @@ import gregtech.api.enums.TC_Aspects.TC_AspectStack; public interface IThaumcraftCompat { int RESEARCH_TYPE_NORMAL = 0, RESEARCH_TYPE_SECONDARY = 1, RESEARCH_TYPE_FREE = 2, RESEARCH_TYPE_HIDDEN = 4, - RESEARCH_TYPE_VIRTUAL = 8, RESEARCH_TYPE_ROUND = 16, RESEARCH_TYPE_SPECIAL = 32, - RESEARCH_TYPE_AUTOUNLOCK = 64; + RESEARCH_TYPE_VIRTUAL = 8, RESEARCH_TYPE_ROUND = 16, RESEARCH_TYPE_SPECIAL = 32, RESEARCH_TYPE_AUTOUNLOCK = 64; /** * The Research Keys of GT */ String IRON_TO_STEEL = "GT_IRON_TO_STEEL", FILL_WATER_BUCKET = "GT_FILL_WATER_BUCKET", - WOOD_TO_CHARCOAL = "GT_WOOD_TO_CHARCOAL", TRANSZINC = "GT_TRANSZINC", TRANSNICKEL = "GT_TRANSNICKEL", - TRANSCOBALT = "GT_TRANSCOBALT", TRANSBISMUTH = "GT_TRANSBISMUTH", TRANSANTIMONY = "GT_TRANSANTIMONY", - TRANSCUPRONICKEL = "GT_TRANSCUPRONICKEL", TRANSBATTERYALLOY = "GT_TRANSBATTERYALLOY", - TRANSSOLDERINGALLOY = "GT_TRANSSOLDERINGALLOY", TRANSBRASS = "GT_TRANSBRASS", - TRANSBRONZE = "GT_TRANSBRONZE", TRANSINVAR = "GT_TRANSINVAR", TRANSELECTRUM = "GT_TRANSELECTRUM", - TRANSALUMINIUM = "GT_TRANSALUMINIUM", CRYSTALLISATION = "GT_CRYSTALLISATION", - ADVANCEDENTROPICPROCESSING = "GT_ADVANCEDENTROPICPROCESSING", // unused - ADVANCEDMETALLURGY = "GT_ADVANCEDMETALLURGY"; + WOOD_TO_CHARCOAL = "GT_WOOD_TO_CHARCOAL", TRANSZINC = "GT_TRANSZINC", TRANSNICKEL = "GT_TRANSNICKEL", + TRANSCOBALT = "GT_TRANSCOBALT", TRANSBISMUTH = "GT_TRANSBISMUTH", TRANSANTIMONY = "GT_TRANSANTIMONY", + TRANSCUPRONICKEL = "GT_TRANSCUPRONICKEL", TRANSBATTERYALLOY = "GT_TRANSBATTERYALLOY", + TRANSSOLDERINGALLOY = "GT_TRANSSOLDERINGALLOY", TRANSBRASS = "GT_TRANSBRASS", TRANSBRONZE = "GT_TRANSBRONZE", + TRANSINVAR = "GT_TRANSINVAR", TRANSELECTRUM = "GT_TRANSELECTRUM", TRANSALUMINIUM = "GT_TRANSALUMINIUM", + CRYSTALLISATION = "GT_CRYSTALLISATION", ADVANCEDENTROPICPROCESSING = "GT_ADVANCEDENTROPICPROCESSING", // unused + ADVANCEDMETALLURGY = "GT_ADVANCEDMETALLURGY"; boolean registerPortholeBlacklistedBlock(Block aBlock); @@ -37,12 +35,12 @@ public interface IThaumcraftCompat { Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List aAspects); Object addInfusionRecipe(String aResearch, ItemStack aMainInput, ItemStack[] aSideInputs, ItemStack aOutput, - int aInstability, List aAspects); + int aInstability, List aAspects); Object addInfusionEnchantmentRecipe(String aResearch, Enchantment aEnchantment, int aInstability, - List aAspects, ItemStack[] aSideInputs); + List aAspects, ItemStack[] aSideInputs); Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, - ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List aAspects, - ItemStack[] aResearchTriggers, Object[] aPages); + ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List aAspects, + ItemStack[] aResearchTriggers, Object[] aPages); } diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 67dc9927cd..a24e05f1a2 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -42,7 +42,7 @@ import gregtech.common.power.Power; * Don't implement this yourself and expect it to work. Extend @MetaTileEntity itself. */ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHandler, IGearEnergyTileEntity, - IMachineBlockUpdateable, IGregtechWailaProvider, IGetGUITextureSet { + IMachineBlockUpdateable, IGregtechWailaProvider, IGetGUITextureSet { /** * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. @@ -146,7 +146,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * When a Player rightclicks the Facing with a soldering iron. */ boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ); + float aZ); /** * Called right before this Machine explodes @@ -266,7 +266,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * @return */ boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, - float aZ); + float aZ); /** * a Player leftclicks the Machine Sneaky leftclicks are getting passed to this unlike with the rightclicks. @@ -342,7 +342,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * returns the DebugLog */ ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, - ArrayList aList); + ArrayList aList); /** * get a small Description @@ -374,7 +374,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * mBaseMetaTileEntity.mRedstone!!!) */ ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone); + boolean aActive, boolean aRedstone); /** * The Textures used for the Item rendering. Return null if you want the regular 3D Block Rendering. @@ -437,7 +437,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand boolean allowGeneralRedstoneOutput(); void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider); + List outputAABB, Entity collider); AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java index 62df2e713f..3f7bc73383 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java @@ -9,7 +9,7 @@ public interface IMetaTileEntityCable extends IMetaTileEntity { @Deprecated long transferElectricity(byte aSide, long aVoltage, long aAmperage, - ArrayList aAlreadyPassedTileEntityList); + ArrayList aAlreadyPassedTileEntityList); default long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet aAlreadyPassedSet) { return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<>(aAlreadyPassedSet)); diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java index bc80eea1ad..76d3f56e74 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java @@ -53,7 +53,7 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { * @return a List of connected Item Pipes */ public static Map scanPipes(IMetaTileEntityItemPipe aMetaTileEntity, - Map aMap, long aStep, boolean aSuckItems, boolean aIgnoreCapacity) { + Map aMap, long aStep, boolean aSuckItems, boolean aIgnoreCapacity) { aStep += aMetaTileEntity.getStepSize(); if (aIgnoreCapacity || aMetaTileEntity.pipeCapacityCheck()) if (aMap.get(aMetaTileEntity) == null || aMap.get(aMetaTileEntity) > aStep) { @@ -62,14 +62,13 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { byte oppositeSide; for (byte side : ALL_VALID_SIDES) { if (aMetaTileEntity instanceof IConnectable - && !((IConnectable) aMetaTileEntity).isConnectedAtSide(side)) - continue; + && !((IConnectable) aMetaTileEntity).isConnectedAtSide(side)) continue; oppositeSide = GT_Utility.getOppositeSide(side); if (aSuckItems) { if (aBaseMetaTileEntity.getCoverInfoAtSide(side) - .letsItemsIn(-2)) { - final IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide( - side); + .letsItemsIn(-2)) { + final IGregTechTileEntity tItemPipe = aBaseMetaTileEntity + .getIGregTechTileEntityAtSide(side); if (aBaseMetaTileEntity.getColorization() >= 0) { final byte tColor = tItemPipe.getColorization(); if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) { @@ -79,22 +78,22 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { if (tItemPipe instanceof BaseMetaPipeEntity) { final IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); if (tMetaTileEntity instanceof IMetaTileEntityItemPipe - && tItemPipe.getCoverInfoAtSide(oppositeSide) - .letsItemsOut(-2)) { + && tItemPipe.getCoverInfoAtSide(oppositeSide) + .letsItemsOut(-2)) { scanPipes( - (IMetaTileEntityItemPipe) tMetaTileEntity, - aMap, - aStep, - aSuckItems, - aIgnoreCapacity); + (IMetaTileEntityItemPipe) tMetaTileEntity, + aMap, + aStep, + aSuckItems, + aIgnoreCapacity); } } } } else { if (aBaseMetaTileEntity.getCoverInfoAtSide(side) - .letsItemsOut(-2)) { - final IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide( - side); + .letsItemsOut(-2)) { + final IGregTechTileEntity tItemPipe = aBaseMetaTileEntity + .getIGregTechTileEntityAtSide(side); if (tItemPipe != null) { if (aBaseMetaTileEntity.getColorization() >= 0) { final byte tColor = tItemPipe.getColorization(); @@ -105,14 +104,14 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { if (tItemPipe instanceof BaseMetaPipeEntity) { final IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); if (tMetaTileEntity instanceof IMetaTileEntityItemPipe - && tItemPipe.getCoverInfoAtSide(oppositeSide) - .letsItemsIn(-2)) { + && tItemPipe.getCoverInfoAtSide(oppositeSide) + .letsItemsIn(-2)) { scanPipes( - (IMetaTileEntityItemPipe) tMetaTileEntity, - aMap, - aStep, - aSuckItems, - aIgnoreCapacity); + (IMetaTileEntityItemPipe) tMetaTileEntity, + aMap, + aStep, + aSuckItems, + aIgnoreCapacity); } } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java index d79367d252..ec760dd346 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java @@ -21,7 +21,7 @@ public interface IColoredTileEntity { * @return Actual color shown on GUI */ default int getGUIColorization() { - return GT_Util.getRGBInt( - (getColorization() != -1 ? Dyes.get(getColorization()) : Dyes.MACHINE_METAL).getRGBA()); + return GT_Util + .getRGBInt((getColorization() != -1 ? Dyes.get(getColorization()) : Dyes.MACHINE_METAL).getRGBA()); } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java index f23c5a64c9..d3186258ef 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java @@ -82,7 +82,7 @@ public interface ICoverable extends IRedstoneTileEntity, IHasInventory, IBasicEn * @param aPlayer the player who made the change */ default void receiveCoverData(byte aCoverSide, int aCoverID, ISerializableObject aCoverData, - EntityPlayerMP aPlayer) { + EntityPlayerMP aPlayer) { if (aCoverData instanceof ISerializableObject.LegacyCoverData) receiveCoverData(aCoverSide, aCoverID, ((ISerializableObject.LegacyCoverData) aCoverData).get()); } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 1affdb0d74..14ead4e4ee 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -84,25 +84,20 @@ public interface IEnergyConnected extends IColoredTileEntity { final byte tColor = ((IEnergyConnected) tTileEntity).getColorization(); if (tColor >= 0 && tColor != aEmitter.getColorization()) continue; } - rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits( - j, - aVoltage, - aAmperage - rUsedAmperes); + rUsedAmperes += ((IEnergyConnected) tTileEntity) + .injectEnergyUnits(j, aVoltage, aAmperage - rUsedAmperes); } else if (tTileEntity instanceof IEnergySink) { - if (((IEnergySink) tTileEntity).acceptsEnergyFrom( - (TileEntity) aEmitter, - ForgeDirection.getOrientation(j))) { + if (((IEnergySink) tTileEntity) + .acceptsEnergyFrom((TileEntity) aEmitter, ForgeDirection.getOrientation(j))) { while (aAmperage > rUsedAmperes && ((IEnergySink) tTileEntity).getDemandedEnergy() > 0 - && ((IEnergySink) tTileEntity).injectEnergy( - ForgeDirection.getOrientation(j), - aVoltage, - aVoltage) < aVoltage) + && ((IEnergySink) tTileEntity) + .injectEnergy(ForgeDirection.getOrientation(j), aVoltage, aVoltage) < aVoltage) rUsedAmperes++; } } else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) { final ForgeDirection tDirection = ForgeDirection.getOrientation(i) - .getOpposite(); + .getOpposite(); final int rfOut = GT_Utility.safeInt(aVoltage * GregTech_API.mEUtoRF / 100); if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) { ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false); diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java index 1f0c7f4b1c..aa1b9a11c6 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java @@ -75,7 +75,7 @@ public interface IExperimentalEnergyTileEntity extends IColoredTileEntity, IHasW * @return the amount of used secondary value. */ public static final long emitEnergyToNetwork(SubTag aEnergyType, long aPrimary, long aSecondary, - IExperimentalEnergyTileEntity aEmitter) { + IExperimentalEnergyTileEntity aEmitter) { long rUsedSecondary = 0; checkAvailabilities(); for (byte i = 0, j = 0; i < 6 && aSecondary > rUsedSecondary; i++) @@ -87,33 +87,24 @@ public interface IExperimentalEnergyTileEntity extends IColoredTileEntity, IHasW byte tColor = ((IExperimentalEnergyTileEntity) tTileEntity).getColorization(); if (tColor >= 0 && tColor != aEmitter.getColorization()) continue; } - rUsedSecondary += ((IExperimentalEnergyTileEntity) tTileEntity).injectEnergy( - aEnergyType, - j, - aPrimary, - aSecondary - rUsedSecondary); + rUsedSecondary += ((IExperimentalEnergyTileEntity) tTileEntity) + .injectEnergy(aEnergyType, j, aPrimary, aSecondary - rUsedSecondary); } else if (IC_ENERGY && aEnergyType == SubTag.ENERGY_ELECTRICITY - && tTileEntity instanceof IEnergySink) { - if (((IEnergySink) tTileEntity).acceptsEnergyFrom( - (TileEntity) aEmitter, - ForgeDirection.getOrientation(j))) { - while (aSecondary > rUsedSecondary - && ((IEnergySink) tTileEntity).getDemandedEnergy() > 0 - && ((IEnergySink) tTileEntity).injectEnergy( - ForgeDirection.getOrientation(j), - aPrimary, - aPrimary) < aPrimary) - rUsedSecondary++; - } - } else - if (RF_ENERGY && aEnergyType == SubTag.ENERGY_REDSTONE_FLUX - && tTileEntity instanceof IEnergyReceiver - && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) { - rUsedSecondary += ((IEnergyReceiver) tTileEntity).receiveEnergy( - ForgeDirection.getOrientation(j), - (int) aSecondary, - false); - } + && tTileEntity instanceof IEnergySink) { + if (((IEnergySink) tTileEntity) + .acceptsEnergyFrom((TileEntity) aEmitter, ForgeDirection.getOrientation(j))) { + while (aSecondary > rUsedSecondary + && ((IEnergySink) tTileEntity).getDemandedEnergy() > 0 + && ((IEnergySink) tTileEntity) + .injectEnergy(ForgeDirection.getOrientation(j), aPrimary, aPrimary) < aPrimary) + rUsedSecondary++; + } + } else if (RF_ENERGY && aEnergyType == SubTag.ENERGY_REDSTONE_FLUX + && tTileEntity instanceof IEnergyReceiver + && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) { + rUsedSecondary += ((IEnergyReceiver) tTileEntity) + .receiveEnergy(ForgeDirection.getOrientation(j), (int) aSecondary, false); + } } return rUsedSecondary; } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java index a561c3ebe1..23e4d662c9 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java @@ -28,8 +28,8 @@ import gregtech.common.blocks.GT_Block_Machines; * It can cause Problems to include this Interface! */ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTileEntity, ICoverable, IFluidHandler, - ITurnable, IGregTechDeviceInformation, IUpgradableMachine, IDigitalChest, IDescribable, IMachineBlockUpdateable, - IGregtechWailaProvider, IGetGUITextureSet, IAddInventorySlots { + ITurnable, IGregTechDeviceInformation, IUpgradableMachine, IDigitalChest, IDescribable, IMachineBlockUpdateable, + IGregtechWailaProvider, IGetGUITextureSet, IAddInventorySlots { /** * gets the Error displayed on the GUI @@ -150,7 +150,7 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil int getLightOpacity(); void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider); + List outputAABB, Entity collider); AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); @@ -172,8 +172,8 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil @Override default boolean isMachineBlockUpdateRecursive() { return !isDead() && getMetaTileEntity() != null - && getMetaTileEntity().getBaseMetaTileEntity() == this - && getMetaTileEntity().isMachineBlockUpdateRecursive(); + && getMetaTileEntity().getBaseMetaTileEntity() == this + && getMetaTileEntity().isMachineBlockUpdateRecursive(); } default void setShutdownStatus(boolean newStatus) { diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java index 19835cd03c..e40e837ade 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java @@ -14,8 +14,8 @@ import net.minecraft.world.World; public interface IGregtechWailaProvider { default void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) {} + IWailaConfigHandler config) {} default void getWailaNBTData(final EntityPlayerMP player, final TileEntity tile, final NBTTagCompound tag, - final World world, int x, int y, int z) {} + final World world, int x, int y, int z) {} } diff --git a/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java b/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java index 36dff21cb0..dbd8ffecf6 100644 --- a/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java +++ b/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java @@ -42,7 +42,7 @@ public class GT_Block_LongDistancePipe extends GT_Generic_Block { ItemList.Long_Distance_Pipeline_Fluid_Pipe.set(new ItemStack(this, 1, 0)); ItemList.Long_Distance_Pipeline_Item_Pipe.set(new ItemStack(this, 1, 1)); mIcons = new IIconContainer[] { Textures.BlockIcons.LONG_DISTANCE_PIPE_FLUID, - Textures.BlockIcons.LONG_DISTANCE_PIPE_ITEM }; + Textures.BlockIcons.LONG_DISTANCE_PIPE_ITEM }; } @Override @@ -119,8 +119,7 @@ public class GT_Block_LongDistancePipe extends GT_Generic_Block { for (int i = 0; i < 3; i++) { ItemStack aStack = new ItemStack(aItem, 1, i); if (!aStack.getDisplayName() - .contains(".name")) - aList.add(aStack); + .contains(".name")) aList.add(aStack); } } } diff --git a/src/main/java/gregtech/api/items/GT_BreederCell_Item.java b/src/main/java/gregtech/api/items/GT_BreederCell_Item.java index 144fc0d39e..587d469017 100644 --- a/src/main/java/gregtech/api/items/GT_BreederCell_Item.java +++ b/src/main/java/gregtech/api/items/GT_BreederCell_Item.java @@ -34,7 +34,7 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp protected boolean neiAdded = false; public GT_BreederCell_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, int aHeatBonusStep, - int aHeatBonusMultiplier, int aRequiredPulse, Supplier aProduct) { + int aHeatBonusMultiplier, int aRequiredPulse, Supplier aProduct) { super(aUnlocalized, aEnglish, aEnglishTooltip); this.mHeatBonusStep = aHeatBonusStep; this.mHeatBonusMultiplier = aHeatBonusMultiplier; @@ -44,12 +44,12 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp mProduct = aProduct.get(); if (!hidden && !neiAdded) { GT_Values.RA.addIC2ReactorBreederCell( - new ItemStack(this), - mProduct, - deflector, - mHeatBonusStep, - mHeatBonusMultiplier, - getMaxDamage()); + new ItemStack(this), + mProduct, + deflector, + mHeatBonusStep, + mHeatBonusMultiplier, + getMaxDamage()); neiAdded = true; } }); @@ -84,10 +84,10 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp default -> EnumChatFormatting.WHITE; }; aList.add( - String.format( - transItem("020", "Progress: %s/%s"), - "" + color2 + formatNumbers(aStack.getItemDamage()) + EnumChatFormatting.RESET, - "" + formatNumbers(getMaxDamage()))); + String.format( + transItem("020", "Progress: %s/%s"), + "" + color2 + formatNumbers(aStack.getItemDamage()) + EnumChatFormatting.RESET, + "" + formatNumbers(getMaxDamage()))); if (aStack.getItemDamage() > 0) aList.add(EnumChatFormatting.RED + transItem("021", "Radiation Hazard")); } @@ -101,7 +101,7 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp @Override public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, - int pulseX, int pulseY, boolean heatrun) { + int pulseX, int pulseY, boolean heatrun) { if (heatrun) { int myLevel = getNewDamage(reactor, yourStack); if (myLevel >= getMaxDamage()) reactor.setItemAt(youX, youY, mProduct.copy()); diff --git a/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java b/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java index 492d009364..1fcda9d84d 100644 --- a/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java +++ b/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java @@ -16,7 +16,7 @@ public class GT_CoolantCellIC_Item extends GT_CoolantCell_Item implements IReact @Override public boolean acceptUraniumPulse(IReactor aReactor, ItemStack aStack, ItemStack pulsingStack, int youX, int youY, - int pulseX, int pulseY, boolean aHeatRun) { + int pulseX, int pulseY, boolean aHeatRun) { return false; } diff --git a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java index 1b9a6de98a..352448b6b1 100644 --- a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java +++ b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java @@ -62,8 +62,8 @@ public class GT_CoolantCell_Item extends GT_Generic_Item { default -> EnumChatFormatting.DARK_RED; }; aList.add( - EnumChatFormatting.WHITE - + String.format(transItem("000", "Stored Heat: %s"), "" + color + getHeatOfStack(aStack))); + EnumChatFormatting.WHITE + + String.format(transItem("000", "Stored Heat: %s"), "" + color + getHeatOfStack(aStack))); if (getControlTagOfStack(aStack) == 1) { aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line1")); aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line2")); diff --git a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java index 2ddf82c342..cec7a86240 100644 --- a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java +++ b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java @@ -38,8 +38,8 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { public double mArmorAbsorbtionPercentage; public GT_EnergyArmor_Item(int aID, String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, - int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, - int aArmorIndex) { + int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, + int aArmorIndex) { super(ArmorMaterial.DIAMOND, aArmorIndex, aType); setMaxStackSize(1); setMaxDamage(100); @@ -117,9 +117,9 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { if (!aPlayer.worldObj.isRemote && (mSpecials & 4) != 0) { if (GT_ModHandler.canUseElectricItem(aStack, 50000) && aPlayer.getFoodStats() - .needFood()) { + .needFood()) { aPlayer.getFoodStats() - .addStats(1, 0.0F); + .addStats(1, 0.0F); GT_ModHandler.useElectricItem(aStack, 50000, aPlayer); } } @@ -166,8 +166,8 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { if ((mSpecials & 256) != 0) { if (GT_ModHandler.canUseElectricItem(aStack, 100) && aPlayer.isSprinting() - && (aPlayer.onGround && Math.abs(aPlayer.motionX) + Math.abs(aPlayer.motionZ) > 0.10000000149011612D - || aPlayer.isInWater())) { + && (aPlayer.onGround && Math.abs(aPlayer.motionX) + Math.abs(aPlayer.motionZ) > 0.10000000149011612D + || aPlayer.isInWater())) { GT_ModHandler.useElectricItem(aStack, 100, aPlayer); float bonus = 0.22F; @@ -201,7 +201,7 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { tTargetChargeItem = aPlayer.inventory.armorInventory[2]; } if (GT_ModHandler.dischargeElectricItem(tTargetDechargeItem, 10, Integer.MAX_VALUE, true, true, true) - < 10) { + < 10) { tTargetDechargeItem = aPlayer.inventory.armorInventory[2]; } @@ -210,9 +210,9 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { } if (aPlayer.worldObj.isDaytime() && aPlayer.worldObj.canBlockSeeTheSky( - MathHelper.floor_double(aPlayer.posX), - MathHelper.floor_double(aPlayer.posY + 1), - MathHelper.floor_double(aPlayer.posZ))) { + MathHelper.floor_double(aPlayer.posX), + MathHelper.floor_double(aPlayer.posY + 1), + MathHelper.floor_double(aPlayer.posZ))) { if ((mSpecials & 32) != 0 && tTargetChargeItem != null) { GT_ModHandler.chargeElectricItem(tTargetChargeItem, 20, Integer.MAX_VALUE, true, false); } @@ -296,13 +296,8 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { if (armor != null && armor.getItem() == this && (mSpecials & 2) != 0) { int distanceFactor = (int) event.distance - 3; int energyCost = (this.mDamageEnergyCost * distanceFactor) / 4; - if (energyCost <= GT_ModHandler.dischargeElectricItem( - armor, - Integer.MAX_VALUE, - Integer.MAX_VALUE, - true, - true, - true)) { + if (energyCost <= GT_ModHandler + .dischargeElectricItem(armor, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true)) { GT_ModHandler.dischargeElectricItem(armor, energyCost, Integer.MAX_VALUE, true, false, true); event.setCanceled(true); break; @@ -314,19 +309,13 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { @Override public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, - double damage, int slotIndex) { + double damage, int slotIndex) { return new ISpecialArmor.ArmorProperties( - (source == DamageSource.fall && (mSpecials & 2) != 0) ? 10 : 0, - getBaseAbsorptionRatio() * mArmorAbsorbtionPercentage, - mDamageEnergyCost > 0 - ? 25 * GT_ModHandler.dischargeElectricItem( - armor, - Integer.MAX_VALUE, - Integer.MAX_VALUE, - true, - true, - true) / mDamageEnergyCost - : 0); + (source == DamageSource.fall && (mSpecials & 2) != 0) ? 10 : 0, + getBaseAbsorptionRatio() * mArmorAbsorbtionPercentage, + mDamageEnergyCost > 0 ? 25 + * GT_ModHandler.dischargeElectricItem(armor, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true) + / mDamageEnergyCost : 0); } @Override @@ -336,14 +325,9 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { @Override public void damageArmor(EntityLivingBase entity, ItemStack itemStack, DamageSource source, int damage, - int slotIndex) { - GT_ModHandler.dischargeElectricItem( - itemStack, - damage * mDamageEnergyCost, - Integer.MAX_VALUE, - true, - false, - true); + int slotIndex) { + GT_ModHandler + .dischargeElectricItem(itemStack, damage * mDamageEnergyCost, Integer.MAX_VALUE, true, false, true); } private double getBaseAbsorptionRatio() { diff --git a/src/main/java/gregtech/api/items/GT_Generic_Item.java b/src/main/java/gregtech/api/items/GT_Generic_Item.java index 66b19d9ddf..26eafe5130 100644 --- a/src/main/java/gregtech/api/items/GT_Generic_Item.java +++ b/src/main/java/gregtech/api/items/GT_Generic_Item.java @@ -44,14 +44,12 @@ public class GT_Generic_Item extends Item implements IProjectileItem { } public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, - boolean aWriteToolTipIntoLangFile) { + boolean aWriteToolTipIntoLangFile) { super(); mName = "gt." + aUnlocalized; GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish); - if (GT_Utility.isStringValid(aEnglishTooltip)) GT_LanguageManager.addStringLocalization( - mTooltip = mName + ".tooltip_main", - aEnglishTooltip, - aWriteToolTipIntoLangFile); + if (GT_Utility.isStringValid(aEnglishTooltip)) GT_LanguageManager + .addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile); else mTooltip = null; setCreativeTab(GregTech_API.TAB_GREGTECH); GameRegistry.registerItem(this, mName, GregTech.ID); @@ -126,13 +124,13 @@ public class GT_Generic_Item extends Item implements IProjectileItem { @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, - double aZ) { + double aZ) { return null; } @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, - float aSpeed) { + float aSpeed) { return null; } diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java index c829f563b1..f1646529ea 100644 --- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java +++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java @@ -34,7 +34,7 @@ import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; public abstract class GT_MetaBase_Item extends GT_Generic_Item - implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem { + implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem { /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ private final ConcurrentHashMap>> mItemBehaviors = new ConcurrentHashMap<>(); @@ -61,9 +61,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item */ public final GT_MetaBase_Item addItemBehavior(int aMetaValue, IItemBehaviour aBehavior) { if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this; - ArrayList> tList = mItemBehaviors.computeIfAbsent( - (short) aMetaValue, - k -> new ArrayList<>(1)); + ArrayList> tList = mItemBehaviors + .computeIfAbsent((short) aMetaValue, k -> new ArrayList<>(1)); tList.add(aBehavior); return this; } @@ -82,7 +81,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, - double aZ) { + double aZ) { ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack)); if (tList != null) for (IItemBehaviour tBehavior : tList) { EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ); @@ -93,7 +92,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, - float aSpeed) { + float aSpeed) { ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack)); if (tList != null) for (IItemBehaviour tBehavior : tList) { EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); @@ -141,7 +140,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, - float hitX, float hitY, float hitZ) { + float hitX, float hitY, float hitZ) { use(aStack, 0, aPlayer); isItemStackUsable(aStack); ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack)); @@ -163,7 +162,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { use(aStack, 0, aPlayer); isItemStackUsable(aStack); ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack)); @@ -201,7 +200,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { String tKey = getUnlocalizedName(aStack) + ".tooltip"; String[] tStrings = GT_LanguageManager.getTranslation(tKey) - .split("/n "); + .split("/n "); for (String tString : tStrings) if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString); @@ -209,29 +208,25 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item if (tStats != null) { if (tStats[3] > 0) { aList.add( - EnumChatFormatting.AQUA - + String.format( - transItem("009", "Contains %s EU Tier: %s"), - formatNumbers(tStats[3]), - "" + (tStats[2] >= 0 ? tStats[2] : 0)) - + EnumChatFormatting.GRAY); + EnumChatFormatting.AQUA + String.format( + transItem("009", "Contains %s EU Tier: %s"), + formatNumbers(tStats[3]), + "" + (tStats[2] >= 0 ? tStats[2] : 0)) + EnumChatFormatting.GRAY); } else { long tCharge = getRealCharge(aStack); if (tStats[3] == -2 && tCharge <= 0) { aList.add( - EnumChatFormatting.AQUA + transItem("010", "Empty. You should recycle it properly.") - + EnumChatFormatting.GRAY); + EnumChatFormatting.AQUA + transItem("010", "Empty. You should recycle it properly.") + + EnumChatFormatting.GRAY); } else { aList.add( - EnumChatFormatting.AQUA - + String.format( - transItem("011", "%s / %s EU - Voltage: %s"), - formatNumbers(tCharge), - formatNumbers(Math.abs(tStats[0])), - "" + V[(int) (tStats[2] >= 0 - ? tStats[2] < V.length ? tStats[2] : V.length - 1 - : 1)]) - + EnumChatFormatting.GRAY); + EnumChatFormatting.AQUA + + String.format( + transItem("011", "%s / %s EU - Voltage: %s"), + formatNumbers(tCharge), + formatNumbers(Math.abs(tStats[0])), + "" + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)]) + + EnumChatFormatting.GRAY); } } } @@ -240,15 +235,13 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item if (tStats != null && tStats[0] > 0) { FluidStack tFluid = getFluidContent(aStack); aList.add( - EnumChatFormatting.BLUE + ((tFluid == null ? transItem("012", "No Fluids Contained") - : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY); + EnumChatFormatting.BLUE + ((tFluid == null ? transItem("012", "No Fluids Contained") + : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY); aList.add( - EnumChatFormatting.BLUE - + String.format( - transItem("013", "%sL / %sL"), - "" + (tFluid == null ? 0 : formatNumbers(tFluid.amount)), - "" + formatNumbers(tStats[0])) - + EnumChatFormatting.GRAY); + EnumChatFormatting.BLUE + String.format( + transItem("013", "%sL / %sL"), + "" + (tFluid == null ? 0 : formatNumbers(tFluid.amount)), + "" + formatNumbers(tStats[0])) + EnumChatFormatting.GRAY); } ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack)); @@ -288,27 +281,26 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item @Override public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, - boolean aSimulate) { + boolean aSimulate) { Long[] tStats = getElectricStats(aStack); if (tStats == null || tStats[2] > aTier - || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) - || aStack.stackSize != 1) - return 0; + || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) + || aStack.stackSize != 1) return 0; // REALLY?? THIS IS THE CULPRIT THAT CHARGES ITEMS AT INSTANT!!! // long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : // Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], // (long) aCharge))); long tTransfer = aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge); long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.min( - Math.abs(tStats[0]), - Long.MAX_VALUE - tTransfer >= tChargeBefore ? tChargeBefore + tTransfer : Long.MAX_VALUE); + Math.abs(tStats[0]), + Long.MAX_VALUE - tTransfer >= tChargeBefore ? tChargeBefore + tTransfer : Long.MAX_VALUE); if (!aSimulate) setCharge(aStack, tNewCharge); return tNewCharge - tChargeBefore; } @Override public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, - boolean aBatteryAlike, boolean aSimulate) { + boolean aBatteryAlike, boolean aSimulate) { Long[] tStats = getElectricStats(aStack); if (tStats == null || tStats[2] > aTier) return 0; if (aBatteryAlike && !canProvideEnergy(aStack)) return 0; @@ -317,9 +309,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item if (!aSimulate) aStack.stackSize--; return tStats[3]; } - long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max( - 0, - tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); + long tChargeBefore = getRealCharge(aStack), tNewCharge = Math + .max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); if (!aSimulate) setCharge(aStack, tNewCharge); return tChargeBefore - tNewCharge; } @@ -358,12 +349,12 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item IElectricItem tArmorItem = (IElectricItem) tArmor.getItem(); if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) { double tCharge = ElectricItem.manager.discharge( - tArmor, - charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), - Integer.MAX_VALUE, - true, - true, - false); + tArmor, + charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), + Integer.MAX_VALUE, + true, + true, + false); if (tCharge > 0) { charge(aStack, tCharge, Integer.MAX_VALUE, true, false); if (aPlayer instanceof EntityPlayer) { @@ -471,18 +462,15 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item Long[] tStats = getFluidContainerStats(aStack); if (tStats == null || tStats[0] <= 0 - || aFluid == null - || aFluid.getFluid() - .getID() - <= 0 - || aFluid.amount <= 0) - return 0; + || aFluid == null + || aFluid.getFluid() + .getID() <= 0 + || aFluid.amount <= 0) return 0; FluidStack tFluid = getFluidContent(aStack); if (tFluid == null || tFluid.getFluid() - .getID() - <= 0) { + .getID() <= 0) { if (aFluid.amount <= tStats[0]) { if (doFill) { setFluidContent(aStack, aFluid); diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java index 74cda91f44..a852d5f400 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java @@ -117,7 +117,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements ItemStack rStack = new ItemStack(this, 1, mOffset + aID); if (mEnabledItems.get(aID)) { throw new IllegalArgumentException( - String.format("ID %s is already reserved for %s!", aID, rStack.getDisplayName())); + String.format("ID %s is already reserved for %s!", aID, rStack.getDisplayName())); } mEnabledItems.set(aID); mVisibleItems.set(aID); @@ -143,14 +143,14 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements if (((IFoodStat) tRandomData).getFoodAction(this, rStack) == EnumAction.eat) { int tFoodValue = ((IFoodStat) tRandomData).getFoodLevel(this, rStack, null); if (tFoodValue > 0) RA.addCannerRecipe( - rStack, - ItemList.IC2_Food_Can_Empty.get(tFoodValue), - ((IFoodStat) tRandomData).isRotten(this, rStack, null) - ? ItemList.IC2_Food_Can_Spoiled.get(tFoodValue) - : ItemList.IC2_Food_Can_Filled.get(tFoodValue), - null, - tFoodValue * 100, - 1); + rStack, + ItemList.IC2_Food_Can_Empty.get(tFoodValue), + ((IFoodStat) tRandomData).isRotten(this, rStack, null) + ? ItemList.IC2_Food_Can_Spoiled.get(tFoodValue) + : ItemList.IC2_Food_Can_Filled.get(tFoodValue), + null, + tFoodValue * 100, + 1); } tUseOreDict = false; } @@ -226,16 +226,15 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements * @return the Item itself for convenience in constructing. */ public final GT_MetaGenerated_Item setElectricStats(int aMetaValue, long aMaxCharge, long aTransferLimit, - long aTier, long aSpecialData, boolean aUseAnimations) { + long aTier, long aSpecialData, boolean aUseAnimations) { if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this; if (aMaxCharge == 0) mElectricStats.remove((short) aMetaValue); else { mElectricStats.put( - (short) aMetaValue, - new Long[] { aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData }); - if (aMetaValue >= mOffset && aUseAnimations) mIconList[aMetaValue - mOffset] = Arrays.copyOf( - mIconList[aMetaValue - mOffset], - Math.max(9, mIconList[aMetaValue - mOffset].length)); + (short) aMetaValue, + new Long[] { aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData }); + if (aMetaValue >= mOffset && aUseAnimations) mIconList[aMetaValue - mOffset] = Arrays + .copyOf(mIconList[aMetaValue - mOffset], Math.max(9, mIconList[aMetaValue - mOffset].length)); } return this; } @@ -327,17 +326,17 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements if (tStat != null) { if (AppleCore.isModLoaded()) { aPlayer.getFoodStats() - .func_151686_a( - (ItemFood) GT_Utility.callConstructor( - "squeek.applecore.api.food.ItemFoodProxy.ItemFoodProxy", - 0, - null, - true, - this), - aStack); + .func_151686_a( + (ItemFood) GT_Utility.callConstructor( + "squeek.applecore.api.food.ItemFoodProxy.ItemFoodProxy", + 0, + null, + true, + this), + aStack); } else { aPlayer.getFoodStats() - .addStats(tStat.getFoodLevel(this, aStack, aPlayer), tStat.getSaturation(this, aStack, aPlayer)); + .addStats(tStat.getFoodLevel(this, aStack, aPlayer), tStat.getSaturation(this, aStack, aPlayer)); } tStat.onEaten(this, aStack, aPlayer); } @@ -349,7 +348,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements public FoodValues getFoodValues(ItemStack aStack) { IFoodStat tStat = mFoodStats.get((short) getDamage(aStack)); return tStat == null ? null - : new FoodValues(tStat.getFoodLevel(this, aStack, null), tStat.getSaturation(this, aStack, null)); + : new FoodValues(tStat.getFoodLevel(this, aStack, null), tStat.getSaturation(this, aStack, null)); } @Override @@ -379,10 +378,10 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements for (short i = 0; i < j; i++) if (mEnabledItems.get(i)) { for (byte k = 1; k < mIconList[i].length; k++) { mIconList[i][k] = aIconRegister.registerIcon( - GregTech.getResourcePath(GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k)); + GregTech.getResourcePath(GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k)); } - mIconList[i][0] = aIconRegister.registerIcon( - GregTech.getResourcePath(GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); + mIconList[i][0] = aIconRegister + .registerIcon(GregTech.getResourcePath(GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); } } diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java index f32c326afa..db41a3c35b 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java @@ -51,7 +51,7 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { super(aUnlocalized, (short) 32000, (short) 766); mPrefix = aGeneratedPrefix; mIconSetIndex = aIconSetIndex >= 0 ? aIconSetIndex - : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0; + : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0; for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) { OrePrefixes tPrefix = mPrefix; @@ -61,12 +61,12 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { if (mPrefix.doGenerateItem(tMaterial)) { ItemStack tStack = new ItemStack(this, 1, i); GT_LanguageManager.addStringLocalization( - getUnlocalizedName(tStack) + ".name", - GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) - : getDefaultLocalization(tPrefix, tMaterial, i)); + getUnlocalizedName(tStack) + ".name", + GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) + : getDefaultLocalization(tPrefix, tMaterial, i)); GT_LanguageManager.addStringLocalization( - getUnlocalizedName(tStack) + ".tooltip", - tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); + getUnlocalizedName(tStack) + ".tooltip", + tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); String tOreName = getOreDictString(tPrefix, tMaterial); tPrefix = OrePrefixes.getOrePrefix(tOreName); if (tPrefix != null && tPrefix.mIsUnificatable) { @@ -116,7 +116,7 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { */ public String getOreDictString(OrePrefixes aPrefix, Materials aMaterial) { return aPrefix.get(aMaterial) - .toString(); + .toString(); } public IIconContainer getIconContainer(int aMetaData, Materials aMaterial) { @@ -149,17 +149,16 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { public short[] getRGBa(ItemStack aStack) { int aMetaData = getDamage(aStack); return aMetaData < GregTech_API.sGeneratedMaterials.length - && GregTech_API.sGeneratedMaterials[aMetaData] != null - ? GregTech_API.sGeneratedMaterials[aMetaData].mRGBa - : Materials._NULL.mRGBa; + && GregTech_API.sGeneratedMaterials[aMetaData] != null ? GregTech_API.sGeneratedMaterials[aMetaData].mRGBa + : Materials._NULL.mRGBa; } @Override public final IIconContainer getIconContainer(int aMetaData) { return aMetaData < GregTech_API.sGeneratedMaterials.length - && GregTech_API.sGeneratedMaterials[aMetaData] != null - ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData]) - : null; + && GregTech_API.sGeneratedMaterials[aMetaData] != null + ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData]) + : null; } @Override @@ -167,13 +166,13 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { public final void getSubItems(Item aItem, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) if (mPrefix.doGenerateItem(GregTech_API.sGeneratedMaterials[i]) && doesShowInCreative( - mPrefix, - GregTech_API.sGeneratedMaterials[i], - GregTech_API.sDoShowAllItemsInCreative)) { - ItemStack tStack = new ItemStack(this, 1, i); - isItemStackUsable(tStack); - aList.add(tStack); - } + mPrefix, + GregTech_API.sGeneratedMaterials[i], + GregTech_API.sDoShowAllItemsInCreative)) { + ItemStack tStack = new ItemStack(this, 1, i); + isItemStackUsable(tStack); + aList.add(tStack); + } super.getSubItems(aItem, aCreativeTab, aList); } @@ -188,13 +187,13 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item { return null; } return aMetaData >= mOffset && aMetaData - mOffset < mIconList.length ? mIconList[aMetaData - mOffset][0] - : null; + : null; } @Override public int getItemStackLimit(ItemStack aStack) { return getDamage(aStack) < mOffset ? Math.min(super.getItemStackLimit(aStack), mPrefix.mDefaultStackSize) - : super.getItemStackLimit(aStack); + : super.getItemStackLimit(aStack); } @Override diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java index 58368ba05b..ac5af06ef4 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java @@ -59,20 +59,20 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { if (doesMaterialAllowGeneration(tPrefix, tMaterial)) { ItemStack tStack = new ItemStack(this, 1, i); GT_LanguageManager.addStringLocalization( - getUnlocalizedName(tStack) + ".name", - GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) - : getDefaultLocalization(tPrefix, tMaterial, i)); + getUnlocalizedName(tStack) + ".name", + GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) + : getDefaultLocalization(tPrefix, tMaterial, i)); GT_LanguageManager.addStringLocalization( - getUnlocalizedName(tStack) + ".tooltip", - tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); + getUnlocalizedName(tStack) + ".tooltip", + tMaterial.getToolTip(tPrefix.mMaterialAmount / M)); if (tPrefix.mIsUnificatable) { GT_OreDictUnificator.set(tPrefix, tMaterial, tStack); } else { GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack); } if ((tPrefix == OrePrefixes.stick || tPrefix == OrePrefixes.wireFine || tPrefix == OrePrefixes.ingot) - && (tMaterial == Materials.Lead || tMaterial == Materials.Tin - || tMaterial == Materials.SolderingAlloy)) { + && (tMaterial == Materials.Lead || tMaterial == Materials.Tin + || tMaterial == Materials.SolderingAlloy)) { GregTech_API.sSolderingMetalList.add(tStack); GT_ModHandler.registerBoxableItemToToolBox(tStack); } @@ -132,9 +132,9 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { */ public final IIconContainer getIconContainer(int aMetaData, Materials aMaterial) { return mGeneratedPrefixList[aMetaData / 1000] != null - && mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0 - ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] - : null; + && mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0 + ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] + : null; } /** @@ -174,13 +174,13 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { @Override public final IIconContainer getIconContainer(int aMetaData) { return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null - : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]); + : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]); } @Override public GT_GeneratedMaterial_Renderer getMaterialRenderer(int aMetaData) { return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null - : GregTech_API.sGeneratedMaterials[aMetaData % 1000].renderer; + : GregTech_API.sGeneratedMaterials[aMetaData % 1000].renderer; } @Override @@ -191,7 +191,7 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item { Materials aMaterial = GregTech_API.sGeneratedMaterials[i % 1000]; if (aPrefix != null && aMaterial != null) { if (doesMaterialAllowGeneration(aPrefix, aMaterial) - && doesShowInCreative(aPrefix, aMaterial, GregTech_API.sDoShowAllItemsInCreative)) { + && doesShowInCreative(aPrefix, aMaterial, GregTech_API.sDoShowAllItemsInCreative)) { ItemStack tStack = new ItemStack(this, 1, i); isItemStackUsable(tStack); aList.add(tStack); diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java index 5243a7bb07..ac376098ed 100644 --- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java +++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java @@ -64,16 +64,14 @@ import gregtech.common.tools.GT_Tool_Turbine; * Materials.Bismuth, Materials.Bismuth, null); */ @Optional.InterfaceList( - value = { - @Optional.Interface( - iface = "forestry.api.arboriculture.IToolGrafter", - modid = "ForestryAPI|arboriculture"), - @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = "RailcraftAPI|items"), - @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools"), - @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIOAPI|Tools"), - @Optional.Interface(iface = "mrtjp.projectred.api.IScrewdriver", modid = "ProjRed|Core"), }) + value = { + @Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = "ForestryAPI|arboriculture"), + @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = "RailcraftAPI|items"), + @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools"), + @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIOAPI|Tools"), + @Optional.Interface(iface = "mrtjp.projectred.api.IScrewdriver", modid = "ProjRed|Core"), }) public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item - implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool, IScrewdriver { + implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool, IScrewdriver { /** * All instances of this Item Class are listed here. This gets used to register the Renderer to all Items of this @@ -165,17 +163,15 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item * @return An ItemStack containing the newly created Item, but without specific Stats. */ public final ItemStack addTool(int aID, String aEnglish, String aToolTip, IToolStats aToolStats, - Object... aOreDictNamesAndAspects) { + Object... aOreDictNamesAndAspects) { if (aToolTip == null) aToolTip = ""; if (aID >= 0 && aID < 32766 && aID % 2 == 0) { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + "." + (aID + 1) + ".name", - aEnglish + " (Empty)"); - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + "." + (aID + 1) + ".tooltip", - "You need to recharge it"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)"); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it"); mToolStats.put((short) aID, aToolStats); mToolStats.put((short) (aID + 1), aToolStats); aToolStats.onStatsAddedToTool(this, aID); @@ -204,7 +200,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item * @param aElectricArray The Electric Stats of this Tool (or null if not electric) */ public final ItemStack getToolWithStats(int aToolID, int aAmount, Materials aPrimaryMaterial, - Materials aSecondaryMaterial, long[] aElectricArray) { + Materials aSecondaryMaterial, long[] aElectricArray) { ItemStack rStack = new ItemStack(this, aAmount, aToolID); IToolStats tToolStats = getToolStats(rStack); if (tToolStats != null) { @@ -212,8 +208,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item if (aPrimaryMaterial != null) { tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.mName); tToolNBT.setLong( - "MaxDamage", - 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier())); + "MaxDamage", + 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier())); } if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.mName); @@ -237,31 +233,21 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item */ @Mod.EventHandler public void onHarvestBlockEvent(ArrayList aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, - int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { IToolStats tStats = getToolStats(aStack); if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F) doDamage( - aStack, - tStats.convertBlockDrops( - aDrops, - aStack, - aPlayer, - aBlock, - aX, - aY, - aZ, - aMetaData, - aFortune, - aSilkTouch, - aEvent) * tStats.getToolDamagePerDropConversion()); + aStack, + tStats + .convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) + * tStats.getToolDamagePerDropConversion()); } @Mod.EventHandler public float onBlockBreakSpeedEvent(float aDefault, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, - int aY, int aZ, byte aMetaData, PlayerEvent.BreakSpeed aEvent) { + int aY, int aZ, byte aMetaData, PlayerEvent.BreakSpeed aEvent) { IToolStats tStats = getToolStats(aStack); return tStats == null ? aDefault - : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ); + : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ); } @Override @@ -274,12 +260,12 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item if (tStats.isChainsaw() && (aBlock instanceof IShearable target)) { if ((target.isShearable(aStack, aPlayer.worldObj, aX, aY, aZ))) { ArrayList drops = target.onSheared( - aStack, - aPlayer.worldObj, - aX, - aY, - aZ, - EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, aStack)); + aStack, + aPlayer.worldObj, + aX, + aY, + aZ, + EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, aStack)); for (ItemStack stack : drops) { float f = 0.7F; double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D; @@ -305,39 +291,38 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) return true; if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) { float tMagicDamage = tStats.getMagicDamageAgainstEntity( - aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) - : 0.0F, + aEntity instanceof EntityLivingBase + ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) + : 0.0F, + aEntity, + aStack, + aPlayer), + tDamage = tStats.getNormalDamageAgainstEntity( + (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage) + .getAttributeValue() + getToolCombatDamage(aStack), aEntity, aStack, - aPlayer), - tDamage = tStats.getNormalDamageAgainstEntity( - (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage) - .getAttributeValue() - + getToolCombatDamage(aStack), - aEntity, - aStack, - aPlayer); + aPlayer); if (tDamage + tMagicDamage > 0.0F) { boolean tCriticalHit = aPlayer.fallDistance > 0.0F && !aPlayer.onGround - && !aPlayer.isOnLadder() - && !aPlayer.isInWater() - && !aPlayer.isPotionActive(Potion.blindness) - && aPlayer.ridingEntity == null - && aEntity instanceof EntityLivingBase; + && !aPlayer.isOnLadder() + && !aPlayer.isInWater() + && !aPlayer.isPotionActive(Potion.blindness) + && aPlayer.ridingEntity == null + && aEntity instanceof EntityLivingBase; if (tCriticalHit && tDamage > 0.0F) tDamage *= 1.5F; tDamage += tMagicDamage; if (aEntity.attackEntityFrom(tStats.getDamageSource(aPlayer, aEntity), tDamage)) { if (aEntity instanceof EntityLivingBase) aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4); int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) - : 0); + ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) + : 0); if (tKnockcack > 0) { aEntity.addVelocity( - -MathHelper.sin(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F, - 0.1D, - MathHelper.cos(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F); + -MathHelper.sin(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F, + 0.1D, + MathHelper.cos(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F); aPlayer.motionX *= 0.6D; aPlayer.motionZ *= 0.6D; aPlayer.setSprinting(false); @@ -351,9 +336,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item EnchantmentHelper.func_151385_b(aPlayer, aEntity); if (aEntity instanceof EntityLivingBase) aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F)); - aEntity.hurtResistantTime = Math.max( - 1, - tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); + aEntity.hurtResistantTime = Math + .max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); aPlayer.addExhaustion(0.3F); doDamage(aStack, tStats.getToolDamagePerEntityAttack()); } @@ -422,133 +406,120 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item // Overflow Tier -> toolQuality float aBaseEff = (5f + getToolCombatDamage(aStack)) * 1000f; float aOptFlow = (Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) - .getSpeedMultiplier() - * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed - * 50F)); + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) + .getSpeedMultiplier() + * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed + * 50F)); aList.add( - tOffset + 0, - EnumChatFormatting.GRAY + String.format( - transItem("001", "Durability: %s/%s"), - "" + EnumChatFormatting.GREEN + formatNumbers(tMaxDamage - getToolDamage(aStack)) + " ", - " " + formatNumbers(tMaxDamage)) + EnumChatFormatting.GRAY); + tOffset + 0, + EnumChatFormatting.GRAY + String.format( + transItem("001", "Durability: %s/%s"), + "" + EnumChatFormatting.GREEN + formatNumbers(tMaxDamage - getToolDamage(aStack)) + " ", + " " + formatNumbers(tMaxDamage)) + EnumChatFormatting.GRAY); aList.add( - tOffset + 1, - EnumChatFormatting.GRAY - + String.format( - transItem("002", "%s lvl %s"), - tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, - "" + getHarvestLevel(aStack, "")) - + EnumChatFormatting.GRAY); + tOffset + 1, + EnumChatFormatting.GRAY + String.format( + transItem("002", "%s lvl %s"), + tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, + "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY); aList.add( - tOffset + 2, - EnumChatFormatting.WHITE - + String.format( - transItem("005", "Turbine Efficiency: %s"), - "" + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack)))) - + "%" - + EnumChatFormatting.GRAY); + tOffset + 2, + EnumChatFormatting.WHITE + + String.format( + transItem("005", "Turbine Efficiency: %s"), + "" + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack)))) + + "%" + + EnumChatFormatting.GRAY); aList.add( - tOffset + 3, - EnumChatFormatting.WHITE + String.format( - transItem("006", "Optimal Steam flow: %s L/t"), - "" + EnumChatFormatting.GOLD - + formatNumbers( - GT_Utility.safeInt( - (long) (Math.max( - Float.MIN_NORMAL, - tStats.getSpeedMultiplier() - * getPrimaryMaterial(aStack).mToolSpeed - * (1000 * getPrimaryMaterial( - aStack).mSteamMultiplier / 20))))) - + EnumChatFormatting.GRAY)); + tOffset + 3, + EnumChatFormatting.WHITE + String.format( + transItem("006", "Optimal Steam flow: %s L/t"), + "" + EnumChatFormatting.GOLD + + formatNumbers( + GT_Utility.safeInt( + (long) (Math.max( + Float.MIN_NORMAL, + tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed + * (1000 * getPrimaryMaterial(aStack).mSteamMultiplier / 20))))) + + EnumChatFormatting.GRAY)); aList.add( - tOffset + 4, - EnumChatFormatting.WHITE + String.format( - transItem("900", "Energy from Optimal Steam Flow: %s EU/t"), - "" + EnumChatFormatting.GOLD - + formatNumbers( - GT_Utility.safeInt( - (long) (Math.max( - Float.MIN_NORMAL, - tStats.getSpeedMultiplier() - * getPrimaryMaterial(aStack).mToolSpeed - * (1000 * getPrimaryMaterial( - aStack).mSteamMultiplier / 20)) - * (50.0F + (10.0F * getToolCombatDamage(aStack))) - / 200))) - + EnumChatFormatting.GRAY)); + tOffset + 4, + EnumChatFormatting.WHITE + String.format( + transItem("900", "Energy from Optimal Steam Flow: %s EU/t"), + "" + EnumChatFormatting.GOLD + + formatNumbers( + GT_Utility.safeInt( + (long) (Math.max( + Float.MIN_NORMAL, + tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed + * (1000 * getPrimaryMaterial(aStack).mSteamMultiplier / 20)) + * (50.0F + (10.0F * getToolCombatDamage(aStack))) + / 200))) + + EnumChatFormatting.GRAY)); { float[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); float aOptFlowLoose = calculatedFlow[0]; float aBaseEffLoose = calculatedFlow[1]; aList.add( - tOffset + 5, - EnumChatFormatting.AQUA + String.format( - transItem("500", "Turbine Efficiency (Loose): %s"), - "" + EnumChatFormatting.BLUE - + (long) aBaseEffLoose / 100 - + "%" - + EnumChatFormatting.GRAY)); + tOffset + 5, + EnumChatFormatting.AQUA + String.format( + transItem("500", "Turbine Efficiency (Loose): %s"), + "" + EnumChatFormatting.BLUE + (long) aBaseEffLoose / 100 + "%" + EnumChatFormatting.GRAY)); aList.add( - tOffset + 6, - EnumChatFormatting.AQUA + String.format( - transItem("501", "Optimal Steam flow (Loose): %s L/t"), - "" + EnumChatFormatting.GOLD - + formatNumbers( - ((long) aOptFlowLoose - * getPrimaryMaterial(aStack).mSteamMultiplier)) - + EnumChatFormatting.GRAY)); + tOffset + 6, + EnumChatFormatting.AQUA + String.format( + transItem("501", "Optimal Steam flow (Loose): %s L/t"), + "" + EnumChatFormatting.GOLD + + formatNumbers(((long) aOptFlowLoose * getPrimaryMaterial(aStack).mSteamMultiplier)) + + EnumChatFormatting.GRAY)); aList.add( - tOffset + 7, - EnumChatFormatting.AQUA + String.format( - transItem("901", "Energy from Optimal Steam Flow (Loose): %s EU/t"), - "" + EnumChatFormatting.GOLD - + formatNumbers( - ((long) aOptFlowLoose * getPrimaryMaterial(aStack).mSteamMultiplier - / 10000) * ((long) aBaseEffLoose / 2)) - + EnumChatFormatting.GRAY)); + tOffset + 7, + EnumChatFormatting.AQUA + String.format( + transItem("901", "Energy from Optimal Steam Flow (Loose): %s EU/t"), + "" + EnumChatFormatting.GOLD + + formatNumbers( + ((long) aOptFlowLoose * getPrimaryMaterial(aStack).mSteamMultiplier / 10000) + * ((long) aBaseEffLoose / 2)) + + EnumChatFormatting.GRAY)); aList.add( - tOffset + 8, - EnumChatFormatting.GRAY + "(Superheated Steam EU values are 2x those of Steam)"); + tOffset + 8, + EnumChatFormatting.GRAY + "(Superheated Steam EU values are 2x those of Steam)"); } aList.add( - tOffset + 9, - EnumChatFormatting.LIGHT_PURPLE + String.format( - transItem("007", "Energy from Optimal Gas Flow: %s EU/t"), - "" + EnumChatFormatting.GOLD - + formatNumbers( - GT_Utility.safeInt( - (long) (Math.max( - Float.MIN_NORMAL, - tStats.getSpeedMultiplier() - * getPrimaryMaterial(aStack).mToolSpeed - * 50 - * getPrimaryMaterial(aStack).mGasMultiplier) - * (50.0F + (10.0F * getToolCombatDamage(aStack))) - / 100))) - + EnumChatFormatting.GRAY)); + tOffset + 9, + EnumChatFormatting.LIGHT_PURPLE + String.format( + transItem("007", "Energy from Optimal Gas Flow: %s EU/t"), + "" + EnumChatFormatting.GOLD + + formatNumbers( + GT_Utility.safeInt( + (long) (Math.max( + Float.MIN_NORMAL, + tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed + * 50 + * getPrimaryMaterial(aStack).mGasMultiplier) + * (50.0F + (10.0F * getToolCombatDamage(aStack))) + / 100))) + + EnumChatFormatting.GRAY)); aList.add( - tOffset + 10, - EnumChatFormatting.LIGHT_PURPLE + String.format( - transItem("008", "Energy from Optimal Plasma Flow: %s EU/t"), - "" + EnumChatFormatting.GOLD - + formatNumbers( - GT_Utility.safeInt( - (long) (Math.max( - Float.MIN_NORMAL, - tStats.getSpeedMultiplier() - * getPrimaryMaterial(aStack).mToolSpeed - * 2000 - * getPrimaryMaterial(aStack).mPlasmaMultiplier) - * (50.0F + (10.0F * getToolCombatDamage(aStack))) - * (1.05 / 100)))) - + EnumChatFormatting.GRAY)); + tOffset + 10, + EnumChatFormatting.LIGHT_PURPLE + String.format( + transItem("008", "Energy from Optimal Plasma Flow: %s EU/t"), + "" + EnumChatFormatting.GOLD + + formatNumbers( + GT_Utility.safeInt( + (long) (Math.max( + Float.MIN_NORMAL, + tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed + * 2000 + * getPrimaryMaterial(aStack).mPlasmaMultiplier) + * (50.0F + (10.0F * getToolCombatDamage(aStack))) + * (1.05 / 100)))) + + EnumChatFormatting.GRAY)); aList.add( - tOffset + 12, - EnumChatFormatting.GRAY + "(EU/t values include efficiency and are not 100% accurate)"); + tOffset + 12, + EnumChatFormatting.GRAY + "(EU/t values include efficiency and are not 100% accurate)"); int toolQualityLevel = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality; int overflowMultiplier = 0; if (toolQualityLevel >= 6) { @@ -559,51 +530,46 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item overflowMultiplier = 1; } aList.add( - tOffset + 11, - EnumChatFormatting.LIGHT_PURPLE + String.format( - transItem("502", "Overflow Efficiency Tier: %s"), - "" + EnumChatFormatting.GOLD + overflowMultiplier + EnumChatFormatting.GRAY)); + tOffset + 11, + EnumChatFormatting.LIGHT_PURPLE + String.format( + transItem("502", "Overflow Efficiency Tier: %s"), + "" + EnumChatFormatting.GOLD + overflowMultiplier + EnumChatFormatting.GRAY)); } else { aList.add( - tOffset, - EnumChatFormatting.WHITE + String.format( - transItem("001", "Durability: %s/%s"), - "" + EnumChatFormatting.GREEN + formatNumbers(tMaxDamage - getToolDamage(aStack)) + " ", - " " + formatNumbers(tMaxDamage)) + EnumChatFormatting.GRAY); + tOffset, + EnumChatFormatting.WHITE + String.format( + transItem("001", "Durability: %s/%s"), + "" + EnumChatFormatting.GREEN + formatNumbers(tMaxDamage - getToolDamage(aStack)) + " ", + " " + formatNumbers(tMaxDamage)) + EnumChatFormatting.GRAY); aList.add( - tOffset + 1, - EnumChatFormatting.WHITE - + String.format( - transItem("002", "%s lvl %s"), - tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, - "" + getHarvestLevel(aStack, "")) - + EnumChatFormatting.GRAY); + tOffset + 1, + EnumChatFormatting.WHITE + String.format( + transItem("002", "%s lvl %s"), + tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, + "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY); aList.add( - tOffset + 2, - EnumChatFormatting.WHITE - + String.format( - transItem("003", "Attack Damage: %s"), - "" + EnumChatFormatting.BLUE + getToolCombatDamage(aStack)) - + EnumChatFormatting.GRAY); + tOffset + 2, + EnumChatFormatting.WHITE + String.format( + transItem("003", "Attack Damage: %s"), + "" + EnumChatFormatting.BLUE + getToolCombatDamage(aStack)) + EnumChatFormatting.GRAY); aList.add( - tOffset + 3, - EnumChatFormatting.WHITE - + String.format( - transItem("004", "Mining Speed: %s"), - "" + EnumChatFormatting.GOLD - + Math.max( - Float.MIN_NORMAL, - tStats.getSpeedMultiplier() - * getPrimaryMaterial(aStack).mToolSpeed)) - + EnumChatFormatting.GRAY); + tOffset + 3, + EnumChatFormatting.WHITE + + String.format( + transItem("004", "Mining Speed: %s"), + "" + EnumChatFormatting.GOLD + + Math.max( + Float.MIN_NORMAL, + tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed)) + + EnumChatFormatting.GRAY); NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { aNBT = aNBT.getCompoundTag("GT.ToolStats"); if (aNBT != null && aNBT.hasKey("Heat")) { int tHeat = aNBT.getInteger("Heat"); long tWorldTime = aPlayer.getEntityWorld() - .getWorldTime(); + .getWorldTime(); if (aNBT.hasKey("HeatTime")) { long tHeatTime = aNBT.getLong("HeatTime"); if (tWorldTime > (tHeatTime + 10)) { @@ -615,11 +581,11 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item } aList.add( - tOffset + 3, - EnumChatFormatting.RED + "Heat: " - + aNBT.getInteger("Heat") - + " K" - + EnumChatFormatting.GRAY); + tOffset + 3, + EnumChatFormatting.RED + "Heat: " + + aNBT.getInteger("Heat") + + " K" + + EnumChatFormatting.GRAY); } } } @@ -637,7 +603,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item if (aNBT != null) { aNBT = aNBT.getCompoundTag("GT.ToolStats"); if (aNBT != null && aNBT.getBoolean("Electric")) return new Long[] { aNBT.getLong("MaxCharge"), - aNBT.getLong("Voltage"), aNBT.getLong("Tier"), aNBT.getLong("SpecialData") }; + aNBT.getLong("Voltage"), aNBT.getLong("Tier"), aNBT.getLong("SpecialData") }; } return null; } @@ -670,8 +636,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item } if (use(aStack, (int) aAmount, null)) { if (java.util.concurrent.ThreadLocalRandom.current() - .nextInt(0, 25) - == 0) { + .nextInt(0, 25) == 0) { long tNewDamage = getToolDamage(aStack) + aAmount; setToolDamage(aStack, tNewDamage); if (tNewDamage >= getToolMaxDamage(aStack)) { @@ -693,8 +658,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item IToolStats tStats = getToolStats(aStack); if (tStats == null || Math.max(0, getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData)) return 0.0F; return tStats.isMinableBlock(aBlock, (byte) aMetaData) - ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) - : 0.0F; + ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) + : 0.0F; } @Override @@ -710,14 +675,14 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item @Override public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, - EntityLivingBase aPlayer) { + EntityLivingBase aPlayer) { if (!isItemStackUsable(aStack)) return false; IToolStats tStats = getToolStats(aStack); if (tStats == null) return false; GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); doDamage( - aStack, - (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); + aStack, + (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F; } @@ -759,7 +724,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item public float getSaplingModifier(ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) { IToolStats tStats = getToolStats(aStack); return tStats != null && tStats.isGrafter() ? Math.min(100.0F, (1 + getHarvestLevel(aStack, "")) * 20.0F) - : 0.0F; + : 0.0F; } @Override @@ -900,12 +865,12 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item for (int i = 0; i < tEnchants.length; i++) if (tLevels[i] > 0) { Integer tLevel = tMap.get(tEnchants[i].effectId); tMap.put( - tEnchants[i].effectId, - tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i])); + tEnchants[i].effectId, + tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i])); } for (Entry tEntry : tMap.entrySet()) { if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) - || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId) + || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId) tResult.put(tEntry.getKey(), tEntry.getValue()); else switch (Enchantment.enchantmentsList[tEntry.getKey()].type) { case weapon: diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java index 617e02cfe6..c38510f750 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java @@ -25,7 +25,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement public final boolean sMox; public GT_RadioactiveCellIC_Item(String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, float aEnergy, - int aRadiation, float aHeat, ItemStack aDepleted, boolean aMox) { + int aRadiation, float aHeat, ItemStack aDepleted, boolean aMox) { super(aUnlocalized, aEnglish, aCellcount); setMaxStackSize(64); this.maxDmg = maxDamage; @@ -38,27 +38,20 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement if (aDepleted != null && aEnergy > 0 && aHeat > 0) { // avoid adding depleted cells to recipe map GT_Values.RA.addIC2ReactorFuelCell( - new ItemStack(this), - aDepleted, - aMox, - aHeat * MYSTERIOUS_MULTIPLIER_HEAT, - aEnergy, - aCellcount); + new ItemStack(this), + aDepleted, + aMox, + aHeat * MYSTERIOUS_MULTIPLIER_HEAT, + aEnergy, + aCellcount); } } private static int checkPulseable(IReactor reactor, int x, int y, ItemStack me, int mex, int mey, boolean heatrun) { ItemStack other = reactor.getItemAt(x, y); if ((other != null) && ((other.getItem() instanceof IReactorComponent)) - && (((IReactorComponent) other.getItem()).acceptUraniumPulse( - reactor, - other, - me, - x, - y, - mex, - mey, - heatrun))) { + && (((IReactorComponent) other.getItem()) + .acceptUraniumPulse(reactor, other, me, x, y, mex, mey, heatrun))) { return 1; } return 0; @@ -81,9 +74,9 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun); } else { pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) - + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) - + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) - + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun); + + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun); // int heat = sumUp(pulses) * 4; @@ -102,11 +95,11 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement int dheat = heat / heatAcceptors.size(); heat -= dheat; dheat = ((IReactorComponent) heatAcceptors.get(0).stack.getItem()).alterHeat( - reactor, - heatAcceptors.get(0).stack, - heatAcceptors.get(0).x, - heatAcceptors.get(0).y, - dheat); + reactor, + heatAcceptors.get(0).stack, + heatAcceptors.get(0).x, + heatAcceptors.get(0).y, + dheat); heat += dheat; heatAcceptors.remove(0); } @@ -135,14 +128,14 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList heatAcceptors) { ItemStack thing = reactor.getItemAt(x, y); if ((thing != null) && ((thing.getItem() instanceof IReactorComponent)) - && (((IReactorComponent) thing.getItem()).canStoreHeat(reactor, thing, x, y))) { + && (((IReactorComponent) thing.getItem()).canStoreHeat(reactor, thing, x, y))) { heatAcceptors.add(new ItemStackCoord(thing, x, y)); } } @Override public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, - int pulseX, int pulseY, boolean heatrun) { + int pulseX, int pulseY, boolean heatrun) { if (!heatrun) { if (sMox) { float breedereffectiveness = (float) reactor.getHeat() / (float) reactor.getMaxHeat(); diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java index 34492b6220..c927737889 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java @@ -144,12 +144,12 @@ public class GT_RadioactiveCell_Item extends GT_Generic_Item implements IBoxable default -> EnumChatFormatting.DARK_GRAY; }; EnumChatFormatting color1 = this instanceof GT_DepletetCell_Item ? color2 = EnumChatFormatting.DARK_GRAY - : EnumChatFormatting.WHITE; + : EnumChatFormatting.WHITE; aList.add( - color1 + String.format( - transItem("001", "Durability: %s/%s"), - "" + color2 + formatNumbers(this.maxDmg - getDurabilityOfStack(aStack)) + color1, - "" + formatNumbers(this.maxDmg))); + color1 + String.format( + transItem("001", "Durability: %s/%s"), + "" + color2 + formatNumbers(this.maxDmg - getDurabilityOfStack(aStack)) + color1, + "" + formatNumbers(this.maxDmg))); } @Override diff --git a/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java b/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java index 8d8db6a52a..07a0c3bd9b 100644 --- a/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java +++ b/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java @@ -16,16 +16,16 @@ import gregtech.api.util.GT_OreDictUnificator; public class GT_SolderingTool_Item extends GT_Tool_Item { public GT_SolderingTool_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, - int aDischargedGTID) { + int aDischargedGTID) { super( - aUnlocalized, - aEnglish, - "To repair and construct Circuitry", - aMaxDamage, - aEntityDamage, - true, - -1, - aDischargedGTID); + aUnlocalized, + aEnglish, + "To repair and construct Circuitry", + aMaxDamage, + aEntityDamage, + true, + -1, + aDischargedGTID); GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingIron, new ItemStack(this, 1, W)); GregTech_API.registerSolderingTool(new ItemStack(this, 1, W)); // setCraftingSound(GregTech_API.sSoundList.get(103)); @@ -37,18 +37,16 @@ public class GT_SolderingTool_Item extends GT_Tool_Item { @Override public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { aList.add( - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".tooltip_1", - "Sets the Strength of outputted Redstone")); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".tooltip_1", "Sets the Strength of outputted Redstone")); aList.add( - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".tooltip_2", - "Needs Soldering Metal in Inventory!")); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".tooltip_2", "Needs Soldering Metal in Inventory!")); } @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); return false; } diff --git a/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java index 7614ea2fe9..29df584326 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java @@ -14,20 +14,20 @@ public class GT_Spray_Bug_Item extends GT_Tool_Item { public GT_Spray_Bug_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { super( - aUnlocalized, - aEnglish, - "A very 'buggy' Spray", - aMaxDamage, - aEntityDamage, - true); /* - * addToEffectiveList(EntityCaveSpider.class.getName()); - * addToEffectiveList(EntitySpider.class.getName()); addToEffectiveList("EntityTFHedgeSpider"); - * addToEffectiveList("EntityTFKingSpider"); addToEffectiveList("EntityTFSwarmSpider"); - * addToEffectiveList("EntityTFTowerBroodling"); addToEffectiveList("EntityTFFireBeetle"); - * addToEffectiveList("EntityTFSlimeBeetle"); setCraftingSound(Sounds.IC2_TOOLS_PAINTER); - * setBreakingSound(Sounds.IC2_TOOLS_PAINTER); setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); - * setUsageAmounts(8, 4, 1); - */ + aUnlocalized, + aEnglish, + "A very 'buggy' Spray", + aMaxDamage, + aEntityDamage, + true); /* + * addToEffectiveList(EntityCaveSpider.class.getName()); + * addToEffectiveList(EntitySpider.class.getName()); addToEffectiveList("EntityTFHedgeSpider"); + * addToEffectiveList("EntityTFKingSpider"); addToEffectiveList("EntityTFSwarmSpider"); + * addToEffectiveList("EntityTFTowerBroodling"); addToEffectiveList("EntityTFFireBeetle"); + * addToEffectiveList("EntityTFSlimeBeetle"); setCraftingSound(Sounds.IC2_TOOLS_PAINTER); + * setBreakingSound(Sounds.IC2_TOOLS_PAINTER); setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); + * setUsageAmounts(8, 4, 1); + */ } /* @@ -38,7 +38,7 @@ public class GT_Spray_Bug_Item extends GT_Tool_Item { */ @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); if (aWorld.isRemote) { return false; diff --git a/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java index fcd291fa01..0a68e222f8 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Foam_Item.java @@ -21,15 +21,15 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item { public GT_Spray_Foam_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { super( - aUnlocalized, - aEnglish, - "Precision Spray", - aMaxDamage, - aEntityDamage, - true); /* - * setCraftingSound(Sounds.IC2_TOOLS_PAINTER); setBreakingSound(Sounds.IC2_TOOLS_PAINTER); - * setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); setUsageAmounts(25, 3, 1); - */ + aUnlocalized, + aEnglish, + "Precision Spray", + aMaxDamage, + aEntityDamage, + true); /* + * setCraftingSound(Sounds.IC2_TOOLS_PAINTER); setBreakingSound(Sounds.IC2_TOOLS_PAINTER); + * setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); setUsageAmounts(25, 3, 1); + */ } /* @@ -46,7 +46,7 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item { */ @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); if (aPlayer.isSneaking()) return false; if (aWorld.isRemote) { @@ -59,10 +59,9 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item { try { if (GT_Utility.getClassName(aTileEntity) - .startsWith("TileEntityCable")) { + .startsWith("TileEntityCable")) { if (GT_Utility.getPublicField(aTileEntity, "foamed") - .getByte(aTileEntity) - == 0) { + .getByte(aTileEntity) == 0) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); GT_Utility.callPublicMethod(aTileEntity, "changeFoam", (byte) 1); @@ -107,7 +106,7 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item { switch (0) { case 0 -> { if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack), tStack.getItemDamage(), 3); return true; @@ -116,22 +115,11 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item { case 1 -> { for (byte i = 0; i < 4; i++) { if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_PAINTER, - 1.0F, - -1, - aX, - aY, - aZ); - aWorld.setBlock( - aX, - aY, - aZ, - GT_Utility.getBlockFromStack(tStack), - tStack.getItemDamage(), - 3); + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); + aWorld + .setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack), tStack.getItemDamage(), 3); } else { if (i == 0) return false; break; @@ -144,33 +132,27 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item { } case 2 -> { boolean temp = false, tXFactor = (ForgeDirection.getOrientation(tSide).offsetX == 0), - tYFactor = (ForgeDirection.getOrientation(tSide).offsetY == 0), - tZFactor = (ForgeDirection.getOrientation(tSide).offsetZ == 0); + tYFactor = (ForgeDirection.getOrientation(tSide).offsetY == 0), + tZFactor = (ForgeDirection.getOrientation(tSide).offsetZ == 0); aX -= (tXFactor ? 1 : 0); aY -= (tYFactor ? 1 : 0); aZ -= (tZFactor ? 1 : 0); for (byte i = 0; i < 3; i++) for (byte j = 0; j < 3; j++) { if (GT_Utility.isBlockAir( - aWorld, - aX + (tXFactor ? i : 0), - aY + (!tXFactor && tYFactor ? i : 0) + (!tZFactor && tYFactor ? j : 0), - aZ + (tZFactor ? j : 0))) { + aWorld, + aX + (tXFactor ? i : 0), + aY + (!tXFactor && tYFactor ? i : 0) + (!tZFactor && tYFactor ? j : 0), + aZ + (tZFactor ? j : 0))) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { - GT_Utility.sendSoundToPlayers( - aWorld, - SoundResource.IC2_TOOLS_PAINTER, - 1.0F, - -1, - aX, - aY, - aZ); + GT_Utility + .sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); aWorld.setBlock( - aX + (tXFactor ? i : 0), - aY + (!tXFactor && tYFactor ? i : 0) + (!tZFactor && tYFactor ? j : 0), - aZ + (tZFactor ? j : 0), - GT_Utility.getBlockFromStack(tStack), - tStack.getItemDamage(), - 3); + aX + (tXFactor ? i : 0), + aY + (!tXFactor && tYFactor ? i : 0) + (!tZFactor && tYFactor ? j : 0), + aZ + (tZFactor ? j : 0), + GT_Utility.getBlockFromStack(tStack), + tStack.getItemDamage(), + 3); temp = true; } else { break; diff --git a/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java index ae6dcdc5f8..1f6d49e8da 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java @@ -19,20 +19,20 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item { public GT_Spray_Hardener_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { super( - aUnlocalized, - aEnglish, - "Construction Foam Hardener", - aMaxDamage, - aEntityDamage, - true); /* - * setCraftingSound(Sounds.IC2_TOOLS_PAINTER); setBreakingSound(Sounds.IC2_TOOLS_PAINTER); - * setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); setUsageAmounts(16, 3, 1); - */ + aUnlocalized, + aEnglish, + "Construction Foam Hardener", + aMaxDamage, + aEntityDamage, + true); /* + * setCraftingSound(Sounds.IC2_TOOLS_PAINTER); setBreakingSound(Sounds.IC2_TOOLS_PAINTER); + * setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); setUsageAmounts(16, 3, 1); + */ } @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); if (aWorld.isRemote) { return false; @@ -44,10 +44,9 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item { try { if (GT_Utility.getClassName(aTileEntity) - .startsWith("TileEntityCable")) { + .startsWith("TileEntityCable")) { if (GT_Utility.getPublicField(aTileEntity, "foamed") - .getByte(aTileEntity) - == 1) { + .getByte(aTileEntity) == 1) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); GT_Utility.callPublicMethod(aTileEntity, "changeFoam", (byte) 2); @@ -61,10 +60,10 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item { } ItemStack tStack1 = GT_ModHandler.getIC2Item("constructionFoam", 1), - tStack2 = GT_ModHandler.getIC2Item("constructionFoamWall", 1); + tStack2 = GT_ModHandler.getIC2Item("constructionFoamWall", 1); if (tStack1 != null && tStack1.isItemEqual(new ItemStack(aBlock)) - && tStack2 != null - && tStack2.getItem() instanceof ItemBlock) { + && tStack2 != null + && tStack2.getItem() instanceof ItemBlock) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack2), 7, 3); @@ -73,11 +72,11 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item { } if (aTileEntity instanceof BaseMetaPipeEntity - && (((BaseMetaPipeEntity) aTileEntity).mConnections & -64) == 64) { + && (((BaseMetaPipeEntity) aTileEntity).mConnections & -64) == 64) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); ((BaseMetaPipeEntity) aTileEntity).mConnections = (byte) ((((BaseMetaPipeEntity) aTileEntity).mConnections - & ~64) | -128); + & ~64) | -128); } return true; } diff --git a/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java index 9056a6a90d..dd10b419d4 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Hydration_Item.java @@ -15,20 +15,20 @@ public class GT_Spray_Hydration_Item extends GT_Tool_Item { public GT_Spray_Hydration_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { super( - aUnlocalized, - aEnglish, - "To hydrate Crops and similar", - aMaxDamage, - aEntityDamage, - true); /* - * setCraftingSound(Sounds.IC2_TOOLS_PAINTER); setBreakingSound(Sounds.IC2_TOOLS_PAINTER); - * setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); setUsageAmounts(20, 3, 1); - */ + aUnlocalized, + aEnglish, + "To hydrate Crops and similar", + aMaxDamage, + aEntityDamage, + true); /* + * setCraftingSound(Sounds.IC2_TOOLS_PAINTER); setBreakingSound(Sounds.IC2_TOOLS_PAINTER); + * setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); setUsageAmounts(20, 3, 1); + */ } @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); if (aWorld.isRemote) { return false; @@ -53,7 +53,7 @@ public class GT_Spray_Hydration_Item extends GT_Tool_Item { if (aTileEntity instanceof IGregTechTileEntity) { if (((IGregTechTileEntity) aTileEntity).getColorization() >= 0 - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { ((IGregTechTileEntity) aTileEntity).setColorization((byte) -1); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, -1, aX, aY, aZ); } diff --git a/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java index 9ccc442b53..402b655692 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Ice_Item.java @@ -21,27 +21,27 @@ public class GT_Spray_Ice_Item extends GT_Tool_Item { public GT_Spray_Ice_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { super( - aUnlocalized, - aEnglish, - "Very effective against Slimes", - aMaxDamage, - aEntityDamage, - true); /* - * addToEffectiveList(EntitySlime.class.getName()); addToEffectiveList("BlueSlime"); - * addToEffectiveList("SlimeClone"); addToEffectiveList("MetalSlime"); - * addToEffectiveList("EntityTFFireBeetle"); addToEffectiveList("EntityTFMazeSlime"); - * addToEffectiveList("EntityTFSlimeBeetle"); setCraftingSound(Sounds.IC2_TOOLS_PAINTER); - * setBreakingSound(Sounds.IC2_TOOLS_PAINTER); setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); - * setUsageAmounts(4, 16, 1); - */ + aUnlocalized, + aEnglish, + "Very effective against Slimes", + aMaxDamage, + aEntityDamage, + true); /* + * addToEffectiveList(EntitySlime.class.getName()); addToEffectiveList("BlueSlime"); + * addToEffectiveList("SlimeClone"); addToEffectiveList("MetalSlime"); + * addToEffectiveList("EntityTFFireBeetle"); addToEffectiveList("EntityTFMazeSlime"); + * addToEffectiveList("EntityTFSlimeBeetle"); setCraftingSound(Sounds.IC2_TOOLS_PAINTER); + * setBreakingSound(Sounds.IC2_TOOLS_PAINTER); setEntityHitSound(Sounds.IC2_TOOLS_PAINTER); + * setUsageAmounts(4, 16, 1); + */ for (Object tName : Arrays.asList( - OrePrefixes.bucket.get(Materials.Water), - OrePrefixes.cell.get(Materials.Water), - OrePrefixes.capsule.get(Materials.Water))) { + OrePrefixes.bucket.get(Materials.Water), + OrePrefixes.cell.get(Materials.Water), + OrePrefixes.capsule.get(Materials.Water))) { GT_ModHandler.addShapelessCraftingRecipe( - new ItemStack(Blocks.ice, 1, 0), - new Object[] { new ItemStack(this, 1, W), tName }); + new ItemStack(Blocks.ice, 1, 0), + new Object[] { new ItemStack(this, 1, W), tName }); } } /* @@ -52,7 +52,7 @@ public class GT_Spray_Ice_Item extends GT_Tool_Item { @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); if (aWorld.isRemote) { return false; diff --git a/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java index e4e03083f5..1607ae7d5b 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Pepper_Item.java @@ -13,32 +13,28 @@ public class GT_Spray_Pepper_Item extends GT_Tool_Item { public GT_Spray_Pepper_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) { super( - aUnlocalized, - aEnglish, - "To defend yourself against Bears", - aMaxDamage, - aEntityDamage, - true); /* - * setCraftingSound(GregTech_API.sSoundList.get(102)); - * setBreakingSound(GregTech_API.sSoundList.get(102)); - * setEntityHitSound(GregTech_API.sSoundList.get(102)); setUsageAmounts(1, 8, 1); - */ + aUnlocalized, + aEnglish, + "To defend yourself against Bears", + aMaxDamage, + aEntityDamage, + true); /* + * setCraftingSound(GregTech_API.sSoundList.get(102)); + * setBreakingSound(GregTech_API.sSoundList.get(102)); + * setEntityHitSound(GregTech_API.sSoundList.get(102)); setUsageAmounts(1, 8, 1); + */ } @Override public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { aList.add( - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".tooltip_1", - "especially Pedobears, Care Bears,")); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".tooltip_1", "especially Pedobears, Care Bears,")); aList.add( - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".tooltip_2", - "Confession Bears, Bear Grylls")); + GT_LanguageManager + .addStringLocalization(getUnlocalizedName() + ".tooltip_2", "Confession Bears, Bear Grylls")); aList.add( - GT_LanguageManager.addStringLocalization( - getUnlocalizedName() + ".tooltip_3", - "And ofcourse Man-Bear-Pig")); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_3", "And ofcourse Man-Bear-Pig")); } /* * @Override public void onHitEntity(Entity aEntity) { if (aEntity instanceof EntityLiving) { @@ -50,7 +46,7 @@ public class GT_Spray_Pepper_Item extends GT_Tool_Item { @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, - int aSide, float hitX, float hitY, float hitZ) { + int aSide, float hitX, float hitY, float hitZ) { super.onItemUseFirst(aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); if (aWorld.isRemote) { return false; diff --git a/src/main/java/gregtech/api/items/GT_Tool_Item.java b/src/main/java/gregtech/api/items/GT_Tool_Item.java index 9689964396..be38896685 100644 --- a/src/main/java/gregtech/api/items/GT_Tool_Item.java +++ b/src/main/java/gregtech/api/items/GT_Tool_Item.java @@ -10,32 +10,32 @@ import gregtech.api.util.GT_ModHandler; public class GT_Tool_Item extends GT_Generic_Item { public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, - boolean aSwingIfUsed) { + boolean aSwingIfUsed) { this(aUnlocalized, aEnglish, aTooltip, aMaxDamage, aEntityDamage, aSwingIfUsed, -1, -1); } public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, - boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID) { + boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID) { this( - aUnlocalized, - aEnglish, - aTooltip, - aMaxDamage, - aEntityDamage, - aSwingIfUsed, - aChargedGTID, - aDisChargedGTID, - 0, - 0.0F); + aUnlocalized, + aEnglish, + aTooltip, + aMaxDamage, + aEntityDamage, + aSwingIfUsed, + aChargedGTID, + aDisChargedGTID, + 0, + 0.0F); } public GT_Tool_Item(String aUnlocalized, String aEnglish, String aTooltip, int aMaxDamage, int aEntityDamage, - boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID, int aToolQuality, float aToolStrength) { + boolean aSwingIfUsed, int aChargedGTID, int aDisChargedGTID, int aToolQuality, float aToolStrength) { super( - aUnlocalized, - aEnglish, - aTooltip, - aTooltip != null && !aTooltip.equals("Doesn't work as intended, this is a Bug")); + aUnlocalized, + aEnglish, + aTooltip, + aTooltip != null && !aTooltip.equals("Doesn't work as intended, this is a Bug")); setMaxDamage(aMaxDamage); setMaxStackSize(1); setNoRepair(); diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 0bc1201827..36d4aadcd5 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -48,14 +48,14 @@ import gregtech.common.covers.CoverInfo; * This is the main TileEntity for EVERYTHING. */ public class BaseMetaPipeEntity extends CommonMetaTileEntity - implements IGregTechTileEntity, IPipeRenderedTileEntity, IDebugableTileEntity { + implements IGregTechTileEntity, IPipeRenderedTileEntity, IDebugableTileEntity { public byte mConnections = IConnectable.NO_CONNECTION; protected MetaPipeEntity mMetaTileEntity; private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; private boolean mWorkUpdate = false, mWorks = true; private byte mColor = 0, oColor = 0, oStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, - mLagWarningCount = 0; + mLagWarningCount = 0; private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0; protected Node node; protected NodePath nodePath; @@ -196,9 +196,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~IConnectable.CONNECTED_ALL)); // If foam not hardened, tries roll chance to harden if ((mConnections & IConnectable.HAS_FOAM) == IConnectable.HAS_FRESHFOAM - && getRandomNumber(1000) == 0) { + && getRandomNumber(1000) == 0) { mConnections = (byte) ((mConnections & ~IConnectable.HAS_FRESHFOAM) - | IConnectable.HAS_HARDENEDFOAM); + | IConnectable.HAS_HARDENEDFOAM); } if (mTickTimer > 12 && oldConnections != mConnections) GregTech_API.causeCableUpdate(worldObj, xCoord, yCoord, zCoord); @@ -235,10 +235,10 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)); + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)); if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); } @@ -257,23 +257,23 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (isServerSide() && hasValidMetaTileEntity()) { tTime = System.nanoTime() - tTime; if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) - % mTimeStatistics.length] = (int) tTime; + % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L) - && mTickTimer > 1000 - && getMetaTileEntity().doTickProfilingMessageDuringThisTick() - && mLagWarningCount++ < 10) + && mTickTimer > 1000 + && getMetaTileEntity().doTickProfilingMessageDuringThisTick() + && mLagWarningCount++ < 10) GT_FML_LOGGER.warn( - "WARNING: Possible Lag Source at [" + xCoord - + "," - + yCoord - + "," - + zCoord - + "] in Dimension " - + worldObj.provider.dimensionId - + " with " - + tTime - + " ns caused by an instance of " - + getMetaTileEntity().getClass()); + "WARNING: Possible Lag Source at [" + xCoord + + "," + + yCoord + + "," + + zCoord + + "] in Dimension " + + worldObj.provider.dimensionId + + " with " + + tTime + + " ns caused by an instance of " + + getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = false; @@ -282,36 +282,35 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity private void sendClientData() { if (mSendClientData) { NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_TileEntity( - xCoord, - (short) yCoord, - zCoord, - mID, - getCoverInfoAtSide((byte) 0).getCoverID(), - getCoverInfoAtSide((byte) 1).getCoverID(), - getCoverInfoAtSide((byte) 2).getCoverID(), - getCoverInfoAtSide((byte) 3).getCoverID(), - getCoverInfoAtSide((byte) 4).getCoverID(), - getCoverInfoAtSide((byte) 5).getCoverID(), - oTextureData = mConnections, - oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, - oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) - | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)), - oColor = mColor), + worldObj, + new GT_Packet_TileEntity( xCoord, - zCoord); + (short) yCoord, + zCoord, + mID, + getCoverInfoAtSide((byte) 0).getCoverID(), + getCoverInfoAtSide((byte) 1).getCoverID(), + getCoverInfoAtSide((byte) 2).getCoverID(), + getCoverInfoAtSide((byte) 3).getCoverID(), + getCoverInfoAtSide((byte) 4).getCoverID(), + getCoverInfoAtSide((byte) 5).getCoverID(), + oTextureData = mConnections, + oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, + oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)), + oColor = mColor), + xCoord, + zCoord); mSendClientData = false; } sendCoverDataIfNeeded(); } public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, - int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { + int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { issueTextureUpdate(); if (aID > 0 && mID != aID) { mID = aID; @@ -384,14 +383,14 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final ArrayList tList = new ArrayList<>(); if (aLogLevel > 3) { tList.add( - "Meta-ID: " + EnumChatFormatting.BLUE - + mID - + EnumChatFormatting.RESET - + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN + " valid" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + " invalid" + EnumChatFormatting.RESET) - + (mMetaTileEntity == null - ? EnumChatFormatting.RED + " MetaTileEntity == null!" + EnumChatFormatting.RESET - : " ")); + "Meta-ID: " + EnumChatFormatting.BLUE + + mID + + EnumChatFormatting.RESET + + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN + " valid" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + " invalid" + EnumChatFormatting.RESET) + + (mMetaTileEntity == null + ? EnumChatFormatting.RED + " MetaTileEntity == null!" + EnumChatFormatting.RESET + : " ")); } if (aLogLevel > 1) { if (mTimeStatistics.length > 0) { @@ -404,30 +403,30 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity } } tList.add( - "Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) - + "ns since " - + mTimeStatistics.length - + " ticks with worst time of " - + tWorstTime - + "ns."); + "Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + + "ns since " + + mTimeStatistics.length + + " ticks with worst time of " + + tWorstTime + + "ns."); } if (mLagWarningCount > 0) { tList.add( - "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) - + " Lag Spike Warnings (anything taking longer than " - + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING - + "ms) on the Server."); + "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + + " Lag Spike Warnings (anything taking longer than " + + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + + "ms) on the Server."); } if (mMetaTileEntity != null) { tList.add( - "Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " - : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you"); + "Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " + : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you"); } } if (joinedIc2Enet) tList.add("Joined IC2 ENet"); return mMetaTileEntity != null ? mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList) - : new ArrayList<>(); + : new ArrayList<>(); } @Override @@ -467,9 +466,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity public void setInventorySlotContents(int aIndex, ItemStack aStack) { markDirty(); mInventoryChanged = true; - if (canAccessData()) mMetaTileEntity.setInventorySlotContents( - aIndex, - worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); + if (canAccessData()) mMetaTileEntity + .setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); } @Override @@ -498,9 +496,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean isUseableByPlayer(EntityPlayer aPlayer) { return hasValidMetaTileEntity() && mTickTimer > 40 - && getTileEntityOffset(0, 0, 0) == this - && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 - && mMetaTileEntity.isAccessAllowed(aPlayer); + && getTileEntityOffset(0, 0, 0) == this + && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 + && mMetaTileEntity.isAccessAllowed(aPlayer); } @Override @@ -735,12 +733,12 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity else if (tConnections == IConnectable.CONNECTED_NORTH || tConnections == IConnectable.CONNECTED_SOUTH) tConnections = (byte) (IConnectable.CONNECTED_NORTH | IConnectable.CONNECTED_SOUTH); if (hasValidMetaTileEntity()) return mMetaTileEntity.getTexture( - this, - aSide, - tConnections, - (byte) (mColor - 1), - tConnections == 0 || (tConnections & (1 << aSide)) != 0, - getOutputRedstoneSignal(aSide) > 0); + this, + aSide, + tConnections, + (byte) (mColor - 1), + tConnections == 0 || (tConnections & (1 << aSide)) != 0, + getOutputRedstoneSignal(aSide) > 0); return Textures.BlockIcons.ERROR_RENDERING; } @@ -782,7 +780,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final byte tSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) - : aSide; + : aSide; return (getCoverInfoAtSide(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) { return true; @@ -792,7 +790,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { mMetaTileEntity.markDirty(); tCurrentItem.func_150996_a(Items.bucket); setColorization((byte) -1); @@ -804,13 +802,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mMetaTileEntity.markDirty(); GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -818,34 +816,34 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( - tSide, - getCoverInfoAtSide(tSide).onCoverScrewdriverClick(aPlayer, 0.5F, 0.5F, 0.5F)); + tSide, + getCoverInfoAtSide(tSide).onCoverScrewdriverClick(aPlayer, 0.5F, 0.5F, 0.5F)); mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ); mMetaTileEntity.markDirty(); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } } else { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { setCoverDataAtSide( - aSide, - getCoverInfoAtSide(aSide).onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); + aSide, + getCoverInfoAtSide(aSide).onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); mMetaTileEntity.markDirty(); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } } return true; @@ -865,18 +863,18 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity else enableWorking(); mMetaTileEntity.markDirty(); GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") - : GT_Utility.trans("087", "Disabled"))); + aPlayer, + GT_Utility.trans("090", "Machine Processing: ") + + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") + : GT_Utility.trans("087", "Disabled"))); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -886,13 +884,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mMetaTileEntity.markDirty(); // logic handled internally GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } doEnetUpdate(); return true; @@ -903,30 +901,30 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mMetaTileEntity.markDirty(); // logic handled internally GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_BATTERY_USE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mMetaTileEntity.markDirty(); mStrongRedstone ^= (1 << tSide); GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("091", "Redstone Output at Side ") + tSide - + GT_Utility.trans("092", " set to: ") - + ((mStrongRedstone & (1 << tSide)) != 0 ? GT_Utility.trans("093", "Strong") - : GT_Utility.trans("094", "Weak"))); + aPlayer, + GT_Utility.trans("091", "Redstone Output at Side ") + tSide + + GT_Utility.trans("092", " set to: ") + + ((mStrongRedstone & (1 << tSide)) != 0 ? GT_Utility.trans("093", "Strong") + : GT_Utility.trans("094", "Weak"))); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 3.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_BATTERY_USE, + 3.0F, + -1, + xCoord, + yCoord, + zCoord); issueBlockUpdate(); } doEnetUpdate(); @@ -941,19 +939,19 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (coverInfo.getCoverID() == 0) { if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { if (GregTech_API.getCoverBehaviorNew(tCurrentItem) - .isCoverPlaceable(coverSide, tCurrentItem, this) - && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + .isCoverPlaceable(coverSide, tCurrentItem, this) + && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); mMetaTileEntity.markDirty(); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -961,13 +959,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_BREAK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_BREAK, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); dropCover(coverSide, aSide, false); mMetaTileEntity.markDirty(); } @@ -1055,7 +1053,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { return canAccessData() && getCoverInfoAtSide((byte) aSide).letsItemsIn(aIndex) - && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); + && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); } /** @@ -1064,11 +1062,11 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { return canAccessData() && getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut( - (byte) aSide, - getCoverIDAtSide((byte) aSide), - getComplexCoverDataAtSide((byte) aSide), - aIndex, - this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); + (byte) aSide, + getCoverIDAtSide((byte) aSide), + getComplexCoverDataAtSide((byte) aSide), + aIndex, + this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); } @Override @@ -1199,12 +1197,10 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (tTileEntity != null && !mMetaTileEntity.isConnectedAtSide((byte) aSide.ordinal())) return false; if (isFill && mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid)) - return true; + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid)) return true; if (!isFill && mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid)) - return true; + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid)) return true; return false; } @@ -1212,7 +1208,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public int fill(ForgeDirection aSide, FluidStack aFluidStack, boolean doFill) { if (mTickTimer > 5 && canAccessData() - && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true)) + && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true)) return mMetaTileEntity.fill(aSide, aFluidStack, doFill); return 0; } @@ -1220,12 +1216,12 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { if (mTickTimer > 5 && canAccessData() - && canMoveFluidOnSide( - aSide, - mMetaTileEntity.getFluid() == null ? null - : mMetaTileEntity.getFluid() - .getFluid(), - false)) + && canMoveFluidOnSide( + aSide, + mMetaTileEntity.getFluid() == null ? null + : mMetaTileEntity.getFluid() + .getFluid(), + false)) return mMetaTileEntity.drain(aSide, maxDrain, doDrain); return null; } @@ -1233,7 +1229,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public FluidStack drain(ForgeDirection aSide, FluidStack aFluidStack, boolean doDrain) { if (mTickTimer > 5 && canAccessData() - && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false)) + && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false)) return mMetaTileEntity.drain(aSide, aFluidStack, doDrain); return null; } @@ -1256,8 +1252,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { final CoverInfo coverInfo = getCoverInfoAtSide((byte) aSide.ordinal()); if (canAccessData() && (aSide == ForgeDirection.UNKNOWN - || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && coverInfo.letsFluidIn(null)) - || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && coverInfo.letsFluidOut(null)) + || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && coverInfo.letsFluidIn(null)) + || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && coverInfo.letsFluidOut(null)) // Doesn't need to be connected to get Tank Info -- otherwise things can't connect )) return mMetaTileEntity.getTankInfo(aSide); return new FluidTankInfo[] {}; @@ -1273,8 +1269,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return true; } aStack = GT_OreDictUnificator.get(aStack); - if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize - <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { + if (GT_Utility.areStacksEqual(tStack, aStack) + && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { markDirty(); tStack.stackSize += aStack.stackSize; return true; @@ -1374,7 +1370,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index c6d74a1b35..6c18d00c8c 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -80,12 +80,10 @@ import ic2.api.Direction; * This is the main TileEntity for EVERYTHING. */ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTechTileEntity, IActionHost, - IGridProxyable, IAlignmentProvider, IConstructableProvider, IDebugableTileEntity, IGregtechWailaProvider { + IGridProxyable, IAlignmentProvider, IConstructableProvider, IDebugableTileEntity, IGregtechWailaProvider { - private static final Field ENTITY_ITEM_HEALTH_FIELD = ReflectionHelper.findField( - EntityItem.class, - "health", - "field_70291_e"); + private static final Field ENTITY_ITEM_HEALTH_FIELD = ReflectionHelper + .findField(EntityItem.class, "health", "field_70291_e"); private final boolean[] mActiveEUInputs = new boolean[] { false, false, false, false, false, false }; private final boolean[] mActiveEUOutputs = new boolean[] { false, false, false, false, false, false }; private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; @@ -97,13 +95,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec protected boolean mReleaseEnergy = false; protected long[] mAverageEUInput = new long[] { 0, 0, 0, 0, 0 }, mAverageEUOutput = new long[] { 0, 0, 0, 0, 0 }; private boolean mHasEnoughEnergy = true, mRunningThroughTick = false, mInputDisabled = false, - mOutputDisabled = false, mMuffler = false, mLockUpgrade = false; + mOutputDisabled = false, mMuffler = false, mLockUpgrade = false; private boolean mActive = false, mWorkUpdate = false, mSteamConverter = false, mWorks = true; private boolean oRedstone = false; private byte mColor = 0, oColor = 0, oStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, - oTexturePage = 0; + oTexturePage = 0; private byte oLightValueClient = 0, oLightValue = -1, mLightValue = 0, mOtherUpgrades = 0, mFacing = 0, oFacing = 0, - mWorkData = 0; + mWorkData = 0; private int mDisplayErrorCode = 0, oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0, mLagWarningCount = 0; private long oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE; private long mLastCheckTick = 0; @@ -160,8 +158,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec else mID = mID > 0 ? mID : 0; if (mID != 0) createNewMetatileEntity(mID); mSidedRedstone = (hasValidMetaTileEntity() && mMetaTileEntity.hasSidedRedstoneOutputBehavior() - ? new byte[] { 0, 0, 0, 0, 0, 0 } - : new byte[] { 15, 15, 15, 15, 15, 15 }); + ? new byte[] { 0, 0, 0, 0, 0, 0 } + : new byte[] { 15, 15, 15, 15, 15, 15 }); } else { if (aID <= 0) mID = (short) aNBT.getInteger("mID"); else mID = aID; @@ -185,7 +183,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec mInputDisabled = aNBT.getBoolean("mInputDisabled"); mOutputDisabled = aNBT.getBoolean("mOutputDisabled"); mOtherUpgrades = (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries") - + aNBT.getByte("mLiBatteries")); + + aNBT.getByte("mLiBatteries")); mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); final int nbtVersion = aNBT.getInteger("nbtVersion"); @@ -214,13 +212,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec */ public void chargeItem(ItemStack aStack) { decreaseStoredEU( - GT_ModHandler.chargeElectricItem( - aStack, - (int) Math.min(Integer.MAX_VALUE, getStoredEU()), - (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), - false, - false), - true); + GT_ModHandler.chargeElectricItem( + aStack, + (int) Math.min(Integer.MAX_VALUE, getStoredEU()), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), + false, + false), + true); } /** @@ -228,14 +226,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec */ public void dischargeItem(ItemStack aStack) { increaseStoredEnergyUnits( - GT_ModHandler.dischargeElectricItem( - aStack, - (int) Math.min(Integer.MAX_VALUE, getEUCapacity() - getStoredEU()), - (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), - false, - false, - false), - true); + GT_ModHandler.dischargeElectricItem( + aStack, + (int) Math.min(Integer.MAX_VALUE, getEUCapacity() - getStoredEU()), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), + false, + false, + false), + true); } protected boolean isRainPossible() { @@ -255,14 +253,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec final int precipitationHeightAtSide4 = worldObj.getPrecipitationHeight(xCoord - 1, zCoord); final int precipitationHeightAtSide5 = worldObj.getPrecipitationHeight(xCoord + 1, zCoord); return (getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord) - || (getCoverIDAtSide((byte) 2) == 0 && precipitationHeightAtSide2 - 1 < yCoord - && precipitationHeightAtSide2 > -1) - || (getCoverIDAtSide((byte) 3) == 0 && precipitationHeightAtSide3 - 1 < yCoord - && precipitationHeightAtSide3 > -1) - || (getCoverIDAtSide((byte) 4) == 0 && precipitationHeightAtSide4 - 1 < yCoord - && precipitationHeightAtSide4 > -1) - || (getCoverIDAtSide((byte) 5) == 0 && precipitationHeightAtSide5 - 1 < yCoord - && precipitationHeightAtSide5 > -1); + || (getCoverIDAtSide((byte) 2) == 0 && precipitationHeightAtSide2 - 1 < yCoord + && precipitationHeightAtSide2 > -1) + || (getCoverIDAtSide((byte) 3) == 0 && precipitationHeightAtSide3 - 1 < yCoord + && precipitationHeightAtSide3 > -1) + || (getCoverIDAtSide((byte) 4) == 0 && precipitationHeightAtSide4 - 1 < yCoord + && precipitationHeightAtSide4 > -1) + || (getCoverIDAtSide((byte) 5) == 0 && precipitationHeightAtSide5 - 1 < yCoord + && precipitationHeightAtSide5 > -1); } @Override @@ -385,15 +383,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec } if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { - final long tOutputVoltage = Math.max( - oOutput, - oOutput + (1L << Math.max(0, GT_Utility.getTier(oOutput) - 1))); + final long tOutputVoltage = Math + .max(oOutput, oOutput + (1L << Math.max(0, GT_Utility.getTier(oOutput) - 1))); final long tUsableAmperage = Math.min( - getOutputAmperage(), - (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); + getOutputAmperage(), + (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); if (tUsableAmperage > 0) { final long tEU = tOutputVoltage - * Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); + * Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); mAverageEUOutput[mAverageEUOutputIndex] += tEU; decreaseStoredEU(tEU, true); } @@ -417,30 +414,30 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (getRandomNumber(10) == 0) { try { GT_Mod.achievements.issueAchievement( - this.getWorldObj() - .getPlayerEntityByName(mOwnerName), - "badweather"); + this.getWorldObj() + .getPlayerEntityByName(mOwnerName), + "badweather"); } catch (Exception ignored) {} GT_Log.exp.println( - "Machine at: " + this.getXCoord() - + " | " - + this.getYCoord() - + " | " - + this.getZCoord() - + " DIMID: " - + this.worldObj.provider.dimensionId - + " explosion due to rain!"); + "Machine at: " + this.getXCoord() + + " | " + + this.getYCoord() + + " | " + + this.getZCoord() + + " DIMID: " + + this.worldObj.provider.dimensionId + + " explosion due to rain!"); doEnergyExplosion(); } else { GT_Log.exp.println( - "Machine at: " + this.getXCoord() - + " | " - + this.getYCoord() - + " | " - + this.getZCoord() - + " DIMID: " - + this.worldObj.provider.dimensionId - + " set to Fire due to rain!"); + "Machine at: " + this.getXCoord() + + " | " + + this.getYCoord() + + " | " + + this.getZCoord() + + " DIMID: " + + this.worldObj.provider.dimensionId + + " set to Fire due to rain!"); setOnFire(); } } @@ -449,22 +446,22 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec return; } if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() - && getRandomNumber(3) == 0) { + && getRandomNumber(3) == 0) { try { GT_Mod.achievements.issueAchievement( - this.getWorldObj() - .getPlayerEntityByName(mOwnerName), - "badweather"); + this.getWorldObj() + .getPlayerEntityByName(mOwnerName), + "badweather"); } catch (Exception ignored) {} GT_Log.exp.println( - "Machine at: " + this.getXCoord() - + " | " - + this.getYCoord() - + " | " - + this.getZCoord() - + " DIMID: " - + this.worldObj.provider.dimensionId - + " explosion due to Thunderstorm!"); + "Machine at: " + this.getXCoord() + + " | " + + this.getYCoord() + + " | " + + this.getZCoord() + + " DIMID: " + + this.worldObj.provider.dimensionId + + " explosion due to Thunderstorm!"); doEnergyExplosion(); } } @@ -482,16 +479,17 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aSideServer) { if (mMetaTileEntity.dechargerSlotCount() > 0 && getStoredEU() < getEUCapacity()) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), - k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { + k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) { dischargeItem(mMetaTileEntity.mInventory[i]); if (ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]) > 0) { - if ((getStoredEU() + ic2.api.info.Info.itemEnergy.getEnergyValue( - mMetaTileEntity.mInventory[i])) < getEUCapacity()) { + if ((getStoredEU() + + ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i])) + < getEUCapacity()) { increaseStoredEnergyUnits( - (long) ic2.api.info.Info.itemEnergy.getEnergyValue( - mMetaTileEntity.mInventory[i]), - false); + (long) ic2.api.info.Info.itemEnergy + .getEnergyValue(mMetaTileEntity.mInventory[i]), + false); mMetaTileEntity.mInventory[i].stackSize--; mInventoryChanged = true; } @@ -507,7 +505,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aSideServer) { if (mMetaTileEntity.rechargerSlotCount() > 0 && getStoredEU() > 0) { for (int i = mMetaTileEntity.rechargerSlotStartIndex(), - k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { + k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { if (getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { chargeItem(mMetaTileEntity.mInventory[i]); if (mMetaTileEntity.mInventory[i].stackSize <= 0) { @@ -539,9 +537,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (mTickTimer > 10) { byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) - | (mRedstone ? 16 : 0) - | (mLockUpgrade ? 32 : 0) - | (mWorks ? 64 : 0)); + | (mRedstone ? 16 : 0) + | (mLockUpgrade ? 32 : 0) + | (mWorks ? 64 : 0)); if (tData != oTextureData) sendBlockEvent(GregTechTileClientEvents.CHANGE_COMMON_DATA, oTextureData = tData); @@ -551,15 +549,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { tData = ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage(); if (tData != oTexturePage) sendBlockEvent( - GregTechTileClientEvents.CHANGE_CUSTOM_DATA, - (byte) ((oTexturePage = tData) | 0x80)); // set last bit as a flag for page + GregTechTileClientEvents.CHANGE_CUSTOM_DATA, + (byte) ((oTexturePage = tData) | 0x80)); // set last bit as a flag for page } if (mColor != oColor) sendBlockEvent(GregTechTileClientEvents.CHANGE_COLOR, oColor = mColor); tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)); + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)); if (tData != oRedstoneData) sendBlockEvent(GregTechTileClientEvents.CHANGE_REDSTONE_OUTPUT, oRedstoneData = tData); if (mLightValue != oLightValue) { @@ -591,23 +589,23 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aSideServer && hasValidMetaTileEntity()) { tTime = System.nanoTime() - tTime; if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) - % mTimeStatistics.length] = (int) tTime; + % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1_000_000L) - && mTickTimer > 1000 - && getMetaTileEntity().doTickProfilingMessageDuringThisTick() - && mLagWarningCount++ < 10) + && mTickTimer > 1000 + && getMetaTileEntity().doTickProfilingMessageDuringThisTick() + && mLagWarningCount++ < 10) GT_FML_LOGGER.warn( - "WARNING: Possible Lag Source at [" + xCoord - + ", " - + yCoord - + ", " - + zCoord - + "] in Dimension " - + worldObj.provider.dimensionId - + " with " - + tTime - + "ns caused by an instance of " - + getMetaTileEntity().getClass()); + "WARNING: Possible Lag Source at [" + xCoord + + ", " + + yCoord + + ", " + + zCoord + + "] in Dimension " + + worldObj.provider.dimensionId + + " with " + + tTime + + "ns caused by an instance of " + + getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = mRunningThroughTick = false; @@ -615,7 +613,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { if (hasValidMetaTileEntity()) { getMetaTileEntity().getWailaBody(itemStack, currenttip, accessor, config); } @@ -624,7 +622,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); if (hasValidMetaTileEntity()) { getMetaTileEntity().getWailaNBTData(player, tile, tag, world, x, y, z); @@ -634,44 +632,42 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec private void sendClientData() { if (mSendClientData) { NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_TileEntity( - xCoord, - (short) yCoord, - zCoord, - mID, - getCoverInfoAtSide((byte) 0).getCoverID(), - getCoverInfoAtSide((byte) 1).getCoverID(), - getCoverInfoAtSide((byte) 2).getCoverID(), - getCoverInfoAtSide((byte) 3).getCoverID(), - getCoverInfoAtSide((byte) 4).getCoverID(), - getCoverInfoAtSide((byte) 5).getCoverID(), - oTextureData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) - | (mRedstone ? 16 : 0) - | (mLockUpgrade ? 32 : 0) - | (mWorks ? 64 : 0)), - oTexturePage = (hasValidMetaTileEntity() - && mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ? ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage() - : 0, - oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, - oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) - | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)), - oColor = mColor), + worldObj, + new GT_Packet_TileEntity( xCoord, - zCoord); + (short) yCoord, + zCoord, + mID, + getCoverInfoAtSide((byte) 0).getCoverID(), + getCoverInfoAtSide((byte) 1).getCoverID(), + getCoverInfoAtSide((byte) 2).getCoverID(), + getCoverInfoAtSide((byte) 3).getCoverID(), + getCoverInfoAtSide((byte) 4).getCoverID(), + getCoverInfoAtSide((byte) 5).getCoverID(), + oTextureData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) + | (mRedstone ? 16 : 0) + | (mLockUpgrade ? 32 : 0) + | (mWorks ? 64 : 0)), + oTexturePage = (hasValidMetaTileEntity() && mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ? ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage() + : 0, + oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, + oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)), + oColor = mColor), + xCoord, + zCoord); mSendClientData = false; } sendCoverDataIfNeeded(); } public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, - int aCover4, int aCover5, byte aTextureData, byte aTexturePage, byte aUpdateData, byte aRedstoneData, - byte aColorData) { + int aCover4, int aCover5, byte aTextureData, byte aTexturePage, byte aUpdateData, byte aRedstoneData, + byte aColorData) { issueTextureUpdate(); if (mID != aID && aID > 0) { mID = aID; @@ -694,20 +690,20 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Deprecated public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, - int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { + int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { receiveMetaTileEntityData( - aID, - aCover0, - aCover1, - aCover2, - aCover3, - aCover4, - aCover5, - aTextureData, - (byte) 0, - aUpdateData, - aRedstoneData, - aColorData); + aID, + aCover0, + aCover1, + aCover2, + aCover3, + aCover4, + aCover5, + aTextureData, + (byte) 0, + aUpdateData, + aRedstoneData, + aColorData); } @Override @@ -719,7 +715,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue); } catch (Throwable e) { GT_Log.err.println( - "Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); + "Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); e.printStackTrace(GT_Log.err); } } @@ -777,14 +773,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec final ArrayList tList = new ArrayList<>(); if (aLogLevel > 2) { tList.add( - "Meta-ID: " + EnumChatFormatting.BLUE - + mID - + EnumChatFormatting.RESET - + (canAccessData() ? EnumChatFormatting.GREEN + " valid" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + " invalid" + EnumChatFormatting.RESET) - + (mMetaTileEntity == null - ? EnumChatFormatting.RED + " MetaTileEntity == null!" + EnumChatFormatting.RESET - : " ")); + "Meta-ID: " + EnumChatFormatting.BLUE + + mID + + EnumChatFormatting.RESET + + (canAccessData() ? EnumChatFormatting.GREEN + " valid" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + " invalid" + EnumChatFormatting.RESET) + + (mMetaTileEntity == null + ? EnumChatFormatting.RED + " MetaTileEntity == null!" + EnumChatFormatting.RESET + : " ")); } if (aLogLevel > 1) { if (mTimeStatistics.length > 0) { @@ -799,41 +795,41 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec // tList.add("tTime " + tTime); } tList.add( - "Average CPU load of ~" + GT_Utility.formatNumbers(tAverageTime / mTimeStatistics.length) - + "ns over " - + GT_Utility.formatNumbers(mTimeStatistics.length) - + " ticks with worst time of " - + GT_Utility.formatNumbers(tWorstTime) - + "ns."); + "Average CPU load of ~" + GT_Utility.formatNumbers(tAverageTime / mTimeStatistics.length) + + "ns over " + + GT_Utility.formatNumbers(mTimeStatistics.length) + + " ticks with worst time of " + + GT_Utility.formatNumbers(tWorstTime) + + "ns."); tList.add( - "Recorded " + GT_Utility.formatNumbers(mMetaTileEntity.mSoundRequests) - + " sound requests in " - + GT_Utility.formatNumbers(mTickTimer - mLastCheckTick) - + " ticks."); + "Recorded " + GT_Utility.formatNumbers(mMetaTileEntity.mSoundRequests) + + " sound requests in " + + GT_Utility.formatNumbers(mTickTimer - mLastCheckTick) + + " ticks."); mLastCheckTick = mTickTimer; mMetaTileEntity.mSoundRequests = 0; } if (mLagWarningCount > 0) { tList.add( - "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) - + " Lag Spike Warnings (anything taking longer than " - + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING - + "ms) on the Server."); + "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + + " Lag Spike Warnings (anything taking longer than " + + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + + "ms) on the Server."); } tList.add( - "Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " - : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you"); + "Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " + : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you"); } if (aLogLevel > 0) { if (getSteamCapacity() > 0 && hasSteamEngineUpgrade()) tList.add( - GT_Utility.formatNumbers(getStoredSteam()) + " of " - + GT_Utility.formatNumbers(getSteamCapacity()) - + " Steam"); + GT_Utility.formatNumbers(getStoredSteam()) + " of " + + GT_Utility.formatNumbers(getSteamCapacity()) + + " Steam"); tList.add( - "Machine is " + (mActive ? EnumChatFormatting.GREEN + "active" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "inactive" + EnumChatFormatting.RESET)); - if (!mHasEnoughEnergy) tList.add( - EnumChatFormatting.RED + "ATTENTION: This Device needs more power." + EnumChatFormatting.RESET); + "Machine is " + (mActive ? EnumChatFormatting.GREEN + "active" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "inactive" + EnumChatFormatting.RESET)); + if (!mHasEnoughEnergy) tList + .add(EnumChatFormatting.RED + "ATTENTION: This Device needs more power." + EnumChatFormatting.RESET); } if (joinedIc2Enet) tList.add("Joined IC2 ENet"); return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList); @@ -892,8 +888,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (canAccessData()) { markDirty(); mMetaTileEntity.setInventorySlotContents( - aIndex, - worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); + aIndex, + worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); } } @@ -923,10 +919,10 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public boolean isUseableByPlayer(EntityPlayer aPlayer) { return canAccessData() && playerOwnsThis(aPlayer, false) - && mTickTimer > 40 - && getTileEntityOffset(0, 0, 0) == this - && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 - && mMetaTileEntity.isAccessAllowed(aPlayer); + && mTickTimer > 40 + && getTileEntityOffset(0, 0, 0) == this + && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 + && mMetaTileEntity.isAccessAllowed(aPlayer); } @Override @@ -1063,7 +1059,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) { if (!canAccessData()) return false; return mHasEnoughEnergy = decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy) || decreaseStoredSteam(aEnergy, false) - || (aIgnoreTooLessEnergy && (decreaseStoredSteam(aEnergy, true))); + || (aIgnoreTooLessEnergy && (decreaseStoredSteam(aEnergy, true))); } @Override @@ -1115,7 +1111,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec public void generatePowerNodes() { if (isServerSide() && (isEnetInput() || isEnetOutput())) { final int time = MinecraftServer.getServer() - .getTickCounter(); + .getTickCounter(); for (byte i : ALL_VALID_SIDES) { if (outputsEnergyTo(i, false) || inputEnergyFrom(i, false)) { final IGregTechTileEntity TE = getIGregTechTileEntityAtSide(i); @@ -1206,14 +1202,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec public ITexture[] getTexture(Block aBlock, byte aSide) { final ITexture coverTexture = getCoverTexture(aSide); final ITexture[] textureUncovered = hasValidMetaTileEntity() - ? mMetaTileEntity.getTexture( - this, - aSide, - mFacing, - (byte) (mColor - 1), - mActive, - getOutputRedstoneSignal(aSide) > 0) - : Textures.BlockIcons.ERROR_RENDERING; + ? mMetaTileEntity + .getTexture(this, aSide, mFacing, (byte) (mColor - 1), mActive, getOutputRedstoneSignal(aSide) > 0) + : Textures.BlockIcons.ERROR_RENDERING; final ITexture[] textureCovered; if (coverTexture != null) { textureCovered = Arrays.copyOf(textureUncovered, textureUncovered.length + 1); @@ -1303,9 +1294,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec setOwnerName(aPlayer.getDisplayName()); setOwnerUuid(aPlayer.getUniqueID()); } else return !privateAccess() || aPlayer.getDisplayName() - .equals("Player") - || mOwnerName.equals("Player") - || mOwnerName.equals(aPlayer.getDisplayName()); + .equals("Player") || mOwnerName.equals("Player") || mOwnerName.equals(aPlayer.getDisplayName()); return true; } @@ -1317,18 +1306,18 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec public void doEnergyExplosion() { if (getUniversalEnergyCapacity() > 0 && getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 5) { GT_Log.exp.println( - "Energy Explosion, injected " + getUniversalEnergyStored() - + "EU >= " - + getUniversalEnergyCapacity() / 5D - + "Capacity of the Machine!"); + "Energy Explosion, injected " + getUniversalEnergyStored() + + "EU >= " + + getUniversalEnergyCapacity() / 5D + + "Capacity of the Machine!"); doExplosion( - oOutput * (getUniversalEnergyStored() >= getUniversalEnergyCapacity() ? 4 - : getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 2 ? 2 : 1)); + oOutput * (getUniversalEnergyStored() >= getUniversalEnergyCapacity() ? 4 + : getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 2 ? 2 : 1)); GT_Mod.achievements.issueAchievement( - this.getWorldObj() - .getPlayerEntityByName(mOwnerName), - "electricproblems"); + this.getWorldObj() + .getPlayerEntityByName(mOwnerName), + "electricproblems"); } } @@ -1370,16 +1359,16 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec public void dropItems(ItemStack tItem) { if (tItem == null) return; final EntityItem tItemEntity = new EntityItem( - this.worldObj, - this.xCoord + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, - this.yCoord + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, - this.zCoord + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, - new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + this.worldObj, + this.xCoord + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + this.yCoord + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + this.zCoord + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, + new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { tItemEntity.getEntityItem() - .setTagCompound( - (NBTTagCompound) tItem.getTagCompound() - .copy()); + .setTagCompound( + (NBTTagCompound) tItem.getTagCompound() + .copy()); } tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D); tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D); @@ -1428,7 +1417,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final byte tSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) - : aSide; + : aSide; return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) { return true; @@ -1439,21 +1428,38 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (isServerSide()) { if (!privateAccess() || aPlayer.getDisplayName() - .equalsIgnoreCase(getOwnerName())) { + .equalsIgnoreCase(getOwnerName())) { final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { tCurrentItem.func_150996_a(Items.bucket); setColorization((byte) (getColorization() >= 16 ? -2 : -1)); return true; } if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { if (aPlayer.isSneaking() && mMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine - && ((GT_MetaTileEntity_BasicMachine) mMetaTileEntity).setMainFacing( - GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ))) { + && ((GT_MetaTileEntity_BasicMachine) mMetaTileEntity) + .setMainFacing(GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ))) { GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); GT_Utility.sendSoundToPlayers( + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); + cableUpdateDelay = 10; + } else if (mMetaTileEntity.onWrenchRightClick( + aSide, + GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ), + aPlayer, + aX, + aY, + aZ)) { + GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); + GT_Utility.sendSoundToPlayers( worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, @@ -1461,50 +1467,33 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec xCoord, yCoord, zCoord); - cableUpdateDelay = 10; - } else if (mMetaTileEntity.onWrenchRightClick( - aSide, - GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ), - aPlayer, - aX, - aY, - aZ)) { - GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - cableUpdateDelay = 10; - } + cableUpdateDelay = 10; + } return true; } if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( + aSide, + getCoverBehaviorAtSideNew(aSide).onCoverScrewdriverClick( aSide, - getCoverBehaviorAtSideNew(aSide).onCoverScrewdriverClick( - aSide, - getCoverIDAtSide(aSide), - getComplexCoverDataAtSide(aSide), - this, - aPlayer, - aX, - aY, - aZ)); + getCoverIDAtSide(aSide), + getComplexCoverDataAtSide(aSide), + this, + aPlayer, + aX, + aY, + aZ)); mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -1514,21 +1503,20 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec mInputDisabled = !mInputDisabled; if (mInputDisabled) mOutputDisabled = !mOutputDisabled; GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("086", "Auto-Input: ") - + (mInputDisabled ? GT_Utility.trans("087", "Disabled") - : GT_Utility.trans("088", "Enabled") - + GT_Utility.trans("089", " Auto-Output: ") - + (mOutputDisabled ? GT_Utility.trans("087", "Disabled") - : GT_Utility.trans("088", "Enabled")))); + aPlayer, + GT_Utility.trans("086", "Auto-Input: ") + (mInputDisabled + ? GT_Utility.trans("087", "Disabled") + : GT_Utility.trans("088", "Enabled") + GT_Utility.trans("089", " Auto-Output: ") + + (mOutputDisabled ? GT_Utility.trans("087", "Disabled") + : GT_Utility.trans("088", "Enabled")))); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_ANVIL_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_ANVIL_USE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -1539,20 +1527,20 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec else enableWorking(); { String tChat = GT_Utility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") - : GT_Utility.trans("087", "Disabled")); + + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") + : GT_Utility.trans("087", "Disabled")); if (getMetaTileEntity() != null && getMetaTileEntity().hasAlternativeModeText()) tChat = getMetaTileEntity().getAlternativeModeText(); GT_Utility.sendChatToPlayer(aPlayer, tChat); } GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -1562,29 +1550,29 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (mMetaTileEntity.onSolderingToolRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) { // logic handled internally GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_BATTERY_USE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= (1 << tSide); GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("091", "Redstone Output at Side ") + tSide - + GT_Utility.trans("092", " set to: ") - + ((mStrongRedstone & (1 << tSide)) != 0 ? GT_Utility.trans("093", "Strong") - : GT_Utility.trans("094", "Weak"))); + aPlayer, + GT_Utility.trans("091", "Redstone Output at Side ") + tSide + + GT_Utility.trans("092", " set to: ") + + ((mStrongRedstone & (1 << tSide)) != 0 ? GT_Utility.trans("093", "Strong") + : GT_Utility.trans("094", "Weak"))); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 3.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_BATTERY_USE, + 3.0F, + -1, + xCoord, + yCoord, + zCoord); issueBlockUpdate(); } doEnetUpdate(); @@ -1597,13 +1585,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (mMetaTileEntity.onWireCutterRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) { // logic handled internally GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } doEnetUpdate(); cableUpdateDelay = 10; @@ -1616,18 +1604,18 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (getCoverIDAtSide(coverSide) == 0) { if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { if (GregTech_API.getCoverBehaviorNew(tCurrentItem) - .isCoverPlaceable(coverSide, tCurrentItem, this) - && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + .isCoverPlaceable(coverSide, tCurrentItem, this) + && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); sendClientData(); } return true; @@ -1636,13 +1624,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_BREAK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_BREAK, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); dropCover(coverSide, aSide, false); } return true; @@ -1651,25 +1639,24 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec // End item != null } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. aSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) - : aSide; + : aSide; return getCoverIDAtSide(aSide) > 0 && getCoverBehaviorAtSideNew(aSide).onCoverShiftRightClick( - aSide, - getCoverIDAtSide(aSide), - getComplexCoverDataAtSide(aSide), - this, - aPlayer); - } - - if (getCoverBehaviorAtSideNew(aSide).onCoverRightClick( aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this, - aPlayer, - aX, - aY, - aZ)) - return true; + aPlayer); + } + + if (getCoverBehaviorAtSideNew(aSide).onCoverRightClick( + aSide, + getCoverIDAtSide(aSide), + getComplexCoverDataAtSide(aSide), + this, + aPlayer, + aX, + aY, + aZ)) return true; if (!getCoverInfoAtSide(aSide).isGUIClickable()) return false; @@ -1677,13 +1664,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) { if (addMufflerUpgrade()) { GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_CLICK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_CLICK, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; } return true; @@ -1694,13 +1681,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec setOwnerName(aPlayer.getDisplayName()); setOwnerUuid(aPlayer.getUniqueID()); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_CLICK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_CLICK, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; } return true; @@ -1714,7 +1701,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ); } catch (Throwable e) { GT_Log.err.println( - "Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); + "Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); e.printStackTrace(GT_Log.err); e.printStackTrace(); } @@ -1728,7 +1715,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer); } catch (Throwable e) { GT_Log.err.println( - "Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); + "Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); e.printStackTrace(GT_Log.err); } } @@ -1782,8 +1769,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { return canAccessData() && (mRunningThroughTick || !mInputDisabled) - && getCoverInfoAtSide((byte) aSide).letsItemsIn(aIndex) - && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); + && getCoverInfoAtSide((byte) aSide).letsItemsIn(aIndex) + && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); } /** @@ -1792,13 +1779,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { return canAccessData() && (mRunningThroughTick || !mOutputDisabled) - && getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut( - (byte) aSide, - getCoverIDAtSide((byte) aSide), - getComplexCoverDataAtSide((byte) aSide), - aIndex, - this) - && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); + && getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut( + (byte) aSide, + getCoverIDAtSide((byte) aSide), + getComplexCoverDataAtSide((byte) aSide), + aIndex, + this) + && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); } @Override @@ -1875,9 +1862,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec mMetaTileEntity = (MetaTileEntity) aMetaTileEntity; else { GT_FML_LOGGER.error( - "Unknown meta tile entity set! Class {}, inventory name {}.", - aMetaTileEntity.getClass(), - aMetaTileEntity.getInventoryName()); + "Unknown meta tile entity set! Class {}, inventory name {}.", + aMetaTileEntity.getClass(), + aMetaTileEntity.getInventoryName()); } } @@ -1952,25 +1939,24 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { if (!canAccessData() || !mMetaTileEntity.isElectric() - || !inputEnergyFrom(aSide) - || aAmperage <= 0 - || aVoltage <= 0 - || getStoredEU() >= getEUCapacity() - || mMetaTileEntity.maxAmperesIn() <= mAcceptedAmperes) - return 0; + || !inputEnergyFrom(aSide) + || aAmperage <= 0 + || aVoltage <= 0 + || getStoredEU() >= getEUCapacity() + || mMetaTileEntity.maxAmperesIn() <= mAcceptedAmperes) return 0; if (aVoltage > getInputVoltage()) { - GT_Log.exp.println( - "Energy Explosion, injected " + aVoltage + "EU/t in a " + getInputVoltage() + "EU/t Machine!"); + GT_Log.exp + .println("Energy Explosion, injected " + aVoltage + "EU/t in a " + getInputVoltage() + "EU/t Machine!"); doExplosion(aVoltage); return 0; } if (increaseStoredEnergyUnits( - aVoltage * (aAmperage = Math.min( - aAmperage, - Math.min( - mMetaTileEntity.maxAmperesIn() - mAcceptedAmperes, - 1 + ((getEUCapacity() - getStoredEU()) / aVoltage)))), - true)) { + aVoltage * (aAmperage = Math.min( + aAmperage, + Math.min( + mMetaTileEntity.maxAmperesIn() - mAcceptedAmperes, + 1 + ((getEUCapacity() - getStoredEU()) / aVoltage)))), + true)) { mAverageEUInput[mAverageEUInputIndex] += aVoltage * aAmperage; mAcceptedAmperes += aAmperage; return aAmperage; @@ -1981,9 +1967,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { if (!canAccessData() || !mMetaTileEntity.isElectric() - || !outputsEnergyTo(aSide) - || getStoredEU() - (aVoltage * aAmperage) < mMetaTileEntity.getMinimumStoredEU()) - return false; + || !outputsEnergyTo(aSide) + || getStoredEU() - (aVoltage * aAmperage) < mMetaTileEntity.getMinimumStoredEU()) return false; if (decreaseStoredEU(aVoltage * aAmperage, false)) { mAverageEUOutput[mAverageEUOutputIndex] += aVoltage * aAmperage; return true; @@ -2006,10 +1991,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { if (mTickTimer > 5 && canAccessData() - && (mRunningThroughTick || !mInputDisabled) - && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn( - aFluid == null ? null : aFluid.getFluid())))) + && (mRunningThroughTick || !mInputDisabled) + && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid == null ? null : aFluid.getFluid())))) return mMetaTileEntity.fill(aSide, aFluid, doFill); return 0; } @@ -2017,12 +2001,12 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { if (mTickTimer > 5 && canAccessData() - && (mRunningThroughTick || !mOutputDisabled) - && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut( - mMetaTileEntity.getFluid() == null ? null - : mMetaTileEntity.getFluid() - .getFluid())))) + && (mRunningThroughTick || !mOutputDisabled) + && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut( + mMetaTileEntity.getFluid() == null ? null + : mMetaTileEntity.getFluid() + .getFluid())))) return mMetaTileEntity.drain(aSide, maxDrain, doDrain); return null; } @@ -2030,10 +2014,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) { if (mTickTimer > 5 && canAccessData() - && (mRunningThroughTick || !mOutputDisabled) - && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut( - aFluid == null ? null : aFluid.getFluid())))) + && (mRunningThroughTick || !mOutputDisabled) + && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid == null ? null : aFluid.getFluid())))) return mMetaTileEntity.drain(aSide, aFluid, doDrain); return null; } @@ -2041,9 +2024,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public boolean canFill(ForgeDirection aSide, Fluid aFluid) { if (mTickTimer > 5 && canAccessData() - && (mRunningThroughTick || !mInputDisabled) - && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid)))) + && (mRunningThroughTick || !mInputDisabled) + && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid)))) return mMetaTileEntity.canFill(aSide, aFluid); return false; } @@ -2051,9 +2034,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public boolean canDrain(ForgeDirection aSide, Fluid aFluid) { if (mTickTimer > 5 && canAccessData() - && (mRunningThroughTick || !mOutputDisabled) - && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid)))) + && (mRunningThroughTick || !mOutputDisabled) + && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid)))) return mMetaTileEntity.canDrain(aSide, aFluid); return false; } @@ -2063,8 +2046,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec final byte tSide = (byte) aSide.ordinal(); if (canAccessData() && (aSide == ForgeDirection.UNKNOWN - || (mMetaTileEntity.isLiquidInput(tSide) && getCoverInfoAtSide(tSide).letsFluidIn(null)) - || (mMetaTileEntity.isLiquidOutput(tSide) && getCoverInfoAtSide(tSide).letsFluidOut(null)))) + || (mMetaTileEntity.isLiquidInput(tSide) && getCoverInfoAtSide(tSide).letsFluidIn(null)) + || (mMetaTileEntity.isLiquidOutput(tSide) && getCoverInfoAtSide(tSide).letsFluidOut(null)))) return mMetaTileEntity.getTankInfo(aSide); return new FluidTankInfo[] {}; } @@ -2096,8 +2079,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec public double getOfferedEnergy() { return (canAccessData() && getStoredEU() - mMetaTileEntity.getMinimumStoredEU() >= oOutput) - ? Math.max(0, oOutput) - : 0; + ? Math.max(0, oOutput) + : 0; } public void drawEnergy(double amount) { @@ -2176,8 +2159,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec return true; } aStack = GT_OreDictUnificator.get(aStack); - if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize - <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { + if (GT_Utility.areStacksEqual(tStack, aStack) + && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { tStack.stackSize += aStack.stackSize; markDirty(); return true; @@ -2235,7 +2218,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); } @@ -2271,8 +2254,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (nbtVersion < 1000000) nbtVersion *= 1000; // 4 is old GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT if (nbtVersion < configCircuitAdditionVersion && getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine - && slotIndex >= 4) - slotIndex += 1; + && slotIndex >= 4) slotIndex += 1; if (mID >= 211 && mID <= 218) { // Assembler if (nbtVersion < chemistryUpdateVersion) { oldInputSize = 2; @@ -2417,8 +2399,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public IAlignment getAlignment() { return getMetaTileEntity() instanceof IAlignmentProvider - ? ((IAlignmentProvider) getMetaTileEntity()).getAlignment() - : getMetaTileEntity() instanceof IAlignment ? (IAlignment) getMetaTileEntity() : null; + ? ((IAlignmentProvider) getMetaTileEntity()).getAlignment() + : getMetaTileEntity() instanceof IAlignment ? (IAlignment) getMetaTileEntity() : null; } @Nullable diff --git a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java index 3ef732b1c8..a73481d89f 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -78,7 +78,7 @@ import ic2.api.energy.event.EnergyTileUnloadEvent; * Basically everything a TileEntity should have. */ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObjectAndCoords, IIC2Enet, IGTEnet, - ITileWithModularUI, IAddGregtechLogo, IGetGUITextureSet, IAddInventorySlots { + ITileWithModularUI, IAddGregtechLogo, IGetGUITextureSet, IAddInventorySlots { protected boolean mInventoryChanged = false; @@ -108,7 +108,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje if (aPlayer.rotationPitch >= 65 && aAllowedFacings[SIDE_UP]) return SIDE_UP; if (aPlayer.rotationPitch <= -65 && aAllowedFacings[SIDE_DOWN]) return SIDE_DOWN; final byte rFacing = COMPASS_DIRECTIONS[MathHelper.floor_double(0.5D + 4.0F * aPlayer.rotationYaw / 360.0F) - & 0x3]; + & 0x3]; if (aAllowedFacings[rFacing]) return rFacing; } for (final byte tSide : ALL_VALID_SIDES) if (aAllowedFacings[tSide]) return tSide; @@ -202,7 +202,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public int getRandomNumber(int aRange) { return ThreadLocalRandom.current() - .nextInt(aRange); + .nextInt(aRange); } @Override @@ -409,8 +409,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje public Block getBlock(ChunkCoordinates aCoords) { if (worldObj == null) return Blocks.air; if (ignoreUnloadedChunks && crossedChunkBorder(aCoords) - && !worldObj.blockExists(aCoords.posX, aCoords.posY, aCoords.posZ)) - return Blocks.air; + && !worldObj.blockExists(aCoords.posX, aCoords.posY, aCoords.posZ)) return Blocks.air; return worldObj.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ); } @@ -473,7 +472,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje return getTileEntityAtSide(aSide); } if (mBufferedTileEntities[aSide].xCoord == tX && mBufferedTileEntities[aSide].yCoord == tY - && mBufferedTileEntities[aSide].zCoord == tZ) { + && mBufferedTileEntities[aSide].zCoord == tZ) { return mBufferedTileEntities[aSide]; } return null; @@ -530,10 +529,10 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje // update if it was / is strong powered. if (((((mStrongRedstone | oStrongRedstone) >>> dir.ordinal()) & 1) != 0) - && getBlock(x1, y1, z1).isNormalCube()) { + && getBlock(x1, y1, z1).isNormalCube()) { final int skipUpdateSide = dir.getOpposite() - .ordinal(); // Don't update this block. Still updates - // diagonal blocks twice if conditions + .ordinal(); // Don't update this block. Still updates + // diagonal blocks twice if conditions // meet. for (final ForgeDirection dir2 : ForgeDirection.VALID_DIRECTIONS) { @@ -549,10 +548,10 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public final void sendBlockEvent(byte aID, byte aValue) { NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_Block_Event(xCoord, (short) yCoord, zCoord, aID, aValue), - xCoord, - zCoord); + worldObj, + new GT_Packet_Block_Event(xCoord, (short) yCoord, zCoord, aID, aValue), + xCoord, + zCoord); } protected boolean crossedChunkBorder(int aX, int aZ) { @@ -662,18 +661,17 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje // Tooltip localization keys public static final String BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", - BATTERY_SLOT_TOOLTIP_ALT = "GT5U.machines.battery_slot.tooltip.alternative", - UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", - SPECIAL_SLOT_TOOLTIP = "GT5U.machines.special_slot.tooltip", - FLUID_INPUT_TOOLTIP = "GT5U.machines.fluid_input_slot.tooltip", - FLUID_OUTPUT_TOOLTIP = "GT5U.machines.fluid_output_slot.tooltip", - STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", - STALLED_VENT_TOOLTIP = "GT5U.machines.stalled_vent.tooltip", - FLUID_TRANSFER_TOOLTIP = "GT5U.machines.fluid_transfer.tooltip", - ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", - POWER_SOURCE_KEY = "GT5U.machines.powersource.", - NEI_TRANSFER_STEAM_TOOLTIP = "GT5U.machines.nei_transfer.steam.tooltip", - NEI_TRANSFER_VOLTAGE_TOOLTIP = "GT5U.machines.nei_transfer.voltage.tooltip"; + BATTERY_SLOT_TOOLTIP_ALT = "GT5U.machines.battery_slot.tooltip.alternative", + UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", + SPECIAL_SLOT_TOOLTIP = "GT5U.machines.special_slot.tooltip", + FLUID_INPUT_TOOLTIP = "GT5U.machines.fluid_input_slot.tooltip", + FLUID_OUTPUT_TOOLTIP = "GT5U.machines.fluid_output_slot.tooltip", + STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", + STALLED_VENT_TOOLTIP = "GT5U.machines.stalled_vent.tooltip", + FLUID_TRANSFER_TOOLTIP = "GT5U.machines.fluid_transfer.tooltip", + ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", POWER_SOURCE_KEY = "GT5U.machines.powersource.", + NEI_TRANSFER_STEAM_TOOLTIP = "GT5U.machines.nei_transfer.steam.tooltip", + NEI_TRANSFER_VOLTAGE_TOOLTIP = "GT5U.machines.nei_transfer.voltage.tooltip"; public static final int TOOLTIP_DELAY = 5; @@ -709,46 +707,45 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje if (NetworkUtils.isClient()) { final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; // noinspection unchecked - final List titleLines = fontRenderer.listFormattedStringToWidth( - title, - getGUIWidth() - (TAB_PADDING + TITLE_PADDING) * 2); + final List titleLines = fontRenderer + .listFormattedStringToWidth(title, getGUIWidth() - (TAB_PADDING + TITLE_PADDING) * 2); titleWidth = titleLines.size() > 1 ? getGUIWidth() - (TAB_PADDING + TITLE_PADDING) * 2 - : fontRenderer.getStringWidth(title); + : fontRenderer.getStringWidth(title); // noinspection PointlessArithmeticExpression titleHeight = titleLines.size() * fontRenderer.FONT_HEIGHT + (titleLines.size() - 1) * 1; } final DrawableWidget tab = new DrawableWidget(); final TextWidget text = new TextWidget(title).setDefaultColor(getTitleColor()) - .setTextAlignment(Alignment.CenterLeft) - .setMaxWidth(titleWidth); + .setTextAlignment(Alignment.CenterLeft) + .setMaxWidth(titleWidth); if (GT_Mod.gregtechproxy.mTitleTabStyle == 1) { tab.setDrawable(getGUITextureSet().getTitleTabAngular()) - .setPos(0, -(titleHeight + TAB_PADDING) + 1) - .setSize(getGUIWidth(), titleHeight + TAB_PADDING * 2); + .setPos(0, -(titleHeight + TAB_PADDING) + 1) + .setSize(getGUIWidth(), titleHeight + TAB_PADDING * 2); text.setPos(TAB_PADDING + TITLE_PADDING, -titleHeight + TAB_PADDING); } else { tab.setDrawable(getGUITextureSet().getTitleTabDark()) - .setPos(0, -(titleHeight + TAB_PADDING * 2) + 1) - .setSize(titleWidth + (TAB_PADDING + TITLE_PADDING) * 2, titleHeight + TAB_PADDING * 2 - 1); + .setPos(0, -(titleHeight + TAB_PADDING * 2) + 1) + .setSize(titleWidth + (TAB_PADDING + TITLE_PADDING) * 2, titleHeight + TAB_PADDING * 2 - 1); text.setPos(TAB_PADDING + TITLE_PADDING, -titleHeight); } builder.widget(tab) - .widget(text); + .widget(text); } protected void addTitleItemIconStyle(ModularWindow.Builder builder, String title) { builder.widget( - new MultiChildWidget().addChild( - new DrawableWidget().setDrawable(getGUITextureSet().getTitleTabNormal()) - .setPos(0, 0) - .setSize(24, 24)) - .addChild( - new ItemDrawable(getStackForm(1)).asWidget() - .setPos(4, 4)) - .addTooltip(title) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(0, -24 + 3)); + new MultiChildWidget().addChild( + new DrawableWidget().setDrawable(getGUITextureSet().getTitleTabNormal()) + .setPos(0, 0) + .setSize(24, 24)) + .addChild( + new ItemDrawable(getStackForm(1)).asWidget() + .setPos(4, 4)) + .addTooltip(title) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(0, -24 + 3)); } @Override @@ -763,9 +760,9 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(152, 63)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(152, 63)); } protected int getGUIWidth() { @@ -789,12 +786,12 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje background = new IDrawable[] { getGUITextureSet().getItemSlot() }; } builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 1) - .startFromSlot(0) - .endAtSlot(0) - .background(background) - .build() - .setPos(79, 34)); + SlotGroup.ofItemHandler(inventoryHandler, 1) + .startFromSlot(0) + .endAtSlot(0) + .background(background) + .build() + .setPos(79, 34)); } @Override @@ -806,12 +803,12 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje background = new IDrawable[] { getGUITextureSet().getItemSlot() }; } builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(0) - .endAtSlot(3) - .background(background) - .build() - .setPos(70, 25)); + SlotGroup.ofItemHandler(inventoryHandler, 2) + .startFromSlot(0) + .endAtSlot(3) + .background(background) + .build() + .setPos(70, 25)); } @Override @@ -823,12 +820,12 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje background = new IDrawable[] { getGUITextureSet().getItemSlot() }; } builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(0) - .endAtSlot(8) - .background(background) - .build() - .setPos(61, 16)); + SlotGroup.ofItemHandler(inventoryHandler, 3) + .startFromSlot(0) + .endAtSlot(8) + .background(background) + .build() + .setPos(61, 16)); } @Override @@ -840,12 +837,12 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje background = new IDrawable[] { getGUITextureSet().getItemSlot() }; } builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(0) - .endAtSlot(15) - .background(background) - .build() - .setPos(52, 7)); + SlotGroup.ofItemHandler(inventoryHandler, 4) + .startFromSlot(0) + .endAtSlot(15) + .background(background) + .build() + .setPos(52, 7)); } public void addCoverTabs(ModularWindow.Builder builder, UIBuildContext buildContext) { @@ -885,9 +882,8 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje final List tCircuits = ccs.getConfigurationCircuits(); final int index = GT_Utility.findMatchingStackInList(tCircuits, cursorStack); if (index < 0) { - int curIndex = GT_Utility.findMatchingStackInList( - tCircuits, - inv.getStackInSlot(ccs.getCircuitSlot())) + 1; + int curIndex = GT_Utility + .findMatchingStackInList(tCircuits, inv.getStackInSlot(ccs.getCircuitSlot())) + 1; if (clickData.mouseButton == 0) { curIndex += 1; } else { @@ -911,25 +907,25 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public List getExtraTooltip() { return Arrays.asList( - EnumChatFormatting.DARK_GRAY + EnumChatFormatting.getTextWithoutFormattingCodes( - StatCollector.translateToLocal("GT5U.machines.select_circuit.tooltip.1")), - EnumChatFormatting.DARK_GRAY + EnumChatFormatting.getTextWithoutFormattingCodes( - StatCollector.translateToLocal("GT5U.machines.select_circuit.tooltip.2")), - EnumChatFormatting.DARK_GRAY + EnumChatFormatting.getTextWithoutFormattingCodes( - StatCollector.translateToLocal("GT5U.machines.select_circuit.tooltip.3"))); + EnumChatFormatting.DARK_GRAY + EnumChatFormatting.getTextWithoutFormattingCodes( + StatCollector.translateToLocal("GT5U.machines.select_circuit.tooltip.1")), + EnumChatFormatting.DARK_GRAY + EnumChatFormatting.getTextWithoutFormattingCodes( + StatCollector.translateToLocal("GT5U.machines.select_circuit.tooltip.2")), + EnumChatFormatting.DARK_GRAY + EnumChatFormatting.getTextWithoutFormattingCodes( + StatCollector.translateToLocal("GT5U.machines.select_circuit.tooltip.3"))); } }.setOverwriteItemStackTooltip(list -> { list.removeIf( - line -> line.contains(StatCollector.translateToLocal("gt.integrated_circuit.tooltip.0")) - || line.contains(StatCollector.translateToLocal("gt.integrated_circuit.tooltip.1"))); + line -> line.contains(StatCollector.translateToLocal("gt.integrated_circuit.tooltip.0")) + || line.contains(StatCollector.translateToLocal("gt.integrated_circuit.tooltip.1"))); return list; }) - .disableShiftInsert() - .setHandlePhantomActionClient(true) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) - .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.select_circuit.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(ccs.getCircuitSlotX() - 1, ccs.getCircuitSlotY() - 1)); + .disableShiftInsert() + .setHandlePhantomActionClient(true) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_INT_CIRCUIT) + .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.select_circuit.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(ccs.getCircuitSlotX() - 1, ccs.getCircuitSlotY() - 1)); } protected void openSelectCircuitDialog(ModularUIContext uiContext, AtomicBoolean dialogOpened) { @@ -940,23 +936,16 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje final List circuits = ccs.getConfigurationCircuits(); uiContext.openClientWindow( - player -> new SelectItemUIFactory( - StatCollector.translateToLocal("GT5U.machines.select_circuit"), - getStackForm(0), - this::onCircuitSelected, - circuits, - GT_Utility.findMatchingStackInList(circuits, inv.getStackInSlot(ccs.getCircuitSlot()))) - .setAnotherWindow( - true, - dialogOpened) - .setGuiTint( - getGUIColorization()) - .setCurrentGetter( - () -> inv.getStackInSlot( - ccs.getCircuitSlot())) - .createWindow( - new UIBuildContext( - player))); + player -> new SelectItemUIFactory( + StatCollector.translateToLocal("GT5U.machines.select_circuit"), + getStackForm(0), + this::onCircuitSelected, + circuits, + GT_Utility.findMatchingStackInList(circuits, inv.getStackInSlot(ccs.getCircuitSlot()))) + .setAnotherWindow(true, dialogOpened) + .setGuiTint(getGUIColorization()) + .setCurrentGetter(() -> inv.getStackInSlot(ccs.getCircuitSlot())) + .createWindow(new UIBuildContext(player))); } protected void onCircuitSelected(ItemStack selected) { diff --git a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java index 9bbc853963..5fa9cbfaee 100644 --- a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java @@ -35,7 +35,7 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity implement } else { if (hasValidMetaTileEntity()) getMetaTileEntity().setBaseMetaTileEntity(null); GregTech_API.METATILEENTITIES[aID].newMetaEntity(this) - .setBaseMetaTileEntity(this); + .setBaseMetaTileEntity(this); mTickTimer = 0; mID = aID; return true; diff --git a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java index 4167bf1701..f2cd7e3019 100644 --- a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java @@ -64,9 +64,9 @@ import gregtech.common.covers.GT_Cover_Fluidfilter; public abstract class CoverableTileEntity extends BaseTileEntity implements ICoverable, IGregtechWailaProvider { public static final String[] COVER_DATA_NBT_KEYS = Arrays.stream(ForgeDirection.VALID_DIRECTIONS) - .mapToInt(Enum::ordinal) - .mapToObj(i -> "mCoverData" + i) - .toArray(String[]::new); + .mapToInt(Enum::ordinal) + .mapToObj(i -> "mCoverData" + i) + .toArray(String[]::new); // New Cover Information protected final CoverInfo[] coverInfos = new CoverInfo[] { null, null, null, null, null, null }; @@ -78,8 +78,8 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov /* Deprecated Cover Variables */ @Deprecated protected final GT_CoverBehaviorBase[] mCoverBehaviors = new GT_CoverBehaviorBase[] { - GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, - GregTech_API.sNoBehavior, GregTech_API.sNoBehavior }; + GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, + GregTech_API.sNoBehavior, GregTech_API.sNoBehavior }; @Deprecated protected int[] mCoverSides = new int[] { 0, 0, 0, 0, 0, 0 }; @@ -105,9 +105,9 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov // Backwards compat, in case of a revert... for now tList.appendTag(coverInfo.writeToNBT(new NBTTagCompound())); aNBT.setTag( - COVER_DATA_NBT_KEYS[i], - coverInfo.getCoverData() - .saveDataToNBT()); + COVER_DATA_NBT_KEYS[i], + coverInfo.getCoverData() + .saveDataToNBT()); } if (tList.tagCount() > 0) { aNBT.setTag(GT_Values.NBT.COVERS, tList); @@ -126,7 +126,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov protected void readCoverNBT(NBTTagCompound aNBT) { mRedstone = aNBT.getBoolean("mRedstone"); mSidedRedstone = aNBT.hasKey("mRedstoneSided") ? aNBT.getByteArray("mRedstoneSided") - : new byte[] { 15, 15, 15, 15, 15, 15 }; + : new byte[] { 15, 15, 15, 15, 15, 15 }; mStrongRedstone = aNBT.getByte("mStrongRedstone"); if (aNBT.hasKey(GT_Values.NBT.COVERS)) { @@ -148,7 +148,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov public void readLegacyCoverInfoNBT(NBTTagCompound aNBT) { final int[] coverIDs = aNBT.hasKey("mCoverSides") ? aNBT.getIntArray("mCoverSides") - : new int[] { 0, 0, 0, 0, 0, 0 }; + : new int[] { 0, 0, 0, 0, 0, 0 }; final boolean hasOldCoverData = (aNBT.hasKey("mCoverData", 11) && aNBT.getIntArray("mCoverData").length == 6); final int[] tOldData = hasOldCoverData ? aNBT.getIntArray("mCoverData") : new int[] {}; @@ -165,10 +165,8 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final String filterKey = String.format("fluidFilter%d", i); if (aNBT.hasKey(filterKey)) { coverData = coverInfo.getCoverBehavior() - .createDataObject( - (tOldData[i] & 7) - | (FluidRegistry.getFluidID(aNBT.getString(filterKey)) - << 3)); + .createDataObject( + (tOldData[i] & 7) | (FluidRegistry.getFluidID(aNBT.getString(filterKey)) << 3)); } } else { coverData = coverBehavior.createDataObject(tOldData[i]); @@ -245,10 +243,10 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov return Textures.BlockIcons.HIDDEN_TEXTURE[0]; // See through } final ITexture coverTexture = (!(this instanceof BaseMetaPipeEntity)) ? coverInfo.getSpecialCoverFGTexture() - : coverInfo.getSpecialCoverTexture(); + : coverInfo.getSpecialCoverTexture(); return coverTexture != null ? coverTexture - : GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide))); + : GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide))); } protected void requestCoverDataIfNeeded() { @@ -299,9 +297,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov public void setCoverDataAtSide(byte aSide, ISerializableObject aData) { final CoverInfo coverInfo = getCoverInfoAtSide(aSide); if (coverInfo.isValid() && coverInfo.getCoverBehavior() - .cast(aData) - != null) - coverInfo.setCoverData(aData); + .cast(aData) != null) coverInfo.setCoverData(aData); } @Override @@ -315,7 +311,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public void setCoverItemAtSide(byte aSide, ItemStack aCover) { GregTech_API.getCoverBehaviorNew(aCover) - .placeCover(aSide, aCover, this); + .placeCover(aSide, aCover, this); } @Override @@ -386,11 +382,11 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov if (tStack != null) { coverInfo.onDropped(); final EntityItem tEntity = new EntityItem( - worldObj, - getOffsetX(aDroppedSide, 1) + 0.5, - getOffsetY(aDroppedSide, 1) + 0.5, - getOffsetZ(aDroppedSide, 1) + 0.5, - tStack); + worldObj, + getOffsetX(aDroppedSide, 1) + 0.5, + getOffsetY(aDroppedSide, 1) + 0.5, + getOffsetZ(aDroppedSide, 1) + 0.5, + tStack); tEntity.motionX = 0; tEntity.motionY = 0; tEntity.motionZ = 0; @@ -438,18 +434,15 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) { - if (!getCoverBehaviorAtSideNew(aSide).manipulatesSidedRedstoneOutput( - aSide, - getCoverIDAtSide(aSide), - getComplexCoverDataAtSide(aSide), - this)) + if (!getCoverBehaviorAtSideNew(aSide) + .manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this)) setOutputRedstoneSignal(aSide, aStrength); } @Override public boolean getRedstone() { return IntStream.range(1, 6) - .anyMatch(i -> getRedstone((byte) i)); + .anyMatch(i -> getRedstone((byte) i)); } @Override @@ -460,15 +453,15 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public byte getStrongestRedstone() { return (byte) IntStream.range(1, 6) - .map(i -> getInternalInputRedstoneSignal((byte) i)) - .max() - .orElse(0); + .map(i -> getInternalInputRedstoneSignal((byte) i)) + .max() + .orElse(0); } @Override public byte getStrongOutputRedstoneSignal(byte aSide) { return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) - : 0; + : 0; } @Override @@ -479,29 +472,25 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public byte getInternalInputRedstoneSignal(byte aSide) { return (byte) (getCoverBehaviorAtSideNew(aSide).getRedstoneInput( - aSide, - getInputRedstoneSignal(aSide), - getCoverIDAtSide(aSide), - getComplexCoverDataAtSide(aSide), - this) & 15); + aSide, + getInputRedstoneSignal(aSide), + getCoverIDAtSide(aSide), + getComplexCoverDataAtSide(aSide), + this) & 15); } @Override public byte getInputRedstoneSignal(byte aSide) { - return (byte) (worldObj.getIndirectPowerLevelTo( - getOffsetX(aSide, 1), - getOffsetY(aSide, 1), - getOffsetZ(aSide, 1), - aSide) & 15); + return (byte) (worldObj + .getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide) & 15); } @Override public byte getOutputRedstoneSignal(byte aSide) { - return getCoverBehaviorAtSideNew(aSide).manipulatesSidedRedstoneOutput( - aSide, - getCoverIDAtSide(aSide), - getComplexCoverDataAtSide(aSide), - this) ? mSidedRedstone[aSide] : getGeneralRS(aSide); + return getCoverBehaviorAtSideNew(aSide) + .manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this) + ? mSidedRedstone[aSide] + : getGeneralRS(aSide); } protected void updateOutputRedstoneSignal(byte aSide) { @@ -520,7 +509,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public void receiveCoverData(byte aCoverSide, int aCoverID, ISerializableObject aCoverData, - EntityPlayerMP aPlayer) { + EntityPlayerMP aPlayer) { if (aCoverSide < 0 || aCoverSide >= 6) return; final CoverInfo oldCoverInfo = getCoverInfoAtSide(aCoverSide); @@ -541,10 +530,10 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final CoverInfo coverInfo = getCoverInfoAtSide(i); if (coverInfo.needsUpdate()) { NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_SendCoverData(coverInfo, this), - xCoord, - zCoord); + worldObj, + new GT_Packet_SendCoverData(coverInfo, this), + xCoord, + zCoord); coverInfo.setNeedsUpdate(false); } } @@ -552,10 +541,10 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); final byte currentFacing = (byte) accessor.getSide() - .ordinal(); + .ordinal(); final NBTTagList tList = tag.getTagList(GT_Values.NBT.COVERS, 10); for (byte i = 0; i < tList.tagCount(); i++) { @@ -566,16 +555,15 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final ItemStack coverStack = coverInfo.getDisplayStack(); if (coverStack != null) { currenttip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.cover", - currentFacing == coverInfo.getSide() - ? StatCollector.translateToLocal("GT5U.waila.cover.current_facing") - : StatCollector.translateToLocal( - "GT5U.interface.coverTabs." - + ForgeDirection.getOrientation(coverInfo.getSide()) - .toString() - .toLowerCase()), - coverStack.getDisplayName())); + StatCollector.translateToLocalFormatted( + "GT5U.waila.cover", + currentFacing == coverInfo.getSide() + ? StatCollector.translateToLocal("GT5U.waila.cover.current_facing") + : StatCollector.translateToLocal( + "GT5U.interface.coverTabs." + ForgeDirection.getOrientation(coverInfo.getSide()) + .toString() + .toLowerCase()), + coverStack.getDisplayName())); final String behaviorDesc = coverInfo.getBehaviorDescription(); if (!Objects.equals(behaviorDesc, E)) currenttip.add(behaviorDesc); } @@ -587,7 +575,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { // No super implementation // super.getWailaNBTData(player, tile, tag, world, x, y, z); @@ -612,10 +600,10 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final ItemStack coverStack = coverInfo.getDisplayStack(); if (coverStack != null) { aList.add( - String.format( - "Cover on %s side: %s", - getTranslation(FACES[coverInfo.getSide()]), - coverStack.getDisplayName())); + String.format( + "Cover on %s side: %s", + getTranslation(FACES[coverInfo.getSide()]), + coverStack.getDisplayName())); } } @@ -628,15 +616,15 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final GT_CoverBehaviorBase behavior = GregTech_API.getCoverBehaviorNew(coverId); if (behavior == null || behavior == GregTech_API.sNoBehavior) continue; if (!aNBT.hasKey(CoverableTileEntity.COVER_DATA_NBT_KEYS[tSide])) continue; - final ISerializableObject dataObject = behavior.createDataObject( - aNBT.getTag(CoverableTileEntity.COVER_DATA_NBT_KEYS[tSide])); + final ISerializableObject dataObject = behavior + .createDataObject(aNBT.getTag(CoverableTileEntity.COVER_DATA_NBT_KEYS[tSide])); final ItemStack coverStack = behavior.getDisplayStack(coverId, dataObject); if (coverStack != null) { aList.add( - String.format( - "Cover on %s side: %s", - getTranslation(FACES[tSide]), - coverStack.getDisplayName())); + String.format( + "Cover on %s side: %s", + getTranslation(FACES[tSide]), + coverStack.getDisplayName())); } } } @@ -652,7 +640,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov @Override public void addCoverTabs(ModularWindow.Builder builder, UIBuildContext buildContext) { final int COVER_TAB_LEFT = -16, COVER_TAB_TOP = 1, COVER_TAB_HEIGHT = 20, COVER_TAB_WIDTH = 18, - COVER_TAB_SPACING = 2, ICON_SIZE = 16; + COVER_TAB_SPACING = 2, ICON_SIZE = 16; final boolean flipHorizontally = GT_Mod.gregtechproxy.mCoverTabsFlipped; final Column columnWidget = new Column(); @@ -660,15 +648,15 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final int xPos = flipHorizontally ? (getGUIWidth() - COVER_TAB_LEFT - COVER_TAB_WIDTH) : COVER_TAB_LEFT; if (GT_Mod.gregtechproxy.mCoverTabsVisible) { columnWidget.setPos(xPos, COVER_TAB_TOP) - .setEnabled( - widget -> ((Column) widget).getChildren() - .stream() - .anyMatch(Widget::isEnabled)); + .setEnabled( + widget -> ((Column) widget).getChildren() + .stream() + .anyMatch(Widget::isEnabled)); } else { columnWidget.setEnabled(false); } columnWidget.setAlignment(MainAxisAlignment.SPACE_BETWEEN) - .setSpace(COVER_TAB_SPACING); + .setSpace(COVER_TAB_SPACING); for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { final byte side = (byte) direction.ordinal(); @@ -683,45 +671,37 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov if (getCoverBehaviorAtSideNew(side).hasCoverGUI()) { if (isHovering()) { backgrounds.add( - flipHorizontally ? tabIconSet.getCoverTabHighlightFlipped() - : tabIconSet.getCoverTabHighlight()); + flipHorizontally ? tabIconSet.getCoverTabHighlightFlipped() + : tabIconSet.getCoverTabHighlight()); } else { backgrounds.add( - flipHorizontally ? tabIconSet.getCoverTabNormalFlipped() - : tabIconSet.getCoverTabNormal()); + flipHorizontally ? tabIconSet.getCoverTabNormalFlipped() + : tabIconSet.getCoverTabNormal()); } } else { backgrounds.add( - flipHorizontally ? tabIconSet.getCoverTabDisabledFlipped() - : tabIconSet.getCoverTabDisabled()); + flipHorizontally ? tabIconSet.getCoverTabDisabledFlipped() + : tabIconSet.getCoverTabDisabled()); } return backgrounds.toArray(new IDrawable[] {}); } }.setOnClick((clickData, widget) -> onTabClicked(clickData, widget, side)) - .dynamicTooltip(() -> getCoverTabTooltip(side)) - .setSize(COVER_TAB_WIDTH, COVER_TAB_HEIGHT)) - .addChild( - new ItemDrawable( - () -> getCoverItemAtSide(side)).asWidget() - .setPos( - (COVER_TAB_WIDTH - - ICON_SIZE) - / 2 - + (flipHorizontally - ? -1 - : 1), - (COVER_TAB_HEIGHT - - ICON_SIZE) - / 2)) - .setEnabled(widget -> getCoverItemAtSide(side) != null)); + .dynamicTooltip(() -> getCoverTabTooltip(side)) + .setSize(COVER_TAB_WIDTH, COVER_TAB_HEIGHT)) + .addChild( + new ItemDrawable(() -> getCoverItemAtSide(side)).asWidget() + .setPos( + (COVER_TAB_WIDTH - ICON_SIZE) / 2 + (flipHorizontally ? -1 : 1), + (COVER_TAB_HEIGHT - ICON_SIZE) / 2)) + .setEnabled(widget -> getCoverItemAtSide(side) != null)); } } @SideOnly(Side.CLIENT) protected List getCoverTabTooltip(byte side) { final String[] SIDE_TOOLTIPS = new String[] { "GT5U.interface.coverTabs.down", "GT5U.interface.coverTabs.up", - "GT5U.interface.coverTabs.north", "GT5U.interface.coverTabs.south", "GT5U.interface.coverTabs.west", - "GT5U.interface.coverTabs.east" }; + "GT5U.interface.coverTabs.north", "GT5U.interface.coverTabs.south", "GT5U.interface.coverTabs.west", + "GT5U.interface.coverTabs.east" }; final CoverInfo coverInfo = getCoverInfoAtSide(side); final ItemStack coverItem = coverInfo.getDisplayStack(); if (coverItem == null) return Collections.emptyList(); @@ -732,11 +712,11 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov for (int i = 0; i < tooltip.size(); i++) { if (i == 0) { tooltip.set( - 0, - (coverHasGUI ? EnumChatFormatting.UNDERLINE : EnumChatFormatting.DARK_GRAY) - + StatCollector.translateToLocal(SIDE_TOOLTIPS[side]) - + (coverHasGUI ? EnumChatFormatting.RESET + ": " : ": " + EnumChatFormatting.RESET) - + tooltip.get(0)); + 0, + (coverHasGUI ? EnumChatFormatting.UNDERLINE : EnumChatFormatting.DARK_GRAY) + + StatCollector.translateToLocal(SIDE_TOOLTIPS[side]) + + (coverHasGUI ? EnumChatFormatting.RESET + ": " : ": " + EnumChatFormatting.RESET) + + tooltip.get(0)); } else { tooltip.set(i, EnumChatFormatting.GRAY + tooltip.get(i)); } @@ -749,19 +729,19 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov final CoverInfo coverInfo = getCoverInfoAtSide(side); if (coverInfo.useModularUI()) { widget.getContext() - .openSyncedWindow(side + COVER_WINDOW_ID_START); + .openSyncedWindow(side + COVER_WINDOW_ID_START); } else { final GT_Packet_TileEntityCoverGUI packet = new GT_Packet_TileEntityCoverGUI( - coverInfo, - getWorld().provider.dimensionId, - widget.getContext() - .getPlayer() - .getEntityId(), - 0); + coverInfo, + getWorld().provider.dimensionId, + widget.getContext() + .getPlayer() + .getEntityId(), + 0); GT_Values.NW.sendToPlayer( - packet, - (EntityPlayerMP) widget.getContext() - .getPlayer()); + packet, + (EntityPlayerMP) widget.getContext() + .getPlayer()); } } } diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index a42525ae45..c8657fbcff 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -99,7 +99,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); } mName = aBasicName.replaceAll(" ", "_") - .toLowerCase(Locale.ENGLISH); + .toLowerCase(Locale.ENGLISH); setBaseMetaTileEntity(new BaseMetaPipeEntity()); getBaseMetaTileEntity().setMetaTileID((short) aID); GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); @@ -115,7 +115,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID); tStack.getItem() - .addInformation(tStack, null, new ArrayList<>(), true); + .addInformation(tStack, null, new ArrayList<>(), true); } /** @@ -149,7 +149,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) { if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) { mBaseMetaTileEntity.getMetaTileEntity() - .inValidate(); + .inValidate(); mBaseMetaTileEntity.setMetaTileEntity(null); } mBaseMetaTileEntity = aBaseMetaTileEntity; @@ -241,19 +241,19 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { return false; } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { return false; } @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { return false; } @@ -318,7 +318,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { */ @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { + float aY, float aZ) { return false; } @@ -397,7 +397,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, - int aLogLevel, ArrayList aList) { + int aLogLevel, ArrayList aList) { return aList; } @@ -598,16 +598,16 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { return isValidSlot(aIndex) && aStack != null - && aIndex < mInventory.length - && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) - && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); + && aIndex < mInventory.length + && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) + && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); } @Override public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { return isValidSlot(aIndex) && aStack != null - && aIndex < mInventory.length - && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); + && aIndex < mInventory.length + && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); } @Override @@ -756,15 +756,15 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { public void doExplosion(long aExplosionPower) { float tStrength = GT_Values.getExplosionPowerForVoltage(aExplosionPower); int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), - tZ = getBaseMetaTileEntity().getZCoord(); + tZ = getBaseMetaTileEntity().getZCoord(); World tWorld = getBaseMetaTileEntity().getWorld(); tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) { new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setStrength(tStrength) - .setSmoking(true) - .setPosition(tX + 0.5, tY + 0.5, tZ + 0.5) - .setWorld(tWorld) - .run(); + .setSmoking(true) + .setPosition(tX + 0.5, tY + 0.5, tZ + 0.5) + .setWorld(tWorld) + .run(); } } @@ -775,7 +775,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1); } @@ -850,10 +850,10 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { if ((alwaysLookConnected || letsIn || letsOut)) { // Are we trying to connect to a pipe? let's do it! final IMetaTileEntity tPipe = tTileEntity instanceof IGregTechTileEntity - ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() - : null; + ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() + : null; if (getClass().isInstance(tPipe) || (tPipe != null && tPipe.getClass() - .isInstance(this))) { + .isInstance(this))) { connectAtSide(aSide); if (!((MetaPipeEntity) tPipe).isConnectedAtSide(tSide)) { // Make sure pipes all get together -- connect back to us if we're connecting to a pipe @@ -869,10 +869,8 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { return 1; } if (!baseMetaTile.getWorld() - .getChunkProvider() - .chunkExists( - baseMetaTile.getOffsetX(aSide, 1) >> 4, - baseMetaTile.getOffsetZ(aSide, 1) >> 4)) { + .getChunkProvider() + .chunkExists(baseMetaTile.getOffsetX(aSide, 1) >> 4, baseMetaTile.getOffsetZ(aSide, 1) >> 4)) { // Target chunk unloaded return -1; } @@ -903,11 +901,10 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide); IMetaTileEntity tPipe = tTileEntity == null ? null : tTileEntity.getMetaTileEntity(); if ((this.getClass() - .isInstance(tPipe) - || (tPipe != null && tPipe.getClass() - .isInstance(this))) - && ((MetaPipeEntity) tPipe).isConnectedAtSide(tSide)) - ((MetaPipeEntity) tPipe).disconnect(tSide); + .isInstance(tPipe) + || (tPipe != null && tPipe.getClass() + .isInstance(this))) + && ((MetaPipeEntity) tPipe).isConnectedAtSide(tSide)) ((MetaPipeEntity) tPipe).disconnect(tSide); } @Override @@ -916,7 +913,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { } public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -925,7 +922,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { } public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -934,12 +931,12 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { } public boolean letsIn(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return false; } public boolean letsOut(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return false; } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index c929bd5677..3acbb2ce2d 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -129,7 +129,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!"); } mName = aBasicName.replace(" ", "_") - .toLowerCase(Locale.ENGLISH); + .toLowerCase(Locale.ENGLISH); setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity()); getBaseMetaTileEntity().setMetaTileID((short) aID); GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); @@ -166,7 +166,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) { if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) { mBaseMetaTileEntity.getMetaTileEntity() - .inValidate(); + .inValidate(); mBaseMetaTileEntity.setMetaTileEntity(null); } mBaseMetaTileEntity = aBaseMetaTileEntity; @@ -228,7 +228,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) { getBaseMetaTileEntity().setFrontFacing(aWrenchingSide); return true; @@ -238,42 +238,30 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (!aPlayer.isSneaking()) return false; byte tSide = GT_Utility.getOppositeSide(aWrenchingSide); TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(aWrenchingSide); if ((tTileEntity instanceof IGregTechTileEntity) - && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable)) { + && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable)) { // The tile entity we're facing is a cable, let's try to connect to it return ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() - .onWireCutterRightClick( - aWrenchingSide, - tSide, - aPlayer, - aX, - aY, - aZ); + .onWireCutterRightClick(aWrenchingSide, tSide, aPlayer, aX, aY, aZ); } return false; } @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (!aPlayer.isSneaking()) return false; byte tSide = GT_Utility.getOppositeSide(aWrenchingSide); TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(aWrenchingSide); if ((tTileEntity instanceof IGregTechTileEntity) - && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable)) { + && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable)) { // The tile entity we're facing is a cable, let's try to connect to it return ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() - .onSolderingToolRightClick( - aWrenchingSide, - tSide, - aPlayer, - aX, - aY, - aZ); + .onSolderingToolRightClick(aWrenchingSide, tSide, aPlayer, aX, aY, aZ); } return false; } @@ -281,18 +269,18 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void onExplosion() { GT_Log.exp.println( - "Machine at " + this.getBaseMetaTileEntity() - .getXCoord() - + " | " - + this.getBaseMetaTileEntity() - .getYCoord() - + " | " - + this.getBaseMetaTileEntity() - .getZCoord() - + " DIMID: " - + this.getBaseMetaTileEntity() - .getWorld().provider.dimensionId - + " exploded."); + "Machine at " + this.getBaseMetaTileEntity() + .getXCoord() + + " | " + + this.getBaseMetaTileEntity() + .getYCoord() + + " | " + + this.getBaseMetaTileEntity() + .getZCoord() + + " DIMID: " + + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId + + " exploded."); } @Override @@ -355,7 +343,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { + float aY, float aZ) { return onRightclick(aBaseMetaTileEntity, aPlayer); } @@ -647,7 +635,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, - int aLogLevel, ArrayList aList) { + int aLogLevel, ArrayList aList) { return aList; } @@ -770,7 +758,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac */ public boolean isTeleporterCompatible() { return isEnetOutput() && getBaseMetaTileEntity().getOutputVoltage() >= 128 - && getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000; + && getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000; } /** @@ -907,16 +895,16 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { return isValidSlot(aIndex) && aStack != null - && aIndex < mInventory.length - && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) - && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); + && aIndex < mInventory.length + && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) + && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); } @Override public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { return isValidSlot(aIndex) && aStack != null - && aIndex < mInventory.length - && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); + && aIndex < mInventory.length + && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack); } @Override @@ -944,10 +932,10 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { if (getBaseMetaTileEntity().hasSteamEngineUpgrade() && GT_ModHandler.isSteam(aFluid) && aFluid.amount > 1) { int tSteam = (int) Math.min( - Integer.MAX_VALUE, - Math.min( - aFluid.amount / 2, - getBaseMetaTileEntity().getSteamCapacity() - getBaseMetaTileEntity().getStoredSteam())); + Integer.MAX_VALUE, + Math.min( + aFluid.amount / 2, + getBaseMetaTileEntity().getSteamCapacity() - getBaseMetaTileEntity().getStoredSteam())); if (tSteam > 0) { markDirty(); if (doFill) getBaseMetaTileEntity().increaseStoredSteam(tSteam, true); @@ -1106,7 +1094,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1); } @@ -1171,12 +1159,12 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { currenttip.add( - String.format( - "Facing: %s", - ForgeDirection.getOrientation(mBaseMetaTileEntity.getFrontFacing()) - .name())); + String.format( + "Facing: %s", + ForgeDirection.getOrientation(mBaseMetaTileEntity.getFrontFacing()) + .name())); if (this instanceof IPowerChannelState state) { // adapted from PowerStateWailaDataProvider @@ -1199,7 +1187,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { if (this instanceof IPowerChannelState state) { // adapted from PowerStateWailaDataProvider final boolean isActive = state.isActive(); @@ -1216,19 +1204,16 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac if (getProxy() == null) return "(proxy)"; if (getProxy().getNode() == null) return "(node)"; if (getProxy().getNode() - .getGrid() - == null) - return "(grid)"; + .getGrid() == null) return "(grid)"; if (!getProxy().getNode() - .meetsChannelRequirements()) - return "(channels)"; + .meetsChannelRequirements()) return "(channels)"; IPathingGrid pg = getProxy().getNode() - .getGrid() - .getCache(IPathingGrid.class); + .getGrid() + .getCache(IPathingGrid.class); if (!pg.isNetworkBooting()) return "(booting)"; IEnergyGrid eg = getProxy().getNode() - .getGrid() - .getCache(IEnergyGrid.class); + .getGrid() + .getCache(IEnergyGrid.class); if (!eg.isNetworkPowered()) return "(power)"; } catch (Throwable ex) { ex.printStackTrace(); diff --git a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java index 674ced4535..da86635fea 100644 --- a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java +++ b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java @@ -82,9 +82,8 @@ public class TileIC2EnergySink extends TileEntity implements IEnergySink { @Override public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { - final long amps = (long) Math.max( - amount / (cableMeta != null ? cableMeta.mVoltage : myMeta.getInputVoltage() * 1.0), - 1.0); + final long amps = (long) Math + .max(amount / (cableMeta != null ? cableMeta.mVoltage : myMeta.getInputVoltage() * 1.0), 1.0); final long euPerAmp = (long) (amount / (amps * 1.0)); final IMetaTileEntity metaTile = myMeta.getMetaTileEntity(); @@ -93,15 +92,13 @@ public class TileIC2EnergySink extends TileEntity implements IEnergySink { final long usedAmps; if (cableMeta != null) { usedAmps = ((IMetaTileEntityCable) metaTile).transferElectricity( - (byte) directionFrom.ordinal(), - Math.min(euPerAmp, cableMeta.mVoltage), - amps, - Sets.newHashSet((TileEntity) myMeta)); - - } else usedAmps = myMeta.injectEnergyUnits( (byte) directionFrom.ordinal(), - Math.min(euPerAmp, myMeta.getInputVoltage()), - amps); + Math.min(euPerAmp, cableMeta.mVoltage), + amps, + Sets.newHashSet((TileEntity) myMeta)); + + } else usedAmps = myMeta + .injectEnergyUnits((byte) directionFrom.ordinal(), Math.min(euPerAmp, myMeta.getInputVoltage()), amps); return amount - (usedAmps * euPerAmp); // transferElectricity for cables @@ -120,8 +117,7 @@ public class TileIC2EnergySink extends TileEntity implements IEnergySink { public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { final IMetaTileEntity metaTile = myMeta.getMetaTileEntity(); if (metaTile instanceof IMetaTileEntityCable && (direction == ForgeDirection.UNKNOWN - || ((IConnectable) metaTile).isConnectedAtSide(direction.ordinal()))) - return true; + || ((IConnectable) metaTile).isConnectedAtSide(direction.ordinal()))) return true; else return myMeta.inputEnergyFrom((byte) direction.ordinal(), false); } } diff --git a/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java b/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java index e8e313141d..83cebbb08d 100644 --- a/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java +++ b/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java @@ -20,73 +20,73 @@ public class GT_MetaTileEntity_E_Furnace extends GT_MetaTileEntity_BasicMachine public GT_MetaTileEntity_E_Furnace(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Not like using a Commodore 64", - 1, - 1, - "E_Furnace.png", - "smelting", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "Not like using a Commodore 64", + 1, + 1, + "E_Furnace.png", + "smelting", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_E_Furnace(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_E_Furnace(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @@ -108,9 +108,9 @@ public class GT_MetaTileEntity_E_Furnace extends GT_MetaTileEntity_BasicMachine @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64, aStack), false, null) != null; + && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64, aStack), false, null) != null; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index ee610d2631..132c48e77d 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -57,9 +57,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public final long mCableLossPerMeter, mAmperage, mVoltage; public final boolean mInsulated, mCanShock; public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredAmperageLast20OK = 0, - mTransferredAmperageOK = 0; + mTransferredAmperageOK = 0; public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0, mTransferredVoltageLast20OK = 0, - mTransferredVoltageOK = 0; + mTransferredVoltageOK = 0; public long mRestRF; public int mOverheat; public static short mMaxOverheat = (short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100); @@ -68,7 +68,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile private long lastWorldTick; public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { super(aID, aName, aNameRegional, 0); mThickNess = aThickNess; mMaterial = aMaterial; @@ -80,7 +80,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile } public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, - long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { super(aName, 0); mThickNess = aThickNess; mMaterial = aMaterial; @@ -99,77 +99,76 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaPipeEntity_Cable( - mName, - mThickNess, - mMaterial, - mCableLossPerMeter, - mAmperage, - mVoltage, - mInsulated, - mCanShock); + mName, + mThickNess, + mMaterial, + mCableLossPerMeter, + mAmperage, + mVoltage, + mInsulated, + mCanShock); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + byte aColorIndex, boolean aConnected, boolean aRedstone) { if (!mInsulated) return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; if (aConnected) { float tThickNess = getThickNess(); if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of( - Textures.BlockIcons.INSULATION_FULL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.374F) // 0.375 x1 return new ITexture[] { - TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), - TextureFactory.of( - Textures.BlockIcons.INSULATION_TINY, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), + TextureFactory.of( + Textures.BlockIcons.INSULATION_TINY, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.499F) // 0.500 x2 return new ITexture[] { - TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), - TextureFactory.of( - Textures.BlockIcons.INSULATION_SMALL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), + TextureFactory.of( + Textures.BlockIcons.INSULATION_SMALL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.624F) // 0.625 x4 return new ITexture[] { - TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), - TextureFactory.of( - Textures.BlockIcons.INSULATION_MEDIUM, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), + TextureFactory.of( + Textures.BlockIcons.INSULATION_MEDIUM, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.749F) // 0.750 x8 return new ITexture[] { - TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), - TextureFactory.of( - Textures.BlockIcons.INSULATION_MEDIUM_PLUS, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), + TextureFactory.of( + Textures.BlockIcons.INSULATION_MEDIUM_PLUS, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.874F) // 0.825 x12 return new ITexture[] { - TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), - TextureFactory.of( - Textures.BlockIcons.INSULATION_LARGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; - return new ITexture[] { TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of( - Textures.BlockIcons.INSULATION_HUGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + Textures.BlockIcons.INSULATION_LARGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + return new ITexture[] { + TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), + TextureFactory.of( + Textures.BlockIcons.INSULATION_HUGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } - return new ITexture[] { TextureFactory.of( - Textures.BlockIcons.INSULATION_FULL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + return new ITexture[] { TextureFactory + .of(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } @Override public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) { if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 - && aEntity instanceof EntityLivingBase - && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) + && aEntity instanceof EntityLivingBase + && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) GT_Utility.applyElectricityDamage( - (EntityLivingBase) aEntity, - mTransferredVoltageLast20, - mTransferredAmperageLast20); + (EntityLivingBase) aEntity, + mTransferredVoltageLast20, + mTransferredAmperageLast20); } @Override @@ -206,8 +205,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { if (!isConnectedAtSide(aSide) && aSide != 6) return 0; if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .letsEnergyIn()) - return 0; + .letsEnergyIn()) return 0; final HashSet nul = null; return transferElectricity(aSide, aVoltage, aAmperage, nul); } @@ -215,7 +213,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override @Deprecated public long transferElectricity(byte aSide, long aVoltage, long aAmperage, - ArrayList aAlreadyPassedTileEntityList) { + ArrayList aAlreadyPassedTileEntityList) { return transferElectricity(aSide, aVoltage, aAmperage, new HashSet<>(aAlreadyPassedTileEntityList)); } @@ -247,10 +245,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if (aBaseMetaTileEntity.isServerSide()) { lastAmperage = new int[16]; lastWorldTick = aBaseMetaTileEntity.getWorld() - .getTotalWorldTime() - - 1; // sets initial value -1 since it is - // in the same tick as first on post - // tick + .getTotalWorldTime() - 1; // sets initial value -1 since it is + // in the same tick as first on post + // tick } } @@ -258,16 +255,16 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aTick % 20 == 0 && aBaseMetaTileEntity.isServerSide() - && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) { + && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) { checkConnections(); } } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (GT_Mod.gregtechproxy.gt6Cable - && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { + && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { if (isConnectedAtSide(aWrenchingSide)) { disconnect(aWrenchingSide); GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected")); @@ -282,9 +279,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (GT_Mod.gregtechproxy.gt6Cable - && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { + && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { if (isConnectedAtSide(aWrenchingSide)) { disconnect(aWrenchingSide); GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected")); @@ -299,25 +296,25 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity); } @Override public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity); } @Override public boolean letsIn(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity); } @Override public boolean letsOut(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity); } @@ -340,8 +337,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile // GT Machine handling if ((tTileEntity instanceof IEnergyConnected) && (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false) - || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false))) - return true; + || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false))) return true; // Solar Panel Compat if (coverBehavior instanceof GT_Cover_SolarPanel) return true; @@ -353,7 +349,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile // AE2-p2p Compat if (GT_Mod.gregtechproxy.mAE2Integration) { if (tTileEntity instanceof appeng.tile.powersink.IC2 - && ((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir)) + && ((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir)) return true; } @@ -364,17 +360,16 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if (tTileEntity instanceof IReactorChamber) ic2Energy = (TileEntity) ((IReactorChamber) tTileEntity).getReactor(); else ic2Energy = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) - ? tTileEntity - : EnergyNet.instance.getTileEntity( - tTileEntity.getWorldObj(), - tTileEntity.xCoord, - tTileEntity.yCoord, - tTileEntity.zCoord); + ? tTileEntity + : EnergyNet.instance.getTileEntity( + tTileEntity.getWorldObj(), + tTileEntity.xCoord, + tTileEntity.yCoord, + tTileEntity.zCoord); // IC2 Sink Compat if ((ic2Energy instanceof IEnergySink) - && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir)) - return true; + && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir)) return true; // IC2 Source Compat if (GT_Mod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) { @@ -385,12 +380,11 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile } // RF Output Compat if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver - && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir)) - return true; + && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir)) return true; // RF Input Compat return GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter - && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir)); + && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir)); } @Override @@ -412,24 +406,24 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public String[] getDescription() { return new String[] { - StatCollector.translateToLocal("GT5U.item.cable.max_voltage") + ": %%%" - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mVoltage) - + " (" - + GT_Utility.getColoredTierNameFromVoltage(mVoltage) - + EnumChatFormatting.GREEN - + ")" - + EnumChatFormatting.GRAY, - StatCollector.translateToLocal("GT5U.item.cable.max_amperage") + ": %%%" - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mAmperage) - + EnumChatFormatting.GRAY, - StatCollector.translateToLocal("GT5U.item.cable.loss") + ": %%%" - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mCableLossPerMeter) - + EnumChatFormatting.GRAY - + "%%% " - + StatCollector.translateToLocal("GT5U.item.cable.eu_volt") }; + StatCollector.translateToLocal("GT5U.item.cable.max_voltage") + ": %%%" + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mVoltage) + + " (" + + GT_Utility.getColoredTierNameFromVoltage(mVoltage) + + EnumChatFormatting.GREEN + + ")" + + EnumChatFormatting.GRAY, + StatCollector.translateToLocal("GT5U.item.cable.max_amperage") + ": %%%" + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mAmperage) + + EnumChatFormatting.GRAY, + StatCollector.translateToLocal("GT5U.item.cable.loss") + ": %%%" + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(mCableLossPerMeter) + + EnumChatFormatting.GRAY + + "%%% " + + StatCollector.translateToLocal("GT5U.item.cable.eu_volt") }; } @Override @@ -466,38 +460,38 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile volts = path.getVoltage(this); } return new String[] { - // EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET, - "Heat: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mOverheat) - + EnumChatFormatting.RESET - + " / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxOverheat) - + EnumChatFormatting.RESET, - "Max Load (1t):", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(amps) - + EnumChatFormatting.RESET - + " A / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mAmperage) - + EnumChatFormatting.RESET - + " A", - "Max EU/p (1t):", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(volts) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mVoltage) - + EnumChatFormatting.RESET - + " EU", - "Max Load (20t): " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mTransferredAmperageLast20OK) - + EnumChatFormatting.RESET - + " A", - "Max EU/p (20t): " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mTransferredVoltageLast20OK) - + EnumChatFormatting.RESET - + " EU" }; + // EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET, + "Heat: " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(mOverheat) + + EnumChatFormatting.RESET + + " / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxOverheat) + + EnumChatFormatting.RESET, + "Max Load (1t):", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(amps) + + EnumChatFormatting.RESET + + " A / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mAmperage) + + EnumChatFormatting.RESET + + " A", + "Max EU/p (1t):", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(volts) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mVoltage) + + EnumChatFormatting.RESET + + " EU", + "Max Load (20t): " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mTransferredAmperageLast20OK) + + EnumChatFormatting.RESET + + " A", + "Max EU/p (20t): " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mTransferredVoltageLast20OK) + + EnumChatFormatting.RESET + + " EU" }; } @Override @@ -549,18 +543,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f; if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f; - return AxisAlignedBB.getBoundingBox( - aX + tSide4, - aY + tSide0, - aZ + tSide2, - aX + tSide5, - aY + tSide1, - aZ + tSide3); + return AxisAlignedBB + .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) { final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); @@ -577,13 +566,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile for (byte aSide = 0; aSide < 6; aSide++) if (isConnectedAtSide(aSide)) { final TileEntity tTileEntity = baseMeta.getTileEntityAtSide(aSide); final TileEntity tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile - || EnergyNet.instance == null) - ? tTileEntity - : EnergyNet.instance.getTileEntity( - tTileEntity.getWorldObj(), - tTileEntity.xCoord, - tTileEntity.yCoord, - tTileEntity.zCoord); + || EnergyNet.instance == null) + ? tTileEntity + : EnergyNet.instance.getTileEntity( + tTileEntity.getWorldObj(), + tTileEntity.xCoord, + tTileEntity.yCoord, + tTileEntity.zCoord); if (tEmitter instanceof IEnergyEmitter) return true; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index c8718d0e52..76c7f418e9 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -55,12 +55,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public byte mDisableInput = 0; public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - int aCapacity, int aHeatResistance, boolean aGasProof) { + int aCapacity, int aHeatResistance, boolean aGasProof) { this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); } public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { + int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { super(aID, aName, aNameRegional, 0, false); mThickNess = aThickNess; mMaterial = aMaterial; @@ -74,12 +74,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Deprecated public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, - int aHeatResistance, boolean aGasProof) { + int aHeatResistance, boolean aGasProof) { this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); } public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, - int aHeatResistance, boolean aGasProof, int aFluidTypes) { + int aHeatResistance, boolean aGasProof, int aFluidTypes) { super(aName, 0); mThickNess = aThickNess; mMaterial = aMaterial; @@ -98,64 +98,64 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaPipeEntity_Fluid( - mName, - mThickNess, - mMaterial, - mCapacity, - mHeatResistance, - mGasProof, - mPipeAmount); + mName, + mThickNess, + mMaterial, + mCapacity, + mHeatResistance, + mGasProof, + mPipeAmount); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + byte aColorIndex, boolean aConnected, boolean aRedstone) { final float tThickNess = getThickNess(); if (mDisableInput == 0) return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) - : TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + : TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; byte tMask = 0; final byte[][] sRestrictionArray = { { 2, 3, 5, 4 }, { 2, 3, 4, 5 }, { 1, 0, 4, 5 }, { 1, 0, 4, 5 }, - { 1, 0, 2, 3 }, { 1, 0, 2, 3 } }; + { 1, 0, 2, 3 }, { 1, 0, 2, 3 } }; if (aSide >= 0 && aSide < 6) { for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i; // Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate if (aSide == 5 || aSide == 2) if (tMask > 3 && tMask < 12) tMask = (byte) (tMask ^ 12); } return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) - : TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - getRestrictorTexture(tMask) }; + : TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), + getRestrictorTexture(tMask) }; } protected static ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) { if (aPipeAmount >= 9) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); if (aPipeAmount >= 4) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); if (aThickNess < 0.124F) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); if (aThickNess < 0.374F) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); if (aThickNess < 0.499F) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); if (aThickNess < 0.749F) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); if (aThickNess < 0.874F) return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); } protected static ITexture getRestrictorTexture(byte aMask) { @@ -244,22 +244,20 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) { if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 - && aEntity instanceof EntityLivingBase) { + && aEntity instanceof EntityLivingBase) { for (FluidStack tFluid : mFluids) { if (tFluid != null) { final int tTemperature = tFluid.getFluid() - .getTemperature(tFluid); - if (tTemperature > 320 && !isCoverOnSide( - (BaseMetaPipeEntity) getBaseMetaTileEntity(), - (EntityLivingBase) aEntity)) { + .getTemperature(tFluid); + if (tTemperature > 320 + && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) { GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break; - } else if (tTemperature < 260 && !isCoverOnSide( - (BaseMetaPipeEntity) getBaseMetaTileEntity(), - (EntityLivingBase) aEntity)) { - GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); - break; - } + } else if (tTemperature < 260 + && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) { + GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); + break; + } } } } @@ -300,55 +298,48 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if (tFluid != null && tFluid.amount > 0) { final int tTemperature = tFluid.getFluid() - .getTemperature(tFluid); + .getTemperature(tFluid); if (tTemperature > mHeatResistance) { if (aBaseMetaTileEntity.getRandomNumber(100) == 0) { // Poof GT_Log.exp.println( - "Set Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() - + " | " - + aBaseMetaTileEntity.getYCoord() - + " | " - + aBaseMetaTileEntity.getZCoord() - + " DIMID: " - + aBaseMetaTileEntity.getWorld().provider.dimensionId); + "Set Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() + + " | " + + aBaseMetaTileEntity.getYCoord() + + " | " + + aBaseMetaTileEntity.getZCoord() + + " DIMID: " + + aBaseMetaTileEntity.getWorld().provider.dimensionId); aBaseMetaTileEntity.setToFire(); return true; } // Mmhmm, Fire aBaseMetaTileEntity.setOnFire(); GT_Log.exp.println( - "Set Blocks around Pipe to Fire due to to low heat resistance at " - + aBaseMetaTileEntity.getXCoord() - + " | " - + aBaseMetaTileEntity.getYCoord() - + " | " - + aBaseMetaTileEntity.getZCoord() - + " DIMID: " - + aBaseMetaTileEntity.getWorld().provider.dimensionId); + "Set Blocks around Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() + + " | " + + aBaseMetaTileEntity.getYCoord() + + " | " + + aBaseMetaTileEntity.getZCoord() + + " DIMID: " + + aBaseMetaTileEntity.getWorld().provider.dimensionId); } if (!mGasProof && tFluid.getFluid() - .isGaseous(tFluid)) { + .isGaseous(tFluid)) { tFluid.amount -= 5; sendSound((byte) 9); if (tTemperature > 320) { try { for (EntityLivingBase tLiving : getBaseMetaTileEntity().getWorld() - .getEntitiesWithinAABB( - EntityLivingBase.class, - AxisAlignedBB.getBoundingBox( - getBaseMetaTileEntity().getXCoord() - - 2, - getBaseMetaTileEntity().getYCoord() - - 2, - getBaseMetaTileEntity().getZCoord() - - 2, - getBaseMetaTileEntity().getXCoord() - + 3, - getBaseMetaTileEntity().getYCoord() - + 3, - getBaseMetaTileEntity().getZCoord() - + 3))) { + .getEntitiesWithinAABB( + EntityLivingBase.class, + AxisAlignedBB.getBoundingBox( + getBaseMetaTileEntity().getXCoord() - 2, + getBaseMetaTileEntity().getYCoord() - 2, + getBaseMetaTileEntity().getZCoord() - 2, + getBaseMetaTileEntity().getXCoord() + 3, + getBaseMetaTileEntity().getYCoord() + 3, + getBaseMetaTileEntity().getZCoord() + 3))) { GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F); } } catch (Throwable e) { @@ -357,21 +348,15 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { } else if (tTemperature < 260) { try { for (EntityLivingBase tLiving : getBaseMetaTileEntity().getWorld() - .getEntitiesWithinAABB( - EntityLivingBase.class, - AxisAlignedBB.getBoundingBox( - getBaseMetaTileEntity().getXCoord() - - 2, - getBaseMetaTileEntity().getYCoord() - - 2, - getBaseMetaTileEntity().getZCoord() - - 2, - getBaseMetaTileEntity().getXCoord() - + 3, - getBaseMetaTileEntity().getYCoord() - + 3, - getBaseMetaTileEntity().getZCoord() - + 3))) { + .getEntitiesWithinAABB( + EntityLivingBase.class, + AxisAlignedBB.getBoundingBox( + getBaseMetaTileEntity().getXCoord() - 2, + getBaseMetaTileEntity().getYCoord() - 2, + getBaseMetaTileEntity().getZCoord() - 2, + getBaseMetaTileEntity().getXCoord() + 3, + getBaseMetaTileEntity().getYCoord() + 3, + getBaseMetaTileEntity().getZCoord() + 3))) { GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F); } } catch (Throwable e) { @@ -400,11 +385,11 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null; if (isConnectedAtSide(aSide) && tTank != null - && (mLastReceivedFrom & (1 << aSide)) == 0 - && getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .letsFluidOut(tFluid.getFluid()) - && (gTank == null || gTank.getCoverInfoAtSide(tSide) - .letsFluidIn(tFluid.getFluid()))) { + && (mLastReceivedFrom & (1 << aSide)) == 0 + && getBaseMetaTileEntity().getCoverInfoAtSide(aSide) + .letsFluidOut(tFluid.getFluid()) + && (gTank == null || gTank.getCoverInfoAtSide(tSide) + .letsFluidIn(tFluid.getFluid()))) { if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) { tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0)); } @@ -436,10 +421,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if (tEntry.right <= 0) continue; - final int tFilledAmount = tEntry.left.fill( - tEntry.middle, - drainFromIndex(tEntry.right, false, index), - false); + final int tFilledAmount = tEntry.left + .fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false); if (tFilledAmount > 0) tEntry.left.fill(tEntry.middle, drainFromIndex(tFilledAmount, true, index), true); @@ -449,7 +432,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (GT_Mod.gregtechproxy.gt6Pipe) { final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); final byte tMask = (byte) (1 << tSide); @@ -477,25 +460,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverBehavior.letsFluidIn(aSide, aCoverID, aCoverVariable, null, aTileEntity); } @Override public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity); } @Override public boolean letsIn(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsFluidIn(aSide, aCoverID, aCoverVariable, null, aTileEntity); } @Override public boolean letsOut(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity); } @@ -514,15 +497,15 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if (tTileEntity == null) return false; final byte tSide = (byte) ForgeDirection.getOrientation(aSide) - .getOpposite() - .ordinal(); + .getOpposite() + .ordinal(); final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity(); if (baseMetaTile == null) return false; final GT_CoverBehaviorBase coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(aSide); final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity) - ? (IGregTechTileEntity) tTileEntity - : null; + ? (IGregTechTileEntity) tTileEntity + : null; if (coverBehavior instanceof GT_Cover_Drain || (GregTech_API.mTConstruct && isTConstructFaucet(tTileEntity))) return true; @@ -533,8 +516,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { final FluidTankInfo[] tInfo = fTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide)); if (tInfo != null) { return tInfo.length > 0 || (GregTech_API.mTranslocator && isTranslocator(tTileEntity)) - || gTileEntity != null - && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator; + || gTileEntity != null + && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator; } } return false; @@ -565,18 +548,19 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ); new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD) - .setWorld(getBaseMetaTileEntity().getWorld()) - .times( - 6, - (x, i) -> x.setMotion( - ForgeDirection.getOrientation(i).offsetX / 5.0, - ForgeDirection.getOrientation(i).offsetY / 5.0, - ForgeDirection.getOrientation(i).offsetZ / 5.0) - .setPosition( - aX - 0.5 + XSTR_INSTANCE.nextFloat(), - aY - 0.5 + XSTR_INSTANCE.nextFloat(), - aZ - 0.5 + XSTR_INSTANCE.nextFloat()) - .run()); + .setWorld(getBaseMetaTileEntity().getWorld()) + .times( + 6, + (x, i) -> x + .setMotion( + ForgeDirection.getOrientation(i).offsetX / 5.0, + ForgeDirection.getOrientation(i).offsetY / 5.0, + ForgeDirection.getOrientation(i).offsetZ / 5.0) + .setPosition( + aX - 0.5 + XSTR_INSTANCE.nextFloat(), + aY - 0.5 + XSTR_INSTANCE.nextFloat(), + aZ - 0.5 + XSTR_INSTANCE.nextFloat()) + .run()); } } @@ -631,9 +615,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { if (aFluid == null || aFluid.getFluid() - .getID() - <= 0) - return 0; + .getID() <= 0) return 0; int index = -1; for (int i = 0; i < mPipeAmount; i++) { @@ -641,10 +623,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { index = i; break; } else if ((mFluids[i] == null || mFluids[i].getFluid() - .getID() - <= 0) && index < 0) { - index = i; - } + .getID() <= 0) && index < 0) { + index = i; + } } return fill_default_intoIndex(aSide, aFluid, doFill, index); @@ -653,13 +634,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { private int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) { if (index < 0 || index >= mPipeAmount) return 0; if (aFluid == null || aFluid.getFluid() - .getID() - <= 0) - return 0; + .getID() <= 0) return 0; if (mFluids[index] == null || mFluids[index].getFluid() - .getID() - <= 0) { + .getID() <= 0) { if (aFluid.amount * mPipeAmount <= getCapacity()) { if (doFill) { mFluids[index] = aFluid.copy(); @@ -735,25 +713,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { public String[] getDescription() { if (mPipeAmount == 1) { return new String[] { - EnumChatFormatting.BLUE + "Fluid Capacity: %%%" - + GT_Utility.formatNumbers(mCapacity * 20L) - + "%%% L/sec" - + EnumChatFormatting.GRAY, - EnumChatFormatting.RED + "Heat Limit: %%%" - + GT_Utility.formatNumbers(mHeatResistance) - + "%%% K" - + EnumChatFormatting.GRAY }; + EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + + GT_Utility.formatNumbers(mCapacity * 20L) + + "%%% L/sec" + + EnumChatFormatting.GRAY, + EnumChatFormatting.RED + "Heat Limit: %%%" + + GT_Utility.formatNumbers(mHeatResistance) + + "%%% K" + + EnumChatFormatting.GRAY }; } else { return new String[] { - EnumChatFormatting.BLUE + "Fluid Capacity: %%%" - + GT_Utility.formatNumbers(mCapacity * 20L) - + "%%% L/sec" - + EnumChatFormatting.GRAY, - EnumChatFormatting.RED + "Heat Limit: %%%" - + GT_Utility.formatNumbers(mHeatResistance) - + "%%% K" - + EnumChatFormatting.GRAY, - EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY }; + EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + + GT_Utility.formatNumbers(mCapacity * 20L) + + "%%% L/sec" + + EnumChatFormatting.GRAY, + EnumChatFormatting.RED + "Heat Limit: %%%" + + GT_Utility.formatNumbers(mHeatResistance) + + "%%% K" + + EnumChatFormatting.GRAY, + EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY }; } } @@ -826,18 +804,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f; if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f; - return AxisAlignedBB.getBoundingBox( - aX + tSide4, - aY + tSide0, - aZ + tSide2, - aX + tSide5, - aY + tSide1, - aZ + tSide3); + return AxisAlignedBB + .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) { final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java index 302155a186..9ccb43e733 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java @@ -19,9 +19,8 @@ import gregtech.api.util.GT_OreDictUnificator; public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { - private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( - "gt.blockmachines.gt_frame.desc.format", - "Just something you can put covers on."); + private static final String localizedDescFormat = GT_LanguageManager + .addStringLocalization("gt.blockmachines.gt_frame.desc.format", "Just something you can put covers on."); public final Materials mMaterial; public GT_MetaPipeEntity_Frame(int aID, String aName, String aNameRegional, Materials aMaterial) { @@ -31,19 +30,19 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { GT_ModHandler.addCraftingRecipe( - getStackForm(2), - RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial) }); + getStackForm(2), + RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial) }); } if (!aMaterial.contains(SubTag.NO_RECIPES)) { // Auto generate frame box recipe in an assembler. RA.addAssemblerRecipe( - GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4), - ItemList.Circuit_Integrated.getWithDamage(0, 4), - getStackForm(1), - 64, - calculateRecipeEU(aMaterial, 7)); + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4), + ItemList.Circuit_Integrated.getWithDamage(0, 4), + getStackForm(1), + 64, + calculateRecipeEU(aMaterial, 7)); } } @@ -64,10 +63,10 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + byte aColorIndex, boolean aConnected, boolean aRedstone) { return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; } @Override @@ -112,13 +111,13 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { @Override public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return false; } @Override public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return false; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index 9e55aa94c7..f69170b83e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -52,7 +52,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE private int[] cacheSides; public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) { + int aInvSlotCount, int aStepSize, boolean aIsRestrictive, int aTickTime) { super(aID, aName, aNameRegional, aInvSlotCount, false); mIsRestrictive = aIsRestrictive; mThickNess = aThickNess; @@ -63,12 +63,12 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE } public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, - int aInvSlotCount, int aStepSize, boolean aIsRestrictive) { + int aInvSlotCount, int aStepSize, boolean aIsRestrictive) { this(aID, aName, aNameRegional, aThickNess, aMaterial, aInvSlotCount, aStepSize, aIsRestrictive, 20); } public GT_MetaPipeEntity_Item(String aName, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, - boolean aIsRestrictive, int aTickTime) { + boolean aIsRestrictive, int aTickTime) { super(aName, aInvSlotCount); mIsRestrictive = aIsRestrictive; mThickNess = aThickNess; @@ -85,87 +85,76 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaPipeEntity_Item( - mName, - mThickNess, - mMaterial, - mInventory.length, - mStepSize, - mIsRestrictive, - mTickTime); + mName, + mThickNess, + mMaterial, + mInventory.length, + mStepSize, + mIsRestrictive, + mTickTime); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + byte aColorIndex, boolean aConnected, boolean aRedstone) { if (mIsRestrictive) { if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.124F) - return new ITexture[] { - TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - TextureFactory.of(PIPE_RESTRICTOR) }; + if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; if (tThickNess < 0.374F) // 0.375 - return new ITexture[] { - TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - TextureFactory.of(PIPE_RESTRICTOR) }; + return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; if (tThickNess < 0.499F) // 0.500 - return new ITexture[] { - TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - TextureFactory.of(PIPE_RESTRICTOR) }; + return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; if (tThickNess < 0.749F) // 0.750 - return new ITexture[] { - TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - TextureFactory.of(PIPE_RESTRICTOR) }; + return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; if (tThickNess < 0.874F) // 0.825 - return new ITexture[] { - TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - TextureFactory.of(PIPE_RESTRICTOR) }; - return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], + return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; + return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; } return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR) }; } if (aConnected) { float tThickNess = getThickNess(); if (tThickNess < 0.124F) return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; if (tThickNess < 0.374F) // 0.375 return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; if (tThickNess < 0.499F) // 0.500 return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; if (tThickNess < 0.749F) // 0.750 return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; if (tThickNess < 0.874F) // 0.825 return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; - return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], + mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + return new ITexture[] { TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; } return new ITexture[] { TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; } @Override @@ -228,9 +217,10 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE for (boolean temp = true; temp && !isInventoryEmpty() && pipeCapacityCheck();) { temp = false; tPipeList.clear(); - for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending( + for (IMetaTileEntityItemPipe tTileEntity : GT_Utility + .sortMapByValuesAcending( IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false)) - .keySet()) { + .keySet()) { if (temp) break; tPipeList.add(tTileEntity); while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity)) @@ -247,7 +237,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (GT_Mod.gregtechproxy.gt6Pipe) { final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); if (isConnectedAtSide(tSide)) { @@ -263,25 +253,25 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverBehavior.letsItemsIn(aSide, aCoverID, aCoverVariable, -1, aTileEntity); } @Override public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverBehavior.letsItemsOut(aSide, aCoverID, aCoverVariable, -1, aTileEntity); } @Override public boolean letsIn(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsItemsIn(aSide, aCoverID, aCoverVariable, -1, aTileEntity); } @Override public boolean letsOut(GT_CoverBehaviorBase coverBehavior, byte aSide, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return coverBehavior.letsItemsOut(aSide, aCoverID, aCoverVariable, -1, aTileEntity); } @@ -303,13 +293,12 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE boolean connectable = GT_Utility.isConnectableNonInventoryPipe(tTileEntity, tSide); final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity) - ? (IGregTechTileEntity) tTileEntity - : null; + ? (IGregTechTileEntity) tTileEntity + : null; if (gTileEntity != null) { if (gTileEntity.getMetaTileEntity() == null) return false; if (gTileEntity.getMetaTileEntity() - .connectsToItemPipe(tSide)) - return true; + .connectsToItemPipe(tSide)) return true; connectable = true; } @@ -346,7 +335,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE for (byte i : ALL_VALID_SIDES) { tSide = (byte) ((i + tOffset) % 6); if (isConnectedAtSide(tSide) - && (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity()))) { + && (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity()))) { if (insertItemStackIntoTileEntity(aSender, tSide)) return true; } } @@ -357,23 +346,23 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide) { if (getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .letsItemsOut(-1)) { + .letsItemsOut(-1)) { final TileEntity tInventory = getBaseMetaTileEntity().getTileEntityAtSide(aSide); if (tInventory != null && !(tInventory instanceof BaseMetaPipeEntity)) { if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser)) - || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) { + || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) { return GT_Utility.moveMultipleItemStacks( - aSender, - tInventory, - (byte) 6, - GT_Utility.getOppositeSide(aSide), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1, - 1) > 0; + aSender, + tInventory, + (byte) 6, + GT_Utility.getOppositeSide(aSide), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + 1) > 0; } } } @@ -443,13 +432,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public String[] getDescription() { if (mTickTime == 20) return new String[] { "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec", - "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; + "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; else if (mTickTime % 20 == 0) return new String[] { - "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + (mTickTime / 20) + "%%% sec", - "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; + "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + (mTickTime / 20) + "%%% sec", + "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; else return new String[] { - "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks", - "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; + "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks", + "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize) }; } private boolean isInventoryEmpty() { @@ -512,18 +501,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f; if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f; - return AxisAlignedBB.getBoundingBox( - aX + tSide4, - aY + tSide0, - aZ + tSide2, - aX + tSide5, - aY + tSide1, - aZ + tSide3); + return AxisAlignedBB + .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) { final AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java index bae070f6dd..ad6a730863 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java @@ -39,7 +39,7 @@ import ic2.api.item.IElectricItem; * Machine */ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_TieredMachineBlock - implements IAddUIWidgets { + implements IAddUIWidgets { public boolean mCharge = false, mDecharge = false; public int mBatteryCount = 0, mChargeableCount = 0; @@ -48,17 +48,17 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier private long mMax = 0; public GT_MetaTileEntity_BasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier, - String aDescription, int aSlotCount) { + String aDescription, int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - int aSlotCount) { + int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures, int aSlotCount) { + ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @@ -76,16 +76,16 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier for (byte i = -1; i < 16; i++) { rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1] }; rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - mInventory.length == 16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] - : mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] - : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + mInventory.length == 16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] + : mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] + : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; } return rTextures; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; } @@ -238,13 +238,13 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName() - .startsWith("gt.metaitem.01.")) { + .startsWith("gt.metaitem.01.")) { String name = aStack.getUnlocalizedName(); if (name.equals("gt.metaitem.01.32510") || name.equals("gt.metaitem.01.32511") - || name.equals("gt.metaitem.01.32520") - || name.equals("gt.metaitem.01.32521") - || name.equals("gt.metaitem.01.32530") - || name.equals("gt.metaitem.01.32531")) { + || name.equals("gt.metaitem.01.32520") + || name.equals("gt.metaitem.01.32521") + || name.equals("gt.metaitem.01.32530") + || name.equals("gt.metaitem.01.32531")) { if (ic2.api.item.ElectricItem.manager.getCharge(aStack) == 0) { return true; } @@ -313,16 +313,15 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier updateStorageInfo(); return new String[] { EnumChatFormatting.BLUE + getLocalName() + EnumChatFormatting.RESET, "Stored Items:", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mStored) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMax) - + EnumChatFormatting.RESET - + " EU", - "Average input:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricInput()) + " EU/t", - "Average output:", - GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricOutput()) + " EU/t" }; + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mStored) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMax) + + EnumChatFormatting.RESET + + " EU", + "Average input:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricInput()) + " EU/t", + "Average output:", GT_Utility.formatNumbers(getBaseMetaTileEntity().getAverageElectricOutput()) + " EU/t" }; } private void updateStorageInfo() { @@ -336,31 +335,31 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { NBTTagCompound tag = accessor.getNBTData(); currenttip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.stored", - GT_Utility.formatNumbers(tag.getLong("mStored")), - GT_Utility.formatNumbers(tag.getLong("mMax")))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.stored", + GT_Utility.formatNumbers(tag.getLong("mStored")), + GT_Utility.formatNumbers(tag.getLong("mMax")))); long avgIn = tag.getLong("AvgIn"); long avgOut = tag.getLong("AvgOut"); currenttip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.avg_in", - GT_Utility.formatNumbers(avgIn), - GT_Utility.getColoredTierNameFromVoltage(avgIn))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.avg_in", + GT_Utility.formatNumbers(avgIn), + GT_Utility.getColoredTierNameFromVoltage(avgIn))); currenttip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.avg_out", - GT_Utility.formatNumbers(avgOut), - GT_Utility.getColoredTierNameFromVoltage(avgOut))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.avg_out", + GT_Utility.formatNumbers(avgOut), + GT_Utility.getColoredTierNameFromVoltage(avgOut))); super.getWailaBody(itemStack, currenttip, accessor, config); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { updateStorageInfo(); super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setLong("mStored", mStored); @@ -383,61 +382,61 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { switch (mInventory.length) { case 4 -> builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(0) - .endAtSlot(3) - .slotCreator(index -> new BaseSlot(inventoryHandler, index) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }) - .background(getGUITextureSet().getItemSlot()) - .build() - .setPos(70, 25)); + SlotGroup.ofItemHandler(inventoryHandler, 2) + .startFromSlot(0) + .endAtSlot(3) + .slotCreator(index -> new BaseSlot(inventoryHandler, index) { + + @Override + public int getSlotStackLimit() { + return 1; + } + }) + .background(getGUITextureSet().getItemSlot()) + .build() + .setPos(70, 25)); case 9 -> builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(0) - .endAtSlot(8) - .slotCreator(index -> new BaseSlot(inventoryHandler, index) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }) - .background(getGUITextureSet().getItemSlot()) - .build() - .setPos(61, 16)); + SlotGroup.ofItemHandler(inventoryHandler, 3) + .startFromSlot(0) + .endAtSlot(8) + .slotCreator(index -> new BaseSlot(inventoryHandler, index) { + + @Override + public int getSlotStackLimit() { + return 1; + } + }) + .background(getGUITextureSet().getItemSlot()) + .build() + .setPos(61, 16)); case 16 -> builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(0) - .endAtSlot(15) - .slotCreator(index -> new BaseSlot(inventoryHandler, index) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }) - .background(getGUITextureSet().getItemSlot()) - .build() - .setPos(52, 7)); + SlotGroup.ofItemHandler(inventoryHandler, 4) + .startFromSlot(0) + .endAtSlot(15) + .slotCreator(index -> new BaseSlot(inventoryHandler, index) { + + @Override + public int getSlotStackLimit() { + return 1; + } + }) + .background(getGUITextureSet().getItemSlot()) + .build() + .setPos(52, 7)); default -> builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 1) - .startFromSlot(0) - .endAtSlot(0) - .slotCreator(index -> new BaseSlot(inventoryHandler, index) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }) - .background(getGUITextureSet().getItemSlot()) - .build() - .setPos(79, 34)); + SlotGroup.ofItemHandler(inventoryHandler, 1) + .startFromSlot(0) + .endAtSlot(0) + .slotCreator(index -> new BaseSlot(inventoryHandler, index) { + + @Override + public int getSlotStackLimit() { + return 1; + } + }) + .background(getGUITextureSet().getItemSlot()) + .build() + .setPos(79, 34)); } } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index 182b25fb92..ef7242b420 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -25,12 +25,12 @@ import gregtech.common.GT_Pollution; public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity_BasicTank { public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } public GT_MetaTileEntity_BasicGenerator(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, ITexture... aTextures) { + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } @@ -62,10 +62,9 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { return mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex - + 1]; + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; } @Override @@ -214,21 +213,21 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (mInventory[getStackDisplaySlot()] == null) mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); mInventory[getStackDisplaySlot()].setStackDisplayName( - "Draining internal buffer: " - + GT_Utility.formatNumbers( - aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) - + " EU"); + "Draining internal buffer: " + + GT_Utility.formatNumbers( + aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + + " EU"); } } else { long tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid); if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount >= tConsumed) { long tFluidAmountToUse = Math.min( - mFluid.amount / tConsumed, - (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); + mFluid.amount / tConsumed, + (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); // long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + // getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);//TODO CHECK if (tFluidAmountToUse > 0 - && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { + && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { // divided by two because this is called every 10 ticks, not 20 GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); mFluid.amount -= tFluidAmountToUse * tConsumed; @@ -237,9 +236,9 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity } if (mInventory[getInputSlot()] != null - && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) - && ((GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null) - || solidFuelOverride(mInventory[getInputSlot()]))) { + && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) + && ((GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null) + || solidFuelOverride(mInventory[getInputSlot()]))) { long tFuelValue = getFuelValue(mInventory[getInputSlot()]); if (tFuelValue <= 0) tFuelValue = getFuelValue(mInventory[getInputSlot()], true); // System.out.println(" tFuelValue : " + tFuelValue ); @@ -256,8 +255,8 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity } if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive( - aBaseMetaTileEntity.isAllowedToWork() - && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); + aBaseMetaTileEntity.isAllowedToWork() + && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); } /** @@ -270,18 +269,18 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity // if it is a gregtech Item, make sure its not a VOLUMETRIC_FLASK or any type of cell, else do vanilla checks if (association != null) { return !OrePrefixes.CELL_TYPES.contains(association.mPrefix) - && !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true); + && !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true); } else { return stack != null && // when the stack is null its not a solid - stack.getItem() != null && // when the item in the stack is null its not a solid - !(stack.getItem() instanceof IFluidContainerItem) && // when the item is a fluid container its not a - // solid... - !(stack.getItem() instanceof IFluidHandler) && // when the item is a fluid handler its not a - // solid... - !stack.getItem() - .getUnlocalizedName() - .contains("bucket"); // since we cant really check for - // buckets... + stack.getItem() != null && // when the item in the stack is null its not a solid + !(stack.getItem() instanceof IFluidContainerItem) && // when the item is a fluid container its not a + // solid... + !(stack.getItem() instanceof IFluidHandler) && // when the item is a fluid handler its not a + // solid... + !stack.getItem() + .getUnlocalizedName() + .contains("bucket"); // since we cant really check for + // buckets... } } @@ -333,7 +332,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack, true) > 0 - || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true), true) > 0); + || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true), true) > 0); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java index cb9c670f05..ff1365a735 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java @@ -13,22 +13,22 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank { public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 1, aDescription, aTextures); } public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription, ITexture... aTextures) { + String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -114,7 +114,7 @@ public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aConnected, boolean aRedstone) { + boolean aConnected, boolean aRedstone) { return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0)][aColorIndex + 1]; } @@ -126,11 +126,11 @@ public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank { rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1] }; rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1] }; rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; } return rTextures; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java index 1296d846af..c9b66e6baf 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull_NonElectric.java @@ -6,23 +6,23 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; public abstract class GT_MetaTileEntity_BasicHull_NonElectric extends GT_MetaTileEntity_BasicHull { public GT_MetaTileEntity_BasicHull_NonElectric(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); } public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, - byte aColorIndex, boolean aConnected, boolean aRedstone) { + byte aColorIndex, boolean aConnected, boolean aRedstone) { return mTextures[Math.min(2, aSide)][aColorIndex + 1]; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 49b76b1579..4868200bf1 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -87,19 +87,19 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom; * Machine */ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank - implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets { + implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets { /** * return values for checkRecipe() */ protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, - FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; + FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; public static final int OTHER_SLOT_COUNT = 5; public final ItemStack[] mOutputItems; public final int mInputSlotCount, mAmperage; public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, - mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; + mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; public boolean mDisableFilter = true; public boolean mDisableMultiStack = true; public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0; @@ -124,16 +124,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * SideFacingPipeInactive */ public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, - String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, - ITexture... aOverlays) { + String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, + ITexture... aOverlays) { super( - aID, - aName, - aNameRegional, - aTier, - OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, - aDescription, - aOverlays); + aID, + aName, + aNameRegional, + aTier, + OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, + aDescription, + aOverlays); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; mAmperage = aAmperage; @@ -143,16 +143,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } public GT_MetaTileEntity_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, - String[] aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, - ITexture... aOverlays) { + String[] aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, + ITexture... aOverlays) { super( - aID, - aName, - aNameRegional, - aTier, - OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, - aDescription, - aOverlays); + aID, + aName, + aNameRegional, + aTier, + OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, + aDescription, + aOverlays); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; mAmperage = aAmperage; @@ -162,7 +162,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, - ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { + ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -173,7 +173,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, - ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { + ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -236,7 +236,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { final int textureIndex; if (mMainFacing < 2) { if (aSide == aFacing) { @@ -293,8 +293,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean isValidSlot(int aIndex) { return aIndex > 0 && super.isValidSlot(aIndex) - && aIndex != getCircuitSlot() - && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; + && aIndex != getCircuitSlot() + && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; } @Override @@ -514,20 +514,20 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - mGUIName, - GT_Utility.isStringValid(mNEIName) ? mNEIName - : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + mGUIName, + GT_Utility.isStringValid(mNEIName) ? mNEIName + : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); } @Override public void initDefaultModes(NBTTagCompound aNBT) { mMainFacing = -1; if (!getBaseMetaTileEntity().getWorld().isRemote) { - GT_ClientPreference tPreference = GT_Mod.gregtechproxy.getClientPreference( - getBaseMetaTileEntity().getOwnerUuid()); + GT_ClientPreference tPreference = GT_Mod.gregtechproxy + .getClientPreference(getBaseMetaTileEntity().getOwnerUuid()); if (tPreference != null) { mDisableFilter = !tPreference.isSingleBlockInitialFilterEnabled(); mDisableMultiStack = !tPreference.isSingleBlockInitialMultiStackEnabled(); @@ -592,9 +592,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) { if (++mProgresstime >= mMaxProgresstime) { for (int i = 0; i < mOutputItems.length; i++) - for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot() + ((j + i) % mOutputItems.length), - mOutputItems[i])) + for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity + .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break; if (mOutputFluid != null) if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy()); @@ -629,47 +628,45 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B boolean tRemovedOutputFluid = false; if (doesAutoOutputFluids() && getDrainableStack() != null - && aBaseMetaTileEntity.getFrontFacing() != mMainFacing - && (tSucceeded || aTick % 20 == 0)) { + && aBaseMetaTileEntity.getFrontFacing() != mMainFacing + && (tSucceeded || aTick % 20 == 0)) { IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); if (tTank != null) { FluidStack tDrained = drain(1000, false); if (tDrained != null) { - int tFilledAmount = tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - tDrained, - false); + int tFilledAmount = tTank + .fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); if (tFilledAmount > 0) tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - drain(tFilledAmount, true), - true); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + drain(tFilledAmount, true), + true); } } if (getDrainableStack() == null) tRemovedOutputFluid = true; } if (doesAutoOutput() && !isOutputEmpty() - && aBaseMetaTileEntity.getFrontFacing() != mMainFacing - && (tSucceeded || mOutputBlocked % 300 == 1 - || aBaseMetaTileEntity.hasInventoryBeenModified() - || aTick % 600 == 0)) { + && aBaseMetaTileEntity.getFrontFacing() != mMainFacing + && (tSucceeded || mOutputBlocked % 300 == 1 + || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600 == 0)) { TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); long tStoredEnergy = aBaseMetaTileEntity.getUniversalEnergyStored(); int tMaxStacks = (int) (tStoredEnergy / 64L); if (tMaxStacks > mOutputItems.length) tMaxStacks = mOutputItems.length; moveMultipleItemStacks( - aBaseMetaTileEntity, - tTileEntity2, - aBaseMetaTileEntity.getFrontFacing(), - aBaseMetaTileEntity.getBackFacing(), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1, - tMaxStacks); + aBaseMetaTileEntity, + tTileEntity2, + aBaseMetaTileEntity.getFrontFacing(), + aBaseMetaTileEntity.getBackFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + tMaxStacks); // for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && // aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { // tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, @@ -684,11 +681,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (allowToCheckRecipe()) { if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() - && (tRemovedOutputFluid || tSucceeded - || aBaseMetaTileEntity.hasInventoryBeenModified() - || aTick % 600 == 0 - || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) - && hasEnoughEnergyToCheckRecipe()) { + && (tRemovedOutputFluid || tSucceeded + || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) + && hasEnoughEnergyToCheckRecipe()) { if (checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) { if (getSpecialSlot() != null && getSpecialSlot().stackSize <= 0) mInventory[getSpecialSlotIndex()] = null; @@ -755,10 +752,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true)) mInventory[tDisplayStackSlot] = null; } else { - mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack( - getFillableStack(), - true, - !displaysStackSize()); + mInventory[tDisplayStackSlot] = GT_Utility + .getFluidDisplayStack(getFillableStack(), true, !displaysStackSize()); } } } @@ -803,7 +798,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B protected boolean canOutput(GT_Recipe aRecipe) { return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null - : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); + : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); } protected boolean canOutput(ItemStack... aOutputs) { @@ -811,11 +806,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B ItemStack[] tOutputSlots = getAllOutputs(); for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++) if (tOutputSlots[i] != null && aOutputs[i] != null - && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) - || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) { - mOutputBlocked++; - return false; - } + && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) + || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) { + mOutputBlocked++; + return false; + } return true; } @@ -929,29 +924,29 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public String[] getInfoData() { return new String[] { EnumChatFormatting.BLUE + mNEIName + EnumChatFormatting.RESET, "Progress:", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers((mProgresstime / 20)) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - "Stored Energy:", - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU()) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getBaseMetaTileEntity().getEUCapacity()) - + EnumChatFormatting.RESET - + " EU", - "Probably uses: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mEUt) - + EnumChatFormatting.RESET - + " EU/t at " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mEUt == 0 ? 0 : mAmperage) - + EnumChatFormatting.RESET - + " A" }; + EnumChatFormatting.GREEN + GT_Utility.formatNumbers((mProgresstime / 20)) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + "Stored Energy:", + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU()) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getBaseMetaTileEntity().getEUCapacity()) + + EnumChatFormatting.RESET + + " EU", + "Probably uses: " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(mEUt) + + EnumChatFormatting.RESET + + " EU/t at " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(mEUt == 0 ? 0 : mAmperage) + + EnumChatFormatting.RESET + + " A" }; } @Override @@ -965,29 +960,29 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (aPlayer.isSneaking()) { mDisableFilter = !mDisableFilter; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.hatch.disableFilter." + mDisableFilter)); + aPlayer, + StatCollector.translateToLocal("GT5U.hatch.disableFilter." + mDisableFilter)); } else { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; GT_Utility.sendChatToPlayer( - aPlayer, - mAllowInputFromOutputSide ? GT_Utility.trans("095", "Input from Output Side allowed") - : GT_Utility.trans("096", "Input from Output Side forbidden")); + aPlayer, + mAllowInputFromOutputSide ? GT_Utility.trans("095", "Input from Output Side allowed") + : GT_Utility.trans("096", "Input from Output Side forbidden")); } } } @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (!aPlayer.isSneaking()) return false; boolean click = super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); if (click) return true; if (aWrenchingSide != mMainFacing) return false; mDisableMultiStack = !mDisableMultiStack; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.hatch.disableMultiStack." + mDisableMultiStack)); + aPlayer, + StatCollector.translateToLocal("GT5U.hatch.disableMultiStack." + mDisableMultiStack)); return true; } @@ -996,10 +991,10 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (aSide != mMainFacing) return true; GT_CoverBehaviorBase tBehavior = GregTech_API.getCoverBehaviorNew(aCoverID.toStack()); return tBehavior.isGUIClickable( - aSide, - GT_Utility.stackToInt(aCoverID.toStack()), - tBehavior.createDataObject(), - getBaseMetaTileEntity()); + aSide, + GT_Utility.stackToInt(aCoverID.toStack()), + tBehavior.createDataObject(), + getBaseMetaTileEntity()); } @Override @@ -1010,9 +1005,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (aSide == mMainFacing || aIndex < getInputSlot() - || aIndex >= getInputSlot() + mInputSlotCount - || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) - return false; + || aIndex >= getInputSlot() + mInputSlotCount + || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false; for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++) if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i]) && mDisableMultiStack) return i == aIndex; @@ -1025,7 +1019,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * check for it anyway. */ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return !mDisableMultiStack || mInventory[aIndex] == null; } @@ -1085,25 +1079,25 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) { return // TODO check or get a better solution DimensionManager.getProvider(dimId) - .getClass() - .getName() - .contains("Orbit") - || DimensionManager.getProvider(dimId) - .getClass() - .getName() - .endsWith("Space") - || DimensionManager.getProvider(dimId) - .getClass() - .getName() - .endsWith("Asteroids") - || DimensionManager.getProvider(dimId) - .getClass() - .getName() - .endsWith("SS") - || DimensionManager.getProvider(dimId) - .getClass() - .getName() - .contains("SpaceStation"); + .getClass() + .getName() + .contains("Orbit") + || DimensionManager.getProvider(dimId) + .getClass() + .getName() + .endsWith("Space") + || DimensionManager.getProvider(dimId) + .getClass() + .getName() + .endsWith("Asteroids") + || DimensionManager.getProvider(dimId) + .getClass() + .getName() + .endsWith("SS") + || DimensionManager.getProvider(dimId) + .getClass() + .getName() + .contains("SpaceStation"); } /** @@ -1116,17 +1110,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B GT_Recipe_Map tMap = getRecipeList(); if (tMap == null) return DID_NOT_FIND_RECIPE; GT_Recipe tRecipe = tMap.findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - V[mTier], - new FluidStack[] { getFillableStack() }, - getSpecialSlot(), - getAllInputs()); + getBaseMetaTileEntity(), + mLastRecipe, + false, + V[mTier], + new FluidStack[] { getFillableStack() }, + getSpecialSlot(), + getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (GT_Mod.gregtechproxy.mLowGravProcessing && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300) - && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) + && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { @@ -1134,8 +1128,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } if (tRecipe.mSpecialValue == -200 - && (getCallbackBase() == null || !(getCallbackBase() instanceof GT_MetaTileEntity_Cleanroom) - || ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency == 0)) + && (getCallbackBase() == null || !(getCallbackBase() instanceof GT_MetaTileEntity_Cleanroom) + || ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency == 0)) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -1145,14 +1139,14 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (tRecipe.mSpecialValue == -200 || tRecipe.mSpecialValue == -300) for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null && getBaseMetaTileEntity().getRandomNumber(10000) - > ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency) { - if (debugCleanroom) { - GT_Log.out.println( - "BasicMachine: Voiding output due to efficiency failure. mEfficiency = " - + ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency); - } - mOutputItems[i] = null; + > ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency) { + if (debugCleanroom) { + GT_Log.out.println( + "BasicMachine: Voiding output due to efficiency failure. mEfficiency = " + + ((GT_MetaTileEntity_Cleanroom) getCallbackBase()).mEfficiency); } + mOutputItems[i] = null; + } mOutputFluid = tRecipe.getFluidOutput(0); if (!skipOC) { calculateOverclockedNess(tRecipe); @@ -1221,7 +1215,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); if (tag.getBoolean("stutteringSingleBlock")) { @@ -1232,41 +1226,41 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B int mEUt = tag.getInteger("eut"); if (mEUt > 0) { currenttip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.use", - GT_Utility.formatNumbers(mEUt), - GT_Utility.getColoredTierNameFromVoltage(mEUt))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.use", + GT_Utility.formatNumbers(mEUt), + GT_Utility.getColoredTierNameFromVoltage(mEUt))); } else if (mEUt < 0) { currenttip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.produce", - GT_Utility.formatNumbers(-mEUt), - GT_Utility.getColoredTierNameFromVoltage(-mEUt))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.produce", + GT_Utility.formatNumbers(-mEUt), + GT_Utility.getColoredTierNameFromVoltage(-mEUt))); } } currenttip.add( - GT_Waila.getMachineProgressString( - isActive, - tag.getInteger("maxProgressSingleBlock"), - tag.getInteger("progressSingleBlock"))); + GT_Waila.getMachineProgressString( + isActive, + tag.getInteger("maxProgressSingleBlock"), + tag.getInteger("progressSingleBlock"))); } currenttip.add( - String.format( - "Machine Facing: %s", - ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock")) - .name())); + String.format( + "Machine Facing: %s", + ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock")) + .name())); currenttip.add( - String.format( - "Output Facing: %s", - ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock")) - .name())); + String.format( + "Output Facing: %s", + ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock")) + .name())); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("progressSingleBlock", mProgresstime); @@ -1310,9 +1304,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B getRecipeList().addGregTechLogoUI(builder, new Pos2d(0, 0)); } else { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(152, 63)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(152, 63)); } } @@ -1328,22 +1322,21 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B builder.widget(createChargerSlot(79, 62)); if (getRecipeList() != null) { builder.widget( - setNEITransferRect( - createProgressBar( - isSteampowered() ? getRecipeList().getProgressBarTextureSteam(getSteamVariant()) - : getRecipeList().getProgressBarTexture(), - getRecipeList().getProgressBarImageSize(), - getRecipeList().progressBarDirection, - getRecipeList().progressBarPos, - getRecipeList().progressBarSize), - getRecipeList().mNEIName)); + setNEITransferRect( + createProgressBar( + isSteampowered() ? getRecipeList().getProgressBarTextureSteam(getSteamVariant()) + : getRecipeList().getProgressBarTexture(), + getRecipeList().getProgressBarImageSize(), + getRecipeList().progressBarDirection, + getRecipeList().progressBarPos, + getRecipeList().progressBarSize), + getRecipeList().mNEIName)); addProgressBarSpecialTextures(builder); } builder.widget( - createErrorStatusArea( - builder, - isSteampowered() ? GT_UITextures.PICTURE_STALLED_STEAM - : GT_UITextures.PICTURE_STALLED_ELECTRICITY)); + createErrorStatusArea( + builder, + isSteampowered() ? GT_UITextures.PICTURE_STALLED_STEAM : GT_UITextures.PICTURE_STALLED_ELECTRICITY)); } /** @@ -1351,23 +1344,23 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B */ protected void addIOSlots(ModularWindow.Builder builder) { final boolean hasFluidInput = getRecipeList() != null ? (getRecipeList().hasFluidInputs()) - : (getCapacity() != 0); + : (getCapacity() != 0); final boolean hasFluidOutput = getRecipeList() != null && getRecipeList().hasFluidOutputs(); UIHelper.forEachSlots( - (i, backgrounds, pos) -> builder.widget(createItemInputSlot(i, backgrounds, pos)), - (i, backgrounds, pos) -> builder.widget(createItemOutputSlot(i, backgrounds, pos)), - (i, backgrounds, pos) -> builder.widget(createSpecialSlot(backgrounds, pos)), - (i, backgrounds, pos) -> builder.widget(createFluidInputSlot(backgrounds, pos)), - (i, backgrounds, pos) -> builder.widget(createFluidOutputSlot(backgrounds, pos)), - getGUITextureSet().getItemSlot(), - getGUITextureSet().getFluidSlot(), - getRecipeList(), - mInputSlotCount, - mOutputItems.length, - hasFluidInput ? 1 : 0, - hasFluidOutput ? 1 : 0, - getSteamVariant(), - Pos2d.ZERO); + (i, backgrounds, pos) -> builder.widget(createItemInputSlot(i, backgrounds, pos)), + (i, backgrounds, pos) -> builder.widget(createItemOutputSlot(i, backgrounds, pos)), + (i, backgrounds, pos) -> builder.widget(createSpecialSlot(backgrounds, pos)), + (i, backgrounds, pos) -> builder.widget(createFluidInputSlot(backgrounds, pos)), + (i, backgrounds, pos) -> builder.widget(createFluidOutputSlot(backgrounds, pos)), + getGUITextureSet().getItemSlot(), + getGUITextureSet().getFluidSlot(), + getRecipeList(), + mInputSlotCount, + mOutputItems.length, + hasFluidInput ? 1 : 0, + hasFluidOutput ? 1 : 0, + getSteamVariant(), + Pos2d.ZERO); } /** @@ -1375,8 +1368,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B */ protected SlotWidget createItemInputSlot(int index, IDrawable[] backgrounds, Pos2d pos) { return (SlotWidget) new SlotWidget(inventoryHandler, getInputSlot() + index).setAccess(true, true) - .setBackground(backgrounds) - .setPos(pos); + .setBackground(backgrounds) + .setPos(pos); } /** @@ -1384,8 +1377,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B */ protected SlotWidget createItemOutputSlot(int index, IDrawable[] backgrounds, Pos2d pos) { return (SlotWidget) new SlotWidget(inventoryHandler, getOutputSlot() + index).setAccess(true, false) - .setBackground(backgrounds) - .setPos(pos); + .setBackground(backgrounds) + .setPos(pos); } /** @@ -1393,71 +1386,57 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B */ protected SlotWidget createSpecialSlot(IDrawable[] backgrounds, Pos2d pos) { return (SlotWidget) new SlotWidget(inventoryHandler, getSpecialSlotIndex()).setAccess(true, true) - .disableShiftInsert() - .setGTTooltip( - () -> mTooltipCache.getData( - getRecipeList() - != null - && getRecipeList().usesSpecialSlot() - ? SPECIAL_SLOT_TOOLTIP - : UNUSED_SLOT_TOOLTIP)) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(backgrounds) - .setPos(pos); + .disableShiftInsert() + .setGTTooltip( + () -> mTooltipCache.getData( + getRecipeList() != null && getRecipeList().usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP + : UNUSED_SLOT_TOOLTIP)) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(backgrounds) + .setPos(pos); } protected FluidDisplaySlotWidget createFluidInputSlot(IDrawable[] backgrounds, Pos2d pos) { return (FluidDisplaySlotWidget) new FluidDisplaySlotWidget( - inventoryHandler, - OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length) - .setFluidAccessConstructor( - () -> constructFluidAccess(true)) - .setIHasFluidDisplay(this) - .setCanDrain(true) - .setCanFill(true) - .setActionRealClick( - FluidDisplaySlotWidget.Action.TRANSFER) - .setBeforeRealClick((clickData, widget) -> { - if (NetworkUtils.isClient()) { - // propagate display item content to - // actual fluid stored in this tank - setFillableStack( - GT_Utility.getFluidFromDisplayStack( - widget.getMcSlot() - .getStack())); - } - return true; - }) - .setUpdateFluidDisplayItem( - this::updateFluidInputDisplayItem) - .setGTTooltip( - () -> mTooltipCache.getData( - FLUID_INPUT_TOOLTIP, - GT_Utility.formatNumbers( - getCapacity()))) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(backgrounds) - .setPos(pos); + inventoryHandler, + OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length) + .setFluidAccessConstructor(() -> constructFluidAccess(true)) + .setIHasFluidDisplay(this) + .setCanDrain(true) + .setCanFill(true) + .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER) + .setBeforeRealClick((clickData, widget) -> { + if (NetworkUtils.isClient()) { + // propagate display item content to + // actual fluid stored in this tank + setFillableStack( + GT_Utility.getFluidFromDisplayStack( + widget.getMcSlot() + .getStack())); + } + return true; + }) + .setUpdateFluidDisplayItem(this::updateFluidInputDisplayItem) + .setGTTooltip(() -> mTooltipCache.getData(FLUID_INPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity()))) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(backgrounds) + .setPos(pos); } protected FluidDisplaySlotWidget createFluidOutputSlot(IDrawable[] backgrounds, Pos2d pos) { - return (FluidDisplaySlotWidget) createDrainableFluidSlot().setUpdateFluidDisplayItem( - this::updateFluidOutputDisplayItem) - .setGTTooltip( - () -> mTooltipCache.getData( - FLUID_OUTPUT_TOOLTIP, - GT_Utility.formatNumbers( - getCapacity()))) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(backgrounds) - .setPos(pos); + return (FluidDisplaySlotWidget) createDrainableFluidSlot() + .setUpdateFluidDisplayItem(this::updateFluidOutputDisplayItem) + .setGTTooltip(() -> mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity()))) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(backgrounds) + .setPos(pos); } @Override protected SlotWidget createChargerSlot(int x, int y) { if (isSteampowered()) { - return (SlotWidget) createChargerSlot(x, y, UNUSED_SLOT_TOOLTIP, new String[0]).setBackground( - getGUITextureSet().getItemSlot()); + return (SlotWidget) createChargerSlot(x, y, UNUSED_SLOT_TOOLTIP, new String[0]) + .setBackground(getGUITextureSet().getItemSlot()); } else { return super.createChargerSlot(x, y); } @@ -1465,36 +1444,32 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B protected CycleButtonWidget createItemAutoOutputButton() { return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mItemTransfer, val -> mItemTransfer = val) - .setStaticTexture( - GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setGTTooltip( - () -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP)) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(25, 62) - .setSize(18, 18); + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setGTTooltip(() -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP)) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(25, 62) + .setSize(18, 18); } protected CycleButtonWidget createFluidAutoOutputButton() { return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mFluidTransfer, val -> mFluidTransfer = val) - .setStaticTexture( - GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setGTTooltip( - () -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP)) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(7, 62) - .setSize(18, 18); + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setGTTooltip(() -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP)) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(7, 62) + .setSize(18, 18); } protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction, - Pos2d pos, Size size) { + Pos2d pos, Size size) { final ProgressBar ret = new ProgressBar(); ret.setProgress(() -> maxProgresstime() != 0 ? (float) getProgresstime() / maxProgresstime() : 0) - .setTexture(texture, imageSize) - .setDirection(direction) - .setPos(pos) - .setSize(size); + .setTexture(texture, imageSize) + .setDirection(direction) + .setPos(pos) + .setSize(size); return ret; } @@ -1507,13 +1482,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B final Power powerInfo = getPower(); final String transferRectTooltip; if (isSteampowered()) { - transferRectTooltip = StatCollector.translateToLocalFormatted( - NEI_TRANSFER_STEAM_TOOLTIP, - powerInfo.getTierString()); + transferRectTooltip = StatCollector + .translateToLocalFormatted(NEI_TRANSFER_STEAM_TOOLTIP, powerInfo.getTierString()); } else { - transferRectTooltip = StatCollector.translateToLocalFormatted( - NEI_TRANSFER_VOLTAGE_TOOLTIP, - powerInfo.getTierString()); + transferRectTooltip = StatCollector + .translateToLocalFormatted(NEI_TRANSFER_VOLTAGE_TOOLTIP, powerInfo.getTierString()); } widget.setNEITransferRect(transferRectID, new Object[] { powerInfo }, transferRectTooltip); } @@ -1524,53 +1497,50 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B if (isSteampowered()) { for (Pair> specialTexture : getRecipeList().specialTexturesSteam) { builder.widget( - new DrawableWidget().setDrawable( - specialTexture.getLeft() - .get(getSteamVariant())) - .setSize( - specialTexture.getRight() - .getLeft()) - .setPos( - specialTexture.getRight() - .getRight())); + new DrawableWidget().setDrawable( + specialTexture.getLeft() + .get(getSteamVariant())) + .setSize( + specialTexture.getRight() + .getLeft()) + .setPos( + specialTexture.getRight() + .getRight())); } } else { for (Pair> specialTexture : getRecipeList().specialTextures) { builder.widget( - new DrawableWidget().setDrawable(specialTexture.getLeft()) - .setSize( - specialTexture.getRight() - .getLeft()) - .setPos( - specialTexture.getRight() - .getRight())); + new DrawableWidget().setDrawable(specialTexture.getLeft()) + .setSize( + specialTexture.getRight() + .getLeft()) + .setPos( + specialTexture.getRight() + .getRight())); } } } protected DrawableWidget createErrorStatusArea(ModularWindow.Builder builder, IDrawable picture) { return (DrawableWidget) new DrawableWidget().setDrawable(picture) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setEnabled( - widget -> !widget.getTooltip() - .isEmpty()) - .dynamicTooltip(this::getErrorDescriptions) - .dynamicTooltipShift(this::getErrorDescriptionsShift) - .setPos(79, 44) - .setSize(18, 18) - .attachSyncer( - new FakeSyncWidget.BooleanSyncer( - () -> mStuttering, - val -> mStuttering = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer( - () -> getBaseMetaTileEntity().getErrorDisplayID(), - val -> getBaseMetaTileEntity().setErrorDisplayID( - val)), - builder, - (widget, val) -> widget.notifyTooltipChange()); + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setEnabled( + widget -> !widget.getTooltip() + .isEmpty()) + .dynamicTooltip(this::getErrorDescriptions) + .dynamicTooltipShift(this::getErrorDescriptionsShift) + .setPos(79, 44) + .setSize(18, 18) + .attachSyncer( + new FakeSyncWidget.BooleanSyncer(() -> mStuttering, val -> mStuttering = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .attachSyncer( + new FakeSyncWidget.IntegerSyncer( + () -> getBaseMetaTileEntity().getErrorDisplayID(), + val -> getBaseMetaTileEntity().setErrorDisplayID(val)), + builder, + (widget, val) -> widget.notifyTooltipChange()); } protected List getErrorDescriptions() { @@ -1591,8 +1561,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } if (mStuttering) { return mTooltipCache.getData( - STALLED_STUTTERING_TOOLTIP, - StatCollector.translateToLocal(POWER_SOURCE_KEY + (isSteampowered() ? "steam" : "power"))); + STALLED_STUTTERING_TOOLTIP, + StatCollector.translateToLocal(POWER_SOURCE_KEY + (isSteampowered() ? "steam" : "power"))); } return null; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java index d2433e04e6..38fce53658 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java @@ -44,27 +44,27 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE public boolean mNeedsSteamVenting = false; public GT_MetaTileEntity_BasicMachine_Bronze(int aID, String aName, String aNameRegional, String aDescription, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { super( - aID, - aName, - aNameRegional, - aHighPressure ? 2 : 1, - 0, - aDescription, - aInputSlotCount, - aOutputSlotCount, - "", - ""); + aID, + aName, + aNameRegional, + aHighPressure ? 2 : 1, + 0, + aDescription, + aInputSlotCount, + aOutputSlotCount, + "", + ""); } public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String aDescription, ITexture[][][] aTextures, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, "", ""); } public GT_MetaTileEntity_BasicMachine_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, "", ""); } @@ -162,37 +162,25 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE @Override public boolean allowToCheckRecipe() { if (mNeedsSteamVenting - && getBaseMetaTileEntity().getCoverIDAtSide(getBaseMetaTileEntity().getFrontFacing()) == 0 - && !GT_Utility.hasBlockHitBox( - getBaseMetaTileEntity().getWorld(), - getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1), - getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1), - getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1))) { + && getBaseMetaTileEntity().getCoverIDAtSide(getBaseMetaTileEntity().getFrontFacing()) == 0 + && !GT_Utility.hasBlockHitBox( + getBaseMetaTileEntity().getWorld(), + getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1), + getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1), + getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1))) { sendSound((byte) 9); mNeedsSteamVenting = false; try { for (EntityLivingBase tLiving : getBaseMetaTileEntity().getWorld() - .getEntitiesWithinAABB( - EntityLivingBase.class, - AxisAlignedBB.getBoundingBox( - getBaseMetaTileEntity().getOffsetX( - getBaseMetaTileEntity().getFrontFacing(), - 1), - getBaseMetaTileEntity().getOffsetY( - getBaseMetaTileEntity().getFrontFacing(), - 1), - getBaseMetaTileEntity().getOffsetZ( - getBaseMetaTileEntity().getFrontFacing(), - 1), - getBaseMetaTileEntity().getOffsetX( - getBaseMetaTileEntity().getFrontFacing(), - 1) + 1, - getBaseMetaTileEntity().getOffsetY( - getBaseMetaTileEntity().getFrontFacing(), - 1) + 1, - getBaseMetaTileEntity().getOffsetZ( - getBaseMetaTileEntity().getFrontFacing(), - 1) + 1))) { + .getEntitiesWithinAABB( + EntityLivingBase.class, + AxisAlignedBB.getBoundingBox( + getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1), + getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1), + getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1), + getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 1, + getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 1, + getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 1))) { GT_Utility.applyHeatDamage(tLiving, getSteamDamage()); } } catch (Throwable e) { @@ -204,14 +192,10 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE @Override public int checkRecipe() { - GT_Recipe tRecipe = getRecipeList().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[mTier], - null, - getAllInputs()); + GT_Recipe tRecipe = getRecipeList() + .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[mTier], null, getAllInputs()); if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) - && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { + && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { this.mOutputItems[0] = tRecipe.getOutput(0); calculateOverclockedNess(tRecipe); return 2; @@ -238,21 +222,19 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ); new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD) - .setWorld(getBaseMetaTileEntity().getWorld()) - .setMotion( - ForgeDirection.getOrientation( - getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0, - ForgeDirection.getOrientation( - getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0, - ForgeDirection.getOrientation( - getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0) - .times( - 8, - x -> x.setPosition( - aX - 0.5 + XSTR_INSTANCE.nextFloat(), - aY - 0.5 + XSTR_INSTANCE.nextFloat(), - aZ - 0.5 + XSTR_INSTANCE.nextFloat()) - .run()); + .setWorld(getBaseMetaTileEntity().getWorld()) + .setMotion( + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0, + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0, + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0) + .times( + 8, + x -> x + .setPosition( + aX - 0.5 + XSTR_INSTANCE.nextFloat(), + aY - 0.5 + XSTR_INSTANCE.nextFloat(), + aZ - 0.5 + XSTR_INSTANCE.nextFloat()) + .run()); } } @@ -264,8 +246,7 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { return GregTech_API.getCoverBehaviorNew(aCoverID.toStack()) - .isSimpleCover() - && super.allowCoverOnSide(aSide, aCoverID); + .isSimpleCover() && super.allowCoverOnSide(aSide, aCoverID); } public float getSteamDamage() { @@ -275,99 +256,99 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE @Override public ITexture[] getSideFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getTopFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getBottomFacingPipeActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getBottomFacingPipeInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTopFacingPipeActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTopFacingPipeInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getSideFacingPipeActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getSideFacingPipeInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override @@ -383,9 +364,9 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(152, 63)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(152, 63)); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java index 70afd35f57..0dc019ae5c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -61,112 +61,93 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ private FallbackableUITexture progressBarTexture; public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - int aGUIParameterA, int aGUIParameterB, String aGUIName, ResourceLocation aSound, boolean aSharedTank, - boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, + int aGUIParameterA, int aGUIParameterB, String aGUIName, ResourceLocation aSound, boolean aSharedTank, + boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { super( - aID, - aName, - aNameRegional, - aTier, - aRecipes.mAmperage, - aDescription, - aInputSlots, - aOutputSlots, - aGUIName, - aRecipes.mNEIName, + aID, + aName, + aNameRegional, + aTier, + aRecipes.mAmperage, + aDescription, + aInputSlots, + aOutputSlots, + aGUIName, + aRecipes.mNEIName, + TextureFactory.of( TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_SIDE_ACTIVE")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_SIDE_ACTIVE_GLOW"))) - .glow() - .build()), + new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE_GLOW"))) + .glow() + .build()), + TextureFactory.of( + TextureFactory + .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_GLOW"))) + .glow() + .build()), + TextureFactory.of( TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_SIDE_GLOW"))) - .glow() - .build()), + new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE_GLOW"))) + .glow() + .build()), + TextureFactory.of( + TextureFactory + .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_GLOW"))) + .glow() + .build()), + TextureFactory.of( TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_FRONT_ACTIVE_GLOW"))) - .glow() - .build()), + new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE_GLOW"))) + .glow() + .build()), + TextureFactory.of( + TextureFactory + .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_GLOW"))) + .glow() + .build()), + TextureFactory.of( TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_FRONT_GLOW"))) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_TOP_ACTIVE")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_TOP_ACTIVE_GLOW"))) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_TOP_GLOW"))) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_BOTTOM_ACTIVE")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_BOTTOM_ACTIVE_GLOW"))) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")), - TextureFactory.builder() - .addIcon( - (new CustomIcon( - "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) - + "/OVERLAY_BOTTOM_GLOW"))) - .glow() - .build())); + new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE_GLOW"))) + .glow() + .build()), + TextureFactory.of( + TextureFactory + .of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")), + TextureFactory.builder() + .addIcon( + (new CustomIcon( + "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_GLOW"))) + .glow() + .build())); this.mSharedTank = aSharedTank; this.mTankCapacity = aTankCapacity; this.mSpecialEffect = aSpecialEffect; @@ -518,39 +499,39 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } if (!GT_ModHandler.addCraftingRecipe( - getStackForm(1), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED - | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE, - aRecipe)) { + getStackForm(1), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE, + aRecipe)) { throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName()); } } } public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - int aGUIParameterA, int aGUIParameterB, String aGUIName, SoundResource aSound, boolean aSharedTank, - boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { + String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, + int aGUIParameterA, int aGUIParameterB, String aGUIName, SoundResource aSound, boolean aSharedTank, + boolean aRequiresFluidForFiltering, SpecialEffects aSpecialEffect, String aOverlays, Object[] aRecipe) { this( - aID, - aName, - aNameRegional, - aTier, - aDescription, - aRecipes, - aInputSlots, - aOutputSlots, - aTankCapacity, - aGUIParameterA, - aGUIParameterB, - aGUIName, - aSound.resourceLocation, - aSharedTank, - aRequiresFluidForFiltering, - aSpecialEffect, - aOverlays, - aRecipe); + aID, + aName, + aNameRegional, + aTier, + aDescription, + aRecipes, + aInputSlots, + aOutputSlots, + aTankCapacity, + aGUIParameterA, + aGUIParameterB, + aGUIName, + aSound.resourceLocation, + aSharedTank, + aRequiresFluidForFiltering, + aSpecialEffect, + aOverlays, + aRecipe); } /** @@ -561,34 +542,34 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ */ @Deprecated public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, - String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, - int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, - boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { + String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, + int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, + boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { this( - aID, - aName, - aNameRegional, - aTier, - aDescription, - aRecipes, - aInputSlots, - aOutputSlots, - aTankCapacity, - aGUIParameterA, - aGUIParameterB, - aGUIName, - new ResourceLocation(aSound), - aSharedTank, - aRequiresFluidForFiltering, - SpecialEffects.fromId(aSpecialEffect), - aOverlays, - aRecipe); + aID, + aName, + aNameRegional, + aTier, + aDescription, + aRecipes, + aInputSlots, + aOutputSlots, + aTankCapacity, + aGUIParameterA, + aGUIParameterB, + aGUIName, + new ResourceLocation(aSound), + aSharedTank, + aRequiresFluidForFiltering, + SpecialEffects.fromId(aSpecialEffect), + aOverlays, + aRecipe); } public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, - GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, - int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, - String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, + int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, + String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); this.mSharedTank = aSharedTank; this.mTankCapacity = aTankCapacity; @@ -601,9 +582,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, - GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, - int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, - String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, + int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, + String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); this.mSharedTank = aSharedTank; this.mTankCapacity = aTankCapacity; @@ -618,23 +599,23 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicMachine_GT_Recipe( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mRecipes, - this.mInputSlotCount, - this.mOutputItems == null ? 0 : this.mOutputItems.length, - this.mTankCapacity, - this.mAmperage, - this.mGUIParameterA, - this.mGUIParameterB, - this.mTextures, - this.mGUIName, - this.mNEIName, - this.mSoundResourceLocation.toString(), - this.mSharedTank, - this.mRequiresFluidForFiltering, - this.mSpecialEffect.ordinal()).setProgressBarTexture(this.progressBarTexture); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mRecipes, + this.mInputSlotCount, + this.mOutputItems == null ? 0 : this.mOutputItems.length, + this.mTankCapacity, + this.mAmperage, + this.mGUIParameterA, + this.mGUIParameterB, + this.mTextures, + this.mGUIName, + this.mNEIName, + this.mSoundResourceLocation.toString(), + this.mSharedTank, + this.mRequiresFluidForFiltering, + this.mSpecialEffect.ordinal()).setProgressBarTexture(this.progressBarTexture); } public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTexture(FallbackableUITexture progressBarTexture) { @@ -644,7 +625,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTextureName(String name, UITexture fallback) { return setProgressBarTexture( - new FallbackableUITexture(UITexture.fullImage(GregTech.ID, "gui/progressbar/" + name), fallback)); + new FallbackableUITexture(UITexture.fullImage(GregTech.ID, "gui/progressbar/" + name), fallback)); } public GT_MetaTileEntity_BasicMachine_GT_Recipe setProgressBarTextureName(String name) { @@ -659,19 +640,19 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_BasicMachine( - aPlayerInventory, - aBaseMetaTileEntity, - this.getLocalName(), - this.mGUIName, - GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName - : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "", - this.mGUIParameterA, - this.mGUIParameterB); + aPlayerInventory, + aBaseMetaTileEntity, + this.getLocalName(), + this.mGUIName, + GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName + : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "", + this.mGUIParameterA, + this.mGUIParameterB); } @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false; switch (this.mInputSlotCount) { case 0 -> { @@ -679,10 +660,28 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } case 1 -> { if (this.getFillableStack() == null) return !this.mRequiresFluidForFiltering && this.getRecipeList() - .containsInput( - aStack); + .containsInput(aStack); else return this.getRecipeList() - .findRecipe( + .findRecipe( + this.getBaseMetaTileEntity(), + this.mLastRecipe, + true, + true, + V[this.mTier], + new FluidStack[] { this.getFillableStack() }, + this.getSpecialSlot(), + appendSelectedCircuit(aStack)) + != null; + } + case 2 -> { + return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) + && (((this.getInputAt(0) != null && this.getInputAt(1) != null) + || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList() + .containsInput(aStack) + : (this.getRecipeList() + .containsInput(aStack) + && this.getRecipeList() + .findRecipe( this.getBaseMetaTileEntity(), this.mLastRecipe, true, @@ -690,33 +689,14 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ V[this.mTier], new FluidStack[] { this.getFillableStack() }, this.getSpecialSlot(), - appendSelectedCircuit(aStack)) - != null; - } - case 2 -> { - return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) && (((this.getInputAt(0) - != null && this.getInputAt(1) != null) - || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList() - .containsInput(aStack) - : (this.getRecipeList() - .containsInput(aStack) - && this.getRecipeList() - .findRecipe( - this.getBaseMetaTileEntity(), - this.mLastRecipe, - true, - true, - V[this.mTier], - new FluidStack[] { this.getFillableStack() }, - this.getSpecialSlot(), - aIndex == this.getInputSlot() - ? appendSelectedCircuit(aStack, this.getInputAt(1)) - : appendSelectedCircuit(this.getInputAt(0), aStack)) - != null)))); + aIndex == this.getInputSlot() + ? appendSelectedCircuit(aStack, this.getInputAt(1)) + : appendSelectedCircuit(this.getInputAt(0), aStack)) + != null)))); } default -> { int tID = this.getBaseMetaTileEntity() - .getMetaTileID(); + .getMetaTileID(); if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) { // assembler // lv-iv; // circuit @@ -727,12 +707,11 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ // luv-uev if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) { if (OreDictionary.getOreName(oreID) - .startsWith("circuit")) - return true; + .startsWith("circuit")) return true; } } return this.getRecipeList() - .containsInput(aStack); + .containsInput(aStack); } } } @@ -751,20 +730,17 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case TOP_SMOKE -> { final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getFrontFacing() != topFacing - && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { new ParticleEventBuilder().setMotion(0.0D, 0.0D, 0.0D) - .setIdentifier(ParticleFX.SMOKE) - .setPosition( - aBaseMetaTileEntity.getXCoord() + 0.8F - - XSTR_INSTANCE.nextFloat() * 0.6F, - aBaseMetaTileEntity.getYCoord() + 0.9F - + XSTR_INSTANCE.nextFloat() * 0.2F, - aBaseMetaTileEntity.getZCoord() + 0.8F - - XSTR_INSTANCE.nextFloat() * 0.6F) - .setWorld(aBaseMetaTileEntity.getWorld()) - .run(); + .setIdentifier(ParticleFX.SMOKE) + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F) + .setWorld(aBaseMetaTileEntity.getWorld()) + .run(); } } default -> {} @@ -790,7 +766,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ final byte mainFacing = (byte) this.mMainFacing; if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { final double oX = aBaseMetaTileEntity.getXCoord(); final double oY = aBaseMetaTileEntity.getYCoord(); @@ -826,11 +802,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ) - .setPosition(x, y, z) - .setWorld( - getBaseMetaTileEntity().getWorld()); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.LAVA) - .run(); + .run(); } } } @@ -852,8 +827,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1 && this.mSoundResourceLocation != null - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath())) + && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) + && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath())) GT_Utility.doSoundAtClient(this.mSoundResourceLocation, 100, 1.0F, aX, aY, aZ); } @@ -863,8 +838,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ // Added to throttle sounds. To reduce lag, this is on the server side so BlockUpdate packets aren't sent. if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick + ticksBetweenSounds)) { if (this.mSoundResourceLocation != null - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) - && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath())) + && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourceDomain()) + && GT_Utility.isStringValid(this.mSoundResourceLocation.getResourcePath())) this.sendLoopStart((byte) 1); // Does not have overflow protection, but they are longs. myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; @@ -888,10 +863,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction, - Pos2d pos, Size size) { - return super.createProgressBar(texture, imageSize, direction, pos, size).setTexture( - progressBarTexture.get(), - mRecipes.getProgressBarImageSize()); + Pos2d pos, Size size) { + return super.createProgressBar(texture, imageSize, direction, pos, size) + .setTexture(progressBarTexture.get(), mRecipes.getProgressBarImageSize()); } public enum X { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java index 3488ab25c1..8a8f63cdb9 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java @@ -23,20 +23,20 @@ import gregtech.common.power.SteamPower; * Machine */ public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEntity_BasicMachine_Bronze - implements IGetTitleColor { + implements IGetTitleColor { public GT_MetaTileEntity_BasicMachine_Steel(int aID, String aName, String aNameRegional, String aDescription, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { super(aID, aName, aNameRegional, aDescription, aInputSlotCount, aOutputSlotCount, aHighPressure); } public GT_MetaTileEntity_BasicMachine_Steel(String aName, String aDescription, ITexture[][][] aTextures, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure); } public GT_MetaTileEntity_BasicMachine_Steel(String aName, String[] aDescription, ITexture[][][] aTextures, - int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { + int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) { super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure); } @@ -48,99 +48,99 @@ public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEn @Override public ITexture[] getSideFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getTopFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; + isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)) }; } @Override public ITexture[] getBottomFacingPipeActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getBottomFacingPipeInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTopFacingPipeActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTopFacingPipeInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getSideFacingPipeActive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getSideFacingPipeInactive(byte aColor) { return new ITexture[] { TextureFactory.of( - isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, - Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; + isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, + Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java index 193d654af6..7d4723d4f6 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java @@ -32,7 +32,7 @@ import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually */ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_TieredMachineBlock - implements IHasFluidDisplayItem, IAddUIWidgets { + implements IHasFluidDisplayItem, IAddUIWidgets { public FluidStack mFluid; protected int mOpenerCount; @@ -41,22 +41,22 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier * @param aInvSlotCount should be 3 */ public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription, ITexture... aTextures) { + String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String[] aDescription, ITexture... aTextures) { + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -184,9 +184,9 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier if (getFillableStack() == null) { if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) { if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), - 1)) { + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { setFillableStack(tFluid.copy()); this.onEmptyingContainerWhenEmpty(); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -194,11 +194,11 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier } } else { if (tFluid.isFluidEqual(getFillableStack()) - && ((long) tFluid.amount + getFillableStack().amount) <= (long) getCapacity()) { + && ((long) tFluid.amount + getFillableStack().amount) <= (long) getCapacity()) { if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), - 1)) { + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { getFillableStack().amount += tFluid.amount; aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); } @@ -208,11 +208,8 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier } if (doesFillContainers()) { - ItemStack tOutput = GT_Utility.fillFluidContainer( - getDrainableStack(), - mInventory[getInputSlot()], - false, - true); + ItemStack tOutput = GT_Utility + .fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -230,10 +227,8 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true)) mInventory[getStackDisplaySlot()] = null; } else { - mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack( - getDisplayedFluid(), - true, - !displaysStackSize()); + mInventory[getStackDisplaySlot()] = GT_Utility + .getFluidDisplayStack(getDisplayedFluid(), true, !displaysStackSize()); } } } @@ -251,13 +246,10 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier @Override public int fill(FluidStack aFluid, boolean doFill) { if (aFluid == null || aFluid.getFluid() - .getID() - <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) - return 0; + .getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0; if (getFillableStack() == null || getFillableStack().getFluid() - .getID() - <= 0) { + .getID() <= 0) { if (aFluid.amount <= getCapacity()) { if (doFill) { setFillableStack(aFluid.copy()); @@ -320,7 +312,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {}; if (isDrainableStackSeparate()) { return new FluidTankInfo[] { new FluidTankInfo(getFillableStack(), getCapacity()), - new FluidTankInfo(getDrainableStack(), getCapacity()) }; + new FluidTankInfo(getDrainableStack(), getCapacity()) }; } else { return new FluidTankInfo[] { new FluidTankInfo(this) }; } @@ -343,56 +335,50 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 16) - .setSize(71, 45)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE) - .setPos(79, 34) - .setSize(18, 18)) - .widget( - new SlotWidget(inventoryHandler, getInputSlot()) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget( - new SlotWidget(inventoryHandler, getOutputSlot()) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 52)) - .widget( - createDrainableFluidSlot().setBackground(GT_UITextures.TRANSPARENT) - .setPos(58, 41)) - .widget( - new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget( - TextWidget.dynamicString( - () -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 16) + .setSize(71, 45)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE) + .setPos(79, 34) + .setSize(18, 18)) + .widget( + new SlotWidget(inventoryHandler, getInputSlot()) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget( + new SlotWidget(inventoryHandler, getOutputSlot()) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(79, 52)) + .widget( + createDrainableFluidSlot().setBackground(GT_UITextures.TRANSPARENT) + .setPos(58, 41)) + .widget( + new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 20)) + .widget( + TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 30)); } protected FluidDisplaySlotWidget createDrainableFluidSlot() { - return new FluidDisplaySlotWidget( - inventoryHandler, - getStackDisplaySlot()).setFluidAccessConstructor(() -> constructFluidAccess(false)) - .setIHasFluidDisplay(this) - .setCanDrain(true) - .setCanFill(!isDrainableStackSeparate()) - .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER) - .setBeforeRealClick((clickData, widget) -> { - if (NetworkUtils.isClient()) { - // propagate display item content to actual fluid stored in this tank - setDrainableStack( - GT_Utility.getFluidFromDisplayStack( - widget.getMcSlot() - .getStack())); - } - return true; - }); + return new FluidDisplaySlotWidget(inventoryHandler, getStackDisplaySlot()) + .setFluidAccessConstructor(() -> constructFluidAccess(false)) + .setIHasFluidDisplay(this) + .setCanDrain(true) + .setCanFill(!isDrainableStackSeparate()) + .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER) + .setBeforeRealClick((clickData, widget) -> { + if (NetworkUtils.isClient()) { + // propagate display item content to actual fluid stored in this tank + setDrainableStack( + GT_Utility.getFluidFromDisplayStack( + widget.getMcSlot() + .getStack())); + } + return true; + }); } protected IFluidAccess constructFluidAccess(boolean aIsFillableStack) { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index 1b451f3108..f7f69ae924 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -33,26 +33,26 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM public int mMaxStackSize = 64; public static int MAX = 8; public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = false, - bSortStacks = false; + bSortStacks = false; public int mSuccess = 0, mTargetStackSize = 0; public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String[] aDescription) { + String[] aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -62,29 +62,29 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM ITexture tIcon = getOverlayIcon(); ITexture tOut = TextureFactory.of(OVERLAY_PIPE_OUT); ITexture tUp = TextureFactory.of( - TextureFactory.of(ARROW_UP), - TextureFactory.builder() - .addIcon(ARROW_UP_GLOW) - .glow() - .build()); + TextureFactory.of(ARROW_UP), + TextureFactory.builder() + .addIcon(ARROW_UP_GLOW) + .glow() + .build()); ITexture tDown = TextureFactory.of( - TextureFactory.of(ARROW_DOWN), - TextureFactory.builder() - .addIcon(ARROW_DOWN_GLOW) - .glow() - .build()); + TextureFactory.of(ARROW_DOWN), + TextureFactory.builder() + .addIcon(ARROW_DOWN_GLOW) + .glow() + .build()); ITexture tLeft = TextureFactory.of( - TextureFactory.of(ARROW_LEFT), - TextureFactory.builder() - .addIcon(ARROW_LEFT_GLOW) - .glow() - .build()); + TextureFactory.of(ARROW_LEFT), + TextureFactory.builder() + .addIcon(ARROW_LEFT_GLOW) + .glow() + .build()); ITexture tRight = TextureFactory.of( - TextureFactory.of(ARROW_RIGHT), - TextureFactory.builder() - .addIcon(ARROW_RIGHT_GLOW) - .glow() - .build()); + TextureFactory.of(ARROW_RIGHT), + TextureFactory.builder() + .addIcon(ARROW_RIGHT_GLOW) + .glow() + .build()); for (int i = 0; i < rTextures[0].length; i++) { rTextures[OUTPUT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tOut }; rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tRight, tIcon }; @@ -98,7 +98,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { int colorIndex = aColorIndex + 1; ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[aSide]; ForgeDirection facing = ForgeDirection.VALID_DIRECTIONS[aFacing]; @@ -292,15 +292,15 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("098", "Do not regulate Item Stack Size")); } else { GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("099", "Regulate Item Stack Size to: ") + mTargetStackSize); + aPlayer, + GT_Utility.trans("099", "Regulate Item Stack Size to: ") + mTargetStackSize); } } } @Override public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { aWrenchingSide = GT_Utility.getOppositeSide(aWrenchingSide); if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) { getBaseMetaTileEntity().setFrontFacing(aWrenchingSide); @@ -329,9 +329,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() - && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() - || aTimer % 200 == 0 - || mSuccess > 0)) { + && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTimer % 200 == 0 + || mSuccess > 0)) { mSuccess--; updateSlots(); moveItems(aBaseMetaTileEntity, aTimer); @@ -351,29 +351,29 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer, int stacks) { int tCost; if (bStockingMode) tCost = GT_Utility.moveMultipleItemStacks( - aBaseMetaTileEntity, - aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), - aBaseMetaTileEntity.getBackFacing(), - aBaseMetaTileEntity.getFrontFacing(), - null, - false, - mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, - mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, - (byte) 64, - (byte) 1, - stacks); + aBaseMetaTileEntity, + aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), + aBaseMetaTileEntity.getBackFacing(), + aBaseMetaTileEntity.getFrontFacing(), + null, + false, + mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, + mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, + (byte) 64, + (byte) 1, + stacks); else tCost = GT_Utility.moveMultipleItemStacks( - aBaseMetaTileEntity, - aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), - aBaseMetaTileEntity.getBackFacing(), - aBaseMetaTileEntity.getFrontFacing(), - null, - false, - (byte) 64, - (byte) 1, - mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, - mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, - stacks); + aBaseMetaTileEntity, + aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), + aBaseMetaTileEntity.getBackFacing(), + aBaseMetaTileEntity.getFrontFacing(), + null, + false, + (byte) 64, + (byte) 1, + mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, + mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, + stacks); if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) { mSuccess = 50; @@ -424,7 +424,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM int slot = validSlots.get(slotindex); slotindex++; mInventory[slot] = stacks.get(sID) - .copy(); + .copy(); toSet = Math.min(toSet, mInventory[slot].getMaxStackSize()); mInventory[slot].stackSize = toSet; slots.merge(sID, toSet, (a, b) -> a - b); @@ -433,14 +433,14 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (aPlayer.isSneaking()) { // I was so proud of all this but I literally just copied code from OutputBus bSortStacks = !bSortStacks; GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("200", "Sort mode: ") - + (bSortStacks ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled"))); + aPlayer, + GT_Utility.trans("200", "Sort mode: ") + + (bSortStacks ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled"))); return true; } return super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); @@ -456,21 +456,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM bOutput = !bOutput; if (bOutput) { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("116", "Emit Energy to Outputside")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("116", "Emit Energy to Outputside")); } else { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("117", "Don't emit Energy")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("117", "Don't emit Energy")); } }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY) - .setPos(7, 62) - .setSize(18, 18)); + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY) + .setPos(7, 62) + .setSize(18, 18)); } protected void addEmitRedstoneButton(ModularWindow.Builder builder) { @@ -478,21 +476,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM bRedstoneIfFull = !bRedstoneIfFull; if (bRedstoneIfFull) { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("118", "Emit Redstone if no Slot is free")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("118", "Emit Redstone if no Slot is free")); } else { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("119", "Don't emit Redstone")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("119", "Don't emit Redstone")); } }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE) - .setPos(25, 62) - .setSize(18, 18)); + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE) + .setPos(25, 62) + .setSize(18, 18)); } protected void addInvertRedstoneButton(ModularWindow.Builder builder) { @@ -500,21 +496,19 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM bInvert = !bInvert; if (bInvert) { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("120", "Invert Redstone")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("120", "Invert Redstone")); } else { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("121", "Don't invert Redstone")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("121", "Don't invert Redstone")); } }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE) - .setPos(43, 62) - .setSize(18, 18)); + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE) + .setPos(43, 62) + .setSize(18, 18)); } protected void addStockingModeButton(ModularWindow.Builder builder) { @@ -522,32 +516,30 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM bStockingMode = !bStockingMode; if (bStockingMode) { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans( - "217", - "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); + widget.getContext() + .getPlayer(), + GT_Utility.trans( + "217", + "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); } else { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans( - "218", - "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); + widget.getContext() + .getPlayer(), + GT_Utility.trans( + "218", + "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); } }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE) - .setPos(61, 62) - .setSize(18, 18)); + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE) + .setPos(61, 62) + .setSize(18, 18)); } protected void addInventorySlots(ModularWindow.Builder builder) { builder.widget( - SlotGroup.ofItemHandler(inventoryHandler, 9) - .endAtSlot(26) - .build() - .setPos(7, 4)); + SlotGroup.ofItemHandler(inventoryHandler, 9) + .endAtSlot(26) + .build() + .setPos(7, 4)); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java index 700732f033..a4456e056c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java @@ -36,7 +36,7 @@ import gregtech.api.util.GT_StructureUtility; * @param */ public abstract class GT_MetaTileEntity_CubicMultiBlockBase> - extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { + extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable { protected static final String STRUCTURE_PIECE_MAIN = "main"; protected static final ClassValue>> STRUCTURE_DEFINITION = new ClassValue<>() { @@ -44,27 +44,23 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase> computeValue(Class type) { return StructureDefinition.>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { "hhh", "hhh", "hhh" }, { "h~h", "h-h", "hhh" }, - { "hhh", "hhh", "hhh" }, })) - .addElement( - 'h', - ofChain( - lazy( - t -> GT_StructureUtility.>buildHatchAdder() - .atLeastList( - t.getAllowedHatches()) - .casingIndex( - t.getHatchTextureIndex()) - .dot(1) - .build()), - onElementPass( - GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded, - lazy( - GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement)))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "hhh", "hhh", "hhh" }, { "h~h", "h-h", "hhh" }, { "hhh", "hhh", "hhh" }, })) + .addElement( + 'h', + ofChain( + lazy( + t -> GT_StructureUtility.>buildHatchAdder() + .atLeastList(t.getAllowedHatches()) + .casingIndex(t.getHatchTextureIndex()) + .dot(1) + .build()), + onElementPass( + GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded, + lazy(GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement)))) + .build(); } }; private int mCasingAmount = 0; @@ -104,7 +100,7 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase= getRequiredCasingCount() - && checkHatches(aBaseMetaTileEntity, aStack); + && checkHatches(aBaseMetaTileEntity, aStack); } /** diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java index bd6facceee..6fdfa53a14 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java @@ -32,7 +32,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; * @param type of this */ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase> - extends GT_MetaTileEntity_TooltipMultiBlockBase implements IAlignment, IConstructable { + extends GT_MetaTileEntity_TooltipMultiBlockBase implements IAlignment, IConstructable { private ExtendedFacing mExtendedFacing = ExtendedFacing.DEFAULT; private IAlignmentLimits mLimits = getInitialAlignmentLimits(); @@ -60,15 +60,15 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase 0) checkStructure(true, getBaseMetaTileEntity()); return built; } protected final int survivialBuildPiece(String piece, ItemStack trigger, int horizontalOffset, int verticalOffset, - int depthOffset, int elementsBudget, ISurvivalBuildEnvironment env, boolean check, boolean checkIfPlaced) { + int depthOffset, int elementsBudget, ISurvivalBuildEnvironment env, boolean check, boolean checkIfPlaced) { int built = survivialBuildPiece( - piece, - trigger, - horizontalOffset, - verticalOffset, - depthOffset, - elementsBudget, - env, - check); + piece, + trigger, + horizontalOffset, + verticalOffset, + depthOffset, + elementsBudget, + env, + check); if (checkIfPlaced && built > 0) checkStructure(true, getBaseMetaTileEntity()); return built; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java index 99b5c6c550..b5eb13b385 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java @@ -21,7 +21,7 @@ import gregtech.api.util.GT_Utility; * Multiblock base class that allows machine to use power over int. */ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase> - extends GT_MetaTileEntity_EnhancedMultiBlockBase { + extends GT_MetaTileEntity_EnhancedMultiBlockBase { public long lEUt; @@ -48,7 +48,7 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase= 2 ? "s" : ""))); + id, + name, + nameRegional, + tier, + slots, + ArrayExt.of( + "Item Input for Multiblocks", + "Shift + right click with screwdriver to turn Sort mode on/off", + "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : ""))); } @Deprecated @@ -70,22 +70,22 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch } public GT_MetaTileEntity_Hatch_InputBus(String aName, int aTier, int aSlots, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aSlots, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override @@ -132,8 +132,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch @Override public void initDefaultModes(NBTTagCompound aNBT) { if (!getBaseMetaTileEntity().getWorld().isRemote) { - GT_ClientPreference tPreference = GT_Mod.gregtechproxy.getClientPreference( - getBaseMetaTileEntity().getOwnerUuid()); + GT_ClientPreference tPreference = GT_Mod.gregtechproxy + .getClientPreference(getBaseMetaTileEntity().getOwnerUuid()); if (tPreference != null) disableFilter = !tPreference.isInputBusInitialFilterEnabled(); } } @@ -175,7 +175,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch int slot = validSlots.get(slotindex); slotindex++; mInventory[slot] = stacks.get(sID) - .copy(); + .copy(); toSet = Math.min(toSet, mInventory[slot].getMaxStackSize()); mInventory[slot].stackSize = toSet; slots.merge(sID, toSet, (a, b) -> a - b); @@ -203,8 +203,7 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .isGUIClickable()) - return; + .isGUIClickable()) return; if (aPlayer.isSneaking()) { if (disableSort) { disableSort = false; @@ -217,14 +216,13 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch } } GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.hatch.disableSort." + disableSort) + " " - + StatCollector.translateToLocal("GT5U.hatch.disableLimited." + disableLimited)); + aPlayer, + StatCollector.translateToLocal("GT5U.hatch.disableSort." + disableSort) + " " + + StatCollector.translateToLocal("GT5U.hatch.disableLimited." + disableLimited)); } else { disableFilter = !disableFilter; - GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter)); + GT_Utility + .sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + disableFilter)); } } @@ -237,8 +235,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide == getBaseMetaTileEntity().getFrontFacing() && aIndex != getCircuitSlot() - && (mRecipeMap == null || disableFilter || mRecipeMap.containsInput(aStack)) - && (disableLimited || limitedAllowPutStack(aIndex, aStack)); + && (mRecipeMap == null || disableFilter || mRecipeMap.containsInput(aStack)) + && (disableLimited || limitedAllowPutStack(aIndex, aStack)); } protected boolean limitedAllowPutStack(int aIndex, ItemStack aStack) { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index a2d30a9d72..12a55d097c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -44,7 +44,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch private static ItemStack[] sAutoMaintenanceInputs; public boolean mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, - mSolderingTool = false, mCrowbar = false, mAuto; + mSolderingTool = false, mCrowbar = false, mAuto; public GT_MetaTileEntity_Hatch_Maintenance(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, "For maintaining Multiblocks"); @@ -57,22 +57,22 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - boolean aAuto) { + boolean aAuto) { super(aName, aTier, aAuto ? 4 : 1, aDescription, aTextures); mAuto = aAuto; } public GT_MetaTileEntity_Hatch_Maintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - boolean aAuto) { + boolean aAuto) { super(aName, aTier, aAuto ? 4 : 1, aDescription, aTextures); mAuto = aAuto; } private static ItemStack[] getAutoMaintenanceInputs() { if (sAutoMaintenanceInputs == null) sAutoMaintenanceInputs = new ItemStack[] { ItemList.Duct_Tape.get(4), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2) }; + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2) }; return sAutoMaintenanceInputs; } @@ -96,22 +96,22 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE_IDLE), - TextureFactory.builder() - .addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW) + .glow() + .build() }; return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE), - TextureFactory.builder() - .addIcon(OVERLAY_AUTOMAINTENANCE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_AUTOMAINTENANCE_GLOW) + .glow() + .build() }; return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE), - TextureFactory.of(OVERLAY_DUCTTAPE) }; + TextureFactory.of(OVERLAY_DUCTTAPE) }; } @Override @@ -148,14 +148,13 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { + float aY, float aZ) { if (aBaseMetaTileEntity.isClientSide()) return true; if (aSide == aBaseMetaTileEntity.getFrontFacing()) { // only allow OC robot fake player if (aPlayer instanceof FakePlayer && !aPlayer.getGameProfile() - .getName() - .endsWith(".robot")) - return false; + .getName() + .endsWith(".robot")) return false; ItemStack tStack = aPlayer.getCurrentEquippedItem(); if (tStack != null) { if (tStack.getItem() instanceof ItemToolbox) { @@ -202,10 +201,8 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch amt = tStack.stackSize; boolean temp = true; for (ItemStack aStack : mInventory) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual( - GT_OreDictUnificator.get(false, aStack), - tStack, - true))) { + if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) + || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) { amt -= aStack.stackSize; if (amt < 1) { temp = false; @@ -222,10 +219,8 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch if (tStack != null) { amt = tStack.stackSize; for (ItemStack aStack : mInventory) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual( - GT_OreDictUnificator.get(false, aStack), - tStack, - true))) { + if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility + .areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) { if (aStack.stackSize < amt) { amt -= aStack.stackSize; aStack.stackSize = 0; @@ -259,20 +254,15 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } if (GT_Utility.isStackInList(aStack, GregTech_API.sWrenchList) && !mWrench - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) - mWrench = true; + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mWrench = true; if (GT_Utility.isStackInList(aStack, GregTech_API.sScrewdriverList) && !mScrewdriver - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) - mScrewdriver = true; + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mScrewdriver = true; if (GT_Utility.isStackInList(aStack, GregTech_API.sSoftHammerList) && !mSoftHammer - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) - mSoftHammer = true; + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mSoftHammer = true; if (GT_Utility.isStackInList(aStack, GregTech_API.sHardHammerList) && !mHardHammer - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) - mHardHammer = true; + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mHardHammer = true; if (GT_Utility.isStackInList(aStack, GregTech_API.sCrowbarList) && !mCrowbar - && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) - mCrowbar = true; + && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) mCrowbar = true; if (!mSolderingTool && GT_ModHandler.useSolderingIron(aStack, aPlayer, aToolboxInventory)) mSolderingTool = true; if (GT_OreDictUnificator.isItemStackInstanceOf(aStack, "craftingDuctTape")) { @@ -312,12 +302,11 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (mAuto && GT_Mod.gregtechproxy.mAMHInteraction) { for (int i = 0; i < getSizeInventory(); i++) if (GT_Utility.areStacksEqual( - GT_OreDictUnificator.get(false, aStack), - GT_OreDictUnificator.get(false, getStackInSlot(i)))) - return i == aIndex; + GT_OreDictUnificator.get(false, aStack), + GT_OreDictUnificator.get(false, getStackInSlot(i)))) return i == aIndex; for (ItemStack tInput : getAutoMaintenanceInputs()) if (GT_Utility.areUnificationsEqual(tInput, aStack, true) - || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tInput, true)) + || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tInput, true)) return true; } return false; @@ -334,33 +323,33 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch getBaseMetaTileEntity().add2by2Slots(builder); } else { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE) - .setPos(78, 33) - .setSize(20, 20)) - .widget(new SlotWidget(BaseSlot.empty()) { - - @Override - public boolean handleDragAndDrop(ItemStack draggedStack, int button) { - return false; - } - - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - if (cursorStack == null) return; - onToolClick(cursorStack, getContext().getPlayer()); - if (cursorStack.stackSize < 1) { - getContext().getPlayer().inventory.setItemStack(null); - } - if (getContext().getPlayer() instanceof EntityPlayerMP) { - ((EntityPlayerMP) getContext().getPlayer()).updateHeldItem(); - } - } - }.disableShiftInsert() + new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE) + .setPos(78, 33) + .setSize(20, 20)) + .widget(new SlotWidget(BaseSlot.empty()) { + + @Override + public boolean handleDragAndDrop(ItemStack draggedStack, int button) { + return false; + } + + @Override + protected void phantomClick(ClickData clickData, ItemStack cursorStack) { + if (cursorStack == null) return; + onToolClick(cursorStack, getContext().getPlayer()); + if (cursorStack.stackSize < 1) { + getContext().getPlayer().inventory.setItemStack(null); + } + if (getContext().getPlayer() instanceof EntityPlayerMP) { + ((EntityPlayerMP) getContext().getPlayer()).updateHeldItem(); + } + } + }.disableShiftInsert() .setBackground(GT_UITextures.TRANSPARENT) .setPos(79, 34)) - .widget( - new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(8, 12)); + .widget( + new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(8, 12)); } } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index f0f1705b1f..1fdafd7f35 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -27,14 +27,14 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( - "gt.blockmachines.hatch.muffler.desc.format", - "Outputs the Pollution (Might cause ... things)%n" + "DO NOT OBSTRUCT THE OUTPUT!%n" - + "Reduces Pollution to %d%%%n" - + "Recovers %d%% of CO2/CO/SO2"); + "gt.blockmachines.hatch.muffler.desc.format", + "Outputs the Pollution (Might cause ... things)%n" + "DO NOT OBSTRUCT THE OUTPUT!%n" + + "Reduces Pollution to %d%%%n" + + "Recovers %d%% of CO2/CO/SO2"); private final int pollutionReduction = calculatePollutionReduction(100); private final int pollutionRecover = 100 - pollutionReduction; private final String[] description = String.format(localizedDescFormat, pollutionReduction, pollutionRecover) - .split("\\R"); + .split("\\R"); private final boolean[] facings = new boolean[ForgeDirection.VALID_DIRECTIONS.length]; public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { @@ -42,7 +42,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String[] aDescription, ITexture... aTextures) { + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } @@ -55,7 +55,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); setInValidFacings(ForgeDirection.DOWN); } @@ -104,11 +104,11 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isClientSide() && this.getBaseMetaTileEntity() - .isActive()) { + .isActive()) { pollutionParticles( - this.getBaseMetaTileEntity() - .getWorld(), - ParticleFX.LARGE_SMOKE.toString()); + this.getBaseMetaTileEntity() + .getWorld(), + ParticleFX.LARGE_SMOKE.toString()); } } @@ -163,35 +163,34 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { zSpd = aDir.offsetZ * (0.1F + 0.2F * XSTR_INSTANCE.nextFloat()); } - WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder().setIdentifier( - name) - .setWorld( - aWorld) - .setMotion( - xSpd, - ySpd, - zSpd); + WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder() + .setIdentifier(name) + .setWorld(aWorld) + .setMotion(xSpd, ySpd, zSpd); if (chk1) { - events.setPosition( + events + .setPosition( xPos + ran1 * 0.5F, yPos + XSTR_INSTANCE.nextFloat() * 0.5F, zPos + XSTR_INSTANCE.nextFloat() * 0.5F) - .run(); + .run(); } if (chk2) { - events.setPosition( + events + .setPosition( xPos + ran2 * 0.5F, yPos + XSTR_INSTANCE.nextFloat() * 0.5F, zPos + XSTR_INSTANCE.nextFloat() * 0.5F) - .run(); + .run(); } if (chk3) { - events.setPosition( + events + .setPosition( xPos + ran3 * 0.5F, yPos + XSTR_INSTANCE.nextFloat() * 0.5F, zPos + XSTR_INSTANCE.nextFloat() * 0.5F) - .run(); + .run(); } } @@ -231,6 +230,6 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public void setInValidFacings(ForgeDirection... aFacings) { Arrays.fill(facings, true); Arrays.stream(aFacings) - .forEach(face -> facings[face.ordinal()] = false); + .forEach(face -> facings[face.ordinal()] = false); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java index 1b7fedce22..48d6569f42 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java @@ -36,7 +36,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_ } public GT_MetaTileEntity_Hatch_MultiInput(String aName, int aSlot, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aSlot, aTier, aDescription, aTextures); this.mStoredFluid = new FluidStack[aSlot]; mCapacityPer = 8000 * (1 << aTier) / aSlot; @@ -172,9 +172,7 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_ @Override public int fill(FluidStack aFluid, boolean doFill) { if (aFluid == null || aFluid.getFluid() - .getID() - <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) - return 0; + .getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0; if (!hasFluid(aFluid) && getFirstEmptySlot() != -1) { int tFilled = Math.min(aFluid.amount, mCapacityPer); if (doFill) { @@ -297,42 +295,35 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { final int SLOT_NUMBER = 4; final Pos2d[] positions = new Pos2d[] { new Pos2d(70, 25), new Pos2d(88, 25), new Pos2d(70, 43), - new Pos2d(88, 43), }; + new Pos2d(88, 43), }; for (int i = 0; i < SLOT_NUMBER; i++) { final int slotId = i; builder.widget( - new FluidDisplaySlotWidget(inventoryHandler, slotId) - .setFluidAccessConstructor( - () -> constructFluidAccess(slotId)) - .setIHasFluidDisplay(this) - .setCanDrain(true) - .setCanFill(!isDrainableStackSeparate()) - .setActionRealClick( - FluidDisplaySlotWidget.Action.TRANSFER) - .setBeforeRealClick((clickData, widget) -> { - if (NetworkUtils.isClient()) { - // propagate display item content to - // actual fluid stored in this tank - setFluid( - GT_Utility.getFluidFromDisplayStack( - widget.getMcSlot() - .getStack()), - slotId); - } - ItemStack tStackHeld = widget.getContext() - .getPlayer().inventory.getItemStack(); - FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem( - tStackHeld, - true); - return constructFluidAccess(slotId).isMatch( - tFluidHeld, - slotId); - }) - .setUpdateFluidDisplayItem( - () -> updateFluidDisplayItem(slotId)) - .setBackground(ModularUITextures.FLUID_SLOT) - .setPos(positions[slotId])); + new FluidDisplaySlotWidget(inventoryHandler, slotId) + .setFluidAccessConstructor(() -> constructFluidAccess(slotId)) + .setIHasFluidDisplay(this) + .setCanDrain(true) + .setCanFill(!isDrainableStackSeparate()) + .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER) + .setBeforeRealClick((clickData, widget) -> { + if (NetworkUtils.isClient()) { + // propagate display item content to + // actual fluid stored in this tank + setFluid( + GT_Utility.getFluidFromDisplayStack( + widget.getMcSlot() + .getStack()), + slotId); + } + ItemStack tStackHeld = widget.getContext() + .getPlayer().inventory.getItemStack(); + FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackHeld, true); + return constructFluidAccess(slotId).isMatch(tFluidHeld, slotId); + }) + .setUpdateFluidDisplayItem(() -> updateFluidDisplayItem(slotId)) + .setBackground(ModularUITextures.FLUID_SLOT) + .setPos(positions[slotId])); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java index b55350a97e..c3cc1edc9b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java @@ -42,16 +42,16 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 4, - new String[] { "Fluid Output for Multiblocks", - "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier)) + "L", - "Right click with screwdriver to restrict output", - "Can be restricted to put out Items and/or Steam/No Steam/1 specific Fluid", - "Restricted Output Hatches are given priority for Multiblock Fluid output" }); + aID, + aName, + aNameRegional, + aTier, + 4, + new String[] { "Fluid Output for Multiblocks", + "Capacity: " + GT_Utility.formatNumbers(8000 * (1 << aTier)) + "L", + "Right click with screwdriver to restrict output", + "Can be restricted to put out Items and/or Steam/No Steam/1 specific Fluid", + "Restricted Output Hatches are given priority for Multiblock Fluid output" }); } public GT_MetaTileEntity_Hatch_Output(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -63,29 +63,27 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl } public GT_MetaTileEntity_Hatch_Output(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, - int inventorySize) { + int inventorySize) { super(aID, aName, aNameRegional, aTier, inventorySize, aDescription); } public GT_MetaTileEntity_Hatch_Output(String name, int tier, int slots, String[] description, - ITexture[][][] textures) { + ITexture[][][] textures) { super(name, tier, slots, description, textures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), - TextureFactory.of(FLUID_OUT_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), - TextureFactory.of(FLUID_OUT_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override @@ -123,26 +121,24 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && mFluid != null) { - IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide( - aBaseMetaTileEntity.getFrontFacing()); + IFluidHandler tTileEntity = aBaseMetaTileEntity + .getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); if (tTileEntity != null) { FluidStack tDrained = aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()), - Math.max(1, mFluid.amount), - false); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()), + Math.max(1, mFluid.amount), + false); if (tDrained != null) { - int tFilledAmount = tTileEntity.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - tDrained, - false); + int tFilledAmount = tTileEntity + .fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); if (tFilledAmount > 0) { tTileEntity.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()), - tFilledAmount, - true), - true); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + aBaseMetaTileEntity.drain( + ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()), + tFilledAmount, + true), + true); } } } @@ -166,7 +162,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl lockedFluidName = lockedFluidName.length() == 0 ? null : lockedFluidName; if (GT_Utility.getFluidFromUnlocalizedName(lockedFluidName) != null) { lockedFluidName = GT_Utility.getFluidFromUnlocalizedName(lockedFluidName) - .getName(); + .getName(); } } @@ -243,8 +239,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .isGUIClickable()) - return; + .isGUIClickable()) return; if (aPlayer.isSneaking()) { mMode = (byte) ((mMode + 9) % 10); } else { @@ -289,49 +284,48 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl if (mFluid == null) { this.setLockedFluidName(null); inBrackets = GT_Utility.trans( - "115.3", - "currently none, will be locked to the next that is put in (or use fluid cell to lock)"); + "115.3", + "currently none, will be locked to the next that is put in (or use fluid cell to lock)"); } else { this.setLockedFluidName( - this.getDrainableStack() - .getFluid() - .getName()); + this.getDrainableStack() + .getFluid() + .getName()); inBrackets = this.getDrainableStack() - .getLocalizedName(); + .getLocalizedName(); } GT_Utility.sendChatToPlayer( - aPlayer, - String.format( - "%s (%s)", - GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), - inBrackets)); + aPlayer, + String.format( + "%s (%s)", + GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), + inBrackets)); } case 9 -> { playerThatLockedfluid = new WeakReference<>(aPlayer); if (mFluid == null) { this.setLockedFluidName(null); inBrackets = GT_Utility.trans( - "115.3", - "currently none, will be locked to the next that is put in (or use fluid cell to lock)"); + "115.3", + "currently none, will be locked to the next that is put in (or use fluid cell to lock)"); } else { this.setLockedFluidName( - this.getDrainableStack() - .getFluid() - .getName()); + this.getDrainableStack() + .getFluid() + .getName()); inBrackets = this.getDrainableStack() - .getLocalizedName(); + .getLocalizedName(); } GT_Utility.sendChatToPlayer( - aPlayer, - String.format("%s (%s)", GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), inBrackets)); + aPlayer, + String.format("%s (%s)", GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), inBrackets)); } } } private boolean tryToLockHatch(EntityPlayer aPlayer, byte aSide) { if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .isGUIClickable()) - return false; + .isGUIClickable()) return false; if (!isFluidLocked()) return false; final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem == null) return false; @@ -340,32 +334,32 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl tFluid = ((IFluidContainerItem) tCurrentItem.getItem()).getFluid(tCurrentItem); if (tFluid != null) { if (getLockedFluidName() != null && !getLockedFluidName().equals( - tFluid.getFluid() - .getName())) { + tFluid.getFluid() + .getName())) { GT_Utility.sendChatToPlayer( - aPlayer, - String.format( - "%s %s", - GT_Utility.trans( - "151.3", - "Hatch is locked to a different fluid. To change the locking, empty it and made it locked to the next fluid with a screwdriver. Currently locked to"), - StatCollector.translateToLocal(getLockedFluidName()))); + aPlayer, + String.format( + "%s %s", + GT_Utility.trans( + "151.3", + "Hatch is locked to a different fluid. To change the locking, empty it and made it locked to the next fluid with a screwdriver. Currently locked to"), + StatCollector.translateToLocal(getLockedFluidName()))); } else { setLockedFluidName( - tFluid.getFluid() - .getName()); + tFluid.getFluid() + .getName()); if (mMode == 8) GT_Utility.sendChatToPlayer( - aPlayer, - String.format( - "%s (%s)", - GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), - tFluid.getLocalizedName())); + aPlayer, + String.format( + "%s (%s)", + GT_Utility.trans("151.1", "Outputs items and 1 specific Fluid"), + tFluid.getLocalizedName())); else GT_Utility.sendChatToPlayer( - aPlayer, - String.format( - "%s (%s)", - GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), - tFluid.getLocalizedName())); + aPlayer, + String.format( + "%s (%s)", + GT_Utility.trans("151.2", "Outputs 1 specific Fluid"), + tFluid.getLocalizedName())); } return true; } @@ -378,7 +372,7 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { + float aY, float aZ) { if (tryToLockHatch(aPlayer, aSide)) return true; return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); } @@ -447,15 +441,13 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl protected void onEmptyingContainerWhenEmpty() { if (this.lockedFluidName == null && this.mFluid != null && isFluidLocked()) { this.setLockedFluidName( - this.mFluid.getFluid() - .getName()); + this.mFluid.getFluid() + .getName()); final EntityPlayer player; if (playerThatLockedfluid == null || (player = playerThatLockedfluid.get()) == null) return; GT_Utility.sendChatToPlayer( - player, - String.format( - GT_Utility.trans("151.4", "Successfully locked Fluid to %s"), - mFluid.getLocalizedName())); + player, + String.format(GT_Utility.trans("151.4", "Successfully locked Fluid to %s"), mFluid.getLocalizedName())); playerThatLockedfluid = null; } } @@ -468,20 +460,20 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl @Override public String[] getInfoData() { return new String[] { EnumChatFormatting.BLUE + "Output Hatch" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + (mFluid == null ? "No Fluid" : mFluid.getLocalizedName()) - + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid == null ? 0 : mFluid.amount) - + " L" - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getCapacity()) - + " L" - + EnumChatFormatting.RESET, - (!isFluidLocked() || lockedFluidName == null) ? "Not Locked" - : ("Locked to " + StatCollector.translateToLocal( - FluidRegistry.getFluidStack(lockedFluidName, 1) - .getUnlocalizedName())) }; + EnumChatFormatting.GOLD + (mFluid == null ? "No Fluid" : mFluid.getLocalizedName()) + + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid == null ? 0 : mFluid.amount) + + " L" + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getCapacity()) + + " L" + + EnumChatFormatting.RESET, + (!isFluidLocked() || lockedFluidName == null) ? "Not Locked" + : ("Locked to " + StatCollector.translateToLocal( + FluidRegistry.getFluidStack(lockedFluidName, 1) + .getUnlocalizedName())) }; } @Override @@ -493,51 +485,44 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(98, 16) - .setSize(71, 45)) - .widget( - new FluidDisplaySlotWidget(inventoryHandler, getLockedDisplaySlot()).setIHasFluidDisplay(this) - .setActionRealClick( - FluidDisplaySlotWidget.Action.LOCK) - .setActionDragAndDrop( - FluidDisplaySlotWidget.Action.LOCK) - .setBeforeClick( - (clickData, - widget) -> { - if (NetworkUtils.isClient()) { - // propagate - // display - // item - // content to - // actual - // fluid - // stored in - // this tank - setDrainableStack( - GT_Utility.getFluidFromDisplayStack( - mInventory[getStackDisplaySlot()])); - } - return true; - }) - .setBackground( - GT_UITextures.TRANSPARENT) - .setPos(149, 41)) - .widget( - new TextWidget("Locked Fluid").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(101, 20)) - .widget(TextWidget.dynamicString(() -> { - final ItemStack lockedDisplayStack = mInventory[getLockedDisplaySlot()]; - return lockedDisplayStack == null ? "None" : lockedDisplayStack.getDisplayName(); - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setTextAlignment(Alignment.CenterLeft) - .setMaxWidth(65) - .setPos(101, 30)) - // #updateFluidDisplayItem invalidates locked fluid slot - // if lockedFluidName == null or mMode is incorrect - .widget(new FakeSyncWidget.StringSyncer(() -> lockedFluidName, val -> lockedFluidName = val)) - .widget(new FakeSyncWidget.ByteSyncer(() -> mMode, val -> mMode = val)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(98, 16) + .setSize(71, 45)) + .widget( + new FluidDisplaySlotWidget(inventoryHandler, getLockedDisplaySlot()).setIHasFluidDisplay(this) + .setActionRealClick(FluidDisplaySlotWidget.Action.LOCK) + .setActionDragAndDrop(FluidDisplaySlotWidget.Action.LOCK) + .setBeforeClick((clickData, widget) -> { + if (NetworkUtils.isClient()) { + // propagate + // display + // item + // content to + // actual + // fluid + // stored in + // this tank + setDrainableStack(GT_Utility.getFluidFromDisplayStack(mInventory[getStackDisplaySlot()])); + } + return true; + }) + .setBackground(GT_UITextures.TRANSPARENT) + .setPos(149, 41)) + .widget( + new TextWidget("Locked Fluid").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(101, 20)) + .widget(TextWidget.dynamicString(() -> { + final ItemStack lockedDisplayStack = mInventory[getLockedDisplaySlot()]; + return lockedDisplayStack == null ? "None" : lockedDisplayStack.getDisplayName(); + }) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setTextAlignment(Alignment.CenterLeft) + .setMaxWidth(65) + .setPos(101, 30)) + // #updateFluidDisplayItem invalidates locked fluid slot + // if lockedFluidName == null or mMode is incorrect + .widget(new FakeSyncWidget.StringSyncer(() -> lockedFluidName, val -> lockedFluidName = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> mMode, val -> mMode = val)); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java index 633d82566c..f04840d7d3 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java @@ -29,23 +29,23 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i public GT_MetaTileEntity_Hatch_OutputBus(int id, String name, String nameRegional, int tier, int slots) { super( - id, - name, - nameRegional, - tier, - slots, - ArrayExt.of( - "Item Output for Multiblocks", - "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : ""))); + id, + name, + nameRegional, + tier, + slots, + ArrayExt.of( + "Item Output for Multiblocks", + "Capacity: " + getSlots(tier) + " stack" + (getSlots(tier) >= 2 ? "s" : ""))); } public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + String[] aDescription) { super(aID, aName, aNameRegional, aTier, getSlots(aTier), aDescription); } public GT_MetaTileEntity_Hatch_OutputBus(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription, int inventorySize) { + String[] aDescription, int inventorySize) { super(aID, aName, aNameRegional, aTier, inventorySize, aDescription); } @@ -61,22 +61,22 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i } public GT_MetaTileEntity_Hatch_OutputBus(String name, int tier, int slots, String[] description, - ITexture[][][] textures) { + ITexture[][][] textures) { super(name, tier, slots, description, textures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } - : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override @@ -131,7 +131,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i } else { int tRealStackLimit = Math.min(getInventoryStackLimit(), tSlot.getMaxStackSize()); if (tSlot.stackSize < tRealStackLimit && tSlot.isItemEqual(aStack) - && ItemStack.areItemStackTagsEqual(tSlot, aStack)) { + && ItemStack.areItemStackTagsEqual(tSlot, aStack)) { if (aStack.stackSize + tSlot.stackSize <= tRealStackLimit) { mInventory[i].stackSize += aStack.stackSize; return true; @@ -160,21 +160,21 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick & 0x7) == 0) { - final IInventory tTileEntity = aBaseMetaTileEntity.getIInventoryAtSide( - aBaseMetaTileEntity.getFrontFacing()); + final IInventory tTileEntity = aBaseMetaTileEntity + .getIInventoryAtSide(aBaseMetaTileEntity.getFrontFacing()); if (tTileEntity != null) { moveMultipleItemStacks( - aBaseMetaTileEntity, - tTileEntity, - aBaseMetaTileEntity.getFrontFacing(), - aBaseMetaTileEntity.getBackFacing(), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1, - mInventory.length); + aBaseMetaTileEntity, + tTileEntity, + aBaseMetaTileEntity.getFrontFacing(), + aBaseMetaTileEntity.getBackFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + mInventory.length); for (int i = 0; i < mInventory.length; i++) if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; // GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity, diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index e26029b629..0f5f5dcc85 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -62,14 +62,14 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity - implements IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI { + implements IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI { public static boolean disableMaintenance; public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, - mSolderingTool = false, mCrowbar = false, mRunningOnLoad = false; + mSolderingTool = false, mCrowbar = false, mRunningOnLoad = false; public boolean mStructureChanged = false; public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, - mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0; + mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0; public volatile boolean mUpdated = false; public int mUpdate = 0; public ItemStack[] mOutputItems = null; @@ -104,43 +104,30 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public GT_MetaTileEntity_MultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 2); - GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MultiBlockMachines.disableMaintenance", - false); - this.damageFactorLow = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MultiBlockMachines.damageFactorLow", - 5); - this.damageFactorHigh = (float) GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MultiBlockMachines.damageFactorHigh", - 0.6f); + GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false); + this.damageFactorLow = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5); + this.damageFactorHigh = (float) GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); this.mNEI = ""; } public GT_MetaTileEntity_MultiBlockBase(String aName) { super(aName, 2); - GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MultiBlockMachines.disableMaintenance", - false); - this.damageFactorLow = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MultiBlockMachines.damageFactorLow", - 5); - this.damageFactorHigh = (float) GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MultiBlockMachines.damageFactorHigh", - 0.6f); + GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false); + this.damageFactorLow = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5); + this.damageFactorHigh = (float) GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); } public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) { return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity() - .getMetaTileEntity() - == aMetaTileEntity - && !aMetaTileEntity.getBaseMetaTileEntity() - .isDead(); + .getMetaTileEntity() == aMetaTileEntity + && !aMetaTileEntity.getBaseMetaTileEntity() + .isDead(); } @Override @@ -164,8 +151,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity mLockedToSingleRecipe = !mLockedToSingleRecipe; if (mLockedToSingleRecipe) { GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("223", "Single recipe locking enabled. Will lock to next recipe.")); + aPlayer, + GT_Utility.trans("223", "Single recipe locking enabled. Will lock to next recipe.")); } else { GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("220", "Single recipe locking disabled.")); mSingleRecipeCheck = null; @@ -377,13 +364,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } aBaseMetaTileEntity.setErrorDisplayID( - (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) - | (mScrewdriver ? 0 : 2) - | (mSoftHammer ? 0 : 4) - | (mHardHammer ? 0 : 8) - | (mSolderingTool ? 0 : 16) - | (mCrowbar ? 0 : 32) - | (mMachine ? 0 : 64)); + (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) + | (mScrewdriver ? 0 : 2) + | (mSoftHammer ? 0 : 4) + | (mHardHammer ? 0 : 8) + | (mSolderingTool ? 0 : 16) + | (mCrowbar ? 0 : 32) + | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); boolean active = aBaseMetaTileEntity.isActive() && mPollution > 0; setMufflers(active); @@ -406,7 +393,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) { if (isValidMetaTileEntity(tHatch)) { if (tHatch.mAuto - && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) + && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) tHatch.autoMaintainance(); if (tHatch.mWrench) mWrench = true; if (tHatch.mScrewdriver) mScrewdriver = true; @@ -446,9 +433,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { try { GT_Mod.achievements.issueAchivementHatch( - aBaseMetaTileEntity.getWorld() - .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), - tStack); + aBaseMetaTileEntity.getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + tStack); } catch (Exception ignored) {} addOutput(tStack); } @@ -456,10 +443,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity addFluidOutputs(mOutputFluids); } mEfficiency = Math.max( - 0, - Math.min( - mEfficiency + mEfficiencyIncrease, - getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); + 0, + Math.min( + mEfficiency + mEfficiencyIncrease, + getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); mOutputItems = null; mProgresstime = 0; mMaxProgresstime = 0; @@ -471,9 +458,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (mOutputFluids.length > 1) { try { GT_Mod.achievements.issueAchievement( - aBaseMetaTileEntity.getWorld() - .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), - "oilplant"); + aBaseMetaTileEntity.getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "oilplant"); } catch (Exception ignored) {} } } @@ -481,7 +468,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } else { if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() - || aBaseMetaTileEntity.hasInventoryBeenModified()) { + || aBaseMetaTileEntity.hasInventoryBeenModified()) { if (aBaseMetaTileEntity.isAllowedToWork()) { if (checkRecipe()) { @@ -517,13 +504,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (getProcessStartSound() != null) GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); } - case INTERRUPT_SOUND_INDEX -> GT_Utility.doSoundAtClient( - SoundResource.IC2_MACHINES_INTERRUPT_ONE, - 100, - 1.0F, - aX, - aY, - aZ); + case INTERRUPT_SOUND_INDEX -> GT_Utility + .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); } } @@ -542,8 +524,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (activitySoundLoop == null) { activitySoundLoop = new GT_SoundLoop(activitySound, getBaseMetaTileEntity(), false, true); Minecraft.getMinecraft() - .getSoundHandler() - .playSound(activitySoundLoop); + .getSoundHandler() + .playSound(activitySoundLoop); } } else { if (activitySoundLoop != null) { @@ -658,10 +640,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public int getRepairStatus() { return (mWrench ? 1 : 0) + (mScrewdriver ? 1 : 0) - + (mSoftHammer ? 1 : 0) - + (mHardHammer ? 1 : 0) - + (mSolderingTool ? 1 : 0) - + (mCrowbar ? 1 : 0); + + (mSoftHammer ? 1 : 0) + + (mHardHammer ? 1 : 0) + + (mSolderingTool ? 1 : 0) + + (mCrowbar ? 1 : 0); } public int getIdealStatus() { @@ -691,15 +673,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 - && !mInventory[1].getUnlocalizedName() - .startsWith("gt.blockmachines.basicmachine.")) { + && !mInventory[1].getUnlocalizedName() + .startsWith("gt.blockmachines.basicmachine.")) { if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { NBTTagCompound tNBT = mInventory[1].getTagCompound(); ((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage( - mInventory[1], - (long) getDamageToComponent(mInventory[1]) * (long) Math.min( - mEUt / this.damageFactorLow, - Math.pow(mEUt, this.damageFactorHigh))); + mInventory[1], + (long) getDamageToComponent(mInventory[1]) + * (long) Math.min(mEUt / this.damageFactorLow, Math.pow(mEUt, this.damageFactorHigh))); if (mInventory[1].stackSize == 0) mInventory[1] = null; } } @@ -710,34 +691,34 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public void explodeMultiblock() { GT_Log.exp.println( - "MultiBlockExplosion at: " + this.getBaseMetaTileEntity() - .getXCoord() - + " | " - + this.getBaseMetaTileEntity() - .getYCoord() - + " | " - + this.getBaseMetaTileEntity() - .getZCoord() - + " DIMID: " - + this.getBaseMetaTileEntity() - .getWorld().provider.dimensionId - + "."); + "MultiBlockExplosion at: " + this.getBaseMetaTileEntity() + .getXCoord() + + " | " + + this.getBaseMetaTileEntity() + .getYCoord() + + " | " + + this.getBaseMetaTileEntity() + .getZCoord() + + " DIMID: " + + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId + + "."); GT_Pollution.addPollution(getBaseMetaTileEntity(), GT_Mod.gregtechproxy.mPollutionOnExplosion); mInventory[1] = null; Iterable allHatches = Iterables.concat( - mInputBusses, - mOutputBusses, - mInputHatches, - mOutputHatches, - mDynamoHatches, - mMufflerHatches, - mEnergyHatches, - mMaintenanceHatches); + mInputBusses, + mOutputBusses, + mInputHatches, + mOutputHatches, + mDynamoHatches, + mMufflerHatches, + mEnergyHatches, + mMaintenanceHatches); for (MetaTileEntity tTileEntity : allHatches) { if (tTileEntity != null && tTileEntity.getBaseMetaTileEntity() != null) { tTileEntity.getBaseMetaTileEntity() - .doExplosion(V[8]); + .doExplosion(V[8]); } } getBaseMetaTileEntity().doExplosion(V[8]); @@ -796,12 +777,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); for (int i = 0; i < ampsOnCurrentHatch; i++) { aDynamo.getBaseMetaTileEntity() - .increaseStoredEnergyUnits(aVoltage, false); + .increaseStoredEnergyUnits(aVoltage, false); } injected += aVoltage * ampsOnCurrentHatch; if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { aDynamo.getBaseMetaTileEntity() - .increaseStoredEnergyUnits(aRemainder, false); + .increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder; } } @@ -813,7 +794,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity long rVoltage = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); + .getInputVoltage(); return rVoltage; } @@ -827,7 +808,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity * @param perfectOC - If the Multiblock OCs perfectly, i.e. the large Chemical Reactor */ protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage, - boolean perfectOC) { + boolean perfectOC) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { // Long time calculation @@ -896,14 +877,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity if (aEU <= 0) return true; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) { if (tHatch.getBaseMetaTileEntity() - .decreaseStoredEnergyUnits(aEU, false)) - return true; + .decreaseStoredEnergyUnits(aEU, false)) return true; } return false; } protected static boolean dumpFluid(List aOutputHatches, FluidStack copiedFluidStack, - boolean restrictiveHatchesOnly) { + boolean restrictiveHatchesOnly) { for (GT_MetaTileEntity_Hatch_Output tHatch : aOutputHatches) { if (!isValidMetaTileEntity(tHatch) || (restrictiveHatchesOnly && tHatch.mMode == 0)) { continue; @@ -967,8 +947,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { if (!outputSuccess && isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) { if (tHatch.getBaseMetaTileEntity() - .addStackToSlot(1, single)) - outputSuccess = true; + .addStackToSlot(1, single)) outputSuccess = true; } } } @@ -983,14 +962,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity tHatch.mRecipeMap = getRecipeMap(); if (isValidMetaTileEntity(tHatch)) { if (GT_Utility.areStacksEqual( - aStack, - tHatch.getBaseMetaTileEntity() - .getStackInSlot(0))) { + aStack, + tHatch.getBaseMetaTileEntity() + .getStackInSlot(0))) { if (tHatch.getBaseMetaTileEntity() - .getStackInSlot(0).stackSize - >= aStack.stackSize) { + .getStackInSlot(0).stackSize >= aStack.stackSize) { tHatch.getBaseMetaTileEntity() - .decrStackSize(0, aStack.stackSize); + .decrStackSize(0, aStack.stackSize); return true; } } @@ -1000,17 +978,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity tHatch.mRecipeMap = getRecipeMap(); if (isValidMetaTileEntity(tHatch)) { for (int i = tHatch.getBaseMetaTileEntity() - .getSizeInventory() - - 1; i >= 0; i--) { + .getSizeInventory() - 1; i >= 0; i--) { if (GT_Utility.areStacksEqual( - aStack, - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i))) { + aStack, + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i))) { if (tHatch.getBaseMetaTileEntity() - .getStackInSlot(i).stackSize - >= aStack.stackSize) { + .getStackInSlot(i).stackSize >= aStack.stackSize) { tHatch.getBaseMetaTileEntity() - .decrStackSize(i, aStack.stackSize); + .decrStackSize(i, aStack.stackSize); return true; } } @@ -1030,11 +1006,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) { if (isValidMetaTileEntity(tHatch)) { for (int i = tHatch.getBaseMetaTileEntity() - .getSizeInventory() - - 1; i >= 0; i--) { + .getSizeInventory() - 1; i >= 0; i--) { rList.add( - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i)); + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i)); } } } @@ -1070,20 +1045,17 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity tHatch.mRecipeMap = getRecipeMap(); if (isValidMetaTileEntity(tHatch)) { for (int i = tHatch.getBaseMetaTileEntity() - .getSizeInventory() - - 1; i >= 0; i--) { + .getSizeInventory() - 1; i >= 0; i--) { if (tHatch.getBaseMetaTileEntity() - .getStackInSlot(i) - != null) + .getStackInSlot(i) != null) rList.add( - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i)); + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i)); } } } if (getStackInSlot(1) != null && getStackInSlot(1).getUnlocalizedName() - .startsWith("gt.integrated_circuit")) - rList.add(getStackInSlot(1)); + .startsWith("gt.integrated_circuit")) rList.add(getStackInSlot(1)); return rList; } @@ -1109,7 +1081,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } protected static T identifyHatch(IGregTechTileEntity aTileEntity, - int aBaseCasingIndex, Class clazz) { + int aBaseCasingIndex, Class clazz) { if (aTileEntity == null) return null; IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (!clazz.isInstance(aMetaTileEntity)) return null; @@ -1177,7 +1149,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == null) return false; if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch hatch - && GT_ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) { + && GT_ExoticEnergyInputHelper.isExoticEnergyInput(aMetaTileEntity)) { hatch.updateTexture(aBaseCasingIndex); return mExoticEnergyHatches.add(hatch); } @@ -1208,12 +1180,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { return addInputBusToMachineList(aTileEntity, aBaseCasingIndex) - || addInputHatchToMachineList(aTileEntity, aBaseCasingIndex); + || addInputHatchToMachineList(aTileEntity, aBaseCasingIndex); } public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { return addOutputBusToMachineList(aTileEntity, aBaseCasingIndex) - || addOutputHatchToMachineList(aTileEntity, aBaseCasingIndex); + || addOutputHatchToMachineList(aTileEntity, aBaseCasingIndex); } public boolean addInputBusToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -1276,62 +1248,62 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } return new String[] { - /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(getActualEnergyUsage()) - + EnumChatFormatting.RESET - + " EU/t", - /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxInputVoltage()) - + EnumChatFormatting.RESET - + " EU/t(*2A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(getMaxInputVoltage())] - + EnumChatFormatting.RESET, - /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" }; + /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(getActualEnergyUsage()) + + EnumChatFormatting.RESET + + " EU/t", + /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" }; } @Override @@ -1392,44 +1364,44 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); if (tag.getBoolean("incompleteStructure")) { currentTip.add(RED + "** INCOMPLETE STRUCTURE **" + RESET); } currentTip.add( - (tag.getBoolean("hasProblems") ? (RED + "** HAS PROBLEMS **") : GREEN + "Running Fine") + RESET - + " Efficiency: " - + tag.getFloat("efficiency") - + "%"); + (tag.getBoolean("hasProblems") ? (RED + "** HAS PROBLEMS **") : GREEN + "Running Fine") + RESET + + " Efficiency: " + + tag.getFloat("efficiency") + + "%"); boolean isActive = tag.getBoolean("isActive"); if (isActive) { long actualEnergyUsage = tag.getLong("energyUsage"); if (actualEnergyUsage > 0) { currentTip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.use", - GT_Utility.formatNumbers(actualEnergyUsage), - GT_Utility.getColoredTierNameFromVoltage(actualEnergyUsage))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.use", + GT_Utility.formatNumbers(actualEnergyUsage), + GT_Utility.getColoredTierNameFromVoltage(actualEnergyUsage))); } else if (actualEnergyUsage < 0) { currentTip.add( - StatCollector.translateToLocalFormatted( - "GT5U.waila.energy.produce", - GT_Utility.formatNumbers(-actualEnergyUsage), - GT_Utility.getColoredTierNameFromVoltage(-actualEnergyUsage))); + StatCollector.translateToLocalFormatted( + "GT5U.waila.energy.produce", + GT_Utility.formatNumbers(-actualEnergyUsage), + GT_Utility.getColoredTierNameFromVoltage(-actualEnergyUsage))); } } currentTip.add( - GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); + GT_Waila.getMachineProgressString(isActive, tag.getInteger("maxProgress"), tag.getInteger("progress"))); super.getWailaBody(itemStack, currentTip, accessor, config); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setBoolean("hasProblems", (getIdealStatus() - getRepairStatus()) > 0); @@ -1567,38 +1539,35 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(190, 85)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(4, 4) + .setSize(190, 85)); final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1); builder.widget( - inventorySlot.setPos(173, 167) - .setBackground(GT_UITextures.SLOT_DARK_GRAY)); + inventorySlot.setPos(173, 167) + .setBackground(GT_UITextures.SLOT_DARK_GRAY)); final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); drawTexts(screenElements, inventorySlot); builder.widget(screenElements); builder.widget(createPowerSwitchButton()) - .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> { - if (val) getBaseMetaTileEntity().enableWorking(); - else getBaseMetaTileEntity().disableWorking(); - })); + .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> { + if (val) getBaseMetaTileEntity().enableWorking(); + else getBaseMetaTileEntity().disableWorking(); + })); builder.widget(createVoidExcessButton()) - .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val)); + .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val)); builder.widget(createInputSeparationButton()) - .widget(new FakeSyncWidget.BooleanSyncer(() -> inputSeparation, val -> inputSeparation = val)); + .widget(new FakeSyncWidget.BooleanSyncer(() -> inputSeparation, val -> inputSeparation = val)); builder.widget(createBatchModeButton()) - .widget(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val)); + .widget(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val)); builder.widget(createLockToSingleRecipeButton()) - .widget( - new FakeSyncWidget.BooleanSyncer( - () -> mLockedToSingleRecipe, - val -> mLockedToSingleRecipe = val)); + .widget(new FakeSyncWidget.BooleanSyncer(() -> mLockedToSingleRecipe, val -> mLockedToSingleRecipe = val)); } @Override @@ -1606,119 +1575,102 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { screenElements.setSynced(false) - .setSpace(0) - .setPos(10, 7); + .setSpace(0) + .setPos(10, 7); - screenElements.widget( + screenElements + .widget( new TextWidget(GT_Utility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mWrench)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); - screenElements.widget( + .setEnabled(widget -> !mWrench)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); + screenElements + .widget( new TextWidget(GT_Utility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mScrewdriver)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); - screenElements.widget( + .setEnabled(widget -> !mScrewdriver)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); + screenElements + .widget( new TextWidget(GT_Utility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mSoftHammer)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); - screenElements.widget( + .setEnabled(widget -> !mSoftHammer)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); + screenElements + .widget( new TextWidget(GT_Utility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mHardHammer)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); - screenElements.widget( + .setEnabled(widget -> !mHardHammer)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); + screenElements + .widget( new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mSolderingTool)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); - screenElements.widget( + .setEnabled(widget -> !mSolderingTool)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); + screenElements + .widget( new TextWidget(GT_Utility.trans("137", "That doesn't belong there.")) - .setDefaultColor( - COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mCrowbar)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); - screenElements.widget( + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> !mCrowbar)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); + screenElements + .widget( new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mMachine)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); + .setEnabled(widget -> !mMachine)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)); screenElements.widget( - new TextWidget("Too Uncertain.").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128) - != 0)); + new TextWidget("Too Uncertain.").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128) != 0)); screenElements.widget( - new TextWidget("Invalid Parameters.").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> (getBaseMetaTileEntity().getErrorDisplayID() - & 256) != 0)); + new TextWidget("Invalid Parameters.").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 256) != 0)); screenElements.widget( - new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && !getBaseMetaTileEntity().isActive())) - .widget( - new FakeSyncWidget.IntegerSyncer( - () -> getBaseMetaTileEntity().getErrorDisplayID(), - val -> getBaseMetaTileEntity().setErrorDisplayID(val))) - .widget( - new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))); + new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> getBaseMetaTileEntity().getErrorDisplayID(), + val -> getBaseMetaTileEntity().setErrorDisplayID(val))) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))); screenElements.widget( - new TextWidget( - GT_Utility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && !getBaseMetaTileEntity().isActive())); + new TextWidget(GT_Utility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())); screenElements.widget( - new TextWidget(GT_Utility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && !getBaseMetaTileEntity().isActive())); + new TextWidget(GT_Utility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && !getBaseMetaTileEntity().isActive())); screenElements.widget( - new TextWidget(GT_Utility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && getBaseMetaTileEntity().isActive())); + new TextWidget(GT_Utility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 && getBaseMetaTileEntity().isActive())); screenElements.widget( - new TextWidget(GT_Utility.trans("143", "Missing Mining Pipe")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> { - if (getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && this instanceof GT_MetaTileEntity_DrillerBase) { - final ItemStack tItem = inventorySlot.getMcSlot() - .getStack(); - return tItem == null - || !GT_Utility.areStacksEqual( - tItem, - GT_ModHandler.getIC2Item( - "miningPipe", - 1L)); - } - return false; - })); + new TextWidget(GT_Utility.trans("143", "Missing Mining Pipe")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> { + if (getBaseMetaTileEntity().getErrorDisplayID() == 0 + && this instanceof GT_MetaTileEntity_DrillerBase) { + final ItemStack tItem = inventorySlot.getMcSlot() + .getStack(); + return tItem == null + || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L)); + } + return false; + })); screenElements.widget( - new TextWidget(GT_Utility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> { - if (getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && this instanceof GT_MetaTileEntity_LargeTurbine) { - final ItemStack tItem = inventorySlot.getMcSlot() - .getStack(); - return tItem == null || !(tItem - .getItem() - == GT_MetaGenerated_Tool_01.INSTANCE - && tItem.getItemDamage() - >= 170 - && tItem.getItemDamage() - <= 177); - } - return false; - })); + new TextWidget(GT_Utility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> { + if (getBaseMetaTileEntity().getErrorDisplayID() == 0 + && this instanceof GT_MetaTileEntity_LargeTurbine) { + final ItemStack tItem = inventorySlot.getMcSlot() + .getStack(); + return tItem == null + || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170 + && tItem.getItemDamage() <= 177); + } + return false; + })); } protected ButtonWidget createPowerSwitchButton() { @@ -1729,24 +1681,23 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity getBaseMetaTileEntity().enableWorking(); } }) - .setPlayClickSoundResource( - () -> getBaseMetaTileEntity().isAllowedToWork() - ? SoundResource.GUI_BUTTON_UP.resourceLocation - : SoundResource.GUI_BUTTON_DOWN.resourceLocation) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (getBaseMetaTileEntity().isAllowedToWork()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF); - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(174, 148) - .setSize(16, 16); + .setPlayClickSoundResource( + () -> getBaseMetaTileEntity().isAllowedToWork() ? SoundResource.GUI_BUTTON_UP.resourceLocation + : SoundResource.GUI_BUTTON_DOWN.resourceLocation) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (getBaseMetaTileEntity().isAllowedToWork()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF); + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 148) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.power_switch")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } @@ -1756,29 +1707,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity voidExcess = !voidExcess; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (isVoidExcessButtonEnabled()) { - if (isVoidExcessEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF); - } - } else { - if (isVoidExcessEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(8, 91) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (isVoidExcessButtonEnabled()) { + if (isVoidExcessEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF); + } + } else { + if (isVoidExcessEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(8, 91) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.void_excess")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } @@ -1788,31 +1739,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity inputSeparation = !inputSeparation; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (isInputSeparationButtonEnabled()) { - if (isInputSeparationEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); - } - } else { - if (isInputSeparationEnabled()) { - ret.add( - GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED); - } else { - ret.add( - GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(26, 91) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (isInputSeparationButtonEnabled()) { + if (isInputSeparationEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); + } + } else { + if (isInputSeparationEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(26, 91) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.input_separation")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } @@ -1822,29 +1771,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity batchMode = !batchMode; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (isBatchModeButtonEnabled()) { - if (isBatchModeEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); - } - } else { - if (isBatchModeEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(44, 91) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (isBatchModeButtonEnabled()) { + if (isBatchModeEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); + } + } else { + if (isBatchModeEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(44, 91) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.batch_mode")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } @@ -1854,29 +1803,29 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity mLockedToSingleRecipe = !mLockedToSingleRecipe; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (supportsSingleRecipeLocking()) { - if (isRecipeLockingEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); - } - } else { - if (isRecipeLockingEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(62, 91) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (supportsSingleRecipeLocking()) { + if (isRecipeLockingEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); + } + } else { + if (isRecipeLockingEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(62, 91) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.lock_recipe")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java index 890733e363..9672c87f40 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java @@ -29,18 +29,18 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_ public boolean bInvertFilter = false; public GT_MetaTileEntity_SpecialFilter(int aID, String aName, String aNameRegional, int aTier, - String[] aDescription) { + String[] aDescription) { // 9 buffer slot, 1 representation slot, 1 holo slot. last seems not needed... super(aID, aName, aNameRegional, aTier, 11, aDescription); } public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_SpecialFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -68,8 +68,8 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_ @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) - && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) - && (this.isStackAllowed(aStack) != this.bInvertFilter); + && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) + && (this.isStackAllowed(aStack) != this.bInvertFilter); } protected abstract boolean isStackAllowed(ItemStack aStack); @@ -91,79 +91,77 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_ bInvertFilter = !bInvertFilter; if (bInvertFilter) { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("124", "Invert Filter")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("124", "Invert Filter")); } else { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("125", "Don't invert Filter")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("125", "Don't invert Filter")); } }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER) - .setPos(61, 62) - .setSize(18, 18)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - bNBTAllowed = !bNBTAllowed; - if (bNBTAllowed) { - GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("126", "Ignore NBT")); - } else { - GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("127", "NBT has to match")); - } - }) - .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT) - .setPos(79, 62) - .setSize(18, 18)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false)) - .setPos(6, 19) - .setSize(27, 24)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true)) - .setPos(53, 19) - .setSize(42, 24)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true)) - .setPos(152, 19) - .setSize(19, 24)) - .widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 9)) { - - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - clickTypeIcon(clickData.mouseButton != 0, cursorStack); - } - - @Override - public void buildTooltip(List tooltip) { - if (getEmptySlotTooltip() != null) { - tooltip.addAll(getEmptySlotTooltip()); - } - super.buildTooltip(tooltip); - } - - @Override - public List getExtraTooltip() { - if (getItemExtraTooltip() != null) { - return getItemExtraTooltip(); - } - return Collections.emptyList(); - } - }.disableShiftInsert() + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER) + .setPos(61, 62) + .setSize(18, 18)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + bNBTAllowed = !bNBTAllowed; + if (bNBTAllowed) { + GT_Utility.sendChatToPlayer( + widget.getContext() + .getPlayer(), + GT_Utility.trans("126", "Ignore NBT")); + } else { + GT_Utility.sendChatToPlayer( + widget.getContext() + .getPlayer(), + GT_Utility.trans("127", "NBT has to match")); + } + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT) + .setPos(79, 62) + .setSize(18, 18)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false)) + .setPos(6, 19) + .setSize(27, 24)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true)) + .setPos(53, 19) + .setSize(42, 24)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true)) + .setPos(152, 19) + .setSize(19, 24)) + .widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 9)) { + + @Override + protected void phantomClick(ClickData clickData, ItemStack cursorStack) { + clickTypeIcon(clickData.mouseButton != 0, cursorStack); + } + + @Override + public void buildTooltip(List tooltip) { + if (getEmptySlotTooltip() != null) { + tooltip.addAll(getEmptySlotTooltip()); + } + super.buildTooltip(tooltip); + } + + @Override + public List getExtraTooltip() { + if (getItemExtraTooltip() != null) { + return getItemExtraTooltip(); + } + return Collections.emptyList(); + } + }.disableShiftInsert() .setPos(34, 22) .setBackground(GT_UITextures.BUTTON_STANDARD)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .endAtSlot(8) - .build() - .setPos(97, 4)); + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3) + .endAtSlot(8) + .build() + .setPos(97, 4)); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java index 3424baca8b..765cd047ad 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java @@ -35,7 +35,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit public final ITexture[][][] mTextures; public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, - int aInvSlotCount, String aDescription, ITexture... aTextures) { + int aInvSlotCount, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 14)); mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; @@ -46,7 +46,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit } public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, - int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + int aInvSlotCount, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 15)); mDescriptionArray = aDescription == null ? new String[0] : aDescription; @@ -63,7 +63,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit } public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aInvSlotCount); mTier = (byte) aTier; mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; @@ -72,7 +72,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit } public GT_MetaTileEntity_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aInvSlotCount); mTier = (byte) aTier; mDescriptionArray = aDescription == null ? new String[0] : aDescription; @@ -124,15 +124,9 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit protected SlotWidget createChargerSlot(int x, int y, String tooltipKey, Object[] tooltipArgs) { return (SlotWidget) new SlotWidget(inventoryHandler, rechargerSlotStartIndex()).disableShiftInsert() - .setGTTooltip( - () -> mTooltipCache.getData( - tooltipKey, - tooltipArgs)) - .setTooltipShowUpDelay( - TOOLTIP_DELAY) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_CHARGER) - .setPos(x, y); + .setGTTooltip(() -> mTooltipCache.getData(tooltipKey, tooltipArgs)) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) + .setPos(x, y); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java index a4c42dd14d..c12c7c1442 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TooltipMultiBlockBase.java @@ -12,10 +12,10 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; * A multiblock with tooltip {@link GT_Multiblock_Tooltip_Builder} */ public abstract class GT_MetaTileEntity_TooltipMultiBlockBase extends GT_MetaTileEntity_MultiBlockBase - implements ISecondaryDescribable { + implements ISecondaryDescribable { private static final AtomicReferenceArray tooltips = new AtomicReferenceArray<>( - GregTech_API.METATILEENTITIES.length); + GregTech_API.METATILEENTITIES.length); public GT_MetaTileEntity_TooltipMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java index c7b9c66b70..ae70607416 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java @@ -58,38 +58,38 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; i++) { rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; } return rTextures; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) - + (aBaseMetaTileEntity.isAllowedToWork() ? 0 : 6)][aColorIndex + 1]; + + (aBaseMetaTileEntity.isAllowedToWork() ? 0 : 6)][aColorIndex + 1]; } @Override @@ -125,7 +125,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public boolean isInputFacing(byte aSide) { return getBaseMetaTileEntity().isAllowedToWork() ? aSide == getBaseMetaTileEntity().getFrontFacing() - : aSide != getBaseMetaTileEntity().getFrontFacing(); + : aSide != getBaseMetaTileEntity().getFrontFacing(); } @Override @@ -175,51 +175,46 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++) if (aBaseMetaTileEntity.inputEnergyFrom(i)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); - if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy( - ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), - 1, - true) == 1) { + if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity) + .extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), 1, true) == 1) { long tEU = ((IEnergyProvider) tTileEntity).extractEnergy( - ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), - GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), - false); + ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), + GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), + false); tEU = tEU * GregTech_API.mRFtoEU / 100; aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); } else if (tTileEntity instanceof IEnergyStorage - && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) { - long tEU = ((IEnergyStorage) tTileEntity).extractEnergy( - GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), - false); - tEU = tEU * GregTech_API.mRFtoEU / 100; - aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); - } else - if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer - && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) { - int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored(); - int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU); - long tEU = 0; - if (tTileEntity instanceof TileCapBank) { - ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork(); - if (network != null && network.getEnergyStoredL() > 0) { - tEU = Math.min( - (Math.min( - Math.min(network.getEnergyStoredL(), storedRF - extractRF), - network.getMaxOutput())) * (long) GregTech_API.mRFtoEU - / 100L, - maxEUInput()); - network.addEnergy(GT_Utility.safeInt(-(tEU * 100 / GregTech_API.mRFtoEU))); - } + && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) { + long tEU = ((IEnergyStorage) tTileEntity) + .extractEnergy(GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), false); + tEU = tEU * GregTech_API.mRFtoEU / 100; + aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); + } else if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer + && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) { + int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored(); + int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU); + long tEU = 0; + if (tTileEntity instanceof TileCapBank) { + ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork(); + if (network != null && network.getEnergyStoredL() > 0) { + tEU = Math.min( + (Math.min( + Math.min(network.getEnergyStoredL(), storedRF - extractRF), + network.getMaxOutput())) * (long) GregTech_API.mRFtoEU / 100L, + maxEUInput()); + network.addEnergy(GT_Utility.safeInt(-(tEU * 100 / GregTech_API.mRFtoEU))); + } + } else { + if (storedRF > extractRF) { + ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF); + tEU = maxEUInput(); } else { - if (storedRF > extractRF) { - ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF); - tEU = maxEUInput(); - } else { - ((IPowerContainer) tTileEntity).setEnergyStored(0); - tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L; - } + ((IPowerContainer) tTileEntity).setEnergyStored(0); + tEU = storedRF * (long) GregTech_API.mRFtoEU / 100L; } - aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); } + aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); + } } } } @@ -252,14 +247,14 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public String getAlternativeModeText() { return (getBaseMetaTileEntity().isAllowedToWork() ? GT_Utility.trans("145", "Step Down, In: ") - : GT_Utility.trans("146", "Step Up, In: ")) + maxEUInput() - + GT_Utility.trans("148", "V ") - + maxAmperesIn() - + GT_Utility.trans("147", "A, Out: ") - + maxEUOutput() - + GT_Utility.trans("148", "V ") - + maxAmperesOut() - + GT_Utility.trans("149", "A"); + : GT_Utility.trans("146", "Step Up, In: ")) + maxEUInput() + + GT_Utility.trans("148", "V ") + + maxAmperesIn() + + GT_Utility.trans("147", "A, Out: ") + + maxEUOutput() + + GT_Utility.trans("148", "V ") + + maxAmperesOut() + + GT_Utility.trans("149", "A"); } @Override @@ -269,45 +264,42 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { final int facing = getBaseMetaTileEntity().getFrontFacing(); final NBTTagCompound tag = accessor.getNBTData(); final int side = (byte) accessor.getSide() - .ordinal(); + .ordinal(); final boolean allowedToWork = tag.getBoolean("isAllowedToWork"); final byte inputTier = GT_Utility.getTier(tag.getLong("maxEUInput")); final byte outputTier = GT_Utility.getTier(tag.getLong("maxEUOutput")); currenttip.add( - String.format( - "%s %s(%dA) -> %s(%dA)", - (allowedToWork ? (GREEN + "Step Down") : (RED + "Step Up")) + RESET, - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier - ? GT_Utility.getColoredTierNameFromTier(inputTier) - : tag.getLong("maxEUInput"), - tag.getLong("maxAmperesIn"), - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier - ? GT_Utility.getColoredTierNameFromTier(outputTier) - : tag.getLong("maxEUOutput"), - tag.getLong("maxAmperesOut"))); + String.format( + "%s %s(%dA) -> %s(%dA)", + (allowedToWork ? (GREEN + "Step Down") : (RED + "Step Up")) + RESET, + GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(inputTier) + : tag.getLong("maxEUInput"), + tag.getLong("maxAmperesIn"), + GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(outputTier) + : tag.getLong("maxEUOutput"), + tag.getLong("maxAmperesOut"))); if ((side == facing && allowedToWork) || (side != facing && !allowedToWork)) { currenttip.add( - String.format( - GOLD + "Input:" + RESET + " %s(%dA)", - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier - ? GT_Utility.getColoredTierNameFromTier(inputTier) - : tag.getLong("maxEUInput"), - tag.getLong("maxAmperesIn"))); + String.format( + GOLD + "Input:" + RESET + " %s(%dA)", + GT_Mod.gregtechproxy.mWailaTransformerVoltageTier ? GT_Utility.getColoredTierNameFromTier(inputTier) + : tag.getLong("maxEUInput"), + tag.getLong("maxAmperesIn"))); } else { currenttip.add( - String.format( - BLUE + "Output:" + RESET + " %s(%dA)", - GT_Mod.gregtechproxy.mWailaTransformerVoltageTier - ? GT_Utility.getColoredTierNameFromTier(outputTier) - : tag.getLong("maxEUOutput"), - tag.getLong("maxAmperesOut"))); + String.format( + BLUE + "Output:" + RESET + " %s(%dA)", + GT_Mod.gregtechproxy.mWailaTransformerVoltageTier + ? GT_Utility.getColoredTierNameFromTier(outputTier) + : tag.getLong("maxEUOutput"), + tag.getLong("maxAmperesOut"))); } super.getWailaBody(itemStack, currenttip, accessor, config); @@ -315,7 +307,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setBoolean("isAllowedToWork", getBaseMetaTileEntity().isAllowedToWork()); tag.setLong("maxEUInput", maxEUInput()); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java index 1c61f9ffa7..0e313a4c00 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java @@ -14,13 +14,13 @@ import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation; import gregtech.api.metatileentity.MetaTileEntity; public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_Dynamo - implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation { + implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation { private String owner_uuid; private String owner_name; public GT_MetaTileEntity_Wireless_Dynamo(String aName, byte aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -86,8 +86,8 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D @Override public String[] getDescription() { return new String[] { EnumChatFormatting.GRAY + "Stores energy globally in a network, up to 2^(2^31) EU.", - EnumChatFormatting.GRAY + "Does not connect to wires. This block accepts EU into the network.", - AuthorColen }; + EnumChatFormatting.GRAY + "Does not connect to wires. This block accepts EU into the network.", + AuthorColen }; } @Override @@ -126,7 +126,7 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D // UUID and username of the owner. owner_uuid = aBaseMetaTileEntity.getOwnerUuid() - .toString(); + .toString(); owner_name = aBaseMetaTileEntity.getOwnerName(); strongCheckOrAddUser(owner_uuid, owner_name); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java index e17cc6fbfb..c363bb6eb0 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java @@ -16,10 +16,10 @@ import gregtech.api.interfaces.tileentity.IWirelessEnergyHatchInformation; import gregtech.api.metatileentity.MetaTileEntity; public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_Energy - implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation { + implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation { - private final BigInteger eu_transferred_per_operation = BigInteger.valueOf( - 2 * V[mTier] * ticks_between_energy_addition); + private final BigInteger eu_transferred_per_operation = BigInteger + .valueOf(2 * V[mTier] * ticks_between_energy_addition); private final long eu_transferred_per_operation_long = eu_transferred_per_operation.longValue(); private String owner_uuid; @@ -36,8 +36,8 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En @Override public String[] getDescription() { return new String[] { EnumChatFormatting.GRAY + "Stores energy globally in a network, up to 2^(2^31) EU.", - EnumChatFormatting.GRAY + "Does not connect to wires. This block withdraws EU from the network.", - AuthorColen }; + EnumChatFormatting.GRAY + "Does not connect to wires. This block withdraws EU from the network.", + AuthorColen }; } @Override @@ -132,7 +132,7 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En // UUID and username of the owner. owner_uuid = aBaseMetaTileEntity.getOwnerUuid() - .toString(); + .toString(); owner_name = aBaseMetaTileEntity.getOwnerName(); strongCheckOrAddUser(owner_uuid, owner_name); diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java index 2e6bdca647..55edf332bd 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlock.java @@ -77,7 +77,7 @@ import gregtech.common.render.IRenderedBlock; */ @Optional.Interface(iface = "com.cricketcraft.chisel.api.IFacade", modid = "ChiselAPI") public class MultiTileEntityBlock extends Block - implements IDebugableBlock, ITileEntityProvider, IRenderedBlock, IFacade { + implements IDebugableBlock, ITileEntityProvider, IRenderedBlock, IFacade { protected static final Map MULTI_BLOCK_MAP = new HashMap<>(); private static boolean LOCK = false; @@ -87,22 +87,22 @@ public class MultiTileEntityBlock extends Block protected final boolean mOpaque, mNormalCube; public static String getName(String aMaterialName, SoundType aSoundType, String aTool, int aHarvestLevelOffset, - int aHarvestLevelMinimum, int aHarvestLevelMaximum, boolean aOpaque, boolean aNormalCube) { + int aHarvestLevelMinimum, int aHarvestLevelMaximum, boolean aOpaque, boolean aNormalCube) { return "gt.block.multiblock." + aMaterialName - + "." - + aSoundType.soundName - + "." - + aTool - + "." - + aHarvestLevelOffset - + "." - + aHarvestLevelMinimum - + "." - + aHarvestLevelMaximum - + "." - + aOpaque - + "." - + aNormalCube; + + "." + + aSoundType.soundName + + "." + + aTool + + "." + + aHarvestLevelOffset + + "." + + aHarvestLevelMinimum + + "." + + aHarvestLevelMaximum + + "." + + aOpaque + + "." + + aNormalCube; } /** @@ -118,50 +118,50 @@ public class MultiTileEntityBlock extends Block * @param aNormalCube if this Block is a normal Cube (for Redstone Stuff). */ public static MultiTileEntityBlock getOrCreate(String aModID, String aMaterialName, Material aMaterial, - SoundType aSoundType, String aTool, int aHarvestLevelOffset, int aHarvestLevelMinimum, - int aHarvestLevelMaximum, boolean aOpaque, boolean aNormalCube) { + SoundType aSoundType, String aTool, int aHarvestLevelOffset, int aHarvestLevelMinimum, int aHarvestLevelMaximum, + boolean aOpaque, boolean aNormalCube) { final MultiTileEntityBlock rBlock = MULTI_BLOCK_MAP.get( - aModID + ":" - + getName( - aMaterialName, - aSoundType, - aTool = aTool.toLowerCase(), - aHarvestLevelOffset, - aHarvestLevelMinimum, - aHarvestLevelMaximum, - aOpaque, - aNormalCube)); + aModID + ":" + + getName( + aMaterialName, + aSoundType, + aTool = aTool.toLowerCase(), + aHarvestLevelOffset, + aHarvestLevelMinimum, + aHarvestLevelMaximum, + aOpaque, + aNormalCube)); return rBlock == null - ? new MultiTileEntityBlock( - aModID, - aMaterialName, - aMaterial, - aSoundType, - aTool, - aHarvestLevelOffset, - aHarvestLevelMinimum, - aHarvestLevelMaximum, - aOpaque, - aNormalCube) - : rBlock; + ? new MultiTileEntityBlock( + aModID, + aMaterialName, + aMaterial, + aSoundType, + aTool, + aHarvestLevelOffset, + aHarvestLevelMinimum, + aHarvestLevelMaximum, + aOpaque, + aNormalCube) + : rBlock; } protected MultiTileEntityBlock(String aModID, String aMaterialName, Material aMaterial, SoundType aSoundType, - String aTool, int aHarvestLevelOffset, int aHarvestLevelMinimum, int aHarvestLevelMaximum, boolean aOpaque, - boolean aNormalCube) { + String aTool, int aHarvestLevelOffset, int aHarvestLevelMinimum, int aHarvestLevelMaximum, boolean aOpaque, + boolean aNormalCube) { super(aMaterial); if (GregTech_API.sPreloadFinished) throw new IllegalStateException("Blocks can only be initialized within preInit!"); mNameInternal = getName( - aMaterialName, - aSoundType, - aTool, - aHarvestLevelOffset, - aHarvestLevelMinimum, - aHarvestLevelMaximum, - aOpaque, - aNormalCube); + aMaterialName, + aSoundType, + aTool, + aHarvestLevelOffset, + aHarvestLevelMinimum, + aHarvestLevelMaximum, + aOpaque, + aNormalCube); GameRegistry.registerBlock(this, ItemBlock.class, mNameInternal); MULTI_BLOCK_MAP.put(aModID + ":" + mNameInternal, this); @@ -187,7 +187,7 @@ public class MultiTileEntityBlock extends Block return; if (aTileEntity instanceof IMTE_BreakBlock && ((IMTE_BreakBlock) aTileEntity).breakBlock()) return; if (aTileEntity instanceof IMTE_HasMultiBlockMachineRelevantData - && ((IMTE_HasMultiBlockMachineRelevantData) aTileEntity).hasMultiBlockMachineRelevantData()) + && ((IMTE_HasMultiBlockMachineRelevantData) aTileEntity).hasMultiBlockMachineRelevantData()) GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); aWorld.removeTileEntity(aX, aY, aZ); @@ -226,7 +226,7 @@ public class MultiTileEntityBlock extends Block public final float getBlockHardness(World aWorld, int aX, int aY, int aZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMTE_GetBlockHardness ? ((IMTE_GetBlockHardness) aTileEntity).getBlockHardness() - : 1.0F; + : 1.0F; } @SideOnly(Side.CLIENT) @@ -244,7 +244,7 @@ public class MultiTileEntityBlock extends Block @Override @SuppressWarnings("unchecked") public final void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB aAABB, - List aList, Entity aEntity) { + List aList, Entity aEntity) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (aTileEntity instanceof IMultiTileEntity) ((IMultiTileEntity) aTileEntity).addCollisionBoxesToList(aAABB, aList, aEntity); @@ -255,16 +255,16 @@ public class MultiTileEntityBlock extends Block public final AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity - ? ((IMultiTileEntity) aTileEntity).getCollisionBoundingBoxFromPool() - : aTileEntity == null ? null : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + ? ((IMultiTileEntity) aTileEntity).getCollisionBoundingBoxFromPool() + : aTileEntity == null ? null : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } @Override public final AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity - ? ((IMultiTileEntity) aTileEntity).getSelectedBoundingBoxFromPool() - : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); + ? ((IMultiTileEntity) aTileEntity).getSelectedBoundingBoxFromPool() + : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); } @Override @@ -284,7 +284,7 @@ public class MultiTileEntityBlock extends Block @Override public final void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, - int aTileZ) { + int aTileZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (!LOCK) { LOCK = true; @@ -317,8 +317,8 @@ public class MultiTileEntityBlock extends Block public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity && ((IMultiTileEntity) aTileEntity).privateAccess() - && !((IMultiTileEntity) aTileEntity).playerOwnsThis(aPlayer, true) ? -1.0F - : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + && !((IMultiTileEntity) aTileEntity).playerOwnsThis(aPlayer, true) ? -1.0F + : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); } @Override @@ -330,42 +330,42 @@ public class MultiTileEntityBlock extends Block @Override public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float aHitX, - float aHitY, float aHitZ) { + float aHitY, float aHitZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (aPlayer != null && ItemList.TC_Thaumometer.isStackEqual(aPlayer.getHeldItem(), true, true)) return false; return aTileEntity instanceof IMultiTileEntity - && ((IMultiTileEntity) aTileEntity).onBlockActivated(aPlayer, (byte) aSide, aHitX, aHitY, aHitZ); + && ((IMultiTileEntity) aTileEntity).onBlockActivated(aPlayer, (byte) aSide, aHitX, aHitY, aHitZ); } @Override public final int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMTE_IsProvidingWeakPower - ? ((IMTE_IsProvidingWeakPower) aTileEntity).isProvidingWeakPower((byte) aSide) - : super.isProvidingWeakPower(aWorld, aX, aY, aZ, aSide); + ? ((IMTE_IsProvidingWeakPower) aTileEntity).isProvidingWeakPower((byte) aSide) + : super.isProvidingWeakPower(aWorld, aX, aY, aZ, aSide); } @Override public final int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMTE_IsProvidingStrongPower - ? ((IMTE_IsProvidingStrongPower) aTileEntity).isProvidingStrongPower((byte) aSide) - : super.isProvidingStrongPower(aWorld, aX, aY, aZ, aSide); + ? ((IMTE_IsProvidingStrongPower) aTileEntity).isProvidingStrongPower((byte) aSide) + : super.isProvidingStrongPower(aWorld, aX, aY, aZ, aSide); } @Override public final boolean shouldCheckWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMTE_ShouldCheckWeakPower - ? ((IMTE_ShouldCheckWeakPower) aTileEntity).shouldCheckWeakPower((byte) aSide) - : isNormalCube(aWorld, aX, aY, aZ); + ? ((IMTE_ShouldCheckWeakPower) aTileEntity).shouldCheckWeakPower((byte) aSide) + : isNormalCube(aWorld, aX, aY, aZ); } @Override public final boolean getWeakChanges(IBlockAccess aWorld, int aX, int aY, int aZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMTE_GetWeakChanges ? ((IMTE_GetWeakChanges) aTileEntity).getWeakChanges() - : super.getWeakChanges(aWorld, aX, aY, aZ); + : super.getWeakChanges(aWorld, aX, aY, aZ); } @Override @@ -379,18 +379,8 @@ public class MultiTileEntityBlock extends Block final TileEntity aTileEntity = getTileEntity(aWorld, aX, aY, aZ, true); if (aTileEntity instanceof IMultiTileEntity) { final ArrayList tList = ((IMultiTileEntity) aTileEntity).getDrops(aFortune, aSilkTouch); - aChance = ForgeEventFactory.fireBlockHarvesting( - tList, - aWorld, - this, - aX, - aY, - aZ, - aMeta, - aFortune, - aChance, - aSilkTouch, - aPlayer); + aChance = ForgeEventFactory + .fireBlockHarvesting(tList, aWorld, this, aX, aY, aZ, aMeta, aFortune, aChance, aSilkTouch, aPlayer); for (ItemStack tStack : tList) if (XSTR.XSTR_INSTANCE.nextFloat() <= aChance) dropBlockAsItem(aWorld, aX, aY, aZ, tStack); } @@ -437,8 +427,8 @@ public class MultiTileEntityBlock extends Block public final boolean shouldSideBeRendered(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { final TileEntity aTileEntity = aWorld.getTileEntity(aX - OFFX[aSide], aY - OFFY[aSide], aZ - OFFZ[aSide]); return aTileEntity instanceof IMultiTileEntity - ? ((IMultiTileEntity) aTileEntity).shouldSideBeRendered((byte) aSide) - : super.shouldSideBeRendered(aWorld, aX, aY, aZ, aSide); + ? ((IMultiTileEntity) aTileEntity).shouldSideBeRendered((byte) aSide) + : super.shouldSideBeRendered(aWorld, aX, aY, aZ, aSide); } @Override @@ -448,14 +438,14 @@ public class MultiTileEntityBlock extends Block final byte aSide = (byte) side; if (side != -1) { final Block facadeBlock = tile.getCoverInfoAtSide(aSide) - .getFacadeBlock(); + .getFacadeBlock(); if (facadeBlock != null) return facadeBlock; } else { // we do not allow more than one type of facade per block, so no need to check every side // see comment in gregtech.common.covers.GT_Cover_FacadeBase.isCoverPlaceable for (byte tSide : ALL_VALID_SIDES) { final Block facadeBlock = tile.getCoverInfoAtSide(tSide) - .getFacadeBlock(); + .getFacadeBlock(); if (facadeBlock != null) { return facadeBlock; } @@ -529,11 +519,10 @@ public class MultiTileEntityBlock extends Block public final int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMTE_GetComparatorInputOverride - ? ((IMTE_GetComparatorInputOverride) aTileEntity).getComparatorInputOverride((byte) aSide) - : aTileEntity instanceof IMTE_IsProvidingWeakPower - ? ((IMTE_IsProvidingWeakPower) aTileEntity).isProvidingWeakPower( - GT_Utility.getOppositeSide(aSide)) - : super.getComparatorInputOverride(aWorld, aX, aY, aZ, aSide); + ? ((IMTE_GetComparatorInputOverride) aTileEntity).getComparatorInputOverride((byte) aSide) + : aTileEntity instanceof IMTE_IsProvidingWeakPower + ? ((IMTE_IsProvidingWeakPower) aTileEntity).isProvidingWeakPower(GT_Utility.getOppositeSide(aSide)) + : super.getComparatorInputOverride(aWorld, aX, aY, aZ, aSide); } @Override @@ -550,9 +539,9 @@ public class MultiTileEntityBlock extends Block public final boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity - ? ((IMultiTileEntity) aTileEntity).isSideSolid( - (byte) (aSide != null ? aSide.ordinal() : GT_Values.SIDE_UNKNOWN)) - : mOpaque; + ? ((IMultiTileEntity) aTileEntity) + .isSideSolid((byte) (aSide != null ? aSide.ordinal() : GT_Values.SIDE_UNKNOWN)) + : mOpaque; } @Override @@ -579,7 +568,7 @@ public class MultiTileEntityBlock extends Block @Override public final ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aUnusableMetaData, - int aFortune) { + int aFortune) { final TileEntity aTileEntity = getTileEntity(aWorld, aX, aY, aZ, true); if (aTileEntity instanceof IMultiTileEntity) return ((IMultiTileEntity) aTileEntity).getDrops(aFortune, false); return new ArrayList<>(); @@ -592,15 +581,11 @@ public class MultiTileEntityBlock extends Block @Override public final float getExplosionResistance(Entity aExploder, World aWorld, int aX, int aY, int aZ, - double aExplosionX, double aExplosionY, double aExplosionZ) { + double aExplosionX, double aExplosionY, double aExplosionZ) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity - ? ((IMultiTileEntity) aTileEntity).getExplosionResistance( - aExploder, - aExplosionX, - aExplosionY, - aExplosionZ) - : 1.0F; + ? ((IMultiTileEntity) aTileEntity).getExplosionResistance(aExploder, aExplosionX, aExplosionY, aExplosionZ) + : 1.0F; } @Override @@ -610,11 +595,11 @@ public class MultiTileEntityBlock extends Block if (aTileEntity != null) LAST_BROKEN_TILEENTITY.set(aTileEntity); if (aTileEntity instanceof IMultiTileEntity) { GT_Log.exp.printf( - "Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", - aX, - aY, - aZ, - aWorld.provider.dimensionId); + "Explosion at : %d | %d | %d DIMID: %s due to near explosion!%n", + aX, + aY, + aZ, + aWorld.provider.dimensionId); ((IMultiTileEntity) aTileEntity).onExploded(aExplosion); } else aWorld.setBlockToAir(aX, aY, aZ); } @@ -628,7 +613,7 @@ public class MultiTileEntityBlock extends Block public final boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity - && ((IMultiTileEntity) aTileEntity).recolourBlock((byte) aSide.ordinal(), (byte) aColor); + && ((IMultiTileEntity) aTileEntity).recolourBlock((byte) aSide.ordinal(), (byte) aColor); } @Override @@ -648,7 +633,7 @@ public class MultiTileEntityBlock extends Block @Override public final ItemStack getPickBlock(MovingObjectPosition aTarget, World aWorld, int aX, int aY, int aZ, - EntityPlayer aPlayer) { + EntityPlayer aPlayer) { final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity instanceof IMultiTileEntity ? ((IMultiTileEntity) aTileEntity).getPickBlock(aTarget) : null; } @@ -660,13 +645,13 @@ public class MultiTileEntityBlock extends Block } public final IMultiTileEntity receiveMultiTileEntityData(IBlockAccess aWorld, int aX, short aY, int aZ, short aRID, - short aID) { + short aID) { if (!(aWorld instanceof World)) return null; TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (!(aTileEntity instanceof IMultiTileEntity) - || ((IMultiTileEntity) aTileEntity).getMultiTileEntityRegistryID() != aRID - || ((IMultiTileEntity) aTileEntity).getMultiTileEntityID() != aID) { + || ((IMultiTileEntity) aTileEntity).getMultiTileEntityRegistryID() != aRID + || ((IMultiTileEntity) aTileEntity).getMultiTileEntityID() != aID) { final MultiTileEntityRegistry tRegistry = MultiTileEntityRegistry.getRegistry(aRID); if (tRegistry == null) return null; @@ -679,7 +664,7 @@ public class MultiTileEntityBlock extends Block } public void receiveCoverData(IMultiTileEntity mte, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, - int aCover5) { + int aCover5) { boolean updated; updated = mte.setCoverIDAtSideNoUpdate((byte) 0, aCover0); updated |= mte.setCoverIDAtSideNoUpdate((byte) 1, aCover1); diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlockInternal.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlockInternal.java index 91855aae55..ec24654a1c 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlockInternal.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityBlockInternal.java @@ -50,14 +50,9 @@ public class MultiTileEntityBlockInternal extends Block implements IRenderedBloc } public boolean placeBlock(World aWorld, int aX, int aY, int aZ, byte aSide, short aMetaData, NBTTagCompound aNBT, - boolean aCauseBlockUpdates, boolean aForcePlacement) { - final MultiTileEntityContainer aMTEContainer = mMultiTileEntityRegistry.getNewTileEntityContainer( - aWorld, - aX, - aY, - aZ, - aMetaData, - aNBT); + boolean aCauseBlockUpdates, boolean aForcePlacement) { + final MultiTileEntityContainer aMTEContainer = mMultiTileEntityRegistry + .getNewTileEntityContainer(aWorld, aX, aY, aZ, aMetaData, aNBT); if (aMTEContainer == null) return false; final Block tReplacedBlock = aWorld.getBlock(aX, aY, aZ); @@ -90,8 +85,8 @@ public class MultiTileEntityBlockInternal extends Block implements IRenderedBloc try { if (aMTEContainer.mTileEntity instanceof IMTE_HasMultiBlockMachineRelevantData) { - if (((IMTE_HasMultiBlockMachineRelevantData) aMTEContainer.mTileEntity).hasMultiBlockMachineRelevantData()) - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + if (((IMTE_HasMultiBlockMachineRelevantData) aMTEContainer.mTileEntity) + .hasMultiBlockMachineRelevantData()) GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } catch (Throwable e) { GT_FML_LOGGER.error("causeMachineUpdate", e); diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java index 593a3c46e7..4e4be793b1 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityClassContainer.java @@ -32,7 +32,7 @@ public class MultiTileEntityClassContainer { public boolean mHidden = false; public MultiTileEntityClassContainer(MultiTileEntityRegistry aRegistry, int aID, - Class aClass) { + Class aClass) { /* Start the Builder */ mRegistry = new WeakReference<>(aRegistry); mID = (short) aID; @@ -45,10 +45,10 @@ public class MultiTileEntityClassContainer { final MultiTileEntityRegistry registry = mRegistry.get(); if (mParameters.hasKey(NBT.MATERIAL) && !mParameters.hasKey(NBT.COLOR)) mParameters.setInteger( - NBT.COLOR, - GT_Util.getRGBInt( - Materials.get(mParameters.getString(NBT.MATERIAL)) - .getRGBA())); + NBT.COLOR, + GT_Util.getRGBInt( + Materials.get(mParameters.getString(NBT.MATERIAL)) + .getRGBA())); try { mCanonicalTileEntity = mClass.newInstance(); @@ -162,7 +162,7 @@ public class MultiTileEntityClassContainer { // Check if cls is extended by mClass if (!cls.isAssignableFrom(mClass)) { throw new IllegalArgumentException( - "Expected a descendent of " + cls.getName() + " got " + mClass.getName() + " instead."); + "Expected a descendent of " + cls.getName() + " got " + mClass.getName() + " instead."); } } @@ -183,7 +183,7 @@ public class MultiTileEntityClassContainer { if (!atLeastOne) { throw new IllegalArgumentException( - "Expected a descendent of any of these " + classNames + " got " + mClass.getName() + " instead."); + "Expected a descendent of any of these " + classNames + " got " + mClass.getName() + " instead."); } } } diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityItemInternal.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityItemInternal.java index 1f3c2dd5ca..a37fa9956e 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityItemInternal.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityItemInternal.java @@ -50,8 +50,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer == null) { aList.add("INVALID ITEM!"); return; @@ -74,12 +74,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont public void getSubItems(Item aItem, CreativeTabs aTab, List aList) { for (MultiTileEntityClassContainer tClass : mBlock.mMultiTileEntityRegistry.mRegistrations) { if (!tClass.mHidden) { - if (((IMultiTileEntity) tClass.mCanonicalTileEntity).getSubItems( - mBlock, - aItem, - aTab, - aList, - tClass.mID)) { + if (((IMultiTileEntity) tClass.mCanonicalTileEntity) + .getSubItems(mBlock, aItem, aTab, aList, tClass.mID)) { aList.add(mBlock.mMultiTileEntityRegistry.getItem(tClass.mID)); } } @@ -88,91 +84,70 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, - float aHitX, float aHitY, float aHitZ) { + float aHitX, float aHitY, float aHitZ) { if (aY < 0 || aY > aWorld.getHeight()) return false; try { final Block tClickedBlock = aWorld.getBlock(aX, aY, aZ); if (tClickedBlock instanceof BlockSnow && (aWorld.getBlockMetadata(aX, aY, aZ) & 7) < 1) { aSide = SIDE_TOP; } else if (tClickedBlock != Blocks.vine && tClickedBlock != Blocks.tallgrass - && tClickedBlock != Blocks.deadbush - && !tClickedBlock.isReplaceable(aWorld, aX, aY, aZ)) { - aX += GT_Values.OFFX[aSide]; - aY += GT_Values.OFFY[aSide]; - aZ += GT_Values.OFFZ[aSide]; - } + && tClickedBlock != Blocks.deadbush + && !tClickedBlock.isReplaceable(aWorld, aX, aY, aZ)) { + aX += GT_Values.OFFX[aSide]; + aY += GT_Values.OFFY[aSide]; + aZ += GT_Values.OFFZ[aSide]; + } final Block tReplacedBlock = aWorld.getBlock(aX, aY, aZ); if (!tReplacedBlock.isReplaceable(aWorld, aX, aY, aZ) - || !mBlock.canReplace(aWorld, aX, aY, aZ, aSide, aStack)) - return false; + || !mBlock.canReplace(aWorld, aX, aY, aZ, aSide, aStack)) return false; if (aStack.stackSize == 0 || (aPlayer != null && !aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack))) return false; - final MultiTileEntityContainer aMTEContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aWorld, - aX, - aY, - aZ, - aStack); + final MultiTileEntityContainer aMTEContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aWorld, aX, aY, aZ, aStack); - if (aMTEContainer != null && (aPlayer == null || aPlayer.isSneaking() + if (aMTEContainer != null + && (aPlayer == null || aPlayer.isSneaking() || !(aMTEContainer.mTileEntity instanceof IMTE_OnlyPlaceableWhenSneaking) || !((IMTE_OnlyPlaceableWhenSneaking) aMTEContainer.mTileEntity).onlyPlaceableWhenSneaking()) - && (aWorld.checkNoEntityCollision(AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1)) - || (aMTEContainer.mTileEntity instanceof IMTE_IgnoreEntityCollisionWhenPlacing - && ((IMTE_IgnoreEntityCollisionWhenPlacing) aMTEContainer.mTileEntity).ignoreEntityCollisionWhenPlacing( - aStack, - aPlayer, - aWorld, - aX, - aY, - aZ, - (byte) aSide, - aHitX, - aHitY, - aHitZ))) - && (!(aMTEContainer.mTileEntity instanceof IMTE_CanPlace) - || ((IMTE_CanPlace) aMTEContainer.mTileEntity).canPlace( - aStack, - aPlayer, - aWorld, - aX, - aY, - aZ, - (byte) aSide, - aHitX, - aHitY, - aHitZ)) - && aWorld.setBlock(aX, aY, aZ, aMTEContainer.mBlock, 15 - aMTEContainer.mBlockMetaData, 2)) { + && (aWorld.checkNoEntityCollision(AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1)) + || (aMTEContainer.mTileEntity instanceof IMTE_IgnoreEntityCollisionWhenPlacing + && ((IMTE_IgnoreEntityCollisionWhenPlacing) aMTEContainer.mTileEntity) + .ignoreEntityCollisionWhenPlacing( + aStack, + aPlayer, + aWorld, + aX, + aY, + aZ, + (byte) aSide, + aHitX, + aHitY, + aHitZ))) + && (!(aMTEContainer.mTileEntity instanceof IMTE_CanPlace) || ((IMTE_CanPlace) aMTEContainer.mTileEntity) + .canPlace(aStack, aPlayer, aWorld, aX, aY, aZ, (byte) aSide, aHitX, aHitY, aHitZ)) + && aWorld.setBlock(aX, aY, aZ, aMTEContainer.mBlock, 15 - aMTEContainer.mBlockMetaData, 2)) { aMTEContainer.setMultiTile(aWorld, aX, aY, aZ); try { - if (((IMultiTileEntity) aMTEContainer.mTileEntity).onPlaced( - aStack, - aPlayer, - aWorld, - aX, - aY, - aZ, - (byte) aSide, - aHitX, - aHitY, - aHitZ)) { + if (((IMultiTileEntity) aMTEContainer.mTileEntity) + .onPlaced(aStack, aPlayer, aWorld, aX, aY, aZ, (byte) aSide, aHitX, aHitY, aHitZ)) { aWorld.playSoundEffect( - aX + 0.5, - aY + 0.5, - aZ + 0.5, - aMTEContainer.mBlock.stepSound.func_150496_b(), - (aMTEContainer.mBlock.stepSound.getVolume() + 1) / 2, - aMTEContainer.mBlock.stepSound.getPitch() * 0.8F); + aX + 0.5, + aY + 0.5, + aZ + 0.5, + aMTEContainer.mBlock.stepSound.func_150496_b(), + (aMTEContainer.mBlock.stepSound.getVolume() + 1) / 2, + aMTEContainer.mBlock.stepSound.getPitch() * 0.8F); } } catch (Throwable e) { GT_FML_LOGGER.error("onPlaced", e); } try { if (aMTEContainer.mTileEntity instanceof IMTE_HasMultiBlockMachineRelevantData - && (((IMTE_HasMultiBlockMachineRelevantData) aMTEContainer.mTileEntity).hasMultiBlockMachineRelevantData())) { + && (((IMTE_HasMultiBlockMachineRelevantData) aMTEContainer.mTileEntity) + .hasMultiBlockMachineRelevantData())) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } catch (Throwable e) { @@ -210,8 +185,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont public void updateItemStack(ItemStack aStack) { final MultiTileEntityClassContainer tContainer = mBlock.mMultiTileEntityRegistry.getClassContainer(aStack); if (tContainer == null) return; - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IItemUpdatable) { ((IItemUpdatable) tTileEntityContainer.mTileEntity).updateItemStack(aStack); } @@ -221,8 +196,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont public void updateItemStack(ItemStack aStack, World aWorld, int aX, int aY, int aZ) { final MultiTileEntityClassContainer tContainer = mBlock.mMultiTileEntityRegistry.getClassContainer(aStack); if (tContainer == null) return; - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IItemUpdatable) { ((IItemUpdatable) tTileEntityContainer.mTileEntity).updateItemStack(aStack, aWorld, aX, aY, aZ); } @@ -232,12 +207,11 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont public int getItemStackLimit(ItemStack aStack) { final MultiTileEntityClassContainer tContainer = mBlock.mMultiTileEntityRegistry.getClassContainer(aStack); if (tContainer == null) return 1; - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IMTE_GetMaxStackSize) { - return ((IMTE_GetMaxStackSize) tTileEntityContainer.mTileEntity).getMaxStackSize( - aStack, - tContainer.mStackSize); + return ((IMTE_GetMaxStackSize) tTileEntityContainer.mTileEntity) + .getMaxStackSize(aStack, tContainer.mStackSize); } return tContainer.mStackSize; } @@ -249,8 +223,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override public FluidStack getFluid(ItemStack aStack) { - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IFluidContainerItem) { final FluidStack rFluid = ((IFluidContainerItem) tTileEntityContainer.mTileEntity).getFluid(aStack); updateItemStack(aStack); @@ -261,8 +235,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override public int getCapacity(ItemStack aStack) { - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IFluidContainerItem) { final int rCapacity = ((IFluidContainerItem) tTileEntityContainer.mTileEntity).getCapacity(aStack); updateItemStack(aStack); @@ -273,8 +247,8 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override public int fill(ItemStack aStack, FluidStack aFluid, boolean aDoFill) { - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IFluidContainerItem) { final int tFilled = ((IFluidContainerItem) tTileEntityContainer.mTileEntity).fill(aStack, aFluid, aDoFill); updateItemStack(aStack); @@ -285,13 +259,11 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override public FluidStack drain(ItemStack aStack, int aMaxDrain, boolean aDoDrain) { - final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry.getNewTileEntityContainer( - aStack); + final MultiTileEntityContainer tTileEntityContainer = mBlock.mMultiTileEntityRegistry + .getNewTileEntityContainer(aStack); if (tTileEntityContainer != null && tTileEntityContainer.mTileEntity instanceof IFluidContainerItem) { - final FluidStack rFluid = ((IFluidContainerItem) tTileEntityContainer.mTileEntity).drain( - aStack, - aMaxDrain, - aDoDrain); + final FluidStack rFluid = ((IFluidContainerItem) tTileEntityContainer.mTileEntity) + .drain(aStack, aMaxDrain, aDoDrain); updateItemStack(aStack); return rFluid; } @@ -300,7 +272,7 @@ public class MultiTileEntityItemInternal extends ItemBlock implements IFluidCont @Override public boolean func_150936_a /* canPlaceAtSide */(World aWorld, int aX, int aY, int aZ, int aSide, - EntityPlayer aPlayer, ItemStack aStack) { + EntityPlayer aPlayer, ItemStack aStack) { return true; } diff --git a/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java b/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java index 1aeed1b3de..1c425106b5 100644 --- a/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java +++ b/src/main/java/gregtech/api/multitileentity/MultiTileEntityRegistry.java @@ -47,7 +47,7 @@ public class MultiTileEntityRegistry { public final MultiTileEntityBlockInternal mBlock; private static MultiTileEntityBlockInternal regblock(String aNameInternal, MultiTileEntityBlockInternal aBlock, - Class aItemClass) { + Class aItemClass) { GameRegistry.registerBlock(aBlock, aItemClass == null ? ItemBlock.class : aItemClass, aNameInternal); return aBlock; } @@ -63,7 +63,7 @@ public class MultiTileEntityRegistry { * @param aNameInternal the internal Name of the Item */ public MultiTileEntityRegistry(String aNameInternal, MultiTileEntityBlockInternal aBlock, - Class aItemClass) { + Class aItemClass) { this(aNameInternal, regblock(aNameInternal, aBlock, aItemClass)); } @@ -72,7 +72,7 @@ public class MultiTileEntityRegistry { */ public MultiTileEntityRegistry(String aNameInternal, MultiTileEntityBlockInternal aBlock) { if (!GregTech_API.sPreloadStarted || GregTech_API.sPreloadFinished) throw new IllegalStateException( - "The MultiTileEntity Registry must be initialised during Preload Phase and not before"); + "The MultiTileEntity Registry must be initialised during Preload Phase and not before"); mNameInternal = aNameInternal; mBlock = aBlock; GT_FML_LOGGER.info(aNameInternal + " " + Block.getIdFromBlock(aBlock) + "This is the answer"); @@ -129,8 +129,7 @@ public class MultiTileEntityRegistry { } if (mRegistry.containsKey(aClassContainer.mID)) { GT_FML_LOGGER.error( - "MULTI-TILE REGISTRY ERROR: Class Container uses occupied MetaData! (" + aClassContainer.mID - + ")"); + "MULTI-TILE REGISTRY ERROR: Class Container uses occupied MetaData! (" + aClassContainer.mID + ")"); tFailed = true; } } @@ -138,18 +137,14 @@ public class MultiTileEntityRegistry { GT_FML_LOGGER.error("MULTI-TILE REGISTRY ERROR: STACKTRACE START"); int i = 0; for (StackTraceElement tElement : new Exception().getStackTrace()) if (i++ < 5 && !tElement.getClassName() - .startsWith( - "sun")) - GT_FML_LOGGER.error("\tat " + tElement); + .startsWith("sun")) GT_FML_LOGGER.error("\tat " + tElement); else break; GT_FML_LOGGER.error("MULTI-TILE REGISTRY ERROR: STACKTRACE END"); return null; } - GT_LanguageManager.addStringLocalization( - mNameInternal + "." + aClassContainer.mID + ".name", - aLocalised, - false); + GT_LanguageManager + .addStringLocalization(mNameInternal + "." + aClassContainer.mID + ".name", aLocalised, false); mRegistry.put(aClassContainer.mID, aClassContainer); mLastRegisteredID = aClassContainer.mID; mRegistrations.add(aClassContainer); @@ -223,22 +218,22 @@ public class MultiTileEntityRegistry { } public MultiTileEntityContainer getNewTileEntityContainer(World aWorld, int aX, int aY, int aZ, int aID, - NBTTagCompound aNBT) { + NBTTagCompound aNBT) { final MultiTileEntityClassContainer tClass = mRegistry.get((short) aID); if (tClass == null || tClass.mBlock == null) return null; final MultiTileEntityContainer rContainer = new MultiTileEntityContainer( - (TileEntity) GT_Utility.callConstructor(tClass.mClass, -1, null, true), - tClass.mBlock, - tClass.mBlockMetaData); + (TileEntity) GT_Utility.callConstructor(tClass.mClass, -1, null, true), + tClass.mBlock, + tClass.mBlockMetaData); if (rContainer.mTileEntity == null) return null; rContainer.mTileEntity.setWorldObj(aWorld); rContainer.mTileEntity.xCoord = aX; rContainer.mTileEntity.yCoord = aY; rContainer.mTileEntity.zCoord = aZ; ((IMultiTileEntity) rContainer.mTileEntity).initFromNBT( - aNBT == null || aNBT.hasNoTags() ? tClass.mParameters : GT_Util.fuseNBT(aNBT, tClass.mParameters), - (short) aID, - (short) Block.getIdFromBlock(mBlock)); + aNBT == null || aNBT.hasNoTags() ? tClass.mParameters : GT_Util.fuseNBT(aNBT, tClass.mParameters), + (short) aID, + (short) Block.getIdFromBlock(mBlock)); return rContainer; } @@ -249,23 +244,23 @@ public class MultiTileEntityRegistry { public TileEntity getNewTileEntity(ItemStack aStack) { final MultiTileEntityContainer tContainer = getNewTileEntityContainer( - null, - 0, - 0, - 0, - Items.feather.getDamage(aStack), - aStack.getTagCompound()); + null, + 0, + 0, + 0, + Items.feather.getDamage(aStack), + aStack.getTagCompound()); return tContainer == null ? null : tContainer.mTileEntity; } public TileEntity getNewTileEntity(World aWorld, int aX, int aY, int aZ, ItemStack aStack) { final MultiTileEntityContainer tContainer = getNewTileEntityContainer( - aWorld, - aX, - aY, - aZ, - Items.feather.getDamage(aStack), - aStack.getTagCompound()); + aWorld, + aX, + aY, + aZ, + Items.feather.getDamage(aStack), + aStack.getTagCompound()); return tContainer == null ? null : tContainer.mTileEntity; } diff --git a/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java index bff998aa89..2ef1042a01 100644 --- a/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java @@ -129,17 +129,16 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu // Loading the registry final String textureName = nbt.getString(NBT.TEXTURE); textures = new IIconContainer[] { - new Textures.BlockIcons.CustomIcon("multitileentity/base/" + textureName + "/bottom"), - new Textures.BlockIcons.CustomIcon("multitileentity/base/" + textureName + "/top"), - new Textures.BlockIcons.CustomIcon("multitileentity/base/" + textureName + "/side"), }; + new Textures.BlockIcons.CustomIcon("multitileentity/base/" + textureName + "/bottom"), + new Textures.BlockIcons.CustomIcon("multitileentity/base/" + textureName + "/top"), + new Textures.BlockIcons.CustomIcon("multitileentity/base/" + textureName + "/side"), }; } @Override public void copyTextures() { // Loading an instance - final TileEntity tCanonicalTileEntity = MultiTileEntityRegistry.getCanonicalTileEntity( - getMultiTileEntityRegistryID(), - getMultiTileEntityID()); + final TileEntity tCanonicalTileEntity = MultiTileEntityRegistry + .getCanonicalTileEntity(getMultiTileEntityRegistryID(), getMultiTileEntityID()); if (tCanonicalTileEntity instanceof MultiTileEntity) textures = ((MultiTileEntity) tCanonicalTileEntity).textures; } @@ -168,7 +167,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu if (nbt.hasKey("z")) zCoord = nbt.getInteger("z"); // read the custom Name. if (nbt.hasKey(NBT.DISPAY)) customName = nbt.getCompoundTag(NBT.DISPAY) - .getString(NBT.CUSTOM_NAME); + .getString(NBT.CUSTOM_NAME); // And now everything else. try { @@ -267,8 +266,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu @Override public TileEntity getTileEntity(int aX, int aY, int aZ) { if (worldObj == null - || (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ))) - return null; + || (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ))) return null; return GT_Util.getTileEntity(worldObj, aX, aY, aZ, true); } @@ -279,7 +277,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu @Override public boolean shouldRefresh(Block aOldBlock, Block aNewBlock, int aOldMeta, int aNewMeta, World aWorld, int aX, - int aY, int aZ) { + int aY, int aZ) { return shouldRefresh || aOldBlock != aNewBlock; } @@ -294,16 +292,16 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, tBlock); if (this instanceof IMTE_IsProvidingStrongPower) for (byte tSide : GT_Values.ALL_VALID_SIDES) { if (getBlockAtSide(tSide).isNormalCube( - worldObj, + worldObj, + xCoord + GT_Values.OFFX[tSide], + yCoord + GT_Values.OFFY[tSide], + zCoord + GT_Values.OFFZ[tSide])) { + worldObj.notifyBlocksOfNeighborChange( xCoord + GT_Values.OFFX[tSide], yCoord + GT_Values.OFFY[tSide], - zCoord + GT_Values.OFFZ[tSide])) { - worldObj.notifyBlocksOfNeighborChange( - xCoord + GT_Values.OFFX[tSide], - yCoord + GT_Values.OFFY[tSide], - zCoord + GT_Values.OFFZ[tSide], - tBlock, - OPOS[tSide]); + zCoord + GT_Values.OFFZ[tSide], + tBlock, + OPOS[tSide]); } } needsBlockUpdate = false; @@ -315,7 +313,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu // TODO: check to an interface // if (getBlockAtSide(aSide) == Blocks.glass) return false; return tTileEntity instanceof IMultiTileEntity ? !((IMultiTileEntity) tTileEntity).isSurfaceOpaque(OPOS[aSide]) - : !getBlockAtSide(aSide).isOpaqueCube(); + : !getBlockAtSide(aSide).isOpaqueCube(); } @Override @@ -487,16 +485,16 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu public AxisAlignedBB box(double[] aBox) { return AxisAlignedBB.getBoundingBox( - xCoord + aBox[0], - yCoord + aBox[1], - zCoord + aBox[2], - xCoord + aBox[3], - yCoord + aBox[4], - zCoord + aBox[5]); + xCoord + aBox[0], + yCoord + aBox[1], + zCoord + aBox[2], + xCoord + aBox[3], + yCoord + aBox[4], + zCoord + aBox[5]); } public boolean box(AxisAlignedBB aAABB, List aList, double aMinX, double aMinY, double aMinZ, - double aMaxX, double aMaxY, double aMaxZ) { + double aMaxX, double aMaxY, double aMaxZ) { final AxisAlignedBB tBox = box(aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ); return tBox.intersectsWith(aAABB) && aList.add(tBox); } @@ -508,12 +506,12 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu public AxisAlignedBB box(double aMinX, double aMinY, double aMinZ, double aMaxX, double aMaxY, double aMaxZ) { return AxisAlignedBB.getBoundingBox( - xCoord + aMinX, - yCoord + aMinY, - zCoord + aMinZ, - xCoord + aMaxX, - yCoord + aMaxY, - zCoord + aMaxZ); + xCoord + aMinX, + yCoord + aMinY, + zCoord + aMinZ, + xCoord + aMaxX, + yCoord + aMaxY, + zCoord + aMaxZ); } @Override @@ -543,12 +541,12 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu public AxisAlignedBB box(float[] aBox) { return AxisAlignedBB.getBoundingBox( - xCoord + aBox[0], - yCoord + aBox[1], - zCoord + aBox[2], - xCoord + aBox[3], - yCoord + aBox[4], - zCoord + aBox[5]); + xCoord + aBox[0], + yCoord + aBox[1], + zCoord + aBox[2], + xCoord + aBox[3], + yCoord + aBox[4], + zCoord + aBox[5]); } public boolean box(Block aBlock) { @@ -572,12 +570,12 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu public boolean box(Block aBlock, double[] aBox) { aBlock.setBlockBounds( - (float) aBox[0], - (float) aBox[1], - (float) aBox[2], - (float) aBox[3], - (float) aBox[4], - (float) aBox[5]); + (float) aBox[0], + (float) aBox[1], + (float) aBox[2], + (float) aBox[3], + (float) aBox[4], + (float) aBox[5]); return true; } @@ -598,7 +596,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu } public boolean box(Block aBlock, double aMinX, double aMinY, double aMinZ, double aMaxX, double aMaxY, - double aMaxZ) { + double aMaxZ) { aBlock.setBlockBounds((float) aMinX, (float) aMinY, (float) aMinZ, (float) aMaxX, (float) aMaxY, (float) aMaxZ); return true; } @@ -701,7 +699,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu @Override public boolean onPlaced(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, byte aSide, - float aHitX, float aHitY, float aHitZ) { + float aHitX, float aHitY, float aHitZ) { facing = getSideForPlayerPlacing(aPlayer, facing, getValidFacings()); onFacingChange(); return true; @@ -733,7 +731,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final byte tSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) - : aSide; + : aSide; return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) { return true; @@ -743,13 +741,13 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu } if (isServerSide()) { if (!privateAccess() || aPlayer.getDisplayName() - .equalsIgnoreCase(getOwnerName())) { + .equalsIgnoreCase(getOwnerName())) { final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); final byte wrenchSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { // TODO (Colorization) } if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) @@ -770,18 +768,18 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu if (getCoverIDAtSide(coverSide) == 0) { if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { if (GregTech_API.getCoverBehaviorNew(tCurrentItem) - .isCoverPlaceable(coverSide, tCurrentItem, this) - && allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + .isCoverPlaceable(coverSide, tCurrentItem, this) + && allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); issueClientUpdate(); } sendCoverDataIfNeeded(); @@ -791,13 +789,13 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_BREAK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_BREAK, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); dropCover(coverSide, aSide, false); } sendCoverDataIfNeeded(); @@ -806,25 +804,24 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu } } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. aSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) - : aSide; + : aSide; return getCoverIDAtSide(aSide) > 0 && getCoverBehaviorAtSideNew(aSide).onCoverShiftRightClick( - aSide, - getCoverIDAtSide(aSide), - getComplexCoverDataAtSide(aSide), - this, - aPlayer); - } - - if (getCoverBehaviorAtSideNew(aSide).onCoverRightClick( aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this, - aPlayer, - aX, - aY, - aZ)) - return true; + aPlayer); + } + + if (getCoverBehaviorAtSideNew(aSide).onCoverRightClick( + aSide, + getCoverIDAtSide(aSide), + getComplexCoverDataAtSide(aSide), + this, + aPlayer, + aX, + aY, + aZ)) return true; if (!getCoverInfoAtSide(aSide).isGUIClickable()) return false; @@ -850,7 +847,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu } public boolean onWrenchRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, float aY, - float aZ) { + float aZ) { if (setMainFacing(wrenchSide)) { GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord); @@ -859,19 +856,19 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu } public boolean onScrewdriverRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, - float aY, float aZ) { + float aY, float aZ) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( + wrenchSide, + getCoverBehaviorAtSideNew(wrenchSide).onCoverScrewdriverClick( wrenchSide, - getCoverBehaviorAtSideNew(wrenchSide).onCoverScrewdriverClick( - wrenchSide, - getCoverIDAtSide(wrenchSide), - getComplexCoverDataAtSide(wrenchSide), - this, - aPlayer, - aX, - aY, - aZ)); + getCoverIDAtSide(wrenchSide), + getComplexCoverDataAtSide(wrenchSide), + this, + aPlayer, + aX, + aY, + aZ)); // TODO: Update connections! GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord); } @@ -879,25 +876,25 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu } public boolean onHammerRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, float aY, - float aZ) { + float aZ) { return true; } public boolean onMalletRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, float aY, - float aZ) { + float aZ) { return true; } public boolean onSolderingRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, - float aY, float aZ) { + float aY, float aZ) { return true; } public boolean onWireCutterRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, - float aY, float aZ) { + float aY, float aZ) { return true; } @@ -932,7 +929,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu @Override public boolean getSubItems(MultiTileEntityBlockInternal aBlock, Item aItem, CreativeTabs aTab, - List aList, short aID) { + List aList, short aID) { return true; } @@ -957,9 +954,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu setOwnerName(aPlayer.getDisplayName()); setOwnerUuid(aPlayer.getUniqueID()); } else return !privateAccess() || aPlayer.getDisplayName() - .equals("Player") - || ownerName.equals("Player") - || ownerName.equals(aPlayer.getDisplayName()); + .equals("Player") || ownerName.equals("Player") || ownerName.equals(aPlayer.getDisplayName()); return true; } @@ -974,29 +969,29 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu public GT_Packet_MultiTileEntity getClientDataPacket() { final GT_Packet_MultiTileEntity packet = new GT_Packet_MultiTileEntity( - 0, - xCoord, - (short) yCoord, - zCoord, - getMultiTileEntityRegistryID(), - getMultiTileEntityID(), - (byte) ((facing & 7) | (mRedstone ? 16 : 0)), - color); + 0, + xCoord, + (short) yCoord, + zCoord, + getMultiTileEntityRegistryID(), + getMultiTileEntityID(), + (byte) ((facing & 7) | (mRedstone ? 16 : 0)), + color); packet.setCoverData( - getCoverInfoAtSide((byte) 0).getCoverID(), - getCoverInfoAtSide((byte) 1).getCoverID(), - getCoverInfoAtSide((byte) 2).getCoverID(), - getCoverInfoAtSide((byte) 3).getCoverID(), - getCoverInfoAtSide((byte) 4).getCoverID(), - getCoverInfoAtSide((byte) 5).getCoverID()); + getCoverInfoAtSide((byte) 0).getCoverID(), + getCoverInfoAtSide((byte) 1).getCoverID(), + getCoverInfoAtSide((byte) 2).getCoverID(), + getCoverInfoAtSide((byte) 3).getCoverID(), + getCoverInfoAtSide((byte) 4).getCoverID(), + getCoverInfoAtSide((byte) 5).getCoverID()); packet.setRedstoneData( - (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0))); + (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0))); return packet; } @@ -1068,18 +1063,18 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); currenttip.add( - String.format( - "Facing: %s", - ForgeDirection.getOrientation(getFrontFacing()) - .name())); + String.format( + "Facing: %s", + ForgeDirection.getOrientation(getFrontFacing()) + .name())); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); } @@ -1093,13 +1088,13 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu final ArrayList tList = new ArrayList<>(); if (aLogLevel > 2) { tList.add( - "MultiTileRegistry-ID: " + EnumChatFormatting.BLUE - + mteRegistry - + EnumChatFormatting.RESET - + " MultiTile-ID: " - + EnumChatFormatting.BLUE - + mteID - + EnumChatFormatting.RESET); + "MultiTileRegistry-ID: " + EnumChatFormatting.BLUE + + mteRegistry + + EnumChatFormatting.RESET + + " MultiTile-ID: " + + EnumChatFormatting.BLUE + + mteID + + EnumChatFormatting.RESET); } if (joinedIc2Enet) tList.add("Joined IC2 ENet"); @@ -1150,9 +1145,9 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu if (aFluid == null || aFluid.amount <= 0) return null; final IFluidTank tTank = getFluidTankDrainable((byte) aDirection.ordinal(), aFluid); if (tTank == null || tTank.getFluid() == null - || tTank.getFluidAmount() == 0 - || !tTank.getFluid() - .isFluidEqual(aFluid)) + || tTank.getFluidAmount() == 0 + || !tTank.getFluid() + .isFluidEqual(aFluid)) return null; return tTank.drain(aFluid.amount, aDoDrain); } @@ -1170,8 +1165,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu if (aFluid == null) return false; final IFluidTank tTank = getFluidTankFillable((byte) aDirection.ordinal(), new FluidStack(aFluid, 0)); return tTank != null && (tTank.getFluid() == null || tTank.getFluid() - .getFluid() - == aFluid); + .getFluid() == aFluid); } @Override @@ -1179,8 +1173,7 @@ public abstract class MultiTileEntity extends CoverableTileEntity implements IMu if (aFluid == null) return false; final IFluidTank tTank = getFluidTankDrainable((byte) aDirection.ordinal(), new FluidStack(aFluid, 0)); return tTank != null && (tTank.getFluid() != null && tTank.getFluid() - .getFluid() - == aFluid); + .getFluid() == aFluid); } @Override diff --git a/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java index a4007ec85e..90c931239a 100644 --- a/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/base/NonTickableMultiTileEntity.java @@ -50,7 +50,7 @@ public abstract class NonTickableMultiTileEntity extends MultiTileEntity { @Override public void receiveCoverData(byte aCoverSide, int aCoverID, ISerializableObject aCoverData, - EntityPlayerMP aPlayer) { + EntityPlayerMP aPlayer) { super.receiveCoverData(aCoverSide, aCoverID, aCoverData, aPlayer); // We don't get ticked so issue the texture update right away issueTextureUpdate(); diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java index 37a3749c8f..b42aa35195 100644 --- a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java @@ -29,8 +29,8 @@ import gregtech.api.multitileentity.MultiTileEntityRegistry; * Heavily inspired by GT6 */ public interface IMultiTileEntity - extends IHasWorldObjectAndCoords, ICoverable, ITurnable, IHasInventory, IEnergyConnected, IBasicEnergyContainer, - IFluidHandler, ITexturedTileEntity, IDebugableTileEntity, IColoredTileEntity { + extends IHasWorldObjectAndCoords, ICoverable, ITurnable, IHasInventory, IEnergyConnected, IBasicEnergyContainer, + IFluidHandler, ITexturedTileEntity, IDebugableTileEntity, IColoredTileEntity { /** * Those two IDs HAVE to be saved inside the NBT of the TileEntity itself. They get set by the Registry itself, when @@ -173,7 +173,7 @@ public interface IMultiTileEntity /** Adds to the Creative Tab. return false to prevent it from being added. */ boolean getSubItems(MultiTileEntityBlockInternal aBlock, Item aItem, CreativeTabs aTab, List aList, - short aID); + short aID); ItemStack getPickBlock(MovingObjectPosition aTarget); @@ -182,7 +182,7 @@ public interface IMultiTileEntity boolean isSurfaceOpaque(byte aSide); boolean onPlaced(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, byte aSide, - float aHitX, float aHitY, float aHitZ); + float aHitX, float aHitY, float aHitZ); // ItemStack getPickBlock(MovingObjectPosition aTarget); @@ -258,14 +258,14 @@ public interface IMultiTileEntity * pipes/wires. */ boolean ignoreEntityCollisionWhenPlacing(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, - int aZ, byte aSide, float aHitX, float aHitY, float aHitZ); + int aZ, byte aSide, float aHitX, float aHitY, float aHitZ); } interface IMTE_CanPlace extends IMultiTileEntity { /** Return false if this TileEntity cannot be placed at that Location. */ boolean canPlace(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, byte aSide, - float aHitX, float aHitY, float aHitZ); + float aHitX, float aHitY, float aHitZ); } interface IMTE_GetMaxStackSize extends IMultiTileEntity { diff --git a/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java b/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java index 740496a8b6..680116e95a 100644 --- a/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java +++ b/src/main/java/gregtech/api/multitileentity/machine/MultiTileBasicMachine.java @@ -218,7 +218,7 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl // `setCapacityMultiplier` for (int i = 0; i < inputTanks.length; i++) { inputTanks[i] = new FluidTankGT(capacity).setCapacityMultiplier(maxParallel * 2L) - .readFromNBT(nbt, NBT.TANK_IN + i); + .readFromNBT(nbt, NBT.TANK_IN + i); } for (int i = 0; i < outputTanks.length; i++) { outputTanks[i] = new FluidTankGT().readFromNBT(nbt, NBT.TANK_OUT + i); @@ -262,34 +262,33 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl // Loading the registry final String textureName = aNBT.getString(NBT.TEXTURE); textures = new IIconContainer[] { - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/bottom"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/top"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/left"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/front"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/right"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/side") }; + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/bottom"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/top"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/left"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/front"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/right"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/side") }; texturesInactive = new IIconContainer[] { - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/bottom"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/top"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/left"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/front"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/right"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/back") }; + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/bottom"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/top"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/left"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/front"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/right"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/inactive/back") }; texturesActive = new IIconContainer[] { - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/bottom"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/top"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/left"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/front"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/right"), - new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/back") }; + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/bottom"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/top"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/left"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/front"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/right"), + new Textures.BlockIcons.CustomIcon(TEXTURE_LOCATION + textureName + "/overlay/active/back") }; } @Override public void copyTextures() { // Loading an instance - final TileEntity tCanonicalTileEntity = MultiTileEntityRegistry.getCanonicalTileEntity( - getMultiTileEntityRegistryID(), - getMultiTileEntityID()); + final TileEntity tCanonicalTileEntity = MultiTileEntityRegistry + .getCanonicalTileEntity(getMultiTileEntityRegistryID(), getMultiTileEntityID()); if (tCanonicalTileEntity instanceof MultiTileBasicMachine) { textures = ((MultiTileBasicMachine) tCanonicalTileEntity).textures; texturesInactive = ((MultiTileBasicMachine) tCanonicalTileEntity).texturesInactive; @@ -302,14 +301,13 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl @Override public ITexture[] getTexture(Block aBlock, byte aSide, boolean isActive, int aRenderPass) { if (aSide != facing) { - return new ITexture[] { TextureFactory.of( - textures[GT_Values.FACING_ROTATIONS[facing][aSide]], - GT_Util.getRGBaArray(rgba)) }; + return new ITexture[] { + TextureFactory.of(textures[GT_Values.FACING_ROTATIONS[facing][aSide]], GT_Util.getRGBaArray(rgba)) }; } return new ITexture[] { - TextureFactory.of(textures[GT_Values.FACING_ROTATIONS[facing][aSide]], GT_Util.getRGBaArray(rgba)), - TextureFactory.of( - (active ? texturesActive : texturesInactive)[GT_Values.FACING_ROTATIONS[facing][aSide]]) }; + TextureFactory.of(textures[GT_Values.FACING_ROTATIONS[facing][aSide]], GT_Util.getRGBaArray(rgba)), + TextureFactory + .of((active ? texturesActive : texturesInactive)[GT_Values.FACING_ROTATIONS[facing][aSide]]) }; } @Override @@ -353,9 +351,9 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl @Override public boolean isUseableByPlayer(EntityPlayer aPlayer) { return playerOwnsThis(aPlayer, false) && mTickTimer > 40 - && getTileEntityOffset(0, 0, 0) == this - && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 - && allowInteraction(aPlayer); + && getTileEntityOffset(0, 0, 0) == this + && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 + && allowInteraction(aPlayer); } @Override @@ -521,12 +519,12 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl ProcessingLogic logic = ((ProcessingLogicHost) this).getProcessingLogic(); logic.clear(); boolean result = logic.setInputItems( - inputInventory.getStacks() - .toArray(new ItemStack[0])) - .setCurrentOutputItems( - outputInventory.getStacks() - .toArray(new ItemStack[0])) - .process(); + inputInventory.getStacks() + .toArray(new ItemStack[0])) + .setCurrentOutputItems( + outputInventory.getStacks() + .toArray(new ItemStack[0])) + .process(); setDuration(logic.getDuration()); setEut(logic.getEut()); setItemOutputs(logic.getOutputItems()); @@ -573,13 +571,8 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl if (getProcessStartSound() != null) GT_Utility.doSoundAtClient(getProcessStartSound(), getTimeBetweenProcessSounds(), 1.0F, aX, aY, aZ); } - case INTERRUPT_SOUND_INDEX -> GT_Utility.doSoundAtClient( - SoundResource.IC2_MACHINES_INTERRUPT_ONE, - 100, - 1.0F, - aX, - aY, - aZ); + case INTERRUPT_SOUND_INDEX -> GT_Utility + .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); } } @@ -603,8 +596,8 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl if (activitySoundLoop == null) { activitySoundLoop = new GT_SoundLoop(activitySound, this, false, true); Minecraft.getMinecraft() - .getSoundHandler() - .playSound(activitySoundLoop); + .getSoundHandler() + .playSound(activitySoundLoop); } } else { if (activitySoundLoop != null) { @@ -765,10 +758,7 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl protected void addDebugInfo(EntityPlayer player, int logLevel, ArrayList list) { if (isElectric()) { list.add( - "Energy: " + EnumChatFormatting.GOLD - + getUniversalEnergyStored() - + "/" - + getUniversalEnergyCapacity()); + "Energy: " + EnumChatFormatting.GOLD + getUniversalEnergyStored() + "/" + getUniversalEnergyCapacity()); } if (acceptsFuel()) { @@ -860,20 +850,20 @@ public abstract class MultiTileBasicMachine extends TickableMultiTileEntity impl switch (soundEventValue) { case PROCESS_START_SOUND_INDEX -> { if (getProcessStartSound() != null) GT_Utility.doSoundAtClient( - getProcessStartSound(), - getTimeBetweenProcessSounds(), - 1.0F, - getXCoord(), - getYCoord(), - getZCoord()); - } - case INTERRUPT_SOUND_INDEX -> GT_Utility.doSoundAtClient( - SoundResource.IC2_MACHINES_INTERRUPT_ONE, - 100, + getProcessStartSound(), + getTimeBetweenProcessSounds(), 1.0F, getXCoord(), getYCoord(), getZCoord()); + } + case INTERRUPT_SOUND_INDEX -> GT_Utility.doSoundAtClient( + SoundResource.IC2_MACHINES_INTERRUPT_ONE, + 100, + 1.0F, + getXCoord(), + getYCoord(), + getZCoord()); } } } diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockController.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockController.java index b76dc1b4bc..088b640dbd 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockController.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockController.java @@ -94,7 +94,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.casings.upgrade.InventoryUpgrade; public abstract class MultiBlockController> extends MultiTileBasicMachine implements - IAlignment, IConstructable, IMultiBlockController, IDescribable, IMTE_AddToolTips, ISurvivalConstructable { + IAlignment, IConstructable, IMultiBlockController, IDescribable, IMTE_AddToolTips, ISurvivalConstructable { private static final Map tooltip = new ConcurrentHashMap<>(); private final List upgradeCasings = new ArrayList<>(); @@ -125,12 +125,12 @@ public abstract class MultiBlockController> ex // A list of sides // Each side has a list of parts that have a cover that need to be ticked protected List>> registeredCoveredParts = Arrays.asList( - new LinkedList<>(), - new LinkedList<>(), - new LinkedList<>(), - new LinkedList<>(), - new LinkedList<>(), - new LinkedList<>()); + new LinkedList<>(), + new LinkedList<>(), + new LinkedList<>(), + new LinkedList<>(), + new LinkedList<>(), + new LinkedList<>()); /** Registry ID of the required casing */ public abstract short getCasingRegistryID(); @@ -177,13 +177,13 @@ public abstract class MultiBlockController> ex nbt.setBoolean(NBT.STRUCTURE_OK, structureOkay); nbt.setByte( - NBT.ROTATION, - (byte) extendedFacing.getRotation() - .getIndex()); + NBT.ROTATION, + (byte) extendedFacing.getRotation() + .getIndex()); nbt.setByte( - NBT.FLIP, - (byte) extendedFacing.getFlip() - .getIndex()); + NBT.FLIP, + (byte) extendedFacing.getFlip() + .getIndex()); saveUpgradeInventoriesToNBT(nbt); } @@ -226,9 +226,9 @@ public abstract class MultiBlockController> ex structureOkay = nbt.getBoolean(NBT.STRUCTURE_OK); extendedFacing = ExtendedFacing.of( - ForgeDirection.getOrientation(getFrontFacing()), - Rotation.byIndex(nbt.getByte(NBT.ROTATION)), - Flip.byIndex(nbt.getByte(NBT.FLIP))); + ForgeDirection.getOrientation(getFrontFacing()), + Rotation.byIndex(nbt.getByte(NBT.ROTATION)), + Flip.byIndex(nbt.getByte(NBT.FLIP))); loadUpgradeInventoriesFromNBT(nbt); } @@ -322,17 +322,17 @@ public abstract class MultiBlockController> ex */ protected final boolean checkPiece(String piece, int horizontalOffset, int verticalOffset, int depthOffset) { return getCastedStructureDefinition().check( - this, - piece, - getWorld(), - getExtendedFacing(), - getXCoord(), - getYCoord(), - getZCoord(), - horizontalOffset, - verticalOffset, - depthOffset, - !structureOkay); + this, + piece, + getWorld(), + getExtendedFacing(), + getXCoord(), + getYCoord(), + getZCoord(), + horizontalOffset, + verticalOffset, + depthOffset, + !structureOkay); } public final boolean buildPiece(String piece, ItemStack trigger, boolean hintsOnly, Vec3Impl offset) { @@ -340,52 +340,52 @@ public abstract class MultiBlockController> ex } protected final boolean buildPiece(String piece, ItemStack trigger, boolean hintOnly, int horizontalOffset, - int verticalOffset, int depthOffset) { + int verticalOffset, int depthOffset) { return getCastedStructureDefinition().buildOrHints( - this, - trigger, - piece, - getWorld(), - getExtendedFacing(), - getXCoord(), - getYCoord(), - getZCoord(), - horizontalOffset, - verticalOffset, - depthOffset, - hintOnly); + this, + trigger, + piece, + getWorld(), + getExtendedFacing(), + getXCoord(), + getYCoord(), + getZCoord(), + horizontalOffset, + verticalOffset, + depthOffset, + hintOnly); } protected final int survivalBuildPiece(String piece, ItemStack trigger, Vec3Impl offset, int elementBudget, - ISurvivalBuildEnvironment env, boolean check) { + ISurvivalBuildEnvironment env, boolean check) { return survivalBuildPiece( - piece, - trigger, - offset.get0(), - offset.get1(), - offset.get2(), - elementBudget, - env, - check); + piece, + trigger, + offset.get0(), + offset.get1(), + offset.get2(), + elementBudget, + env, + check); } protected final Integer survivalBuildPiece(String piece, ItemStack trigger, int horizontalOffset, - int verticalOffset, int depthOffset, int elementBudget, ISurvivalBuildEnvironment env, boolean check) { + int verticalOffset, int depthOffset, int elementBudget, ISurvivalBuildEnvironment env, boolean check) { return getCastedStructureDefinition().survivalBuild( - this, - trigger, - piece, - getWorld(), - getExtendedFacing(), - getXCoord(), - getYCoord(), - getZCoord(), - horizontalOffset, - verticalOffset, - depthOffset, - elementBudget, - env, - check); + this, + trigger, + piece, + getWorld(), + getExtendedFacing(), + getXCoord(), + getYCoord(), + getZCoord(), + horizontalOffset, + verticalOffset, + depthOffset, + elementBudget, + env, + check); } @SuppressWarnings("unchecked") @@ -407,13 +407,13 @@ public abstract class MultiBlockController> ex structureOkay = false; if (isServerSide()) { StructureLibAPI.sendAlignment( - this, - new NetworkRegistry.TargetPoint( - getWorld().provider.dimensionId, - getXCoord(), - getYCoord(), - getZCoord(), - 512)); + this, + new NetworkRegistry.TargetPoint( + getWorld().provider.dimensionId, + getXCoord(), + getYCoord(), + getZCoord(), + 512)); } else { issueTextureUpdate(); } @@ -422,7 +422,7 @@ public abstract class MultiBlockController> ex @Override public boolean onWrenchRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, float aY, - float aZ) { + float aZ) { if (wrenchSide != getFrontFacing()) return super.onWrenchRightClick(aPlayer, tCurrentItem, wrenchSide, aX, aY, aZ); if (aPlayer.isSneaking()) { @@ -689,13 +689,8 @@ public abstract class MultiBlockController> ex @Override public boolean placeBlock(S t, World world, int x, int y, int z, ItemStack trigger) { final MultiTileEntityRegistry tRegistry = MultiTileEntityRegistry.getRegistry(registryID); - final MultiTileEntityContainer tContainer = tRegistry.getNewTileEntityContainer( - world, - x, - y, - z, - meta, - null); + final MultiTileEntityContainer tContainer = tRegistry + .getNewTileEntityContainer(world, x, y, z, meta, null); if (tContainer == null) { GT_FML_LOGGER.error("NULL CONTAINER"); return false; @@ -760,9 +755,9 @@ public abstract class MultiBlockController> ex if (aFluid == null || aFluid.amount <= 0) return null; final IFluidTank tTank = getFluidTankDrainable(aPart, (byte) aDirection.ordinal(), aFluid); if (tTank == null || tTank.getFluid() == null - || tTank.getFluidAmount() == 0 - || !tTank.getFluid() - .isFluidEqual(aFluid)) + || tTank.getFluidAmount() == 0 + || !tTank.getFluid() + .isFluidEqual(aFluid)) return null; final FluidStack rDrained = tTank.drain(aFluid.amount, aDoDrain); if (rDrained != null && aDoDrain) markInventoryBeenModified(); @@ -784,8 +779,7 @@ public abstract class MultiBlockController> ex if (aFluid == null) return false; final IFluidTank tTank = getFluidTankFillable(aPart, (byte) aDirection.ordinal(), new FluidStack(aFluid, 0)); return tTank != null && (tTank.getFluid() == null || tTank.getFluid() - .getFluid() - == aFluid); + .getFluid() == aFluid); } @Override @@ -793,8 +787,7 @@ public abstract class MultiBlockController> ex if (aFluid == null) return false; final IFluidTank tTank = getFluidTankDrainable(aPart, (byte) aDirection.ordinal(), new FluidStack(aFluid, 0)); return tTank != null && (tTank.getFluid() != null && tTank.getFluid() - .getFluid() - == aFluid); + .getFluid() == aFluid); } @Override @@ -848,12 +841,12 @@ public abstract class MultiBlockController> ex @Override public void unregisterInventory(String aName, String aID, int aType) { if ((aType == InventoryUpgrade.INPUT || aType == InventoryUpgrade.BOTH) - && multiBlockInputInventory.containsKey(aID)) { + && multiBlockInputInventory.containsKey(aID)) { multiBlockInputInventory.remove(aID, multiBlockInputInventory.get(aID)); multiBlockInputInventoryNames.remove(aID, aName); } if ((aType == InventoryUpgrade.OUTPUT || aType == InventoryUpgrade.BOTH) - && multiBlockOutputInventory.containsKey(aID)) { + && multiBlockOutputInventory.containsKey(aID)) { multiBlockOutputInventory.remove(aID, multiBlockOutputInventory.get(aID)); multiBlockOutputInventoryNames.remove(aID, aName); } @@ -862,11 +855,11 @@ public abstract class MultiBlockController> ex @Override public void changeInventoryName(String aName, String aID, int aType) { if ((aType == InventoryUpgrade.INPUT || aType == InventoryUpgrade.BOTH) - && multiBlockInputInventoryNames.containsKey(aID)) { + && multiBlockInputInventoryNames.containsKey(aID)) { multiBlockInputInventoryNames.put(aID, aName); } if ((aType == InventoryUpgrade.OUTPUT || aType == InventoryUpgrade.BOTH) - && multiBlockOutputInventoryNames.containsKey(aID)) { + && multiBlockOutputInventoryNames.containsKey(aID)) { multiBlockOutputInventoryNames.put(aID, aName); } } @@ -1093,8 +1086,8 @@ public abstract class MultiBlockController> ex final String lockedInventory = aPart.getLockedInventory(); if (lockedInventory != null && !lockedInventory.equals("")) { str.append(" [Locked: ") - .append(lockedInventory) - .append("]"); + .append(lockedInventory) + .append("]"); } return str.toString(); @@ -1145,24 +1138,24 @@ public abstract class MultiBlockController> ex protected ItemStack[] getAllItemInputs() { return getInventoriesForInput().getStacks() - .toArray(new ItemStack[0]); + .toArray(new ItemStack[0]); } protected ItemStack[] getAllOutputItems() { return getInventoriesForOutput().getStacks() - .toArray(new ItemStack[0]); + .toArray(new ItemStack[0]); } protected Iterable> getItemInputsForEachInventory() { return multiBlockInputInventory.entrySet() - .stream() - .map( - (entry) -> Pair.of( - entry.getValue() - .getStacks() - .toArray(new ItemStack[0]), - entry.getKey())) - .collect(Collectors.toList()); + .stream() + .map( + (entry) -> Pair.of( + entry.getValue() + .getStacks() + .toArray(new ItemStack[0]), + entry.getKey())) + .collect(Collectors.toList()); } protected void setItemOutputs(String inventory, ItemStack... itemOutputs) { @@ -1219,7 +1212,7 @@ public abstract class MultiBlockController> ex int index = 0; while (fluid != null && fluid.amount > 0 && index < tanks.size()) { int filled = tanks.get(index++) - .fill(fluid, true); + .fill(fluid, true); fluid.amount -= filled; } } @@ -1245,15 +1238,13 @@ public abstract class MultiBlockController> ex boolean result = false; if (isSeparateInputs()) { for (Pair inventory : getItemInputsForEachInventory()) { - IItemHandlerModifiable outputInventory = multiBlockOutputInventory.getOrDefault( - inventory.getLeft(), - null); + IItemHandlerModifiable outputInventory = multiBlockOutputInventory + .getOrDefault(inventory.getLeft(), null); result = logic.setInputItems(inventory.getLeft()) - .setCurrentOutputItems( - outputInventory != null ? outputInventory.getStacks() - .toArray(new ItemStack[0]) - : null) - .process(); + .setCurrentOutputItems( + outputInventory != null ? outputInventory.getStacks() + .toArray(new ItemStack[0]) : null) + .process(); if (result) { inventoryName = inventory.getRight(); break; @@ -1262,8 +1253,8 @@ public abstract class MultiBlockController> ex } } else { result = logic.setInputItems(getAllItemInputs()) - .setCurrentOutputItems(getAllOutputItems()) - .process(); + .setCurrentOutputItems(getAllOutputItems()) + .process(); } setDuration(logic.getDuration()); setEut(logic.getEut()); @@ -1315,7 +1306,7 @@ public abstract class MultiBlockController> ex protected Widget getGregTechLogo() { return new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17); + .setSize(17, 17); } @Override @@ -1329,98 +1320,98 @@ public abstract class MultiBlockController> ex int page = 0; TabContainer tabs = new TabContainer().setButtonSize(20, 24); tabs.addTabButton( - new TabButton(page++) - .setBackground( - false, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), - new ItemDrawable(getStackForm(1)).withFixedSize(16, 16) - .withOffset(2, 4)) - .setBackground( - true, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), - new ItemDrawable(getStackForm(1)).withFixedSize(16, 16) - .withOffset(2, 4)) - .addTooltip(getLocalName()) - .setPos(20 * (page - 1), -20)) + new TabButton(page++) + .setBackground( + false, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), + new ItemDrawable(getStackForm(1)).withFixedSize(16, 16) + .withOffset(2, 4)) + .setBackground( + true, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), + new ItemDrawable(getStackForm(1)).withFixedSize(16, 16) + .withOffset(2, 4)) + .addTooltip(getLocalName()) + .setPos(20 * (page - 1), -20)) .addPage(createMainPage().setSize(getGUIWidth(), getGUIHeight())); if (hasItemInput()) { tabs.addTabButton( - new TabButton(page++) - .setBackground( - false, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), - GT_UITextures.PICTURE_ITEM_IN.withFixedSize(16, 16) - .withOffset(2, 4)) - .setBackground( - true, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), - GT_UITextures.PICTURE_ITEM_IN.withFixedSize(16, 16) - .withOffset(2, 4)) - .setPos(20 * (page - 1), -20)) + new TabButton(page++) + .setBackground( + false, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), + GT_UITextures.PICTURE_ITEM_IN.withFixedSize(16, 16) + .withOffset(2, 4)) + .setBackground( + true, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), + GT_UITextures.PICTURE_ITEM_IN.withFixedSize(16, 16) + .withOffset(2, 4)) + .setPos(20 * (page - 1), -20)) .addPage( - new MultiChildWidget().addChild(getItemInventoryInputGUI()) - .addChild(getGregTechLogo().setPos(147, 86)) - .setSize(getGUIWidth(), getGUIHeight())); + new MultiChildWidget().addChild(getItemInventoryInputGUI()) + .addChild(getGregTechLogo().setPos(147, 86)) + .setSize(getGUIWidth(), getGUIHeight())); } if (hasItemOutput()) { tabs.addTabButton( - new TabButton(page++) - .setBackground( - false, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), - GT_UITextures.PICTURE_ITEM_OUT.withFixedSize(16, 16) - .withOffset(2, 4)) - .setBackground( - true, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), - GT_UITextures.PICTURE_ITEM_OUT.withFixedSize(16, 16) - .withOffset(2, 4)) - .setPos(20 * (page - 1), -20)) + new TabButton(page++) + .setBackground( + false, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), + GT_UITextures.PICTURE_ITEM_OUT.withFixedSize(16, 16) + .withOffset(2, 4)) + .setBackground( + true, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), + GT_UITextures.PICTURE_ITEM_OUT.withFixedSize(16, 16) + .withOffset(2, 4)) + .setPos(20 * (page - 1), -20)) .addPage( - new MultiChildWidget().addChild(getItemInventoryOutputGUI()) - .addChild(getGregTechLogo().setPos(147, 86)) - .setSize(getGUIWidth(), getGUIHeight())); + new MultiChildWidget().addChild(getItemInventoryOutputGUI()) + .addChild(getGregTechLogo().setPos(147, 86)) + .setSize(getGUIWidth(), getGUIHeight())); } if (hasFluidInput()) { tabs.addTabButton( - new TabButton(page++) - .setBackground( - false, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), - GT_UITextures.PICTURE_FLUID_IN.withFixedSize(16, 16) - .withOffset(2, 4)) - .setBackground( - true, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), - GT_UITextures.PICTURE_FLUID_IN.withFixedSize(16, 16) - .withOffset(2, 4)) - .setPos(20 * (page - 1), -20)) + new TabButton(page++) + .setBackground( + false, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), + GT_UITextures.PICTURE_FLUID_IN.withFixedSize(16, 16) + .withOffset(2, 4)) + .setBackground( + true, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), + GT_UITextures.PICTURE_FLUID_IN.withFixedSize(16, 16) + .withOffset(2, 4)) + .setPos(20 * (page - 1), -20)) .addPage( - new MultiChildWidget().addChild(getFluidInventoryInputGUI()) - .addChild(getGregTechLogo().setPos(147, 86)) - .setSize(getGUIWidth(), getGUIHeight())); + new MultiChildWidget().addChild(getFluidInventoryInputGUI()) + .addChild(getGregTechLogo().setPos(147, 86)) + .setSize(getGUIWidth(), getGUIHeight())); } if (hasFluidOutput()) { tabs.addTabButton( - new TabButton(page++) - .setBackground( - false, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), - GT_UITextures.PICTURE_FLUID_OUT.withFixedSize(16, 16) - .withOffset(2, 4)) - .setBackground( - true, - ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), - GT_UITextures.PICTURE_FLUID_OUT.withFixedSize(16, 16) - .withOffset(2, 4)) - .setPos(20 * (page - 1), -20)) + new TabButton(page++) + .setBackground( + false, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), + GT_UITextures.PICTURE_FLUID_OUT.withFixedSize(16, 16) + .withOffset(2, 4)) + .setBackground( + true, + ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), + GT_UITextures.PICTURE_FLUID_OUT.withFixedSize(16, 16) + .withOffset(2, 4)) + .setPos(20 * (page - 1), -20)) .addPage( - new MultiChildWidget().addChild(getFluidInventoryOutputGUI()) - .addChild(getGregTechLogo().setPos(147, 86)) - .setSize(getGUIWidth(), getGUIHeight())); + new MultiChildWidget().addChild(getFluidInventoryOutputGUI()) + .addChild(getGregTechLogo().setPos(147, 86)) + .setSize(getGUIWidth(), getGUIHeight())); } builder.widget(tabs); } @@ -1428,9 +1419,9 @@ public abstract class MultiBlockController> ex protected MultiChildWidget createMainPage() { MultiChildWidget page = new MultiChildWidget(); page.addChild( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 4) - .setSize(160, 75)) + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 4) + .setSize(160, 75)) .addChild(createButtons()); return page; } @@ -1438,20 +1429,20 @@ public abstract class MultiBlockController> ex protected MultiChildWidget createButtons() { MultiChildWidget buttons = new MultiChildWidget(); buttons.setSize(16, 167) - .setPos(7, 86); + .setPos(7, 86); buttons.addChild(createPowerSwitchButton()) - .addChild(new FakeSyncWidget.BooleanSyncer(this::isAllowedToWork, val -> { - if (val) enableWorking(); - else disableWorking(); - })) - .addChild(createVoidExcessButton()) - .addChild(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val)) - .addChild(createInputSeparationButton()) - .addChild(new FakeSyncWidget.BooleanSyncer(() -> separateInputs, val -> separateInputs = val)) - .addChild(createBatchModeButton()) - .addChild(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val)) - .addChild(createLockToSingleRecipeButton()) - .addChild(new FakeSyncWidget.BooleanSyncer(() -> recipeLock, val -> recipeLock = val)); + .addChild(new FakeSyncWidget.BooleanSyncer(this::isAllowedToWork, val -> { + if (val) enableWorking(); + else disableWorking(); + })) + .addChild(createVoidExcessButton()) + .addChild(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val)) + .addChild(createInputSeparationButton()) + .addChild(new FakeSyncWidget.BooleanSyncer(() -> separateInputs, val -> separateInputs = val)) + .addChild(createBatchModeButton()) + .addChild(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val)) + .addChild(createLockToSingleRecipeButton()) + .addChild(new FakeSyncWidget.BooleanSyncer(() -> recipeLock, val -> recipeLock = val)); return buttons; } @@ -1463,12 +1454,12 @@ public abstract class MultiBlockController> ex final int columnsToMake = Math.min(Math.min(inv.getSlots(), 128) - rows * 4, 4); for (int column = 0; column < columnsToMake; column++) { scrollable.widget( - new SlotWidget(inv, rows * 4 + column).setPos(column * 18, rows * 18) - .setSize(18, 18)); + new SlotWidget(inv, rows * 4 + column).setPos(column * 18, rows * 18) + .setSize(18, 18)); } } return scrollable.setSize(18 * 4 + 4, 18 * 5) - .setPos(52, 7); + .setPos(52, 7); } protected Widget getItemInventoryOutputGUI() { @@ -1478,12 +1469,12 @@ public abstract class MultiBlockController> ex final int columnsToMake = Math.min(Math.min(inv.getSlots(), 128) - rows * 4, 4); for (int column = 0; column < columnsToMake; column++) { scrollable.widget( - new SlotWidget(inv, rows * 4 + column).setPos(column * 18, rows * 18) - .setSize(18, 18)); + new SlotWidget(inv, rows * 4 + column).setPos(column * 18, rows * 18) + .setSize(18, 18)); } } return scrollable.setSize(18 * 4 + 4, 18 * 5) - .setPos(52, 7); + .setPos(52, 7); } protected IItemHandlerModifiable getInventoriesForInput() { @@ -1502,12 +1493,12 @@ public abstract class MultiBlockController> ex for (int column = 0; column < columnsToMake; column++) { final FluidSlotWidget fluidSlot = new FluidSlotWidget(tanks[rows * 4 + column]); scrollable.widget( - fluidSlot.setPos(column * 18, rows * 18) - .setSize(18, 18)); + fluidSlot.setPos(column * 18, rows * 18) + .setSize(18, 18)); } } return scrollable.setSize(18 * 4 + 4, 18 * 4) - .setPos(52, 7); + .setPos(52, 7); } protected Widget getFluidInventoryOutputGUI() { @@ -1519,12 +1510,12 @@ public abstract class MultiBlockController> ex final FluidSlotWidget fluidSlot = new FluidSlotWidget(tanks[rows * 4 + column]); fluidSlot.setInteraction(true, false); scrollable.widget( - fluidSlot.setPos(column * 18, rows * 18) - .setSize(18, 18)); + fluidSlot.setPos(column * 18, rows * 18) + .setSize(18, 18)); } } return scrollable.setSize(18 * 4 + 4, 18 * 5) - .setPos(52, 7); + .setPos(52, 7); } protected ButtonWidget createPowerSwitchButton() { @@ -1535,7 +1526,7 @@ public abstract class MultiBlockController> ex enableWorking(); } }) - .setPlayClickSound(true); + .setPlayClickSound(true); button.setBackground(() -> { List ret = new ArrayList<>(); ret.add(GT_UITextures.BUTTON_STANDARD); @@ -1546,10 +1537,10 @@ public abstract class MultiBlockController> ex } return ret.toArray(new IDrawable[0]); }) - .setPos(144, 0) - .setSize(16, 16); + .setPos(144, 0) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.power_switch")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return button; } @@ -1559,7 +1550,7 @@ public abstract class MultiBlockController> ex voidExcess = !voidExcess; } }) - .setPlayClickSound(true); + .setPlayClickSound(true); button.setBackground(() -> { List ret = new ArrayList<>(); ret.add(GT_UITextures.BUTTON_STANDARD); @@ -1578,10 +1569,10 @@ public abstract class MultiBlockController> ex } return ret.toArray(new IDrawable[0]); }) - .setPos(54, 0) - .setSize(16, 16); + .setPos(54, 0) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.void_excess")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return button; } @@ -1599,31 +1590,29 @@ public abstract class MultiBlockController> ex separateInputs = !separateInputs; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (isInputSeparationButtonEnabled()) { - if (isInputSeparationEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); - } - } else { - if (isInputSeparationEnabled()) { - ret.add( - GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED); - } else { - ret.add( - GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(36, 0) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (isInputSeparationButtonEnabled()) { + if (isInputSeparationEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); + } + } else { + if (isInputSeparationEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(36, 0) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.input_separation")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } @@ -1641,29 +1630,29 @@ public abstract class MultiBlockController> ex batchMode = !batchMode; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (isBatchModeButtonEnabled()) { - if (isBatchModeEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); - } - } else { - if (isBatchModeEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(18, 0) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (isBatchModeButtonEnabled()) { + if (isBatchModeEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); + } + } else { + if (isBatchModeEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(18, 0) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.batch_mode")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } @@ -1681,29 +1670,29 @@ public abstract class MultiBlockController> ex recipeLock = !recipeLock; } }) - .setPlayClickSound(true) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (supportsSingleRecipeLocking()) { - if (isRecipeLockingEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); - } - } else { - if (isRecipeLockingEnabled()) { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED); - } - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(0, 0) - .setSize(16, 16); + .setPlayClickSound(true) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (supportsSingleRecipeLocking()) { + if (isRecipeLockingEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); + } + } else { + if (isRecipeLockingEnabled()) { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(0, 0) + .setSize(16, 16); button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.lock_recipe")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + .setTooltipShowUpDelay(TOOLTIP_DELAY); return (ButtonWidget) button; } diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java index 953fc42f56..936145daa8 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPart.java @@ -64,13 +64,13 @@ import gregtech.api.util.GT_Utility; import gregtech.common.covers.CoverInfo; public abstract class MultiBlockPart extends NonTickableMultiTileEntity - implements IMultiBlockPart, IMTE_BreakBlock, IMTE_HasModes, PowerLogicHost { + implements IMultiBlockPart, IMTE_BreakBlock, IMTE_HasModes, PowerLogicHost { public static final int NOTHING = 0, ENERGY_IN = B[0], ENERGY_OUT = B[1], FLUID_IN = B[2], FLUID_OUT = B[3], - ITEM_IN = B[4], ITEM_OUT = B[5]; + ITEM_IN = B[4], ITEM_OUT = B[5]; protected final List BASIC_MODES = new ArrayList<>( - Arrays.asList(NOTHING, ENERGY_IN, ENERGY_OUT, FLUID_IN, FLUID_OUT, ITEM_IN, ITEM_OUT)); + Arrays.asList(NOTHING, ENERGY_IN, ENERGY_OUT, FLUID_IN, FLUID_OUT, ITEM_IN, ITEM_OUT)); protected ChunkCoordinates mTargetPos = null; protected IMultiBlockController target = null; @@ -121,7 +121,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); currenttip.add(String.format("Mode: %s", getModeName(mMode))); } @@ -192,9 +192,9 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity if (aNBT.hasKey(NBT.MODE)) mMode = aNBT.getByte(NBT.MODE); if (aNBT.hasKey(NBT.TARGET)) { mTargetPos = new ChunkCoordinates( - aNBT.getInteger(NBT.TARGET_X), - aNBT.getShort(NBT.TARGET_Y), - aNBT.getInteger(NBT.TARGET_Z)); + aNBT.getInteger(NBT.TARGET_X), + aNBT.getShort(NBT.TARGET_Y), + aNBT.getInteger(NBT.TARGET_Z)); } if (aNBT.hasKey(NBT.LOCKED_INVENTORY)) { mLockedInventory = aNBT.getString(NBT.LOCKED_INVENTORY); @@ -322,22 +322,19 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity // Loading the registry final String textureName = aNBT.getString(NBT.TEXTURE); textures = new IIconContainer[] { - new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/bottom"), - new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/top"), - new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/side"), - new Textures.BlockIcons.CustomIcon( - "multitileentity/multiblockparts/" + textureName + "/overlay/bottom"), - new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/overlay/top"), - new Textures.BlockIcons.CustomIcon( - "multitileentity/multiblockparts/" + textureName + "/overlay/side") }; + new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/bottom"), + new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/top"), + new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/side"), + new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/overlay/bottom"), + new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/overlay/top"), + new Textures.BlockIcons.CustomIcon("multitileentity/multiblockparts/" + textureName + "/overlay/side") }; } @Override public void copyTextures() { // Loading an instance - final TileEntity tCanonicalTileEntity = MultiTileEntityRegistry.getCanonicalTileEntity( - getMultiTileEntityRegistryID(), - getMultiTileEntityID()); + final TileEntity tCanonicalTileEntity = MultiTileEntityRegistry + .getCanonicalTileEntity(getMultiTileEntityRegistryID(), getMultiTileEntityID()); if (tCanonicalTileEntity instanceof MultiBlockPart) textures = ((MultiBlockPart) tCanonicalTileEntity).textures; } @@ -348,13 +345,13 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity final ITexture baseTexture = TextureFactory.of(super.getTexture(aBlock, aSide, isActive, aRenderPass)); if (mMode != 0 && aSide == facing) { if (mMode == getModeOrdinal(ITEM_IN)) return new ITexture[] { baseTexture, - TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) }; + TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) }; if (mMode == getModeOrdinal(ITEM_OUT)) return new ITexture[] { baseTexture, - TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }; + TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }; if (mMode == getModeOrdinal(FLUID_IN)) return new ITexture[] { baseTexture, - TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) }; + TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) }; if (mMode == getModeOrdinal(FLUID_OUT)) return new ITexture[] { baseTexture, - TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) }; + TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) }; if (mMode == getModeOrdinal(ENERGY_IN)) return new ITexture[] { baseTexture, TextureFactory.of(OVERLAY_ENERGY_IN_MULTI) }; if (mMode == getModeOrdinal(ENERGY_OUT)) @@ -399,7 +396,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity @Override public boolean onMalletRightClick(EntityPlayer aPlayer, ItemStack tCurrentItem, byte wrenchSide, float aX, float aY, - float aZ) { + float aZ) { if (mAllowedModes == NOTHING) return true; mMode = getNextAllowedMode(BASIC_MODES); @@ -434,7 +431,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity if (!modeSelected(FLUID_IN)) return 0; final byte aSide = (byte) aDirection.ordinal(); if (aDirection != ForgeDirection.UNKNOWN - && (aSide != facing || !coverLetsFluidIn(aSide, aFluidStack == null ? null : aFluidStack.getFluid()))) + && (aSide != facing || !coverLetsFluidIn(aSide, aFluidStack == null ? null : aFluidStack.getFluid()))) return 0; final IMultiBlockController controller = getTarget(true); return controller == null ? 0 : controller.fill(this, aDirection, aFluidStack, aDoFill); @@ -445,7 +442,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity if (!modeSelected(FLUID_OUT)) return null; final byte aSide = (byte) aDirection.ordinal(); if (aDirection != ForgeDirection.UNKNOWN - && (aSide != facing || !coverLetsFluidOut(aSide, aFluidStack == null ? null : aFluidStack.getFluid()))) + && (aSide != facing || !coverLetsFluidOut(aSide, aFluidStack == null ? null : aFluidStack.getFluid()))) return null; final IMultiBlockController controller = getTarget(true); return controller == null ? null : controller.drain(this, aDirection, aFluidStack, aDoDrain); @@ -459,7 +456,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity if (controller == null) return null; final FluidStack aFluidStack = controller.getDrainableFluid(aSide); if (aDirection != ForgeDirection.UNKNOWN - && (aSide != facing || !coverLetsFluidOut(aSide, aFluidStack == null ? null : aFluidStack.getFluid()))) + && (aSide != facing || !coverLetsFluidOut(aSide, aFluidStack == null ? null : aFluidStack.getFluid()))) return null; return controller.drain(this, aDirection, aAmountToDrain, aDoDrain); } @@ -494,7 +491,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity final CoverInfo coverInfo = getCoverInfoAtSide(aSide); if ((controller.isLiquidInput(aSide) && coverInfo.letsFluidIn(null, controller)) - || (controller.isLiquidOutput(aSide) && coverInfo.letsFluidOut(null, controller))) + || (controller.isLiquidOutput(aSide) && coverInfo.letsFluidOut(null, controller))) return controller.getTankInfo(this, aDirection); return GT_Values.emptyFluidTankInfo; @@ -560,8 +557,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity @Override public boolean canInsertItem(int aSlot, ItemStack aStack, int aSide) { if (!modeSelected(ITEM_IN, ITEM_OUT) - || (facing != SIDE_UNKNOWN && (facing != aSide || !coverLetsItemsIn((byte) aSide, aSlot)))) - return false; + || (facing != SIDE_UNKNOWN && (facing != aSide || !coverLetsItemsIn((byte) aSide, aSlot)))) return false; final IMultiBlockController controller = getTarget(true); return (controller != null && controller.canInsertItem(this, aSlot, aStack, (byte) aSide)); } @@ -569,8 +565,7 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity @Override public boolean canExtractItem(int aSlot, ItemStack aStack, int aSide) { if (!modeSelected(ITEM_IN, ITEM_OUT) - || (facing != SIDE_UNKNOWN && (facing != aSide || !coverLetsItemsOut((byte) aSide, aSlot)))) - return false; + || (facing != SIDE_UNKNOWN && (facing != aSide || !coverLetsItemsOut((byte) aSide, aSlot)))) return false; final IMultiBlockController controller = getTarget(true); return (controller != null && controller.canExtractItem(this, aSlot, aStack, (byte) aSide)); } @@ -664,33 +659,33 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity int columnsToMake = Math.min(Math.min(inv.getSlots(), 128) - rows * 4, 4); for (int column = 0; column < columnsToMake; column++) { scrollable.widget( - new SlotWidget(inv, rows * 4 + column).setPos(column * 18, rows * 18) - .setSize(18, 18)); + new SlotWidget(inv, rows * 4 + column).setPos(column * 18, rows * 18) + .setSize(18, 18)); } } builder.widget( - scrollable.setSize(18 * 4 + 4, 18 * 4) - .setPos(52, 18)); + scrollable.setSize(18 * 4 + 4, 18 * 4) + .setPos(52, 18)); DropDownWidget dropDown = new DropDownWidget(); dropDown.addDropDownItemsSimple( - controller.getInventoryNames(this), - (buttonWidget, index, label, setSelected) -> buttonWidget.setOnClick((clickData, widget) -> { - if (getNameOfInventoryFromIndex(controller, index).equals("all")) { - mLockedInventory = GT_Values.E; - mLockedInventoryIndex = 0; - } else { - mLockedInventory = getNameOfInventoryFromIndex(controller, index); - mLockedInventoryIndex = index; - } - setSelected.run(); - }), - true); + controller.getInventoryNames(this), + (buttonWidget, index, label, setSelected) -> buttonWidget.setOnClick((clickData, widget) -> { + if (getNameOfInventoryFromIndex(controller, index).equals("all")) { + mLockedInventory = GT_Values.E; + mLockedInventoryIndex = 0; + } else { + mLockedInventory = getNameOfInventoryFromIndex(controller, index); + mLockedInventoryIndex = index; + } + setSelected.run(); + }), + true); builder.widget( - dropDown.setSelected(mLockedInventoryIndex) - .setExpandedMaxHeight(60) - .setDirection(DropDownWidget.Direction.DOWN) - .setPos(53, 5) - .setSize(70, 11)); + dropDown.setSelected(mLockedInventoryIndex) + .setExpandedMaxHeight(60) + .setDirection(DropDownWidget.Direction.DOWN) + .setPos(53, 5) + .setSize(70, 11)); } protected String getNameOfInventoryFromIndex(final IMultiBlockController controller, int index) { @@ -716,13 +711,13 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity fluidSlot.setInteraction(true, false); } scrollable.widget( - fluidSlot.setPos(column * 18, rows * 18) - .setSize(18, 18)); + fluidSlot.setPos(column * 18, rows * 18) + .setSize(18, 18)); } } builder.widget( - scrollable.setSize(18 * 4 + 4, 18 * 4) - .setPos(52, 7)); + scrollable.setSize(18 * 4 + 4, 18 * 4) + .setPos(52, 7)); } @Override @@ -756,9 +751,9 @@ public abstract class MultiBlockPart extends NonTickableMultiTileEntity public void addGregTechLogo(Builder builder) { if (modeSelected(ITEM_IN, ITEM_OUT)) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(152, 74)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(152, 74)); } else { super.addGregTechLogo(builder); } diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPowerController.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPowerController.java index 0834c64b75..7f202ec5a4 100644 --- a/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPowerController.java +++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/MultiBlockPowerController.java @@ -7,7 +7,7 @@ import gregtech.api.logic.PowerLogic; import gregtech.api.logic.interfaces.PowerLogicHost; public abstract class MultiBlockPowerController> extends MultiBlockController - implements PowerLogicHost { + implements PowerLogicHost { public MultiBlockPowerController() { super(); diff --git a/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java b/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java index 74876ef2bc..b0b33492f7 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java +++ b/src/main/java/gregtech/api/net/GT_Packet_Block_Event.java @@ -40,11 +40,11 @@ public class GT_Packet_Block_Event extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_Block_Event( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - aData.readByte()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + aData.readByte()); } @Override diff --git a/src/main/java/gregtech/api/net/GT_Packet_ClientPreference.java b/src/main/java/gregtech/api/net/GT_Packet_ClientPreference.java index 7322339167..6108802862 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_ClientPreference.java +++ b/src/main/java/gregtech/api/net/GT_Packet_ClientPreference.java @@ -52,6 +52,6 @@ public class GT_Packet_ClientPreference extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_ClientPreference( - new GT_ClientPreference(aData.readBoolean(), aData.readBoolean(), aData.readBoolean())); + new GT_ClientPreference(aData.readBoolean(), aData.readBoolean(), aData.readBoolean())); } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_GtTileEntityGuiRequest.java b/src/main/java/gregtech/api/net/GT_Packet_GtTileEntityGuiRequest.java index bf1a7e4af7..bccb4b2b76 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_GtTileEntityGuiRequest.java +++ b/src/main/java/gregtech/api/net/GT_Packet_GtTileEntityGuiRequest.java @@ -34,7 +34,7 @@ public class GT_Packet_GtTileEntityGuiRequest extends GT_Packet_New { } public GT_Packet_GtTileEntityGuiRequest(int mX, short mY, int mZ, int guiId, int dimID, int playerID, - int parentGuiId) { + int parentGuiId) { super(false); this.mX = mX; this.mY = mY; @@ -69,13 +69,13 @@ public class GT_Packet_GtTileEntityGuiRequest extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_GtTileEntityGuiRequest( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt()); } @Override @@ -92,22 +92,22 @@ public class GT_Packet_GtTileEntityGuiRequest extends GT_Packet_New { final EntityPlayerMP player = (EntityPlayerMP) world.getEntityByID(playerId); final CoverableTileEntity coverableTile = (baseTile instanceof CoverableTileEntity) - ? (CoverableTileEntity) baseTile - : null; + ? (CoverableTileEntity) baseTile + : null; // If the requested Gui ID corresponds to a cover, send the cover data to the client so they can open it. if (GT_Proxy.GUI_ID_COVER_SIDE_BASE <= guiId && guiId < GT_Proxy.GUI_ID_COVER_SIDE_BASE + 6 - && coverableTile != null) { + && coverableTile != null) { final byte coverSide = (byte) (guiId - GT_Proxy.GUI_ID_COVER_SIDE_BASE); final GT_Packet_TileEntityCoverGUI packet = new GT_Packet_TileEntityCoverGUI( - this.mX, - this.mY, - this.mZ, - coverSide, - coverableTile.getCoverIDAtSide(coverSide), - coverableTile.getComplexCoverDataAtSide(coverSide), - this.dimId, - this.playerId, - parentGuiId); + this.mX, + this.mY, + this.mZ, + coverSide, + coverableTile.getCoverIDAtSide(coverSide), + coverableTile.getComplexCoverDataAtSide(coverSide), + this.dimId, + this.playerId, + parentGuiId); GT_Values.NW.sendToPlayer(packet, player); } else if (guiId == 0) { if (baseTile.useModularUI()) { diff --git a/src/main/java/gregtech/api/net/GT_Packet_MultiTileEntity.java b/src/main/java/gregtech/api/net/GT_Packet_MultiTileEntity.java index b31355adad..6c67dbe6b7 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_MultiTileEntity.java +++ b/src/main/java/gregtech/api/net/GT_Packet_MultiTileEntity.java @@ -21,7 +21,7 @@ import io.netty.buffer.ByteBuf; public class GT_Packet_MultiTileEntity extends GT_Packet_New { public static final int COVERS = B[0], REDSTONE = B[1], MODES = B[2], CONTROLLER = B[3], INVENTORY_INDEX = B[4], - INVENTORY_NAME = B[5], BOOLEANS = B[6], SOUND = B[7]; + INVENTORY_NAME = B[5], BOOLEANS = B[6], SOUND = B[7]; private int features = 0; @@ -47,7 +47,7 @@ public class GT_Packet_MultiTileEntity extends GT_Packet_New { // For multi tiles public GT_Packet_MultiTileEntity(int aFeatures, int aX, short aY, int aZ, short aRID, short aID, byte aCommonData, - byte aColor) { + byte aColor) { super(false); features = aFeatures; @@ -179,25 +179,25 @@ public class GT_Packet_MultiTileEntity extends GT_Packet_New { final int packetFeatures = aData.readInt(); final GT_Packet_MultiTileEntity packet = new GT_Packet_MultiTileEntity( - packetFeatures, - // Coords - aData.readInt(), - aData.readShort(), - aData.readInt(), - // Registry & ID - aData.readShort(), - aData.readShort(), - // Common Data - aData.readByte(), - aData.readByte()); + packetFeatures, + // Coords + aData.readInt(), + aData.readShort(), + aData.readInt(), + // Registry & ID + aData.readShort(), + aData.readShort(), + // Common Data + aData.readByte(), + aData.readByte()); if ((packetFeatures & COVERS) == COVERS) { packet.setCoverData( - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt()); + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt()); } if ((packetFeatures & REDSTONE) == REDSTONE) { packet.setRedstoneData(aData.readByte()); @@ -288,11 +288,11 @@ public class GT_Packet_MultiTileEntity extends GT_Packet_New { } } catch (Exception e) { GT_Mod.GT_FML_LOGGER.error( - "Exception setting tile entity data for tile entity {} at ({}, {}, {})", - tTileEntity, - mX, - mY, - mZ); + "Exception setting tile entity data for tile entity {} at ({}, {}, {})", + tTileEntity, + mX, + mY, + mZ); } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_RequestCoverData.java b/src/main/java/gregtech/api/net/GT_Packet_RequestCoverData.java index e1ac057aa4..3f919dacd4 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_RequestCoverData.java +++ b/src/main/java/gregtech/api/net/GT_Packet_RequestCoverData.java @@ -81,11 +81,11 @@ public class GT_Packet_RequestCoverData extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_RequestCoverData( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - aData.readInt()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + aData.readInt()); } @Override diff --git a/src/main/java/gregtech/api/net/GT_Packet_SendCoverData.java b/src/main/java/gregtech/api/net/GT_Packet_SendCoverData.java index 971ed66aec..b348cbb9e3 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_SendCoverData.java +++ b/src/main/java/gregtech/api/net/GT_Packet_SendCoverData.java @@ -30,7 +30,7 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { } public GT_Packet_SendCoverData(int mX, short mY, int mZ, byte coverSide, int coverID, - ISerializableObject coverData) { + ISerializableObject coverData) { super(false); this.mX = mX; this.mY = mY; @@ -83,14 +83,14 @@ public class GT_Packet_SendCoverData extends GT_Packet_New { public GT_Packet_New decode(ByteArrayDataInput aData) { final int coverId; return new GT_Packet_SendCoverData( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - coverId = aData.readInt(), - GregTech_API.getCoverBehaviorNew(coverId) - .createDataObject() - .readFromPacket(aData, null)); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + coverId = aData.readInt(), + GregTech_API.getCoverBehaviorNew(coverId) + .createDataObject() + .readFromPacket(aData, null)); } @Override diff --git a/src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java b/src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java index ac72730705..b2d9a59438 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java +++ b/src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java @@ -84,10 +84,10 @@ public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_SetConfigurationCircuit( - aData.readInt(), - aData.readShort(), - aData.readInt(), - ISerializableObject.readItemStackFromGreggyByteBuf(aData)); + aData.readInt(), + aData.readShort(), + aData.readInt(), + ISerializableObject.readItemStackFromGreggyByteBuf(aData)); } @Override @@ -102,9 +102,9 @@ public class GT_Packet_SetConfigurationCircuit extends GT_Packet_New { if (machine == null) return; if (!machine.allowSelectCircuit()) return; machine.getConfigurationCircuits() - .stream() - .filter(stack -> GT_Utility.areStacksEqual(stack, circuit)) - .findFirst() - .ifPresent(stack -> ((IHasInventory) tile).setInventorySlotContents(machine.getCircuitSlot(), stack)); + .stream() + .filter(stack -> GT_Utility.areStacksEqual(stack, circuit)) + .findFirst() + .ifPresent(stack -> ((IHasInventory) tile).setInventorySlotContents(machine.getCircuitSlot(), stack)); } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_SetLockedFluid.java b/src/main/java/gregtech/api/net/GT_Packet_SetLockedFluid.java index 0252201ba3..04f147b208 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_SetLockedFluid.java +++ b/src/main/java/gregtech/api/net/GT_Packet_SetLockedFluid.java @@ -88,13 +88,13 @@ public class GT_Packet_SetLockedFluid extends GT_Packet_New { mteToLock.lockFluid(true); mteToLock.setLockedFluidName(tFluid.getName()); GT_Utility.sendChatToPlayer( - mPlayer, - String.format( - GT_LanguageManager.addStringLocalization( - "Interaction_DESCRIPTION_Index_151.4", - "Successfully locked Fluid to %s", - false), - new FluidStack(tFluid, 1).getLocalizedName())); + mPlayer, + String.format( + GT_LanguageManager.addStringLocalization( + "Interaction_DESCRIPTION_Index_151.4", + "Successfully locked Fluid to %s", + false), + new FluidStack(tFluid, 1).getLocalizedName())); mteToLock.onFluidLockPacketReceived(tFluid.getName()); } diff --git a/src/main/java/gregtech/api/net/GT_Packet_Sound.java b/src/main/java/gregtech/api/net/GT_Packet_Sound.java index 808ddc218c..f742c39dba 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_Sound.java +++ b/src/main/java/gregtech/api/net/GT_Packet_Sound.java @@ -52,12 +52,12 @@ public class GT_Packet_Sound extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_Sound( - aData.readUTF(), - aData.readFloat(), - aData.readFloat(), - aData.readInt(), - aData.readShort(), - aData.readInt()); + aData.readUTF(), + aData.readFloat(), + aData.readFloat(), + aData.readInt(), + aData.readShort(), + aData.readInt()); } @Override diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java b/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java index 99a5c55dc6..29562e9b4d 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java +++ b/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java @@ -23,7 +23,7 @@ public class GT_Packet_TileEntity extends GT_Packet_New { // For multi tiles public GT_Packet_TileEntity(int aX, short aY, int aZ, short aRID, short aID, int aC0, int aC1, int aC2, int aC3, - int aC4, int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { + int aC4, int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { super(false); mX = aX; mY = aY; @@ -45,29 +45,29 @@ public class GT_Packet_TileEntity extends GT_Packet_New { // For meta tiles public GT_Packet_TileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, - int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { + int aC5, byte aTexture, byte aTexturePage, byte aUpdate, byte aRedstone, byte aColor) { this( - aX, - aY, - aZ, - (short) 0, - aID, - aC0, - aC1, - aC2, - aC3, - aC4, - aC5, - aTexture, - aTexturePage, - aUpdate, - aRedstone, - aColor); + aX, + aY, + aZ, + (short) 0, + aID, + aC0, + aC1, + aC2, + aC3, + aC4, + aC5, + aTexture, + aTexturePage, + aUpdate, + aRedstone, + aColor); } // For pipes public GT_Packet_TileEntity(int aX, short aY, int aZ, short aID, int aC0, int aC1, int aC2, int aC3, int aC4, - int aC5, byte aTexture, byte aUpdate, byte aRedstone, byte aColor) { + int aC5, byte aTexture, byte aUpdate, byte aRedstone, byte aColor) { this(aX, aY, aZ, (short) 0, aID, aC0, aC1, aC2, aC3, aC4, aC5, aTexture, (byte) 0, aUpdate, aRedstone, aColor); } @@ -97,26 +97,26 @@ public class GT_Packet_TileEntity extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_TileEntity( - // Coords - aData.readInt(), - aData.readShort(), - aData.readInt(), - // Registry & ID - aData.readShort(), - aData.readShort(), - // Covers - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - // Everything else - aData.readByte(), - aData.readByte(), - aData.readByte(), - aData.readByte(), - aData.readByte()); + // Coords + aData.readInt(), + aData.readShort(), + aData.readInt(), + // Registry & ID + aData.readShort(), + aData.readShort(), + // Covers + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + // Everything else + aData.readByte(), + aData.readByte(), + aData.readByte(), + aData.readByte(), + aData.readByte()); } @Override @@ -126,38 +126,27 @@ public class GT_Packet_TileEntity extends GT_Packet_New { try { final Block tBlock; if (tTileEntity instanceof BaseMetaTileEntity) ((BaseMetaTileEntity) tTileEntity).receiveMetaTileEntityData( - mID, - mC0, - mC1, - mC2, - mC3, - mC4, - mC5, - mTexture, - mTexturePage, - mUpdate, - mRedstone, - mColor); - else if (tTileEntity instanceof BaseMetaPipeEntity) - ((BaseMetaPipeEntity) tTileEntity).receiveMetaTileEntityData( - mID, - mC0, - mC1, - mC2, - mC3, - mC4, - mC5, - mTexture, - mUpdate, - mRedstone, - mColor); + mID, + mC0, + mC1, + mC2, + mC3, + mC4, + mC5, + mTexture, + mTexturePage, + mUpdate, + mRedstone, + mColor); + else if (tTileEntity instanceof BaseMetaPipeEntity) ((BaseMetaPipeEntity) tTileEntity) + .receiveMetaTileEntityData(mID, mC0, mC1, mC2, mC3, mC4, mC5, mTexture, mUpdate, mRedstone, mColor); } catch (Exception e) { GT_Mod.GT_FML_LOGGER.error( - "Exception setting tile entity data for tile entity {} at ({}, {}, {})", - tTileEntity, - mX, - mY, - mZ); + "Exception setting tile entity data for tile entity {} at ({}, {}, {})", + tTileEntity, + mX, + mY, + mZ); } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntityCover.java b/src/main/java/gregtech/api/net/GT_Packet_TileEntityCover.java index 07d99a3896..0e4bedc16e 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_TileEntityCover.java +++ b/src/main/java/gregtech/api/net/GT_Packet_TileEntityCover.java @@ -74,13 +74,13 @@ public class GT_Packet_TileEntityCover extends GT_Packet_New { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_TileEntityCover( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - aData.readInt(), - aData.readInt(), - aData.readInt()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + aData.readInt(), + aData.readInt(), + aData.readInt()); } @Override diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverGUI.java b/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverGUI.java index 25d4adf8e1..79156e4223 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverGUI.java +++ b/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverGUI.java @@ -39,7 +39,7 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { } public GT_Packet_TileEntityCoverGUI(int mX, short mY, int mZ, byte coverSide, int coverID, int coverData, int dimID, - int playerID) { + int playerID) { super(false); this.mX = mX; this.mY = mY; @@ -55,7 +55,7 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { } public GT_Packet_TileEntityCoverGUI(int mX, short mY, int mZ, byte coverSide, int coverID, - ISerializableObject coverData, int dimID, int playerID) { + ISerializableObject coverData, int dimID, int playerID) { super(false); this.mX = mX; this.mY = mY; @@ -86,7 +86,7 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { } public GT_Packet_TileEntityCoverGUI(int mX, short mY, int mZ, byte coverSide, int coverID, - ISerializableObject coverData, int dimID, int playerID, int parentGuiId) { + ISerializableObject coverData, int dimID, int playerID, int parentGuiId) { super(false); this.mX = mX; this.mY = mY; @@ -101,7 +101,7 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { } public GT_Packet_TileEntityCoverGUI(byte side, int coverID, int coverData, ICoverable tile, - EntityPlayerMP aPlayer) { + EntityPlayerMP aPlayer) { super(false); this.mX = tile.getXCoord(); @@ -132,7 +132,7 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { } public GT_Packet_TileEntityCoverGUI(byte side, int coverID, ISerializableObject coverData, ICoverable tile, - EntityPlayerMP aPlayer) { + EntityPlayerMP aPlayer) { super(false); this.mX = tile.getXCoord(); this.mY = tile.getYCoord(); @@ -172,17 +172,17 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { public GT_Packet_New decode(ByteArrayDataInput aData) { int coverID; return new GT_Packet_TileEntityCoverGUI( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - coverID = aData.readInt(), - GregTech_API.getCoverBehaviorNew(coverID) - .createDataObject() - .readFromPacket(aData, null), - aData.readInt(), - aData.readInt(), - aData.readInt()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + coverID = aData.readInt(), + GregTech_API.getCoverBehaviorNew(coverID) + .createDataObject() + .readFromPacket(aData, null), + aData.readInt(), + aData.readInt(), + aData.readInt()); } @Override @@ -197,19 +197,19 @@ public class GT_Packet_TileEntityCoverGUI extends GT_Packet_New { GT_CoverBehaviorBase cover = gtTile.getCoverBehaviorAtSideNew(side); if (cover.hasCoverGUI()) { final GuiScreen gui = (GuiScreen) cover.getClientGUI( - side, - gtTile.getCoverIDAtSide(side), - gtTile.getComplexCoverDataAtSide(side), - gtTile, - thePlayer, - thePlayer.worldObj); + side, + gtTile.getCoverIDAtSide(side), + gtTile.getComplexCoverDataAtSide(side), + gtTile, + thePlayer, + thePlayer.worldObj); // If it's one of this mod's covers, tell it to exit to the GUI with the specified ID (-1 is // ignored) if (gui instanceof GT_GUICover) { ((GT_GUICover) gui).setParentGuiId(parentGuiId); } Minecraft.getMinecraft() - .displayGuiScreen(gui); + .displayGuiScreen(gui); } } } diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverNew.java b/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverNew.java index 453ed88e60..89201710f3 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverNew.java +++ b/src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverNew.java @@ -36,7 +36,7 @@ public class GT_Packet_TileEntityCoverNew extends GT_Packet_New { } public GT_Packet_TileEntityCoverNew(int mX, short mY, int mZ, byte coverSide, int coverID, - ISerializableObject coverData, int dimID) { + ISerializableObject coverData, int dimID) { super(false); this.mX = mX; this.mY = mY; @@ -91,15 +91,15 @@ public class GT_Packet_TileEntityCoverNew extends GT_Packet_New { public GT_Packet_New decode(ByteArrayDataInput aData) { int coverId; return new GT_Packet_TileEntityCoverNew( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - coverId = aData.readInt(), - GregTech_API.getCoverBehaviorNew(coverId) - .createDataObject() - .readFromPacket(aData, mPlayer), - aData.readInt()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + coverId = aData.readInt(), + GregTech_API.getCoverBehaviorNew(coverId) + .createDataObject() + .readFromPacket(aData, mPlayer), + aData.readInt()); } @Override diff --git a/src/main/java/gregtech/api/net/GT_Packet_WirelessRedstoneCover.java b/src/main/java/gregtech/api/net/GT_Packet_WirelessRedstoneCover.java index 6f0f8d215d..5121ce03df 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_WirelessRedstoneCover.java +++ b/src/main/java/gregtech/api/net/GT_Packet_WirelessRedstoneCover.java @@ -29,14 +29,14 @@ public class GT_Packet_WirelessRedstoneCover extends GT_Packet_TileEntityCover { } public GT_Packet_WirelessRedstoneCover(int mX, short mY, int mZ, byte coverSide, int coverID, int dimID, - int publicChannel, int checkBoxValue) { + int publicChannel, int checkBoxValue) { super(mX, mY, mZ, coverSide, coverID, 0, dimID); mPublicChannel = publicChannel; mCheckBoxValue = checkBoxValue; } public GT_Packet_WirelessRedstoneCover(byte coverSide, int coverID, ICoverable tile, int publicChannel, - int checkBoxValue) { + int checkBoxValue) { super(coverSide, coverID, 0, tile); mPublicChannel = publicChannel; mCheckBoxValue = checkBoxValue; @@ -72,14 +72,14 @@ public class GT_Packet_WirelessRedstoneCover extends GT_Packet_TileEntityCover { @Override public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_WirelessRedstoneCover( - aData.readInt(), - aData.readShort(), - aData.readInt(), - aData.readByte(), - aData.readInt(), - aData.readInt(), - aData.readInt(), - aData.readInt()); + aData.readInt(), + aData.readShort(), + aData.readInt(), + aData.readByte(), + aData.readInt(), + aData.readInt(), + aData.readInt(), + aData.readInt()); } @Override @@ -89,8 +89,7 @@ public class GT_Packet_WirelessRedstoneCover extends GT_Packet_TileEntityCover { TileEntity tile = world.getTileEntity(mX, mY, mZ); if (tile instanceof IGregTechTileEntity && !((IGregTechTileEntity) tile).isDead()) { int tPrivateChannel = (mCheckBoxValue > 0) ? mPlayer.getUniqueID() - .hashCode() - & PRIVATE_MASK : 0; + .hashCode() & PRIVATE_MASK : 0; int tCoverData = tPrivateChannel | (mCheckBoxValue & CHECKBOX_MASK) | (mPublicChannel & PUBLIC_MASK); ((IGregTechTileEntity) tile).receiveCoverData(side, coverID, tCoverData); } diff --git a/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java b/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java index 6bbab251ba..c2e0556de9 100644 --- a/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java +++ b/src/main/java/gregtech/api/objects/AE2DigitalChestHandler.java @@ -10,14 +10,14 @@ public class AE2DigitalChestHandler implements appeng.api.storage.IExternalStora @Override public boolean canHandle(final TileEntity te, final ForgeDirection d, final appeng.api.storage.StorageChannel chan, - final appeng.api.networking.security.BaseActionSource mySrc) { + final appeng.api.networking.security.BaseActionSource mySrc) { return chan == appeng.api.storage.StorageChannel.ITEMS && te instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_DigitalChestBase; + && ((BaseMetaTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_DigitalChestBase; } @Override public appeng.api.storage.IMEInventory getInventory(final TileEntity te, final ForgeDirection d, - final appeng.api.storage.StorageChannel chan, final appeng.api.networking.security.BaseActionSource src) { + final appeng.api.storage.StorageChannel chan, final appeng.api.networking.security.BaseActionSource src) { if (chan == appeng.api.storage.StorageChannel.ITEMS) { return ((GT_MetaTileEntity_DigitalChestBase) (((BaseMetaTileEntity) te).getMetaTileEntity())); } diff --git a/src/main/java/gregtech/api/objects/CollectorUtils.java b/src/main/java/gregtech/api/objects/CollectorUtils.java index 178ea0d5e8..7265076683 100644 --- a/src/main/java/gregtech/api/objects/CollectorUtils.java +++ b/src/main/java/gregtech/api/objects/CollectorUtils.java @@ -24,7 +24,7 @@ public class CollectorUtils { } public static , M extends Map> Collector entriesToMap( - Supplier mapSupplier) { + Supplier mapSupplier) { return Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, CollectorUtils.throwingMerger(), mapSupplier); } } diff --git a/src/main/java/gregtech/api/objects/ElementStack.java b/src/main/java/gregtech/api/objects/ElementStack.java index 4f71c6efee..58fffd475a 100644 --- a/src/main/java/gregtech/api/objects/ElementStack.java +++ b/src/main/java/gregtech/api/objects/ElementStack.java @@ -31,7 +31,7 @@ public class ElementStack implements Cloneable { if (aObject == null) return false; if (aObject instanceof Element) return aObject == mElement; if (aObject instanceof ElementStack) return ((ElementStack) aObject).mElement == mElement - && (mAmount < 0 || ((ElementStack) aObject).mAmount < 0 || ((ElementStack) aObject).mAmount == mAmount); + && (mAmount < 0 || ((ElementStack) aObject).mAmount < 0 || ((ElementStack) aObject).mAmount == mAmount); return false; } diff --git a/src/main/java/gregtech/api/objects/GT_ChunkManager.java b/src/main/java/gregtech/api/objects/GT_ChunkManager.java index 6101deedbc..6dbabe2535 100644 --- a/src/main/java/gregtech/api/objects/GT_ChunkManager.java +++ b/src/main/java/gregtech/api/objects/GT_ChunkManager.java @@ -23,7 +23,7 @@ import gregtech.api.util.GT_Log; // This class handles re-initializing chunks after a server restart public class GT_ChunkManager - implements ForgeChunkManager.OrderedLoadingCallback, ForgeChunkManager.PlayerOrderedLoadingCallback { + implements ForgeChunkManager.OrderedLoadingCallback, ForgeChunkManager.PlayerOrderedLoadingCallback { private Map registeredTickets = new HashMap<>(); public static GT_ChunkManager instance = new GT_ChunkManager(); @@ -47,22 +47,22 @@ public class GT_ChunkManager if (GT_Values.alwaysReloadChunkloaders) { for (Ticket ticket : tickets) { int x = ticket.getModData() - .getInteger("OwnerX"); + .getInteger("OwnerX"); int y = ticket.getModData() - .getInteger("OwnerY"); + .getInteger("OwnerY"); int z = ticket.getModData() - .getInteger("OwnerZ"); + .getInteger("OwnerZ"); if (y > 0) { TileEntity tile = world.getTileEntity(x, y, z); if (tile != null && tile instanceof IGregTechTileEntity - && ((IGregTechTileEntity) tile).isAllowedToWork()) { + && ((IGregTechTileEntity) tile).isAllowedToWork()) { ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(x >> 4, z >> 4)); if (!registeredTickets.containsKey(tile)) { registeredTickets.put(tile, ticket); if (((IGregTechTileEntity) tile).getMetaTileEntity() instanceof IChunkLoader) ForgeChunkManager.forceChunk( - ticket, - ((IChunkLoader) ((IGregTechTileEntity) tile).getMetaTileEntity()).getActiveChunk()); + ticket, + ((IChunkLoader) ((IGregTechTileEntity) tile).getMetaTileEntity()).getActiveChunk()); validTickets.add(ticket); } } @@ -88,33 +88,28 @@ public class GT_ChunkManager public static boolean requestPlayerChunkLoad(TileEntity owner, ChunkCoordIntPair chunkXZ, String player) { if (!GT_Values.enableChunkloaders) return false; if (!GT_Values.alwaysReloadChunkloaders && chunkXZ == null) return false; - if (GT_Values.debugChunkloaders && chunkXZ != null) GT_Log.out.println( - "GT_ChunkManager: Chunk request: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); + if (GT_Values.debugChunkloaders && chunkXZ != null) GT_Log.out + .println("GT_ChunkManager: Chunk request: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); if (instance.registeredTickets.containsKey(owner)) { ForgeChunkManager.forceChunk(instance.registeredTickets.get(owner), chunkXZ); } else { Ticket ticket; - if (player.equals("")) ticket = ForgeChunkManager.requestTicket( - GT_Mod.instance, - owner.getWorldObj(), - ForgeChunkManager.Type.NORMAL); - else ticket = ForgeChunkManager.requestPlayerTicket( - GT_Mod.instance, - player, - owner.getWorldObj(), - ForgeChunkManager.Type.NORMAL); + if (player.equals("")) ticket = ForgeChunkManager + .requestTicket(GT_Mod.instance, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL); + else ticket = ForgeChunkManager + .requestPlayerTicket(GT_Mod.instance, player, owner.getWorldObj(), ForgeChunkManager.Type.NORMAL); if (ticket == null) { if (GT_Values.debugChunkloaders) GT_Log.out.println("GT_ChunkManager: ForgeChunkManager.requestTicket failed"); return false; } if (GT_Values.debugChunkloaders) GT_Log.out.println( - "GT_ChunkManager: ticket issued for machine at: (" + owner.xCoord - + ", " - + owner.yCoord - + ", " - + owner.zCoord - + ")"); + "GT_ChunkManager: ticket issued for machine at: (" + owner.xCoord + + ", " + + owner.yCoord + + ", " + + owner.zCoord + + ")"); NBTTagCompound tag = ticket.getModData(); tag.setInteger("OwnerX", owner.xCoord); tag.setInteger("OwnerY", owner.yCoord); @@ -135,8 +130,8 @@ public class GT_ChunkManager if (!GT_Values.enableChunkloaders) return; Ticket ticket = instance.registeredTickets.get(owner); if (ticket != null) { - if (GT_Values.debugChunkloaders) GT_Log.out.println( - "GT_ChunkManager: Chunk release: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); + if (GT_Values.debugChunkloaders) GT_Log.out + .println("GT_ChunkManager: Chunk release: (" + chunkXZ.chunkXPos + ", " + chunkXZ.chunkZPos + ")"); ForgeChunkManager.unforceChunk(ticket, chunkXZ); } } @@ -147,14 +142,14 @@ public class GT_ChunkManager if (ticket != null) { if (GT_Values.debugChunkloaders) { GT_Log.out.println( - "GT_ChunkManager: ticket released by machine at: (" + owner.xCoord - + ", " - + owner.yCoord - + ", " - + owner.zCoord - + ")"); - for (ChunkCoordIntPair chunk : ticket.getChunkList()) GT_Log.out.println( - "GT_ChunkManager: Chunk release: (" + chunk.chunkXPos + ", " + chunk.chunkZPos + ")"); + "GT_ChunkManager: ticket released by machine at: (" + owner.xCoord + + ", " + + owner.yCoord + + ", " + + owner.zCoord + + ")"); + for (ChunkCoordIntPair chunk : ticket.getChunkList()) GT_Log.out + .println("GT_ChunkManager: Chunk release: (" + chunk.chunkXPos + ", " + chunk.chunkZPos + ")"); } ForgeChunkManager.releaseTicket(ticket); instance.registeredTickets.remove(owner); @@ -165,12 +160,12 @@ public class GT_ChunkManager GT_Log.out.println("GT_ChunkManager: Start forced chunks dump:"); instance.registeredTickets.forEach((machine, ticket) -> { GT_Log.out.print( - "GT_ChunkManager: Chunks forced by the machine at (" + machine.xCoord - + ", " - + machine.yCoord - + ", " - + machine.zCoord - + ")"); + "GT_ChunkManager: Chunks forced by the machine at (" + machine.xCoord + + ", " + + machine.yCoord + + ", " + + machine.zCoord + + ")"); if (ticket.isPlayerTicket()) GT_Log.out.print(" Owner: " + ticket.getPlayerName()); GT_Log.out.print(" :"); for (ChunkCoordIntPair c : ticket.getChunkList()) { diff --git a/src/main/java/gregtech/api/objects/GT_Cover_Default.java b/src/main/java/gregtech/api/objects/GT_Cover_Default.java index 04659d584f..b6259a9366 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_Default.java +++ b/src/main/java/gregtech/api/objects/GT_Cover_Default.java @@ -23,14 +23,14 @@ public class GT_Cover_Default extends GT_CoverBehavior { @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = ((aCoverVariable + 1) & 15); GT_Utility.sendChatToPlayer( - aPlayer, - ((aCoverVariable & 1) != 0 ? GT_Utility.trans("128.1", "Redstone ") : "") - + ((aCoverVariable & 2) != 0 ? GT_Utility.trans("129.1", "Energy ") : "") - + ((aCoverVariable & 4) != 0 ? GT_Utility.trans("130.1", "Fluids ") : "") - + ((aCoverVariable & 8) != 0 ? GT_Utility.trans("131.1", "Items ") : "")); + aPlayer, + ((aCoverVariable & 1) != 0 ? GT_Utility.trans("128.1", "Redstone ") : "") + + ((aCoverVariable & 2) != 0 ? GT_Utility.trans("129.1", "Energy ") : "") + + ((aCoverVariable & 4) != 0 ? GT_Utility.trans("130.1", "Fluids ") : "") + + ((aCoverVariable & 8) != 0 ? GT_Utility.trans("131.1", "Items ") : "")); return aCoverVariable; } diff --git a/src/main/java/gregtech/api/objects/GT_Cover_None.java b/src/main/java/gregtech/api/objects/GT_Cover_None.java index 58d43476ef..e0b1adf66e 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_None.java +++ b/src/main/java/gregtech/api/objects/GT_Cover_None.java @@ -69,25 +69,25 @@ public class GT_Cover_None extends GT_CoverBehavior { @Override public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @Override public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return false; } @Override public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - boolean aForced) { + boolean aForced) { return true; } @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - long aTimer) { + long aTimer) { return 0; } @@ -98,153 +98,153 @@ public class GT_Cover_None extends GT_CoverBehavior { @Override protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; } @Override protected ISerializableObject.LegacyCoverData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) { return aCoverVariable; } @Override protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, - float aY, float aZ) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, + float aY, float aZ) { return false; } @Override protected ISerializableObject.LegacyCoverData onCoverScrewdriverClickImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, - float aY, float aZ) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, + float aY, float aZ) { return aCoverVariable; } @Override protected boolean onCoverShiftRightClickImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) { return false; } @Override protected boolean onCoverRemovalImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity, boolean aForced) { + ICoverable aTileEntity, boolean aForced) { return true; } @Override protected String getDescriptionImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return E; } @Override protected float getBlastProofLevelImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return 10.0F; } @Override protected boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override protected boolean letsRedstoneGoOutImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return true; } @Override protected boolean letsFibreGoInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override protected boolean letsFibreGoOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override protected boolean letsEnergyInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override protected boolean letsEnergyOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override protected boolean letsFluidInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - Fluid aFluid, ICoverable aTileEntity) { + Fluid aFluid, ICoverable aTileEntity) { return true; } @Override protected boolean letsFluidOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - Fluid aFluid, ICoverable aTileEntity) { + Fluid aFluid, ICoverable aTileEntity) { return true; } @Override protected boolean letsItemsInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - int aSlot, ICoverable aTileEntity) { + int aSlot, ICoverable aTileEntity) { return true; } @Override protected boolean letsItemsOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - int aSlot, ICoverable aTileEntity) { + int aSlot, ICoverable aTileEntity) { return true; } @Override protected boolean isGUIClickableImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @Override protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return false; } @Override protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return false; } @Override protected byte getRedstoneInputImpl(byte aSide, byte aInputRedstone, int aCoverID, - ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { + ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) { return aInputRedstone; } @Override protected int getTickRateImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return 0; } @Override protected byte getLensColorImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return -1; } @Override protected ItemStack getDropImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return null; } } diff --git a/src/main/java/gregtech/api/objects/GT_Fluid.java b/src/main/java/gregtech/api/objects/GT_Fluid.java index 1f82f412e5..10824d6327 100644 --- a/src/main/java/gregtech/api/objects/GT_Fluid.java +++ b/src/main/java/gregtech/api/objects/GT_Fluid.java @@ -26,7 +26,7 @@ public class GT_Fluid extends Fluid implements Runnable { @Override public int getColor() { return (Math.max(0, Math.min(255, mRGBa[0])) << 16) | (Math.max(0, Math.min(255, mRGBa[1])) << 8) - | Math.max(0, Math.min(255, mRGBa[2])); + | Math.max(0, Math.min(255, mRGBa[2])); } @Override diff --git a/src/main/java/gregtech/api/objects/GT_FluidStack.java b/src/main/java/gregtech/api/objects/GT_FluidStack.java index b5b6f6ff19..779f3a732a 100644 --- a/src/main/java/gregtech/api/objects/GT_FluidStack.java +++ b/src/main/java/gregtech/api/objects/GT_FluidStack.java @@ -18,8 +18,8 @@ import gregtech.api.util.GT_Utility; */ public class GT_FluidStack extends FluidStack { - private static final Collection sAllFluidStacks = Collections.newSetFromMap( - new WeakHashMap<>(10000)); + private static final Collection sAllFluidStacks = Collections + .newSetFromMap(new WeakHashMap<>(10000)); private static volatile boolean lock = false; private Fluid mFluid; @@ -58,7 +58,7 @@ public class GT_FluidStack extends FluidStack { int fluidID; try { fluidID = this.getFluid() - .getID(); + .getID(); } catch (Throwable e) { System.err.println(e); } @@ -81,10 +81,10 @@ public class GT_FluidStack extends FluidStack { @Override public String toString() { return String.format( - "GT_FluidStack: %s x %s, ID:%s", - this.amount, - this.getFluid() - .getName(), - this.getFluidID()); + "GT_FluidStack: %s x %s, ID:%s", + this.amount, + this.getFluid() + .getName(), + this.getFluidID()); } } diff --git a/src/main/java/gregtech/api/objects/GT_HashSet.java b/src/main/java/gregtech/api/objects/GT_HashSet.java index 64ff0f10b0..6442631035 100644 --- a/src/main/java/gregtech/api/objects/GT_HashSet.java +++ b/src/main/java/gregtech/api/objects/GT_HashSet.java @@ -45,7 +45,7 @@ public class GT_HashSet extends AbstractSet { @Override public Iterator iterator() { return (Iterator) map.keySet() - .iterator(); + .iterator(); } @Override diff --git a/src/main/java/gregtech/api/objects/GT_ItemStack.java b/src/main/java/gregtech/api/objects/GT_ItemStack.java index 21dffd1945..27e79a3e96 100644 --- a/src/main/java/gregtech/api/objects/GT_ItemStack.java +++ b/src/main/java/gregtech/api/objects/GT_ItemStack.java @@ -25,9 +25,9 @@ public class GT_ItemStack { public GT_ItemStack(ItemStack aStack, boolean wildcard) { this( - aStack == null ? null : aStack.getItem(), - aStack == null ? 0 : aStack.stackSize, - aStack == null ? 0 : wildcard ? GT_Values.W : Items.feather.getDamage(aStack)); + aStack == null ? null : aStack.getItem(), + aStack == null ? 0 : aStack.stackSize, + aStack == null ? 0 : wildcard ? GT_Values.W : Items.feather.getDamage(aStack)); } public GT_ItemStack(int aHashCode) { diff --git a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java index 330d72b88a..bbb22e7d36 100644 --- a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java +++ b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java @@ -7,7 +7,7 @@ import gregtech.api.interfaces.ITexture; @Deprecated public class GT_RenderedTexture extends gregtech.common.render.GT_RenderedTexture - implements ITexture, IColorModulationContainer { + implements ITexture, IColorModulationContainer { @Deprecated public short[] mRGBa; diff --git a/src/main/java/gregtech/api/objects/GT_SidedTexture.java b/src/main/java/gregtech/api/objects/GT_SidedTexture.java index 8ceb6a9a6d..d042ebede9 100644 --- a/src/main/java/gregtech/api/objects/GT_SidedTexture.java +++ b/src/main/java/gregtech/api/objects/GT_SidedTexture.java @@ -10,13 +10,13 @@ import gregtech.api.interfaces.ITexture; */ @Deprecated public class GT_SidedTexture extends gregtech.common.render.GT_SidedTexture - implements ITexture, IColorModulationContainer { + implements ITexture, IColorModulationContainer { @Deprecated public short[] mRGBa; public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, - IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa, boolean aAllowAlpha) { + IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa, boolean aAllowAlpha) { super(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, aRGBa, aAllowAlpha); // Backwards Compat @@ -24,12 +24,12 @@ public class GT_SidedTexture extends gregtech.common.render.GT_SidedTexture } public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, - IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa) { + IIconContainer aIcon4, IIconContainer aIcon5, short[] aRGBa) { this(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, aRGBa, true); } public GT_SidedTexture(IIconContainer aIcon0, IIconContainer aIcon1, IIconContainer aIcon2, IIconContainer aIcon3, - IIconContainer aIcon4, IIconContainer aIcon5) { + IIconContainer aIcon4, IIconContainer aIcon5) { this(aIcon0, aIcon1, aIcon2, aIcon3, aIcon4, aIcon5, Dyes._NULL.mRGBa); } diff --git a/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java b/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java index e40fb96ef2..cc7410a481 100644 --- a/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java +++ b/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java @@ -36,7 +36,7 @@ public class GT_StdRenderedTexture extends GT_RenderedTexture { public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { LightingHelper lighting = new LightingHelper(aRenderer); lighting.setupLightingYNeg(aBlock, aX, aY, aZ) - .setupColor(ForgeDirection.DOWN.ordinal(), mRGBa); + .setupColor(ForgeDirection.DOWN.ordinal(), mRGBa); aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon()); if (mIconContainer.getOverlayIcon() != null) { lighting.setupColor(ForgeDirection.DOWN.ordinal(), 0xffffff); diff --git a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java index 4f534956c7..8578f32228 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java @@ -18,15 +18,15 @@ public class GT_UO_Dimension { if (aConfigCategory.containsKey("Dimension")) { aConfigCategory.get("Dimension").comment = "Dimension ID or Class Name"; Dimension = aConfigCategory.get("Dimension") - .getString(); + .getString(); } maxChance = 0; // GT_FML_LOGGER.info("GT UO "+aConfigCategory.getName()+" Dimension:"+Dimension); for (int i = 0; i < aConfigCategory.getChildren() - .size(); i++) { + .size(); i++) { GT_UO_Fluid fluid = new GT_UO_Fluid( - (ConfigCategory) aConfigCategory.getChildren() - .toArray()[i]); + (ConfigCategory) aConfigCategory.getChildren() + .toArray()[i]); fFluids.put(fluid.Registry, fluid); maxChance += fluid.Chance; } @@ -45,7 +45,7 @@ public class GT_UO_Dimension { public String getUOFluidKey(GT_UO_Fluid uoFluid) { return fFluids.inverse() - .get(uoFluid); + .get(uoFluid); } public GT_UO_Fluid getUOFluid(String key) { diff --git a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java index cd03380d8d..6beb8263e0 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java +++ b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java @@ -25,10 +25,9 @@ public class GT_UO_DimensionList { return fDimensionList.get(Integer.toString(aDimension)); for (BiMap.Entry dl : fDimensionList.entrySet()) if (DimensionManager.getProvider(aDimension) - .getClass() - .getName() - .contains(dl.getValue().Dimension)) - return dl.getValue(); + .getClass() + .getName() + .contains(dl.getValue().Dimension)) return dl.getValue(); return fDimensionList.get("Default"); } @@ -42,21 +41,21 @@ public class GT_UO_DimensionList { } public void SetConfigValues(String aDimensionName, String aDimension, String aName, String aRegistry, - int aMinAmount, int aMaxAmount, int aChance, int aDecreasePerOperationAmount) { + int aMinAmount, int aMaxAmount, int aChance, int aDecreasePerOperationAmount) { String Category = fCategory + "." + aDimensionName; fConfig.get(Category, "Dimension", aDimension) - .getString(); + .getString(); Category += "." + aName; fConfig.get(Category, "Registry", aRegistry) - .getString(); + .getString(); fConfig.get(Category, "MinAmount", aMinAmount) - .getInt(aMinAmount); + .getInt(aMinAmount); fConfig.get(Category, "MaxAmount", aMaxAmount) - .getInt(aMaxAmount); + .getInt(aMaxAmount); fConfig.get(Category, "Chance", aChance) - .getInt(aChance); + .getInt(aChance); fConfig.get(Category, "DecreasePerOperationAmount", aDecreasePerOperationAmount) - .getInt(aDecreasePerOperationAmount); + .getInt(aDecreasePerOperationAmount); // IT IS IN BUCKETS!!! } @@ -76,23 +75,23 @@ public class GT_UO_DimensionList { fConfig.setCategoryComment(fCategory, "Config Underground Fluids (Delete this Category for regenerate)"); fConfig.setCategoryComment( - fCategory + ".Default", - "Set Default Generating (Use this Category for Default settings)"); + fCategory + ".Default", + "Set Default Generating (Use this Category for Default settings)"); fConfig.setCategoryComment(fCategory + ".Overworld", "Set Overworld Generating"); fConfig.setCategoryComment(fCategory + ".Moon", "Set Moon Generating"); blackList = new int[] { -1, 1 }; blackList = aConfig.get(fCategory, "DimBlackList", blackList, "Dimension IDs Black List") - .getIntList(); + .getIntList(); java.util.Arrays.sort(blackList); for (int i = 0; i < fConfig.getCategory(fCategory) - .getChildren() - .size(); i++) { + .getChildren() + .size(); i++) { GT_UO_Dimension Dimension = new GT_UO_Dimension( - (ConfigCategory) fConfig.getCategory(fCategory) - .getChildren() - .toArray()[i]); + (ConfigCategory) fConfig.getCategory(fCategory) + .getChildren() + .toArray()[i]); fDimensionList.put(Dimension.Dimension, Dimension); } } diff --git a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java index 555d8856b2..7f9898e02e 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java @@ -20,30 +20,30 @@ public class GT_UO_Fluid { if (aConfigCategory.containsKey("Registry")) { aConfigCategory.get("Registry").comment = "Fluid registry name"; Registry = aConfigCategory.get("Registry") - .getString(); + .getString(); } if (aConfigCategory.containsKey("MaxAmount")) { - aConfigCategory.get( - "MaxAmount").comment = "Max amount generation (per operation, sets the VeinData) 80000 MAX"; + aConfigCategory + .get("MaxAmount").comment = "Max amount generation (per operation, sets the VeinData) 80000 MAX"; MaxAmount = aConfigCategory.get("MaxAmount") - .getInt(0); + .getInt(0); } if (aConfigCategory.containsKey("MinAmount")) { aConfigCategory.get("MinAmount").comment = "Min amount generation (per operation, sets the VeinData) 0 MIN"; MinAmount = aConfigCategory.get("MinAmount") - .getInt(0); + .getInt(0); } if (aConfigCategory.containsKey("Chance")) { - aConfigCategory.get( - "Chance").comment = "Chance generating (weighted chance!, there will be a fluid in chunk always!)"; + aConfigCategory + .get("Chance").comment = "Chance generating (weighted chance!, there will be a fluid in chunk always!)"; Chance = aConfigCategory.get("Chance") - .getInt(0); + .getInt(0); } if (aConfigCategory.containsKey("DecreasePerOperationAmount")) { aConfigCategory.get( - "DecreasePerOperationAmount").comment = "Decrease per operation (actual fluid gained works like (Litre)VeinData/5000)"; + "DecreasePerOperationAmount").comment = "Decrease per operation (actual fluid gained works like (Litre)VeinData/5000)"; DecreasePerOperationAmount = aConfigCategory.get("DecreasePerOperationAmount") - .getInt(5); + .getInt(5); } // GT_FML_LOGGER.info("GT UO "+aConfigCategory.getName()+" Fluid:"+Registry+" Max:"+MaxAmount+" // Min:"+MinAmount+" Chance:"+Chance); diff --git a/src/main/java/gregtech/api/objects/ItemData.java b/src/main/java/gregtech/api/objects/ItemData.java index 4fe0320ca7..c6a04bbb7e 100644 --- a/src/main/java/gregtech/api/objects/ItemData.java +++ b/src/main/java/gregtech/api/objects/ItemData.java @@ -23,8 +23,8 @@ public class ItemData { mMaterial = aMaterial == null ? null : new MaterialStack(aMaterial, aPrefix.mMaterialAmount); mBlackListed = aBlackListed; mByProducts = aPrefix.mSecondaryMaterial == null || aPrefix.mSecondaryMaterial.mMaterial == null - ? EMPTY_MATERIALSTACK_ARRAY - : new MaterialStack[] { aPrefix.mSecondaryMaterial.clone() }; + ? EMPTY_MATERIALSTACK_ARRAY + : new MaterialStack[] { aPrefix.mSecondaryMaterial.clone() }; } public ItemData(OrePrefixes aPrefix, Materials aMaterial) { @@ -39,7 +39,7 @@ public class ItemData { mByProducts = EMPTY_MATERIALSTACK_ARRAY; } else { MaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_MATERIALSTACK_ARRAY - : new MaterialStack[aByProducts.length]; + : new MaterialStack[aByProducts.length]; int j = 0; for (MaterialStack aByProduct : aByProducts) if (aByProduct != null && aByProduct.mMaterial != null) tByProducts[j++] = aByProduct.clone(); @@ -116,7 +116,7 @@ public class ItemData { public String toString() { if (mPrefix == null || mMaterial == null || mMaterial.mMaterial == null) return ""; return String.valueOf( - new StringBuilder().append(mPrefix.name()) - .append(mMaterial.mMaterial.mName)); + new StringBuilder().append(mPrefix.name()) + .append(mMaterial.mMaterial.mName)); } } diff --git a/src/main/java/gregtech/api/objects/MaterialStack.java b/src/main/java/gregtech/api/objects/MaterialStack.java index c2ce2f951a..0a433e0d99 100644 --- a/src/main/java/gregtech/api/objects/MaterialStack.java +++ b/src/main/java/gregtech/api/objects/MaterialStack.java @@ -32,8 +32,7 @@ public class MaterialStack implements Cloneable { if (aObject == null) return false; if (aObject instanceof Materials) return aObject == mMaterial; if (aObject instanceof MaterialStack) return ((MaterialStack) aObject).mMaterial == mMaterial - && (mAmount < 0 || ((MaterialStack) aObject).mAmount < 0 - || ((MaterialStack) aObject).mAmount == mAmount); + && (mAmount < 0 || ((MaterialStack) aObject).mAmount < 0 || ((MaterialStack) aObject).mAmount == mAmount); return false; } diff --git a/src/main/java/gregtech/api/objects/ObjMap.java b/src/main/java/gregtech/api/objects/ObjMap.java index 05205b92c4..bb15aab0d7 100644 --- a/src/main/java/gregtech/api/objects/ObjMap.java +++ b/src/main/java/gregtech/api/objects/ObjMap.java @@ -225,7 +225,7 @@ public class ObjMap { public static int arraySize(final int expected, final float f) { final long s = Math.max(2, nextPowerOfTwo((long) Math.ceil(expected / f))); if (s > (1 << 30)) throw new IllegalArgumentException( - "Too large (" + expected + " expected elements with load factor " + f + ")"); + "Too large (" + expected + " expected elements with load factor " + f + ")"); return (int) s; } diff --git a/src/main/java/gregtech/api/objects/XSTR.java b/src/main/java/gregtech/api/objects/XSTR.java index d9c0b4bdb1..3a71e9afab 100644 --- a/src/main/java/gregtech/api/objects/XSTR.java +++ b/src/main/java/gregtech/api/objects/XSTR.java @@ -40,8 +40,8 @@ public class XSTR extends Random { @Override public synchronized void setSeed(long seed) { if (!Thread.currentThread() - .getStackTrace()[2].getClassName() - .equals(Random.class.getName())) + .getStackTrace()[2].getClassName() + .equals(Random.class.getName())) throw new NoSuchMethodError("This is meant to be shared!, leave seed state alone!"); } }; @@ -245,7 +245,6 @@ public class XSTR extends Random { public void nextBytes(byte[] bytes_arr) { for (int iba = 0, lenba = bytes_arr.length; iba < lenba;) for (int rndba = nextInt(), nba = Math.min(lenba - iba, Integer.SIZE / Byte.SIZE); nba-- - > 0; rndba >>= Byte.SIZE) - bytes_arr[iba++] = (byte) rndba; + > 0; rndba >>= Byte.SIZE) bytes_arr[iba++] = (byte) rndba; } } diff --git a/src/main/java/gregtech/api/render/TextureFactory.java b/src/main/java/gregtech/api/render/TextureFactory.java index 06a883bd1c..6a49165ad4 100644 --- a/src/main/java/gregtech/api/render/TextureFactory.java +++ b/src/main/java/gregtech/api/render/TextureFactory.java @@ -49,7 +49,7 @@ public final class TextureFactory { */ public static ITexture of(final ITexture... textures) { return builder().addLayer(textures) - .build(); + .build(); } /** @@ -65,11 +65,11 @@ public final class TextureFactory { * @return The instance of an {@link ITexture} implementation */ public static ITexture of(final IIconContainer bottom, final IIconContainer top, final IIconContainer north, - final IIconContainer south, final IIconContainer west, final IIconContainer east, final short[] rgba) { + final IIconContainer south, final IIconContainer west, final IIconContainer east, final short[] rgba) { return builder().addIcon(bottom, top, north, south, west, east) - .setRGBA(rgba) - .setAllowAlpha(true) - .build(); + .setRGBA(rgba) + .setAllowAlpha(true) + .build(); } /** @@ -82,11 +82,11 @@ public final class TextureFactory { * @return The instance of an {@link ITexture} implementation */ public static ITexture of(final IIconContainer bottom, final IIconContainer top, final IIconContainer sides, - final short[] rgba) { + final short[] rgba) { return builder().addIcon(bottom, top, sides, sides, sides, sides) - .setRGBA(rgba) - .setAllowAlpha(true) - .build(); + .setRGBA(rgba) + .setAllowAlpha(true) + .build(); } /** @@ -99,20 +99,20 @@ public final class TextureFactory { */ public static ITexture of(final IIconContainer iconContainer, final short[] rgba, final boolean allowAlpha) { return builder().addIcon(iconContainer) - .setRGBA(rgba) - .setAllowAlpha(allowAlpha) - .build(); + .setRGBA(rgba) + .setAllowAlpha(allowAlpha) + .build(); } public static ITexture of(final IIconContainer iconContainer, final short[] rgba) { return builder().addIcon(iconContainer) - .setRGBA(rgba) - .build(); + .setRGBA(rgba) + .build(); } public static ITexture of(final IIconContainer iconContainer) { return builder().addIcon(iconContainer) - .build(); + .build(); } /** @@ -126,20 +126,20 @@ public final class TextureFactory { */ public static ITexture of(final Block block, final int meta, final ForgeDirection side, final short[] rgba) { return builder().setFromBlock(block, meta) - .setFromSide(side) - .setRGBA(rgba) - .build(); + .setFromSide(side) + .setRGBA(rgba) + .build(); } public static ITexture of(final Block block, final int meta, final ForgeDirection side) { return builder().setFromBlock(block, meta) - .setFromSide(side) - .build(); + .setFromSide(side) + .build(); } public static ITexture of(final Block block, final int meta) { return builder().setFromBlock(block, meta) - .build(); + .build(); } public static ITexture of(final Block block) { diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java b/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java index e4febba51f..c670307b5d 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java @@ -52,17 +52,17 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { // Now see if we should add the nearby blocks to the queue: // only add blocks the cable is connected to if (tTileEntity instanceof BaseMetaPipeEntity - && ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable) { + && ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable) { ChunkCoordinates tCoords; for (byte tSide : ALL_VALID_SIDES) { - if (((GT_MetaPipeEntity_Cable) ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity()).isConnectedAtSide( - tSide)) { + if (((GT_MetaPipeEntity_Cable) ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity()) + .isConnectedAtSide(tSide)) { final ForgeDirection offset = ForgeDirection.getOrientation(tSide); if (visited.add( - tCoords = new ChunkCoordinates( - aCoords.posX + offset.offsetX, - aCoords.posY + offset.offsetY, - aCoords.posZ + offset.offsetZ))) + tCoords = new ChunkCoordinates( + aCoords.posX + offset.offsetX, + aCoords.posY + offset.offsetY, + aCoords.posZ + offset.offsetZ))) tQueue.add(tCoords); } } @@ -70,13 +70,13 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { } } catch (Exception e) { GT_Mod.GT_FML_LOGGER.error( - "Well this update was broken... " + mCoords - + ", mWorld={" - + world.getProviderName() - + " @dimId " - + world.provider.dimensionId - + "}", - e); + "Well this update was broken... " + mCoords + + ", mWorld={" + + world.getProviderName() + + " @dimId " + + world.provider.dimensionId + + "}", + e); } } } diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java index f06c3ac06b..ceb6adfa7a 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java @@ -77,12 +77,12 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { public static void initExecutorService() { EXECUTOR_SERVICE = Executors.newFixedThreadPool( - Math.max( - 1, - (Runtime.getRuntime() - .availableProcessors() * 2 - / 3)), - THREAD_FACTORY); + Math.max( + 1, + (Runtime.getRuntime() + .availableProcessors() * 2 + / 3)), + THREAD_FACTORY); } public static void shutdownExecutorService() { @@ -95,7 +95,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { // Wait a while for tasks to respond to being cancelled if (!EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS)) { GT_Mod.GT_FML_LOGGER.error( - "Well this didn't terminated well... GT_Runnable_MachineBlockUpdate.shutdownExecutorService"); + "Well this didn't terminated well... GT_Runnable_MachineBlockUpdate.shutdownExecutorService"); } } } catch (InterruptedException ie) { @@ -104,7 +104,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { EXECUTOR_SERVICE.shutdownNow(); // Preserve interrupt status Thread.currentThread() - .interrupt(); + .interrupt(); } catch (Exception e) { GT_Mod.GT_FML_LOGGER.error("Well this didn't terminated well...", e); // (Re-)Cancel in case @@ -130,8 +130,8 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { try { tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); isMachineBlock = GregTech_API.isMachineBlock( - world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ), - world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ)); + world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ), + world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ)); } finally { GT_Proxy.TICK_LOCK.unlock(); } @@ -145,9 +145,9 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { // 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) { + || (tTileEntity instanceof IMachineBlockUpdateable + && ((IMachineBlockUpdateable) tTileEntity).isMachineBlockUpdateRecursive()) + || isMachineBlock) { ChunkCoordinates tCoords; if (visited.add(tCoords = new ChunkCoordinates(aCoords.posX + 1, aCoords.posY, aCoords.posZ))) @@ -166,13 +166,13 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { } } catch (Exception e) { GT_Mod.GT_FML_LOGGER.error( - "Well this update was broken... " + mCoords - + ", mWorld={" - + world.getProviderName() - + " @dimId " - + world.provider.dimensionId - + "}", - e); + "Well this update was broken... " + mCoords + + ", mWorld={" + + world.getProviderName() + + " @dimId " + + world.provider.dimensionId + + "}", + e); } } } diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java index dfee28cf47..b3c04bc233 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java @@ -15,7 +15,7 @@ public class GT_Runnable_Sound implements Runnable { private final float mSoundStrength, mSoundModulation; public GT_Runnable_Sound(World aWorld, double aX, double aY, double aZ, int aTimeUntilNextSound, - ResourceLocation aSoundResourceLocation, float aSoundStrength, float aSoundModulation) { + ResourceLocation aSoundResourceLocation, float aSoundStrength, float aSoundModulation) { mWorld = aWorld; mX = aX; mY = aY; @@ -30,16 +30,16 @@ public class GT_Runnable_Sound implements Runnable { * @deprecated Use {@link #GT_Runnable_Sound(World, double, double, double, int, ResourceLocation, float, float)} */ public GT_Runnable_Sound(World aWorld, int aX, int aY, int aZ, int aTimeUntilNextSound, - ResourceLocation aSoundResourceLocation, float aSoundStrength, float aSoundModulation) { + ResourceLocation aSoundResourceLocation, float aSoundStrength, float aSoundModulation) { this( - aWorld, - (double) aX + 0.5D, - (double) aY + 0.5D, - (double) aZ + 0.5D, - aTimeUntilNextSound, - aSoundResourceLocation, - aSoundStrength, - aSoundModulation); + aWorld, + (double) aX + 0.5D, + (double) aY + 0.5D, + (double) aZ + 0.5D, + aTimeUntilNextSound, + aSoundResourceLocation, + aSoundStrength, + aSoundModulation); } /** @@ -47,16 +47,16 @@ public class GT_Runnable_Sound implements Runnable { */ @Deprecated public GT_Runnable_Sound(World aWorld, int aX, int aY, int aZ, int aTimeUntilNextSound, String aSoundName, - float aSoundStrength, float aSoundModulation) { + float aSoundStrength, float aSoundModulation) { this( - aWorld, - (double) aX + 0.5D, - (double) aY + 0.5D, - (double) aZ + 0.5D, - aTimeUntilNextSound, - new ResourceLocation(aSoundName), - aSoundStrength, - aSoundModulation); + aWorld, + (double) aX + 0.5D, + (double) aY + 0.5D, + (double) aZ + 0.5D, + aTimeUntilNextSound, + new ResourceLocation(aSoundName), + aSoundStrength, + aSoundModulation); } @Override diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSection.java b/src/main/java/gregtech/api/util/ColorsMetadataSection.java index 05d0bd4059..fb9cc6dd56 100644 --- a/src/main/java/gregtech/api/util/ColorsMetadataSection.java +++ b/src/main/java/gregtech/api/util/ColorsMetadataSection.java @@ -18,7 +18,7 @@ public class ColorsMetadataSection implements IMetadataSection { private final boolean guiTintEnabled; public ColorsMetadataSection(Map hexTextColorMap, Map hexGuiTintMap, - boolean guiTintEnabled) { + boolean guiTintEnabled) { this.hexTextColors = hexTextColorMap; this.textColors = convertHexMapToIntMap(hexTextColorMap); @@ -54,7 +54,7 @@ public class ColorsMetadataSection implements IMetadataSection { private boolean isColorInMap(String key, Map hexMap) { return hexMap.containsKey(key) && !hexMap.get(key) - .isEmpty(); + .isEmpty(); } public boolean sGuiTintingEnabled() { diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java index ae480343b2..f898049e46 100644 --- a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java +++ b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java @@ -22,7 +22,7 @@ import gregtech.api.enums.Dyes; public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializer { public ColorsMetadataSection deserialize(JsonElement metadataColors, Type type, - JsonDeserializationContext context) { + JsonDeserializationContext context) { // Default values boolean enableGuiTint = GregTech_API.sColoredGUI; Map hexGuiTintMap = new HashMap<>(); @@ -33,11 +33,11 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ JsonObject textColors = JsonUtils.func_152754_s(jsonObject, "textColor"); for (Map.Entry entry : textColors.entrySet()) { if (entry.getValue() - .isJsonPrimitive()) { + .isJsonPrimitive()) { hexTextColorMap.put( - entry.getKey(), - entry.getValue() - .getAsString()); + entry.getKey(), + entry.getValue() + .getAsString()); } else { GT_Mod.GT_FML_LOGGER.warn("ColorOverride expects primitive value for key `textColor`"); } @@ -46,10 +46,8 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ if (jsonObject.has("guiTint")) { JsonObject guiTints = JsonUtils.func_152754_s(jsonObject, "guiTint"); - enableGuiTint = JsonUtils.getJsonObjectBooleanFieldValueOrDefault( - guiTints, - "enableGuiTintWhenPainted", - true); + enableGuiTint = JsonUtils + .getJsonObjectBooleanFieldValueOrDefault(guiTints, "enableGuiTintWhenPainted", true); for (Dyes dye : Dyes.values()) { hexGuiTintMap.put(dye.mName, GT_Util.toHexString(dye.getRGBA())); @@ -58,8 +56,8 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ for (String key : hexGuiTintMap.keySet()) { if (enableGuiTint) { hexGuiTintMap.replace( - key, - JsonUtils.getJsonObjectStringFieldValueOrDefault(guiTints, key, hexGuiTintMap.get(key))); + key, + JsonUtils.getJsonObjectStringFieldValueOrDefault(guiTints, key, hexGuiTintMap.get(key))); } else { hexGuiTintMap.replace(key, GT_Util.toHexString(Dyes.dyeWhite.getRGBA())); } diff --git a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java index 71c1e4716b..de46309a9f 100644 --- a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java +++ b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java @@ -141,12 +141,12 @@ public enum GT_ApiaryUpgrade { void apply(Consumer fn) { UNIQUE_UPGRADE_LIST.get(this) - .forEach(fn); + .forEach(fn); } } private static final EnumMap> UNIQUE_UPGRADE_LIST = new EnumMap<>( - UNIQUE_INDEX.class); + UNIQUE_INDEX.class); private int meta = 0; private int maxnumber = 1; @@ -158,7 +158,7 @@ public enum GT_ApiaryUpgrade { private final HashSet blacklistedUpgrades = new HashSet<>(); GT_ApiaryUpgrade(UNIQUE_INDEX unique_index, int meta, int maxnumber, - BiConsumer applier) { + BiConsumer applier) { this.unique_index = unique_index; this.meta = meta; this.maxnumber = maxnumber; @@ -211,7 +211,7 @@ public enum GT_ApiaryUpgrade { static { EnumSet.allOf(GT_ApiaryUpgrade.class) - .forEach(GT_ApiaryUpgrade::setup_static_variables); + .forEach(GT_ApiaryUpgrade::setup_static_variables); speed8upgraded.blacklistedUpgrades.add(production.id); production.blacklistedUpgrades.add(speed8upgraded.id); } diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java index 7dc15f994d..b53cc4ba07 100644 --- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java +++ b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java @@ -137,9 +137,9 @@ public class GT_AssemblyLineUtils { } } if (!aTag.hasKey("output") || !aTag.hasKey("time") - || aTag.getInteger("time") <= 0 - || !aTag.hasKey("eu") - || !GT_Utility.isStackValid(aOutput)) { + || aTag.getInteger("time") <= 0 + || !aTag.hasKey("eu") + || !GT_Utility.isStackValid(aOutput)) { return LookupResultType.INVALID_STICK.getResult(); } if (GT_Values.D1) { @@ -152,14 +152,14 @@ public class GT_AssemblyLineUtils { // Try build a recipe instance if (aReturnBuiltRecipe) { return LookupResultType.VALID_STACK_AND_VALID_HASH.getResult( - new GT_Recipe_AssemblyLine( - null, - 0, - aInputs.toArray(new ItemStack[0]), - aFluidInputs.toArray(new FluidStack[0]), - aOutput, - aTime, - aEU)); + new GT_Recipe_AssemblyLine( + null, + 0, + aInputs.toArray(new ItemStack[0]), + aFluidInputs.toArray(new FluidStack[0]), + aOutput, + aTime, + aEU)); } for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { @@ -192,7 +192,7 @@ public class GT_AssemblyLineUtils { private static boolean areStacksEqual(ItemStack[] lhs, List rhs) { return lhs == null ? rhs.isEmpty() - : !rhs.isEmpty() && GT_Utility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true); + : !rhs.isEmpty() && GT_Utility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true); } /** @@ -279,8 +279,8 @@ public class GT_AssemblyLineUtils { */ public static boolean doesDataStickHaveOutput(ItemStack aDataStick) { if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound() - && aDataStick.getTagCompound() - .hasKey("output")) { + && aDataStick.getTagCompound() + .hasKey("output")) { return true; } return false; @@ -312,7 +312,7 @@ public class GT_AssemblyLineUtils { if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound()) { NBTTagCompound aNBT = aDataStick.getTagCompound(); if (aNBT.hasKey("Data.Recipe.Hash") && !aNBT.getString("Data.Recipe.Hash") - .equals("Hash.0")) { + .equals("Hash.0")) { return true; } } @@ -378,8 +378,8 @@ public class GT_AssemblyLineUtils { if (isItemDataStick(aDataStick)) { String s = aNewRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName()); if (s == null) { s = aNewRecipe.mOutput.getDisplayName(); @@ -390,11 +390,11 @@ public class GT_AssemblyLineUtils { if (GT_Values.D1) { GT_Recipe_AssemblyLine aOldRecipe = findAssemblyLineRecipeFromDataStick(aDataStick, true).recipe; GT_FML_LOGGER.info( - "Updating data stick: " + aDataStick.getDisplayName() - + " | Old Recipe Hash: " - + generateRecipeHash(aOldRecipe) - + ", New Recipe Hash: " - + aHash); + "Updating data stick: " + aDataStick.getDisplayName() + + " | Old Recipe Hash: " + + generateRecipeHash(aOldRecipe) + + ", New Recipe Hash: " + + aHash); } String author = "Assembling Line Recipe Generator"; @@ -445,20 +445,20 @@ public class GT_AssemblyLineUtils { NBTTagList tNBTList = new NBTTagList(); s = aNewRecipe.mOutput.getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName()); if (s == null) s = aNewRecipe.mOutput.getDisplayName(); } tNBTList.appendTag( - new NBTTagString( - "Construction plan for " + aNewRecipe.mOutput.stackSize - + " " - + s - + ". Needed EU/t: " - + aNewRecipe.mEUt - + " Production time: " - + (aNewRecipe.mDuration / 20))); + new NBTTagString( + "Construction plan for " + aNewRecipe.mOutput.stackSize + + " " + + s + + ". Needed EU/t: " + + aNewRecipe.mEUt + + " Production time: " + + (aNewRecipe.mDuration / 20))); for (int i = 0; i < aNewRecipe.mInputs.length; i++) { if (aNewRecipe.mOreDictAlt[i] != null) { int count = 0; @@ -467,16 +467,16 @@ public class GT_AssemblyLineUtils { if (tStack != null) { s = tStack.getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName()); if (s == null) s = tStack.getDisplayName(); } tBuilder.append(count == 0 ? "" : "\nOr ") - .append(tStack.stackSize) - .append(" ") - .append(s); + .append(tStack.stackSize) + .append(" ") + .append(s); count++; } } @@ -484,28 +484,27 @@ public class GT_AssemblyLineUtils { } else if (aNewRecipe.mInputs[i] != null) { s = aNewRecipe.mInputs[i].getDisplayName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mInputs[i].getDisplayName()); if (s == null) s = aNewRecipe.mInputs[i].getDisplayName(); } tNBTList.appendTag( - new NBTTagString( - "Input Bus " + (i + 1) + ": " + aNewRecipe.mInputs[i].stackSize + " " + s)); + new NBTTagString("Input Bus " + (i + 1) + ": " + aNewRecipe.mInputs[i].stackSize + " " + s)); } } for (int i = 0; i < aNewRecipe.mFluidInputs.length; i++) { if (aNewRecipe.mFluidInputs[i] != null) { s = aNewRecipe.mFluidInputs[i].getLocalizedName(); if (FMLCommonHandler.instance() - .getEffectiveSide() - .isServer()) { + .getEffectiveSide() + .isServer()) { s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mFluidInputs[i].getLocalizedName()); if (s == null) s = aNewRecipe.mFluidInputs[i].getLocalizedName(); } tNBTList.appendTag( - new NBTTagString( - "Input Hatch " + (i + 1) + ": " + aNewRecipe.mFluidInputs[i].amount + "L " + s)); + new NBTTagString( + "Input Hatch " + (i + 1) + ": " + aNewRecipe.mFluidInputs[i].amount + "L " + s)); } } tNBT.setTag("pages", tNBTList); diff --git a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java b/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java index 7a1515ec0c..e5889a6442 100644 --- a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java +++ b/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java @@ -18,19 +18,19 @@ public class GT_Assemblyline_Server { public static LinkedHashMap lServerNames = new LinkedHashMap<>(); private static LinkedHashMap internal2 = new LinkedHashMap<>(), internal3 = new LinkedHashMap<>(), - internal4 = new LinkedHashMap<>(); + internal4 = new LinkedHashMap<>(); private static HashMap internal = new HashMap<>(); public static void fillMap(FMLPreInitializationEvent aEvent) { String s = new String( - aEvent.getModConfigurationDirectory() - .getAbsolutePath()); + aEvent.getModConfigurationDirectory() + .getAbsolutePath()); s = s.substring( - 0, - aEvent.getModConfigurationDirectory() - .getAbsolutePath() - .length() - 6); + 0, + aEvent.getModConfigurationDirectory() + .getAbsolutePath() + .length() - 6); s = s + "GregTech.lang"; File f = new File(s); s = ""; @@ -41,43 +41,38 @@ public class GT_Assemblyline_Server { for (Map.Entry entry : internal.entrySet()) { try { s = entry.getValue() - .getString() - .replaceAll("%", ""); + .getString() + .replaceAll("%", ""); if (entry.getKey() - .contains("metaitem") - && s.contains("material")) - internal2.put(entry.getKey(), s); + .contains("metaitem") && s.contains("material")) internal2.put(entry.getKey(), s); else if (entry.getKey() - .contains("blockmachines") - && s.contains("material")) - internal3.put(entry.getKey(), s); + .contains("blockmachines") && s.contains("material")) internal3.put(entry.getKey(), s); else if ((entry.getKey() - .contains("blockores") - || (entry.getKey() - .contains("blockmetal") - || entry.getKey() - .contains("blockgem"))) - && s.contains("material")) - internal4.put(entry.getKey(), s); + .contains("blockores") + || (entry.getKey() + .contains("blockmetal") + || entry.getKey() + .contains("blockgem"))) + && s.contains("material")) internal4.put(entry.getKey(), s); else lServerNames.put(entry.getKey(), s); } catch (Exception ignored) {} } for (Map.Entry entry : internal2.entrySet()) { try { if (entry.getKey() - .contains("name")) { + .contains("name")) { int i = Integer.parseInt( - entry.getKey() - .substring( - "gt.metaitem.01.".length(), - entry.getKey() - .length() - ".name".length())); + entry.getKey() + .substring( + "gt.metaitem.01.".length(), + entry.getKey() + .length() - ".name".length())); i = i % 1000; if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); + entry.getKey(), + entry.getValue() + .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); else lServerNames.put(entry.getKey(), null); } } catch (Exception ignored) {} @@ -85,237 +80,225 @@ public class GT_Assemblyline_Server { for (Map.Entry entry : internal3.entrySet()) { try { if (entry.getKey() - .contains("cable")) + .contains("cable")) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.cable.".length(), - entry.getKey() - .length() - ".01.name".length()))); + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.cable.".length(), + entry.getKey() + .length() - ".01.name".length()))); else if (entry.getKey() - .contains("gt_frame_")) + .contains("gt_frame_")) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_frame_".length(), - entry.getKey() - .length() - ".name".length()))); + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_frame_".length(), + entry.getKey() + .length() - ".name".length()))); else if (entry.getKey() - .contains("gt_pipe_")) { - if (!entry.getKey() - .contains("_huge") - && !entry.getKey() - .contains("_large") - && !entry.getKey() - .contains("_nonuple") - && !entry.getKey() - .contains("_quadruple") - && !entry.getKey() - .contains("_small") - && !entry.getKey() - .contains("_tiny")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - ".name".length()))); - else if (entry.getKey() - .contains("_huge") - || entry.getKey() - .contains("_tiny")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_tiny.name".length()))); - else if (entry.getKey() - .contains("_large") - || entry.getKey() - .contains("_small")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_large.name".length()))); - else if (entry.getKey() - .contains("_nonuple")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_nonuple.name".length()))); - else if (entry.getKey() - .contains("_quadruple")) - lServerNames.put( - entry.getKey(), - entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.gt_pipe_".length(), - entry.getKey() - .length() - "_quadruple.name".length()))); - } else - if (entry.getKey() - .contains("wire")) - lServerNames.put( + .contains("gt_pipe_")) { + if (!entry.getKey() + .contains("_huge") + && !entry.getKey() + .contains("_large") + && !entry.getKey() + .contains("_nonuple") + && !entry.getKey() + .contains("_quadruple") + && !entry.getKey() + .contains("_small") + && !entry.getKey() + .contains("_tiny")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - ".name".length()))); + else if (entry.getKey() + .contains("_huge") + || entry.getKey() + .contains("_tiny")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_tiny.name".length()))); + else if (entry.getKey() + .contains("_large") + || entry.getKey() + .contains("_small")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_large.name".length()))); + else if (entry.getKey() + .contains("_nonuple")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_nonuple.name".length()))); + else if (entry.getKey() + .contains("_quadruple")) + lServerNames.put( entry.getKey(), entry.getValue() - .replace( - "material", - entry.getKey() - .substring( - "gt.blockmachines.wire.".length(), - entry.getKey() - .length() - ".01.name".length()))); - else lServerNames.put(entry.getKey(), entry.getValue()); + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.gt_pipe_".length(), + entry.getKey() + .length() - "_quadruple.name".length()))); + } else if (entry.getKey() + .contains("wire")) + lServerNames.put( + entry.getKey(), + entry.getValue() + .replace( + "material", + entry.getKey() + .substring( + "gt.blockmachines.wire.".length(), + entry.getKey() + .length() - ".01.name".length()))); + else lServerNames.put(entry.getKey(), entry.getValue()); } catch (Exception ignored) {} } for (Map.Entry entry : internal4.entrySet()) { try { if (entry.getKey() - .contains("blockores")) { + .contains("blockores")) { int i = Integer.parseInt( - entry.getKey() - .substring( - "gt.blockores.".length(), - entry.getKey() - .length() - ".name".length())); + entry.getKey() + .substring( + "gt.blockores.".length(), + entry.getKey() + .length() - ".name".length())); i = i % 1000; if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put( - entry.getKey(), - entry.getValue() - .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); + entry.getKey(), + entry.getValue() + .replace("material", GregTech_API.sGeneratedMaterials[i].toString())); else lServerNames.put(entry.getKey(), null); } else if (entry.getKey() - .contains("blockmetal")) { - Materials[] mMats = null; - String t = entry.getKey() - .substring("gt.blockmetal".length()); - t = t.substring(0, 1); - int i = Integer.parseInt(t); - switch (i) { - case 1 -> mMats = new Materials[] { Materials.Adamantium, Materials.Aluminium, - Materials.Americium, Materials.AnnealedCopper, Materials.Antimony, - Materials.Arsenic, Materials.AstralSilver, Materials.BatteryAlloy, - Materials.Beryllium, Materials.Bismuth, Materials.BismuthBronze, - Materials.BlackBronze, Materials.BlackSteel, Materials.BlueAlloy, - Materials.BlueSteel, Materials.Brass }; - case 2 -> mMats = new Materials[] { Materials.Bronze, Materials.Caesium, - Materials.Cerium, Materials.Chrome, Materials.ChromiumDioxide, - Materials.Cobalt, Materials.CobaltBrass, Materials.Copper, - Materials.Cupronickel, Materials.DamascusSteel, Materials.DarkIron, - Materials.DeepIron, Materials.Desh, Materials.Duranium, - Materials.Dysprosium, Materials.Electrum }; - case 3 -> mMats = new Materials[] { Materials.ElectrumFlux, Materials.Enderium, - Materials.Erbium, Materials.Europium, Materials.FierySteel, - Materials.Gadolinium, Materials.Gallium, Materials.Holmium, - Materials.HSLA, Materials.Indium, Materials.InfusedGold, - Materials.Invar, Materials.Iridium, Materials.IronMagnetic, - Materials.IronWood, Materials.Kanthal }; - case 4 -> mMats = new Materials[] { Materials.Knightmetal, Materials.Lanthanum, - Materials.Lead, Materials.Lutetium, Materials.Magnalium, - Materials.Magnesium, Materials.Manganese, Materials.MeteoricIron, - Materials.MeteoricSteel, Materials.Trinium, Materials.Mithril, - Materials.Molybdenum, Materials.Naquadah, Materials.NaquadahAlloy, - Materials.NaquadahEnriched, Materials.Naquadria }; - case 5 -> mMats = new Materials[] { Materials.Neodymium, - Materials.NeodymiumMagnetic, Materials.Neutronium, Materials.Nichrome, - Materials.Nickel, Materials.Niobium, Materials.NiobiumNitride, - Materials.NiobiumTitanium, Materials.Osmiridium, Materials.Osmium, - Materials.Palladium, Materials.PigIron, Materials.Platinum, - Materials.Plutonium, Materials.Plutonium241, Materials.Praseodymium }; - case 6 -> mMats = new Materials[] { Materials.Promethium, Materials.RedAlloy, - Materials.RedSteel, Materials.RoseGold, Materials.Rubidium, - Materials.Samarium, Materials.Scandium, Materials.ShadowIron, - Materials.ShadowSteel, Materials.Silicon, Materials.Silver, - Materials.SolderingAlloy, Materials.StainlessSteel, Materials.Steel, - Materials.SteelMagnetic, Materials.SterlingSilver }; - case 7 -> mMats = new Materials[] { Materials.Sunnarium, Materials.Tantalum, - Materials.Tellurium, Materials.Terbium, Materials.Thaumium, - Materials.Thorium, Materials.Thulium, Materials.Tin, Materials.TinAlloy, - Materials.Titanium, Materials.Tritanium, Materials.Tungsten, - Materials.TungstenSteel, Materials.Ultimet, Materials.Uranium, - Materials.Uranium235 }; - case 8 -> mMats = new Materials[] { Materials.Vanadium, - Materials.VanadiumGallium, Materials.WroughtIron, Materials.Ytterbium, - Materials.Yttrium, Materials.YttriumBariumCuprate, Materials.Zinc, - Materials.TungstenCarbide, Materials.VanadiumSteel, Materials.HSSG, - Materials.HSSE, Materials.HSSS, Materials.Steeleaf, Materials.Ichorium, - Materials.Firestone }; - } - t = entry.getKey() - .substring( - "gt.blockmetal1.".length(), - entry.getKey() - .length() - ".name".length()); - i = Integer.parseInt(t); - lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); - mMats = null; - } else - if (entry.getKey() - .contains("blockgem")) { - Materials[] mMats = null; - String t = entry.getKey() - .substring("gt.blockgem".length()); - t = t.substring(0, 1); - int i = Integer.parseInt(t); - switch (i) { - case 1 -> mMats = new Materials[] { Materials.InfusedAir, Materials.Amber, - Materials.Amethyst, Materials.InfusedWater, Materials.BlueTopaz, - Materials.CertusQuartz, Materials.Dilithium, Materials.EnderEye, - Materials.EnderPearl, Materials.FoolsRuby, Materials.Force, - Materials.Forcicium, Materials.Forcillium, Materials.GreenSapphire, - Materials.InfusedFire, Materials.Jasper, MaterialsBotania.ManaDiamond, - MaterialsBotania.BotaniaDragonstone }; - case 2 -> mMats = new Materials[] { Materials.Lazurite, Materials.Lignite, - Materials.Monazite, Materials.Niter, Materials.Olivine, Materials.Opal, - Materials.InfusedOrder, Materials.InfusedEntropy, Materials.Phosphorus, - Materials.Quartzite, Materials.GarnetRed, Materials.Ruby, - Materials.Sapphire, Materials.Sodalite, Materials.Tanzanite, - Materials.InfusedEarth }; - case 3 -> mMats = new Materials[] { Materials.Topaz, Materials.Vinteum, - Materials.GarnetYellow, Materials.NetherStar, Materials.Charcoal, - Materials.Blaze }; - } - t = entry.getKey() - .substring( - "gt.blockgem1.".length(), - entry.getKey() - .length() - ".name".length()); - i = Integer.parseInt(t); - lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); - mMats = null; - } + .contains("blockmetal")) { + Materials[] mMats = null; + String t = entry.getKey() + .substring("gt.blockmetal".length()); + t = t.substring(0, 1); + int i = Integer.parseInt(t); + switch (i) { + case 1 -> mMats = new Materials[] { Materials.Adamantium, Materials.Aluminium, + Materials.Americium, Materials.AnnealedCopper, Materials.Antimony, Materials.Arsenic, + Materials.AstralSilver, Materials.BatteryAlloy, Materials.Beryllium, Materials.Bismuth, + Materials.BismuthBronze, Materials.BlackBronze, Materials.BlackSteel, + Materials.BlueAlloy, Materials.BlueSteel, Materials.Brass }; + case 2 -> mMats = new Materials[] { Materials.Bronze, Materials.Caesium, Materials.Cerium, + Materials.Chrome, Materials.ChromiumDioxide, Materials.Cobalt, Materials.CobaltBrass, + Materials.Copper, Materials.Cupronickel, Materials.DamascusSteel, Materials.DarkIron, + Materials.DeepIron, Materials.Desh, Materials.Duranium, Materials.Dysprosium, + Materials.Electrum }; + case 3 -> mMats = new Materials[] { Materials.ElectrumFlux, Materials.Enderium, + Materials.Erbium, Materials.Europium, Materials.FierySteel, Materials.Gadolinium, + Materials.Gallium, Materials.Holmium, Materials.HSLA, Materials.Indium, + Materials.InfusedGold, Materials.Invar, Materials.Iridium, Materials.IronMagnetic, + Materials.IronWood, Materials.Kanthal }; + case 4 -> mMats = new Materials[] { Materials.Knightmetal, Materials.Lanthanum, + Materials.Lead, Materials.Lutetium, Materials.Magnalium, Materials.Magnesium, + Materials.Manganese, Materials.MeteoricIron, Materials.MeteoricSteel, Materials.Trinium, + Materials.Mithril, Materials.Molybdenum, Materials.Naquadah, Materials.NaquadahAlloy, + Materials.NaquadahEnriched, Materials.Naquadria }; + case 5 -> mMats = new Materials[] { Materials.Neodymium, Materials.NeodymiumMagnetic, + Materials.Neutronium, Materials.Nichrome, Materials.Nickel, Materials.Niobium, + Materials.NiobiumNitride, Materials.NiobiumTitanium, Materials.Osmiridium, + Materials.Osmium, Materials.Palladium, Materials.PigIron, Materials.Platinum, + Materials.Plutonium, Materials.Plutonium241, Materials.Praseodymium }; + case 6 -> mMats = new Materials[] { Materials.Promethium, Materials.RedAlloy, + Materials.RedSteel, Materials.RoseGold, Materials.Rubidium, Materials.Samarium, + Materials.Scandium, Materials.ShadowIron, Materials.ShadowSteel, Materials.Silicon, + Materials.Silver, Materials.SolderingAlloy, Materials.StainlessSteel, Materials.Steel, + Materials.SteelMagnetic, Materials.SterlingSilver }; + case 7 -> mMats = new Materials[] { Materials.Sunnarium, Materials.Tantalum, + Materials.Tellurium, Materials.Terbium, Materials.Thaumium, Materials.Thorium, + Materials.Thulium, Materials.Tin, Materials.TinAlloy, Materials.Titanium, + Materials.Tritanium, Materials.Tungsten, Materials.TungstenSteel, Materials.Ultimet, + Materials.Uranium, Materials.Uranium235 }; + case 8 -> mMats = new Materials[] { Materials.Vanadium, Materials.VanadiumGallium, + Materials.WroughtIron, Materials.Ytterbium, Materials.Yttrium, + Materials.YttriumBariumCuprate, Materials.Zinc, Materials.TungstenCarbide, + Materials.VanadiumSteel, Materials.HSSG, Materials.HSSE, Materials.HSSS, + Materials.Steeleaf, Materials.Ichorium, Materials.Firestone }; + } + t = entry.getKey() + .substring( + "gt.blockmetal1.".length(), + entry.getKey() + .length() - ".name".length()); + i = Integer.parseInt(t); + lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); + mMats = null; + } else if (entry.getKey() + .contains("blockgem")) { + Materials[] mMats = null; + String t = entry.getKey() + .substring("gt.blockgem".length()); + t = t.substring(0, 1); + int i = Integer.parseInt(t); + switch (i) { + case 1 -> mMats = new Materials[] { Materials.InfusedAir, Materials.Amber, + Materials.Amethyst, Materials.InfusedWater, Materials.BlueTopaz, + Materials.CertusQuartz, Materials.Dilithium, Materials.EnderEye, + Materials.EnderPearl, Materials.FoolsRuby, Materials.Force, Materials.Forcicium, + Materials.Forcillium, Materials.GreenSapphire, Materials.InfusedFire, + Materials.Jasper, MaterialsBotania.ManaDiamond, + MaterialsBotania.BotaniaDragonstone }; + case 2 -> mMats = new Materials[] { Materials.Lazurite, Materials.Lignite, + Materials.Monazite, Materials.Niter, Materials.Olivine, Materials.Opal, + Materials.InfusedOrder, Materials.InfusedEntropy, Materials.Phosphorus, + Materials.Quartzite, Materials.GarnetRed, Materials.Ruby, Materials.Sapphire, + Materials.Sodalite, Materials.Tanzanite, Materials.InfusedEarth }; + case 3 -> mMats = new Materials[] { Materials.Topaz, Materials.Vinteum, + Materials.GarnetYellow, Materials.NetherStar, Materials.Charcoal, Materials.Blaze }; + } + t = entry.getKey() + .substring( + "gt.blockgem1.".length(), + entry.getKey() + .length() - ".name".length()); + i = Integer.parseInt(t); + lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString()); + mMats = null; + } } catch (Exception ignored) {} } diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java index 12e6b86019..f3337a8c0a 100644 --- a/src/main/java/gregtech/api/util/GT_BaseCrop.java +++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java @@ -57,28 +57,27 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size */ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, - int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, - int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, - ItemStack[] aSpecialDrops) { + int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, + int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop, ItemStack[] aSpecialDrops) { new GT_BaseCrop( - aID, - aCropName, - aDiscoveredBy, - aBaseSeed, - aTier, - aMaxSize, - aGrowthSpeed, - aAfterHarvestSize, - aHarvestSize, - aStatChemical, - aStatFood, - aStatDefensive, - aStatColor, - aStatWeed, - aAttributes, - null, - aDrop, - aSpecialDrops); + aID, + aCropName, + aDiscoveredBy, + aBaseSeed, + aTier, + aMaxSize, + aGrowthSpeed, + aAfterHarvestSize, + aHarvestSize, + aStatChemical, + aStatFood, + aStatDefensive, + aStatColor, + aStatWeed, + aAttributes, + null, + aDrop, + aSpecialDrops); } /** @@ -96,9 +95,9 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { * @param aBlock the block below needed for crop to grow. If null no block needed */ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, - int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, - int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, - ItemStack[] aSpecialDrops) { + int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, + int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, + ItemStack[] aSpecialDrops) { mName = aCropName; aID = GT_Config.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID); if (aDiscoveredBy != null && !aDiscoveredBy.equals(E)) mDiscoveredBy = aDiscoveredBy; @@ -126,13 +125,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (bIc2NeiLoaded) { try { Class.forName("speiger.src.crops.api.CropPluginAPI") - .getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo")) - .invoke( - Class.forName("speiger.src.crops.api.CropPluginAPI") - .getField("instance"), - this); + .getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo")) + .invoke( + Class.forName("speiger.src.crops.api.CropPluginAPI") + .getField("instance"), + this); } catch (IllegalAccessException | ClassNotFoundException | SecurityException | NoSuchMethodException - | NoSuchFieldException | InvocationTargetException | IllegalArgumentException ex) { + | NoSuchFieldException | InvocationTargetException | IllegalArgumentException ex) { bIc2NeiLoaded = false; } } @@ -207,11 +206,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { public ItemStack getGain(ICropTile aCrop) { int tDrop = 0; if (mSpecialDrops != null && (tDrop = java.util.concurrent.ThreadLocalRandom.current() - .nextInt( - 0, - (mSpecialDrops.length * 2) - + 2)) - < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { + .nextInt(0, (mSpecialDrops.length * 2) + 2)) < mSpecialDrops.length && mSpecialDrops[tDrop] != null) { return GT_Utility.copyOrNull(mSpecialDrops[tDrop]); } return GT_Utility.copyOrNull(mDrop); @@ -234,19 +229,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { } for (int i = 1; i < this.getrootslength(aCrop); i++) { Block tBlock = aCrop.getWorld() - .getBlock( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); if ((tBlock instanceof GT_Block_Ores_Abstract)) { TileEntity tTileEntity = aCrop.getWorld() - .getTileEntity( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getTileEntity(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000)]; + % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { if (tMaterial == mBlock) { return true; @@ -257,18 +246,14 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { } } else { int tMetaID = aCrop.getWorld() - .getBlockMetadata( - aCrop.getLocation().posX, - aCrop.getLocation().posY - i, - aCrop.getLocation().posZ); + .getBlockMetadata(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ); ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() - .startsWith("ore")) - && (tAssotiation.mMaterial.mMaterial == mBlock)) { + .startsWith("ore")) && (tAssotiation.mMaterial.mMaterial == mBlock)) { return true; } if ((tAssotiation != null) && (tAssotiation.mPrefix == OrePrefixes.block) - && (tAssotiation.mMaterial.mMaterial == mBlock)) { + && (tAssotiation.mMaterial.mMaterial == mBlock)) { return true; } } @@ -293,10 +278,10 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo { if (mBlock != null) { ArrayList result = new ArrayList<>(1); result.add( - String.format( - "Requires %s Ore or Block of %s as soil block to reach full growth.", - mBlock.mName, - mBlock.mName)); + String.format( + "Requires %s Ore or Block of %s as soil block to reach full growth.", + mBlock.mName, + mBlock.mName)); return result; } return null; diff --git a/src/main/java/gregtech/api/util/GT_CLS_Compat.java b/src/main/java/gregtech/api/util/GT_CLS_Compat.java index 4dff5f65f9..0d3864e26f 100644 --- a/src/main/java/gregtech/api/util/GT_CLS_Compat.java +++ b/src/main/java/gregtech/api/util/GT_CLS_Compat.java @@ -45,24 +45,24 @@ public class GT_CLS_Compat { } Optional.ofNullable(alexiilMinecraftDisplayer) - .ifPresent(e -> { - try { - getLastPercent = e.getMethod("getLastPercent"); - isReplacingVanillaMaterials = e.getField("isReplacingVanillaMaterials"); - isRegisteringGTmaterials = e.getField("isRegisteringGTmaterials"); - } catch (NoSuchMethodException | NoSuchFieldException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); - } - }); + .ifPresent(e -> { + try { + getLastPercent = e.getMethod("getLastPercent"); + isReplacingVanillaMaterials = e.getField("isReplacingVanillaMaterials"); + isRegisteringGTmaterials = e.getField("isRegisteringGTmaterials"); + } catch (NoSuchMethodException | NoSuchFieldException ex) { + GT_Mod.GT_FML_LOGGER.catching(ex); + } + }); Optional.ofNullable(alexiilProgressDisplayer) - .ifPresent(e -> { - try { - displayProgress = e.getMethod("displayProgress", String.class, float.class); - } catch (NoSuchMethodException ex) { - GT_Mod.GT_FML_LOGGER.catching(ex); - } - }); + .ifPresent(e -> { + try { + displayProgress = e.getMethod("displayProgress", String.class, float.class); + } catch (NoSuchMethodException ex) { + GT_Mod.GT_FML_LOGGER.catching(ex); + } + }); try { progressBarStep = cpwProgressBar.getDeclaredField("step"); @@ -75,7 +75,7 @@ public class GT_CLS_Compat { private GT_CLS_Compat() {} private static void registerAndReportProgression(String materialsType, Collection materials, - ProgressManager.ProgressBar progressBar, Function getName, Consumer action) { + ProgressManager.ProgressBar progressBar, Function getName, Consumer action) { int sizeStep = materials.size(); final long progressionReportsEvery = 100; final long bakingMsgEvery = 1000; @@ -89,7 +89,7 @@ public class GT_CLS_Compat { if (nextProgressionReportAt < now) { nextProgressionReportAt = now + progressionReportsEvery; String materialName = getName.apply(m) - .toString(); + .toString(); try { displayProgress.invoke(null, materialName, (float) currentStep / sizeStep); } catch (IllegalAccessException | InvocationTargetException iae) { @@ -104,8 +104,8 @@ public class GT_CLS_Compat { } if (nextBakingMsgAt < now) { nextBakingMsgAt = now + bakingMsgEvery; - GT_Mod.GT_FML_LOGGER.info( - String.format("%s - Baking: %d%%", materialsType, currentStep * 100 / sizeStep)); + GT_Mod.GT_FML_LOGGER + .info(String.format("%s - Baking: %d%%", materialsType, currentStep * 100 / sizeStep)); } action.accept(m); currentStep += 1; @@ -119,35 +119,35 @@ public class GT_CLS_Compat { } public static void stepMaterialsCLS(Collection mEvents, - ProgressManager.ProgressBar progressBar) throws IllegalAccessException, InvocationTargetException { + ProgressManager.ProgressBar progressBar) throws IllegalAccessException, InvocationTargetException { try { isRegisteringGTmaterials.set(null, true); } catch (IllegalArgumentException | IllegalAccessException e) { GT_Mod.GT_FML_LOGGER.catching(e); } registerAndReportProgression( - "GregTech materials", - mEvents, - progressBar, - m -> m.mMaterial, - GT_Proxy::registerRecipes); + "GregTech materials", + mEvents, + progressBar, + m -> m.mMaterial, + GT_Proxy::registerRecipes); ProgressManager.pop(progressBar); isRegisteringGTmaterials.set(null, false); } public static void doActualRegistrationCLS(ProgressManager.ProgressBar progressBar, - Set replacedVanillaItemsSet) throws InvocationTargetException, IllegalAccessException { + Set replacedVanillaItemsSet) throws InvocationTargetException, IllegalAccessException { try { isReplacingVanillaMaterials.set(null, true); } catch (IllegalArgumentException | IllegalAccessException e) { GT_Mod.GT_FML_LOGGER.catching(e); } registerAndReportProgression( - "Vanilla materials", - replacedVanillaItemsSet, - progressBar, - m -> m.mDefaultLocalName, - GT_PostLoad::doActualRegistration); + "Vanilla materials", + replacedVanillaItemsSet, + progressBar, + m -> m.mDefaultLocalName, + GT_PostLoad::doActualRegistration); } public static void pushToDisplayProgress() throws InvocationTargetException, IllegalAccessException { diff --git a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java index bfc6daf45f..bb73cf77ed 100644 --- a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java +++ b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java @@ -67,12 +67,12 @@ public abstract class GT_ChunkAssociatedData> instances = new ConcurrentHashMap<>(); private static final int IO_PARALLELISM = Math.min( - 8, - Math.max( - 1, - Runtime.getRuntime() - .availableProcessors() * 2 - / 3)); + 8, + Math.max( + 1, + Runtime.getRuntime() + .availableProcessors() * 2 + / 3)); private static final ExecutorService IO_WORKERS = Executors.newWorkStealingPool(IO_PARALLELISM); private static final Pattern FILE_PATTERN = Pattern.compile("(.+)\\.(-?\\d+)\\.(-?\\d+)\\.dat"); @@ -103,7 +103,7 @@ public abstract class GT_ChunkAssociatedData elementType, int regionLength, byte version, - boolean saveDefaults) { + boolean saveDefaults) { if (regionLength * regionLength > Short.MAX_VALUE || regionLength <= 0) throw new IllegalArgumentException("Region invalid: " + regionLength); if (!IData.class.isAssignableFrom(elementType)) throw new IllegalArgumentException("Data type invalid"); @@ -138,13 +138,13 @@ public abstract class GT_ChunkAssociatedData new ConcurrentHashMap<>()) - .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); + .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); return region.get(Math.floorMod(chunkX, regionLength), Math.floorMod(chunkZ, regionLength)); } protected final void set(World world, int chunkX, int chunkZ, T data) { SuperRegion region = masterMap.computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>()) - .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); + .computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c)); region.set(Math.floorMod(chunkX, regionLength), Math.floorMod(chunkZ, regionLength), data); } @@ -161,55 +161,54 @@ public abstract class GT_ChunkAssociatedData m.values() - .stream()) - .filter(SuperRegion::isDirty) - .count(); + .stream() + .flatMap( + m -> m.values() + .stream()) + .filter(SuperRegion::isDirty) + .count(); if (dirtyRegionCount > 0) GT_Log.out.println( - "Clearing ChunkAssociatedData with " + dirtyRegionCount - + " regions dirty. Data might have been lost!"); + "Clearing ChunkAssociatedData with " + dirtyRegionCount + " regions dirty. Data might have been lost!"); } masterMap.clear(); } public void save() { saveRegions( - masterMap.values() - .stream() - .flatMap( - m -> m.values() - .stream())); + masterMap.values() + .stream() + .flatMap( + m -> m.values() + .stream())); } public void save(World world) { Map map = masterMap.get(world.provider.dimensionId); if (map != null) saveRegions( - map.values() - .stream()); + map.values() + .stream()); } private void saveRegions(Stream stream) { stream.filter(SuperRegion::isDirty) - .map(c -> (Runnable) c::save) - .map(r -> CompletableFuture.runAsync(r, IO_WORKERS)) - .reduce(CompletableFuture::allOf) - .ifPresent(f -> { - try { - f.get(); - } catch (Exception e) { - GT_Log.err.println("Data save error: " + mId); - e.printStackTrace(GT_Log.err); - } - }); + .map(c -> (Runnable) c::save) + .map(r -> CompletableFuture.runAsync(r, IO_WORKERS)) + .reduce(CompletableFuture::allOf) + .ifPresent(f -> { + try { + f.get(); + } catch (Exception e) { + GT_Log.err.println("Data save error: " + mId); + e.printStackTrace(GT_Log.err); + } + }); } protected abstract void writeElement(DataOutput output, T element, World world, int chunkX, int chunkZ) - throws IOException; + throws IOException; protected abstract T readElement(DataInput input, int version, World world, int chunkX, int chunkZ) - throws IOException; + throws IOException; protected abstract T createElement(World world, int chunkX, int chunkZ); @@ -235,43 +234,34 @@ public abstract class GT_ChunkAssociatedData stream = Files.list(getSaveDirectory(w).toPath())) { Map worldData = stream.map(f -> { Matcher matcher = FILE_PATTERN.matcher( - f.getFileName() - .toString()); + f.getFileName() + .toString()); return matcher.matches() ? matcher : null; }) - .filter(Objects::nonNull) - .filter(m -> mId.equals(m.group(1))) - .map( - m -> CompletableFuture.supplyAsync( - () -> new SuperRegion( - w, - Integer.parseInt(m.group(2)), - Integer.parseInt(m.group(3))), - IO_WORKERS)) - .map(f -> { - try { - return f.get(); - } catch (Exception e) { - GT_Log.err.println("Error loading region"); - e.printStackTrace(GT_Log.err); - return null; - } - }) - .filter(Objects::nonNull) - .collect( - Collectors.toMap( - SuperRegion::getCoord, - Function.identity())); + .filter(Objects::nonNull) + .filter(m -> mId.equals(m.group(1))) + .map( + m -> CompletableFuture.supplyAsync( + () -> new SuperRegion(w, Integer.parseInt(m.group(2)), Integer.parseInt(m.group(3))), + IO_WORKERS)) + .map(f -> { + try { + return f.get(); + } catch (Exception e) { + GT_Log.err.println("Error loading region"); + e.printStackTrace(GT_Log.err); + return null; + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toMap(SuperRegion::getCoord, Function.identity())); masterMap.put(w.provider.dimensionId, worldData); } catch (IOException | UncheckedIOException e) { GT_Log.err.println("Error loading all region"); @@ -282,11 +272,11 @@ public abstract class GT_ChunkAssociatedData(world); this.coord = regionCoord; backingStorage = new File( - getSaveDirectory(world), - String.format("%s.%d.%d.dat", mId, regionCoord.chunkXPos, regionCoord.chunkZPos)); + getSaveDirectory(world), + String.format("%s.%d.%d.dat", mId, regionCoord.chunkXPos, regionCoord.chunkZPos)); if (backingStorage.isFile()) load(); } @@ -335,9 +325,9 @@ public abstract class GT_ChunkAssociatedData 0) { return true; } @@ -58,13 +56,11 @@ public abstract class GT_CircuitryBehavior { public static boolean getAllRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) { for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) == 0) { return false; } @@ -80,13 +76,11 @@ public abstract class GT_CircuitryBehavior { int tRedstoneAmount = 0; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) { tRedstoneAmount++; } @@ -102,13 +96,11 @@ public abstract class GT_CircuitryBehavior { byte tRedstoneAmount = 0; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { tRedstoneAmount = (byte) Math.max(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side)); } } @@ -127,13 +119,11 @@ public abstract class GT_CircuitryBehavior { byte tRedstoneAmount = 15; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) tRedstoneAmount = (byte) Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side)); } @@ -149,13 +139,11 @@ public abstract class GT_CircuitryBehavior { byte tRedstoneAmount = 15; for (byte side : ALL_VALID_SIDES) { if (side != aRedstoneCircuitBlock.getOutputFacing() && aRedstoneCircuitBlock.getCover(side) - .letsRedstoneGoIn( - side, - aRedstoneCircuitBlock.getCoverID( - side), - aRedstoneCircuitBlock.getCoverVariable( - side), - aRedstoneCircuitBlock.getOwnTileEntity())) { + .letsRedstoneGoIn( + side, + aRedstoneCircuitBlock.getCoverID(side), + aRedstoneCircuitBlock.getCoverVariable(side), + aRedstoneCircuitBlock.getOwnTileEntity())) { tRedstoneAmount = (byte) Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side)); } } @@ -195,7 +183,7 @@ public abstract class GT_CircuitryBehavior { * If the ItemStack should be displayed. Parameters are between 0 and 3. */ public abstract boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, - int aIndex); + int aIndex); /** * The Name of the Gate for the GUI diff --git a/src/main/java/gregtech/api/util/GT_ClientPreference.java b/src/main/java/gregtech/api/util/GT_ClientPreference.java index 0d5e39c1a8..e48af386cb 100644 --- a/src/main/java/gregtech/api/util/GT_ClientPreference.java +++ b/src/main/java/gregtech/api/util/GT_ClientPreference.java @@ -7,7 +7,7 @@ public class GT_ClientPreference { private final boolean mInputBusInitialFilter; public GT_ClientPreference(boolean mSingleBlockInitialFilter, boolean mSingleBlockInitialMultiStack, - boolean mInputBusInitialFilter) { + boolean mInputBusInitialFilter) { this.mSingleBlockInitialFilter = mSingleBlockInitialFilter; this.mSingleBlockInitialMultiStack = mSingleBlockInitialMultiStack; this.mInputBusInitialFilter = mInputBusInitialFilter; @@ -15,10 +15,8 @@ public class GT_ClientPreference { public GT_ClientPreference(GT_Config aClientDataFile) { this.mSingleBlockInitialFilter = aClientDataFile.get("preference", "mSingleBlockInitialFilter", false); - this.mSingleBlockInitialMultiStack = aClientDataFile.get( - "preference", - "mSingleBlockInitialAllowMultiStack", - false); + this.mSingleBlockInitialMultiStack = aClientDataFile + .get("preference", "mSingleBlockInitialAllowMultiStack", false); this.mInputBusInitialFilter = aClientDataFile.get("preference", "mInputBusInitialFilter", true); } diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java index 40bff73ac7..36585559c2 100644 --- a/src/main/java/gregtech/api/util/GT_Config.java +++ b/src/main/java/gregtech/api/util/GT_Config.java @@ -33,10 +33,10 @@ public class GT_Config implements Runnable { public static int addIDConfig(Object aCategory, String aName, int aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = sConfigFileIDs.get( - aCategory.toString() - .replaceAll("\\|", "."), - aName.replaceAll("\\|", "."), - aDefault); + aCategory.toString() + .replaceAll("\\|", "."), + aName.replaceAll("\\|", "."), + aDefault); int rResult = tProperty.getInt(aDefault); if (!tProperty.wasRead() && shouldSave()) sConfigFileIDs.save(); return rResult; @@ -52,7 +52,7 @@ public class GT_Config implements Runnable { /* Do nothing */ } String sName = aStack.getItem() - .toString(); + .toString(); String[] tmp = sName.split("@"); if (tmp.length > 0) sName = tmp[0]; return sName + "." + aStack.getItemDamage(); @@ -66,10 +66,10 @@ public class GT_Config implements Runnable { public boolean get(Object aCategory, String aName, boolean aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); boolean rResult = tProperty.getBoolean(aDefault); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -82,10 +82,10 @@ public class GT_Config implements Runnable { public int get(Object aCategory, String aName, int aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); int rResult = tProperty.getInt(aDefault); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -98,10 +98,10 @@ public class GT_Config implements Runnable { public double get(Object aCategory, String aName, double aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); double rResult = tProperty.getDouble(aDefault); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -114,10 +114,10 @@ public class GT_Config implements Runnable { public String get(Object aCategory, String aName, String aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - (aName + "_" + aDefault).replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); String rResult = tProperty.getString(); if (!tProperty.wasRead() && shouldSave()) mConfig.save(); return rResult; @@ -130,10 +130,10 @@ public class GT_Config implements Runnable { public String[] get(Object aCategory, String aName, String... aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString() - .replaceAll("\\|", "_"), - aName.replaceAll("\\|", "_"), - aDefault); + aCategory.toString() + .replaceAll("\\|", "_"), + aName.replaceAll("\\|", "_"), + aDefault); String[] rResult = tProperty.getStringList(); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); return rResult; diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java index f12da42700..60196bd236 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java @@ -48,13 +48,13 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase { * @return null if none, otherwise return facade target block */ public final Block getFacadeBlock(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getFacadeBlockImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -104,7 +104,7 @@ public abstract class GT_CoverBehaviorBase { * @return 0 if none, otherwise return facade target meta */ public final int getFacadeMeta(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getFacadeMetaImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -121,7 +121,7 @@ public abstract class GT_CoverBehaviorBase { * overloads. */ public final ITexture getSpecialCoverFGTexture(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getSpecialCoverFGTextureImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -130,7 +130,7 @@ public abstract class GT_CoverBehaviorBase { * {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its overloads. */ public final ITexture getSpecialCoverTexture(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getSpecialCoverTextureImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -141,7 +141,7 @@ public abstract class GT_CoverBehaviorBase { * {@link ICoverable#issueCoverUpdate(byte)} This option only affects the initial sync. */ public final boolean isDataNeededOnClient(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return isDataNeededOnClientImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -149,7 +149,7 @@ public abstract class GT_CoverBehaviorBase { * Called upon receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side. */ public final void onDataChanged(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { onDataChangedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -157,14 +157,14 @@ public abstract class GT_CoverBehaviorBase { * Called before receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side. */ public final void preDataChanged(byte aSide, int aCoverID, int aNewCoverId, ISerializableObject aCoverVariable, - ISerializableObject aNewCoverVariable, ICoverable aTileEntity) { + ISerializableObject aNewCoverVariable, ICoverable aTileEntity) { preDataChangedImpl( - aSide, - aCoverID, - aNewCoverId, - forceCast(aCoverVariable), - forceCast(aNewCoverVariable), - aTileEntity); + aSide, + aCoverID, + aNewCoverId, + forceCast(aCoverVariable), + forceCast(aNewCoverVariable), + aTileEntity); } /** @@ -175,7 +175,7 @@ public abstract class GT_CoverBehaviorBase { } public final boolean isRedstoneSensitive(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { return isRedstoneSensitiveImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aTimer); } @@ -183,7 +183,7 @@ public abstract class GT_CoverBehaviorBase { * Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time. */ public final T doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { return doCoverThingsImpl(aSide, aInputRedstone, aCoverID, forceCast(aCoverVariable), aTileEntity, aTimer); } @@ -193,7 +193,7 @@ public abstract class GT_CoverBehaviorBase { * return true, if something actually happens. */ public final boolean onCoverRightClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { return onCoverRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ); } @@ -203,29 +203,29 @@ public abstract class GT_CoverBehaviorBase { * return the new Value of the Cover Variable */ public final T onCoverScrewdriverClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { return onCoverScrewdriverClickImpl( - aSide, - aCoverID, - forceCast(aCoverVariable), - aTileEntity, - aPlayer, - aX, - aY, - aZ); + aSide, + aCoverID, + forceCast(aCoverVariable), + aTileEntity, + aPlayer, + aX, + aY, + aZ); } /** * Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case. */ public final boolean onCoverShiftRightClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer) { + ICoverable aTileEntity, EntityPlayer aPlayer) { return onCoverShiftRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer); } @Deprecated public final Object getClientGUI(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { + ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) { return getClientGUIImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aWorld); } @@ -234,7 +234,7 @@ public abstract class GT_CoverBehaviorBase { * getting broken, only if you break the Cover away from the Machine. */ public final boolean onCoverRemoval(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity, boolean aForced) { + ICoverable aTileEntity, boolean aForced) { return onCoverRemovalImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aForced); } @@ -243,7 +243,7 @@ public abstract class GT_CoverBehaviorBase { * survival. */ public final void onBaseTEDestroyed(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { onBaseTEDestroyedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -251,7 +251,7 @@ public abstract class GT_CoverBehaviorBase { * Gives a small Text for the status of the Cover. */ public final String getDescription(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getDescriptionImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -259,7 +259,7 @@ public abstract class GT_CoverBehaviorBase { * How Blast Proof the Cover is. 30 is normal. */ public final float getBlastProofLevel(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getBlastProofLevelImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -269,7 +269,7 @@ public abstract class GT_CoverBehaviorBase { * This is just Informative so that Machines know if their Redstone Input is blocked or not */ public final boolean letsRedstoneGoIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -277,7 +277,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets RS-Signals out of the Block */ public final boolean letsRedstoneGoOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -287,7 +287,7 @@ public abstract class GT_CoverBehaviorBase { * This is just Informative so that Machines know if their Redstone Input is blocked or not */ public final boolean letsFibreGoIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFibreGoInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -295,7 +295,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Fibre-Signals out of the Block */ public final boolean letsFibreGoOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFibreGoOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -303,7 +303,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Energy into the Block */ public final boolean letsEnergyIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsEnergyInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -311,7 +311,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Energy out of the Block */ public final boolean letsEnergyOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsEnergyOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -319,7 +319,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ public final boolean letsFluidIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFluidInImpl(aSide, aCoverID, forceCast(aCoverVariable), aFluid, aTileEntity); } @@ -327,7 +327,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ public final boolean letsFluidOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsFluidOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aFluid, aTileEntity); } @@ -337,7 +337,7 @@ public abstract class GT_CoverBehaviorBase { * Slot). */ public final boolean letsItemsIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsItemsInImpl(aSide, aCoverID, forceCast(aCoverVariable), aSlot, aTileEntity); } @@ -347,7 +347,7 @@ public abstract class GT_CoverBehaviorBase { * Slot). */ public final boolean letsItemsOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsItemsOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aSlot, aTileEntity); } @@ -355,7 +355,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets you rightclick the Machine normally */ public final boolean isGUIClickable(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return isGUIClickableImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -363,7 +363,7 @@ public abstract class GT_CoverBehaviorBase { * Needs to return true for Covers, which have a Redstone Output on their Facing. */ public final boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return manipulatesSidedRedstoneOutputImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -371,7 +371,7 @@ public abstract class GT_CoverBehaviorBase { * if this Cover should let Pipe Connections look connected even if it is not the case. */ public final boolean alwaysLookConnected(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return alwaysLookConnectedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -380,7 +380,7 @@ public abstract class GT_CoverBehaviorBase { * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0. */ public final byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, - ISerializableObject aCoverVariable, ICoverable aTileEntity) { + ISerializableObject aCoverVariable, ICoverable aTileEntity) { return getRedstoneInputImpl(aSide, aInputRedstone, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -397,7 +397,7 @@ public abstract class GT_CoverBehaviorBase { * The MC Color of this Lens. -1 for no Color (meaning this isn't a Lens then). */ public final byte getLensColor(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getLensColorImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } @@ -405,7 +405,7 @@ public abstract class GT_CoverBehaviorBase { * @return the ItemStack dropped by this Cover */ public final ItemStack getDrop(byte aSide, int aCoverID, ISerializableObject aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getDropImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity); } // endregion @@ -450,8 +450,8 @@ public abstract class GT_CoverBehaviorBase { addUIWidgets(builder); if (getUIBuildContext().isAnotherWindow()) { builder.widget( - ButtonWidget.closeWindowButton(true) - .setPos(getGUIWidth() - 15, 3)); + ButtonWidget.closeWindowButton(true) + .setPos(getGUIWidth() - 15, 3)); } return builder.build(); } @@ -472,8 +472,8 @@ public abstract class GT_CoverBehaviorBase { public T getCoverData() { if (isCoverValid()) { return forceCast( - getUIBuildContext().getTile() - .getComplexCoverDataAtSide(getUIBuildContext().getCoverSide())); + getUIBuildContext().getTile() + .getComplexCoverDataAtSide(getUIBuildContext().getCoverSide())); } else { return null; } @@ -482,13 +482,13 @@ public abstract class GT_CoverBehaviorBase { public boolean setCoverData(T data) { if (isCoverValid()) { getUIBuildContext().getTile() - .receiveCoverData( - getUIBuildContext().getCoverSide(), - getUIBuildContext().getCoverID(), - data, - getUIBuildContext().getPlayer() instanceof EntityPlayerMP - ? (EntityPlayerMP) getUIBuildContext().getPlayer() - : null); + .receiveCoverData( + getUIBuildContext().getCoverSide(), + getUIBuildContext().getCoverID(), + data, + getUIBuildContext().getPlayer() instanceof EntityPlayerMP + ? (EntityPlayerMP) getUIBuildContext().getPlayer() + : null); return true; } else { return false; @@ -497,22 +497,21 @@ public abstract class GT_CoverBehaviorBase { public boolean isCoverValid() { return !getUIBuildContext().getTile() - .isDead() - && getUIBuildContext().getTile() - .getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide()) - != GregTech_API.sNoBehavior; + .isDead() + && getUIBuildContext().getTile() + .getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide()) != GregTech_API.sNoBehavior; } protected void addTitleToUI(ModularWindow.Builder builder) { ItemStack coverItem = GT_Utility.intToStack(getUIBuildContext().getCoverID()); if (coverItem != null) { builder.widget( - new ItemDrawable(coverItem).asWidget() - .setPos(5, 5) - .setSize(16, 16)) - .widget( - new TextWidget(coverItem.getDisplayName()).setDefaultColor(COLOR_TITLE.get()) - .setPos(25, 9)); + new ItemDrawable(coverItem).asWidget() + .setPos(5, 5) + .setSize(16, 16)) + .widget( + new TextWidget(coverItem.getDisplayName()).setDefaultColor(COLOR_TITLE.get()) + .setPos(25, 9)); } } @@ -554,7 +553,7 @@ public abstract class GT_CoverBehaviorBase { } protected ITexture getSpecialCoverFGTextureImpl(byte aSide, int aCoverID, T aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return coverFGTexture; } @@ -569,14 +568,14 @@ public abstract class GT_CoverBehaviorBase { protected void onDataChangedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {} protected void preDataChangedImpl(byte aSide, int aCoverID, int aNewCoverId, T aCoverVariable, T aNewCoverVariable, - ICoverable aTileEntity) {} + ICoverable aTileEntity) {} protected void onDroppedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {} protected void onBaseTEDestroyedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {} protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - long aTimer) { + long aTimer) { return false; } @@ -584,7 +583,7 @@ public abstract class GT_CoverBehaviorBase { * Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time. */ protected T doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { return aCoverVariable; } @@ -594,7 +593,7 @@ public abstract class GT_CoverBehaviorBase { * return true, if something actually happens. */ protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return false; } @@ -604,7 +603,7 @@ public abstract class GT_CoverBehaviorBase { * return the new Value of the Cover Variable */ protected T onCoverScrewdriverClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return aCoverVariable; } @@ -612,20 +611,20 @@ public abstract class GT_CoverBehaviorBase { * Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case. */ protected boolean onCoverShiftRightClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer) { + EntityPlayer aPlayer) { if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) { lastPlayer = aPlayer; if (useModularUI()) { GT_UIInfos.openCoverUI(aTileEntity, aPlayer, aSide); } else { GT_Values.NW.sendToPlayer( - new GT_Packet_TileEntityCoverGUI( - aSide, - aCoverID, - aCoverVariable, - aTileEntity, - (EntityPlayerMP) aPlayer), - (EntityPlayerMP) aPlayer); + new GT_Packet_TileEntityCoverGUI( + aSide, + aCoverID, + aCoverVariable, + aTileEntity, + (EntityPlayerMP) aPlayer), + (EntityPlayerMP) aPlayer); } return true; } @@ -634,7 +633,7 @@ public abstract class GT_CoverBehaviorBase { @Deprecated protected Object getClientGUIImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, World aWorld) { + EntityPlayer aPlayer, World aWorld) { return null; } @@ -643,7 +642,7 @@ public abstract class GT_CoverBehaviorBase { * getting broken, only if you break the Cover away from the Machine. */ protected boolean onCoverRemovalImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, - boolean aForced) { + boolean aForced) { return true; } @@ -711,7 +710,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ protected boolean letsFluidInImpl(byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -719,7 +718,7 @@ public abstract class GT_CoverBehaviorBase { * If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not. */ protected boolean letsFluidOutImpl(byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -752,7 +751,7 @@ public abstract class GT_CoverBehaviorBase { * Needs to return true for Covers, which have a Redstone Output on their Facing. */ protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, T aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } @@ -768,7 +767,7 @@ public abstract class GT_CoverBehaviorBase { * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0. */ protected byte getRedstoneInputImpl(byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return letsRedstoneGoIn(aSide, aCoverID, aCoverVariable, aTileEntity) ? aInputRedstone : 0; } @@ -825,7 +824,7 @@ public abstract class GT_CoverBehaviorBase { * return true, if something actually happens. */ public boolean onCoverRightclickClient(byte aSide, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { return false; } diff --git a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java index 9ca7a16031..dbb14222c0 100644 --- a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java +++ b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java @@ -24,7 +24,7 @@ public class GT_ExoticEnergyInputHelper { public static void register(Class clazz) { if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException( - clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); + clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); sExoticEnergyHatchType.add(clazz); } @@ -37,18 +37,18 @@ public class GT_ExoticEnergyInputHelper { return; } if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException( - clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); + clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName()); sExoticEnergyHatchType.add((Class) clazz); } public static boolean drainEnergy(long aEU, Collection hatches) { for (GT_MetaTileEntity_Hatch tHatch : hatches) { long tDrain = Math.min( - tHatch.getBaseMetaTileEntity() - .getStoredEU(), - aEU); + tHatch.getBaseMetaTileEntity() + .getStoredEU(), + aEU); tHatch.getBaseMetaTileEntity() - .decreaseStoredEnergyUnits(tDrain, false); + .decreaseStoredEnergyUnits(tDrain, false); aEU -= tDrain; } return aEU <= 0; @@ -65,8 +65,7 @@ public class GT_ExoticEnergyInputHelper { long rEU = 0L; for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rEU += tHatch.getBaseMetaTileEntity() - .getInputVoltage() - * tHatch.maxWorkingAmperesIn(); + .getInputVoltage() * tHatch.maxWorkingAmperesIn(); return rEU; } @@ -74,7 +73,7 @@ public class GT_ExoticEnergyInputHelper { long rVoltage = 0; for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); + .getInputVoltage(); return rVoltage; } @@ -85,7 +84,7 @@ public class GT_ExoticEnergyInputHelper { } for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity() - .getInputVoltage(); + .getInputVoltage(); return rVoltage / hatches.size(); } @@ -93,7 +92,7 @@ public class GT_ExoticEnergyInputHelper { long rAmp = 0; for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) rAmp += tHatch.getBaseMetaTileEntity() - .getInputAmperage(); + .getInputAmperage(); return rAmp; } diff --git a/src/main/java/gregtech/api/util/GT_FoodStat.java b/src/main/java/gregtech/api/util/GT_FoodStat.java index b658f3abe5..5eda76f9d0 100644 --- a/src/main/java/gregtech/api/util/GT_FoodStat.java +++ b/src/main/java/gregtech/api/util/GT_FoodStat.java @@ -33,7 +33,7 @@ public class GT_FoodStat implements IFoodStat { * III] The likelihood that this Potion Effect takes place upon being eaten [1 - 100] */ public GT_FoodStat(int aFoodLevel, float aSaturation, EnumAction aAction, ItemStack aEmptyContainer, - boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) { + boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) { mFoodLevel = aFoodLevel; mSaturation = aSaturation; mAction = aAction == null ? EnumAction.eat : aAction; @@ -72,12 +72,11 @@ public class GT_FoodStat implements IFoodStat { aPlayer.dropPlayerItemWithRandomChoice(tStack, true); new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder().setIdentifier(SoundResource.RANDOM_BURP) - .setVolume(0.5F) - .setPitch( - aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F) - .setEntity(aPlayer) - .setWorld(aPlayer.worldObj) - .run(); + .setVolume(0.5F) + .setPitch(aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F) + .setEntity(aPlayer) + .setWorld(aPlayer.worldObj) + .run(); if (!aPlayer.worldObj.isRemote) { if (mMilk) { @@ -86,24 +85,21 @@ public class GT_FoodStat implements IFoodStat { for (int i = 3; i < mPotionEffects.length; i += 4) { if (aPlayer.worldObj.rand.nextInt(100) < mPotionEffects[i]) { aPlayer.addPotionEffect( - new PotionEffect( - mPotionEffects[i - 3], - mPotionEffects[i - 2], - mPotionEffects[i - 1], - mInvisibleParticles)); + new PotionEffect( + mPotionEffects[i - 3], + mPotionEffects[i - 2], + mPotionEffects[i - 1], + mInvisibleParticles)); } } if (mExplosive) { new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setSmoking(true) - .setFlaming(true) - .setStrength(4f) - .setPosition( - aPlayer.posX, - aPlayer.posY, - aPlayer.posZ) - .setEntity(aPlayer) - .setWorld(aPlayer.worldObj) - .run(); + .setFlaming(true) + .setStrength(4f) + .setPosition(aPlayer.posX, aPlayer.posY, aPlayer.posZ) + .setEntity(aPlayer) + .setWorld(aPlayer.worldObj) + .run(); aPlayer.attackEntityFrom(GT_DamageSources.getExplodingDamage(), Float.MAX_VALUE); } } diff --git a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java index 95efdf40f0..933c379db1 100644 --- a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java +++ b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java @@ -17,111 +17,111 @@ public class GT_Forestry_Compat { public static void populateFakeNeiRecipes() { if (ItemList.FR_Bee_Drone.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Drone.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Bee_Drone.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Bee_Princess.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Princess.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Bee_Princess.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Bee_Queen.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Queen.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Bee_Queen.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Tree_Sapling.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Tree_Sapling.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Tree_Sapling.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Butterfly.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Butterfly.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Butterfly.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Larvae.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Larvae.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Larvae.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Serum.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Serum.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Serum.getWithName(1L, "Scanned Serum") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Serum.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Serum.getWithName(1L, "Scanned Serum") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_Caterpillar.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Caterpillar.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_Caterpillar.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } if (ItemList.FR_PollenFertile.get(1L) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_PollenFertile.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + false, + new ItemStack[] { ItemList.FR_PollenFertile.getWildcard(1L) }, + new ItemStack[] { ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen") }, + null, + new FluidStack[] { Materials.Honey.getFluid(100L) }, + null, + 500, + 2, + 0); } } @@ -135,31 +135,31 @@ public class GT_Forestry_Compat { for (Map.Entry entry : outputs.entrySet()) { tChances[i] = (int) (entry.getValue() * 10000); tOutputs[i] = entry.getKey() - .copy(); + .copy(); i++; } GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getInput() }, - tOutputs, - null, - tChances, - null, - null, - 128, - 5, - 0); + true, + new ItemStack[] { tRecipe.getInput() }, + tOutputs, + null, + tChances, + null, + null, + 128, + 5, + 0); GT_Recipe.GT_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getInput() }, - tOutputs, - null, - tChances, - null, - null, - 128, - 5, - 0); + true, + new ItemStack[] { tRecipe.getInput() }, + tOutputs, + null, + tChances, + null, + null, + 128, + 5, + 0); } } catch (Throwable e) { if (GT_Values.D1) { @@ -173,16 +173,16 @@ public class GT_Forestry_Compat { for (ISqueezerRecipe tRecipe : RecipeManagers.squeezerManager.recipes()) { if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null)) { GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getResources()[0] }, - new ItemStack[] { tRecipe.getRemnants() }, - null, - new int[] { (int) (tRecipe.getRemnantsChance() * 10000) }, - null, - new FluidStack[] { tRecipe.getFluidOutput() }, - 32, - 8, - 0); + true, + new ItemStack[] { tRecipe.getResources()[0] }, + new ItemStack[] { tRecipe.getRemnants() }, + null, + new int[] { (int) (tRecipe.getRemnantsChance() * 10000) }, + null, + new FluidStack[] { tRecipe.getFluidOutput() }, + 32, + 8, + 0); } } } catch (Throwable e) { diff --git a/src/main/java/gregtech/api/util/GT_GC_Compat.java b/src/main/java/gregtech/api/util/GT_GC_Compat.java index 23b4a42930..3b9bd5bda9 100644 --- a/src/main/java/gregtech/api/util/GT_GC_Compat.java +++ b/src/main/java/gregtech/api/util/GT_GC_Compat.java @@ -18,21 +18,19 @@ public class GT_GC_Compat { // GC Compat if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC) { if (!(tTileEntity instanceof IConnector) - || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER)) { + || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER)) { EnergySource eSource = new EnergySourceAdjacent(tDirection); float tSizeToReceive = aVoltage * EnergyConfigHandler.IC2_RATIO, - tStored = ((IEnergyHandlerGC) tTileEntity).getEnergyStoredGC(eSource); + tStored = ((IEnergyHandlerGC) tTileEntity).getEnergyStoredGC(eSource); if (tSizeToReceive >= tStored - || tSizeToReceive <= ((IEnergyHandlerGC) tTileEntity).getMaxEnergyStoredGC(eSource) - tStored) { + || tSizeToReceive <= ((IEnergyHandlerGC) tTileEntity).getMaxEnergyStoredGC(eSource) - tStored) { float tReceived = ((IEnergyHandlerGC) tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false); if (tReceived > 0) { tSizeToReceive -= tReceived; while (tSizeToReceive > 0) { - tReceived = ((IEnergyHandlerGC) tTileEntity).receiveEnergyGC( - eSource, - tSizeToReceive, - false); + tReceived = ((IEnergyHandlerGC) tTileEntity) + .receiveEnergyGC(eSource, tSizeToReceive, false); if (tReceived < 1) break; tSizeToReceive -= tReceived; } @@ -48,8 +46,8 @@ public class GT_GC_Compat { public static boolean canConnect(TileEntity tTileEntity, ForgeDirection tDirection) { // GC Compat if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC - && (!(tTileEntity instanceof IConnector) - || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER))) + && (!(tTileEntity instanceof IConnector) + || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER))) return true; return false; } diff --git a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java b/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java index c3057f3caa..ba9e3b9773 100644 --- a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java +++ b/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java @@ -58,21 +58,21 @@ public class GT_HatchElementBuilder { public final GT_HatchElementBuilder anyOf(IHatchElement... elements) { if (elements == null || elements.length == 0) throw new IllegalArgumentException(); return adder( - Arrays.stream(elements) - .map( - e -> e.adder() - .rebrand()) - .reduce(IGT_HatchAdder::orElse) - .get()).hatchClasses( - Arrays.stream(elements) - .map(IHatchElement::mteClasses) - .flatMap(Collection::stream) - .collect(Collectors.toList())) - .cacheHint( - () -> Arrays.stream(elements) - .map(IHatchElement::name) - .sorted() - .collect(Collectors.joining(" or ", "of type ", ""))); + Arrays.stream(elements) + .map( + e -> e.adder() + .rebrand()) + .reduce(IGT_HatchAdder::orElse) + .get()).hatchClasses( + Arrays.stream(elements) + .map(IHatchElement::mteClasses) + .flatMap(Collection::stream) + .collect(Collectors.toList())) + .cacheHint( + () -> Arrays.stream(elements) + .map(IHatchElement::name) + .sorted() + .collect(Collectors.joining(" or ", "of type ", ""))); } /** @@ -84,8 +84,8 @@ public class GT_HatchElementBuilder { public final GT_HatchElementBuilder atLeast(IHatchElement... elements) { if (elements == null || elements.length == 0) throw new IllegalArgumentException(); return atLeast( - Arrays.stream(elements) - .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); + Arrays.stream(elements) + .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); } /** @@ -96,9 +96,8 @@ public class GT_HatchElementBuilder { public final GT_HatchElementBuilder atLeastList(List> elements) { if (elements == null || elements.isEmpty()) throw new IllegalArgumentException(); return atLeast( - elements.stream() - .collect( - Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); + elements.stream() + .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting()))); } /** @@ -108,57 +107,51 @@ public class GT_HatchElementBuilder { if (elements == null || elements.isEmpty() || elements.containsKey(null) || elements.containsValue(null)) throw new IllegalArgumentException(); List> list = elements.keySet() - .stream() - .map(IHatchElement::mteClasses) - .flatMap(Collection::stream) - .collect(Collectors.toList()); + .stream() + .map(IHatchElement::mteClasses) + .flatMap(Collection::stream) + .collect(Collectors.toList()); // map cannot be null or empty, so assert Optional isPresent return adder( - elements.keySet() - .stream() - .map( - e -> e.adder() - .rebrand()) - .reduce(IGT_HatchAdder::orElse) - .orElseThrow(AssertionError::new)) - .hatchItemFilter( - obj -> GT_StructureUtility.filterByMTEClass( - elements.entrySet() - .stream() - .filter( - entry -> entry.getKey() - .count(obj) - < entry.getValue() - .longValue()) - .flatMap( - entry -> entry.getKey() - .mteClasses() - .stream()) - .collect(Collectors.toList()))) - .shouldReject( - obj -> elements.entrySet() - .stream() - .allMatch( - e -> e.getKey() - .count(obj) - >= e.getValue() - .longValue())) - .shouldSkip( - (BiPredicate & Builtin) ( - c, t) -> t != null && list.stream() - .anyMatch( - clazz -> clazz.isInstance( - t.getMetaTileEntity()))) - .cacheHint( - () -> elements.keySet() - .stream() - .map(IHatchElement::name) - .sorted() - .collect( - Collectors.joining( - " or ", - "of type ", - ""))); + elements.keySet() + .stream() + .map( + e -> e.adder() + .rebrand()) + .reduce(IGT_HatchAdder::orElse) + .orElseThrow(AssertionError::new)) + .hatchItemFilter( + obj -> GT_StructureUtility.filterByMTEClass( + elements.entrySet() + .stream() + .filter( + entry -> entry.getKey() + .count(obj) + < entry.getValue() + .longValue()) + .flatMap( + entry -> entry.getKey() + .mteClasses() + .stream()) + .collect(Collectors.toList()))) + .shouldReject( + obj -> elements.entrySet() + .stream() + .allMatch( + e -> e.getKey() + .count(obj) + >= e.getValue() + .longValue())) + .shouldSkip( + (BiPredicate & Builtin) (c, + t) -> t != null && list.stream() + .anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity()))) + .cacheHint( + () -> elements.keySet() + .stream() + .map(IHatchElement::name) + .sorted() + .collect(Collectors.joining(" or ", "of type ", ""))); } // endregion @@ -198,34 +191,34 @@ public class GT_HatchElementBuilder { } public GT_HatchElementBuilder hatchItemFilter( - Function> aHatchItemFilter) { + Function> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); mHatchItemFilter = (t, s) -> aHatchItemFilter.apply(t); return this; } public GT_HatchElementBuilder hatchItemFilterAnd( - Function> aHatchItemFilter) { + Function> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); BiFunction> tOldFilter = mHatchItemFilter; mHatchItemFilter = (t, s) -> tOldFilter.apply(t, s) - .and(aHatchItemFilter.apply(t)); + .and(aHatchItemFilter.apply(t)); return this; } public GT_HatchElementBuilder hatchItemFilter( - BiFunction> aHatchItemFilter) { + BiFunction> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); mHatchItemFilter = aHatchItemFilter; return this; } public GT_HatchElementBuilder hatchItemFilterAnd( - BiFunction> aHatchItemFilter) { + BiFunction> aHatchItemFilter) { if (aHatchItemFilter == null) throw new IllegalArgumentException(); BiFunction> tOldFilter = mHatchItemFilter; mHatchItemFilter = (t, s) -> tOldFilter.apply(t, s) - .and(aHatchItemFilter.apply(t, s)); + .and(aHatchItemFilter.apply(t, s)); return this; } @@ -297,14 +290,11 @@ public class GT_HatchElementBuilder { // region intermediate public GT_HatchElementBuilder hatchClass(Class clazz) { - return hatchItemFilter( - c -> is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))).cacheHint( - () -> "of class " + clazz.getSimpleName()) - .shouldSkip( - (BiPredicate & Builtin) ( - c, - t) -> clazz.isInstance( - t.getMetaTileEntity())); + return hatchItemFilter(c -> is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))) + .cacheHint(() -> "of class " + clazz.getSimpleName()) + .shouldSkip( + (BiPredicate & Builtin) (c, t) -> clazz + .isInstance(t.getMetaTileEntity())); } @SafeVarargs @@ -315,26 +305,22 @@ public class GT_HatchElementBuilder { public final GT_HatchElementBuilder hatchClasses(List> classes) { List> list = new ArrayList<>(classes); return hatchItemFilter(obj -> GT_StructureUtility.filterByMTEClass(list)).cacheHint( - () -> list.stream() - .map(Class::getSimpleName) - .sorted() - .collect(Collectors.joining(" or ", "of class ", ""))) - .shouldSkip( - (BiPredicate & Builtin) ( - c, t) -> t != null - && list.stream() - .anyMatch( - clazz -> clazz.isInstance( - t.getMetaTileEntity()))); + () -> list.stream() + .map(Class::getSimpleName) + .sorted() + .collect(Collectors.joining(" or ", "of class ", ""))) + .shouldSkip( + (BiPredicate & Builtin) (c, t) -> t != null && list.stream() + .anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity()))); } public GT_HatchElementBuilder hatchId(int aId) { return hatchItemFilter( - c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines - && is.getItemDamage() == aId).cacheHint(() -> "of id " + aId) - .shouldSkip( - (BiPredicate & Builtin) ( - c, t) -> t != null && t.getMetaTileID() == aId); + c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines + && is.getItemDamage() == aId).cacheHint(() -> "of id " + aId) + .shouldSkip( + (BiPredicate & Builtin) (c, t) -> t != null + && t.getMetaTileID() == aId); } public GT_HatchElementBuilder hatchIds(int... aIds) { @@ -342,16 +328,15 @@ public class GT_HatchElementBuilder { if (aIds.length == 1) return hatchId(aIds[0]); TIntCollection coll = aIds.length < 16 ? new TIntArrayList(aIds) : new TIntHashSet(aIds); return hatchItemFilter( - c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines - && coll.contains(is.getItemDamage())).cacheHint( - () -> Arrays.stream(coll.toArray()) - .sorted() - .mapToObj(String::valueOf) - .collect(Collectors.joining(" or ", "of id ", ""))) - .shouldSkip( - (BiPredicate & Builtin) ( - c, t) -> t != null && coll.contains( - t.getMetaTileID())); + c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines + && coll.contains(is.getItemDamage())).cacheHint( + () -> Arrays.stream(coll.toArray()) + .sorted() + .mapToObj(String::valueOf) + .collect(Collectors.joining(" or ", "of id ", ""))) + .shouldSkip( + (BiPredicate & Builtin) (c, t) -> t != null + && coll.contains(t.getMetaTileID())); } // endregion @@ -382,7 +367,7 @@ public class GT_HatchElementBuilder { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); + && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); } @Override @@ -400,7 +385,7 @@ public class GT_HatchElementBuilder { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); + && mAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) mCasingIndex); } @Override @@ -432,55 +417,54 @@ public class GT_HatchElementBuilder { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return BlocksToPlace.create(mHatchItemFilter.apply(t, trigger)); } @Deprecated @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer chatter) { + IItemSource s, EntityPlayerMP actor, Consumer chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (mShouldSkip != null) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof IGregTechTileEntity - && mShouldSkip.test(t, (IGregTechTileEntity) tileEntity)) - return PlaceResult.SKIP; + && mShouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return PlaceResult.SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return PlaceResult.REJECT; if (mReject != null && mReject.test(t)) return PlaceResult.REJECT; ItemStack taken = env.getSource() - .takeOne(mHatchItemFilter.apply(t, trigger), true); + .takeOne(mHatchItemFilter.apply(t, trigger), true); if (GT_Utility.isStackInvalid(taken)) { String type = getHint(); env.getChatter() - .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_hatch", type)); + .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_hatch", type)); return PlaceResult.REJECT; } if (StructureUtility.survivalPlaceBlock( - taken, - ItemStackPredicate.NBTMode.IGNORE, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor()) != PlaceResult.ACCEPT) { + taken, + ItemStackPredicate.NBTMode.IGNORE, + null, + true, + world, + x, + y, + z, + env.getSource(), + env.getActor()) != PlaceResult.ACCEPT) { return PlaceResult.REJECT; } // try to infer facing @@ -497,9 +481,7 @@ public class GT_HatchElementBuilder { // explicitly rejected, probably obstructed by another slice if (mDisallowedDirection.contains(direction)) continue; ForgeDirection rotated = env.getFacing() - .getWorldDirection( - direction.offsetY != 0 ? direction.getOpposite() - : direction); + .getWorldDirection(direction.offsetY != 0 ? direction.getOpposite() : direction); allowed.add(rotated); } } diff --git a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java index 7097e877bd..d6b41e69b0 100644 --- a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java +++ b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java @@ -13,6 +13,6 @@ public class GT_ItsNotMyFaultException extends RuntimeException { @Override public String toString() { return "The GregTech-Addon has a Problem.\nIT'S NOT MY FAULT!!! Below is how to fix it.\n" + mError - + "\nDO NOT COME TO ME WITH THIS CRASH. YOU CAUSED IT YOURSELF, AND I TOLD YOU HOW TO FIX IT!!!"; + + "\nDO NOT COME TO ME WITH THIS CRASH. YOU CAUSED IT YOURSELF, AND I TOLD YOU HOW TO FIX IT!!!"; } } diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java index 26651b42a3..eeaa12a9ed 100644 --- a/src/main/java/gregtech/api/util/GT_LanguageManager.java +++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java @@ -20,15 +20,15 @@ import gregtech.api.GregTech_API; public class GT_LanguageManager { public static final HashMap TEMPMAP = new HashMap<>(), BUFFERMAP = new HashMap<>(), - LANGMAP = new HashMap<>(); + LANGMAP = new HashMap<>(); public static Configuration sEnglishFile; public static String sLanguage = "en_US"; public static boolean sUseEnglishFile = false; public static boolean i18nPlaceholder = true; public static String FACE_ANY = "gt.lang.face.any", FACE_BOTTOM = "gt.lang.face.bottom", - FACE_TOP = "gt.lang.face.top", FACE_LEFT = "gt.lang.face.left", FACE_FRONT = "gt.lang.face.front", - FACE_RIGHT = "gt.lang.face.right", FACE_BACK = "gt.lang.face.back", FACE_NONE = "gt.lang.face.none"; + FACE_TOP = "gt.lang.face.top", FACE_LEFT = "gt.lang.face.left", FACE_FRONT = "gt.lang.face.front", + FACE_RIGHT = "gt.lang.face.right", FACE_BACK = "gt.lang.face.back", FACE_NONE = "gt.lang.face.none"; public static String[] FACES = { FACE_BOTTOM, FACE_TOP, FACE_LEFT, FACE_FRONT, FACE_RIGHT, FACE_BACK, FACE_NONE }; @@ -36,17 +36,13 @@ public class GT_LanguageManager { static { try { - Field fieldStringTranslateLanguageList = ReflectionHelper.findField( - net.minecraft.util.StringTranslate.class, - "languageList", - "field_74816_c"); - Field fieldStringTranslateInstance = ReflectionHelper.findField( - net.minecraft.util.StringTranslate.class, - "instance", - "field_74817_a"); + Field fieldStringTranslateLanguageList = ReflectionHelper + .findField(net.minecraft.util.StringTranslate.class, "languageList", "field_74816_c"); + Field fieldStringTranslateInstance = ReflectionHelper + .findField(net.minecraft.util.StringTranslate.class, "instance", "field_74817_a"); // noinspection unchecked - stringTranslateLanguageList = (Map) fieldStringTranslateLanguageList.get( - fieldStringTranslateInstance.get(null)); + stringTranslateLanguageList = (Map) fieldStringTranslateLanguageList + .get(fieldStringTranslateInstance.get(null)); } catch (Exception e) { e.printStackTrace(); } @@ -67,7 +63,7 @@ public class GT_LanguageManager { } TEMPMAP.put(aKey.trim(), aEnglish); LanguageRegistry.instance() - .injectLanguage(sLanguage, TEMPMAP); + .injectLanguage(sLanguage, TEMPMAP); TEMPMAP.clear(); if (sUseEnglishFile && !aWriteIntoLangFile) { if (!LANGMAP.containsKey(aKey)) { @@ -95,7 +91,7 @@ public class GT_LanguageManager { Property tProperty = sEnglishFile.get("LanguageFile", aKey.trim(), aEnglish); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sEnglishFile.save(); if (sEnglishFile.get("EnableLangFile", "UseThisFileAsLanguageFile", false) - .getBoolean(false)) { + .getBoolean(false)) { aEnglish = tProperty.getString(); sUseEnglishFile = true; } @@ -108,7 +104,7 @@ public class GT_LanguageManager { String tTrimmedKey = aKey.trim(), rTranslation; if (sUseEnglishFile) { rTranslation = LanguageRegistry.instance() - .getStringLocalization(tTrimmedKey); + .getStringLocalization(tTrimmedKey); } else { rTranslation = StatCollector.translateToLocal(tTrimmedKey); } @@ -148,7 +144,7 @@ public class GT_LanguageManager { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("display")) { String tName = tNBT.getCompoundTag("display") - .getString("Name"); + .getString("Name"); if (GT_Utility.isStringValid(tName)) { return tName; } @@ -219,13 +215,13 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_065", "Emit if 5 Maintenance Needed(inverted)"); addStringLocalization("Interaction_DESCRIPTION_Index_066", "Emit if rotor needs maintenance low accuracy mod"); addStringLocalization( - "Interaction_DESCRIPTION_Index_067", - "Emit if rotor needs maintenance low accuracy mod(inverted)"); + "Interaction_DESCRIPTION_Index_067", + "Emit if rotor needs maintenance low accuracy mod(inverted)"); addStringLocalization("Interaction_DESCRIPTION_Index_068", "Emit if rotor needs maintenance high accuracy mod"); addStringLocalization("Interaction_DESCRIPTION_Index_068.1", "Emit if any Player is close"); addStringLocalization( - "Interaction_DESCRIPTION_Index_069", - "Emit if rotor needs maintenance high accuracy mod(inverted)"); + "Interaction_DESCRIPTION_Index_069", + "Emit if rotor needs maintenance high accuracy mod(inverted)"); addStringLocalization("Interaction_DESCRIPTION_Index_069.1", "Emit if other Player is close"); addStringLocalization("Interaction_DESCRIPTION_Index_070", "Emit if you are close"); addStringLocalization("Interaction_DESCRIPTION_Index_071", "Conducts strongest Input"); @@ -373,8 +369,8 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_204", "No Pollution in Chunk! HAYO!"); addStringLocalization("Interaction_DESCRIPTION_Index_206", "Scan for Assembly Line"); addStringLocalization( - "Interaction_DESCRIPTION_Index_207", - "Pump speed: %dL every %d ticks, %.2f L/sec on average"); + "Interaction_DESCRIPTION_Index_207", + "Pump speed: %dL every %d ticks, %.2f L/sec on average"); addStringLocalization("Interaction_DESCRIPTION_Index_208", " L"); addStringLocalization("Interaction_DESCRIPTION_Index_209", " ticks"); addStringLocalization("Interaction_DESCRIPTION_Index_209.1", " tick"); @@ -391,8 +387,8 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_222", "Fluid threshold"); addStringLocalization("Interaction_DESCRIPTION_Index_222.1", "Energy threshold"); addStringLocalization( - "Interaction_DESCRIPTION_Index_223", - "Single recipe locking enabled. Will lock to next recipe."); + "Interaction_DESCRIPTION_Index_223", + "Single recipe locking enabled. Will lock to next recipe."); addStringLocalization("Interaction_DESCRIPTION_Index_224", "Always On"); addStringLocalization("Interaction_DESCRIPTION_Index_225", "Active with Redstone Signal"); addStringLocalization("Interaction_DESCRIPTION_Index_226", "Inactive with Redstone Signal"); @@ -436,8 +432,8 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_262", "Fluid Auto Output Disabled"); addStringLocalization("Interaction_DESCRIPTION_Index_263", "Fluid Auto Output Enabled"); addStringLocalization( - "Interaction_DESCRIPTION_Index_264", - "currently none, will be locked to the next that is put in"); + "Interaction_DESCRIPTION_Index_264", + "currently none, will be locked to the next that is put in"); addStringLocalization("Interaction_DESCRIPTION_Index_265", "1 specific Fluid"); addStringLocalization("Interaction_DESCRIPTION_Index_266", "Lock Fluid Mode Disabled"); addStringLocalization("Interaction_DESCRIPTION_Index_267", "Overflow Voiding Mode Disabled"); diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 3ed707822a..58cadd9d7d 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -84,7 +84,7 @@ public class GT_ModHandler { private static final Map sIC2ItemMap = new HashMap<>(); private static final List sAllRecipeList = new ArrayList<>(5000), - sBufferRecipeList = new ArrayList<>(1000); + sBufferRecipeList = new ArrayList<>(1000); private static final List delayedRemovalByOutput = new ArrayList<>(); private static final List delayedRemovalByRecipe = new ArrayList<>(); @@ -106,50 +106,50 @@ public class GT_ModHandler { private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0); private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R"; private static final ItemStack[][] sShapes1 = new ItemStack[][] { - { sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null }, - { sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1 }, - { null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1 }, - { sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null }, - { sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, - { sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1 }, - { null, null, null, sMt1, null, sMt1, sMt1, null, sMt1 }, - { null, sMt1, null, null, sMt1, null, null, sMt2, null }, - { sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, - { null, sMt1, null, null, sMt2, null, null, sMt2, null }, - { sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null }, - { null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null }, - { sMt1, sMt1, null, null, sMt2, null, null, sMt2, null }, - { null, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, - { null, sMt1, null, sMt1, null, null, null, sMt1, sMt2 }, - { null, sMt1, null, null, null, sMt1, sMt2, sMt1, null }, - { null, sMt1, null, sMt1, null, sMt1, null, null, sMt2 }, - { null, sMt1, null, sMt1, null, sMt1, sMt2, null, null }, - { null, sMt2, null, null, sMt1, null, null, sMt1, null }, - { null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1 }, - { null, sMt2, null, null, sMt2, null, null, sMt1, null }, - { null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null }, - { null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1 }, - { null, sMt2, null, null, sMt2, null, sMt1, sMt1, null }, - { sMt1, null, null, null, sMt2, null, null, null, sMt2 }, - { null, null, sMt1, null, sMt2, null, sMt2, null, null }, - { sMt1, null, null, null, sMt2, null, null, null, null }, - { null, null, sMt1, null, sMt2, null, null, null, null }, - { sMt1, sMt2, null, null, null, null, null, null, null }, - { sMt2, sMt1, null, null, null, null, null, null, null }, - { sMt1, null, null, sMt2, null, null, null, null, null }, - { sMt2, null, null, sMt1, null, null, null, null, null }, - { sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null }, - { sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null }, - { null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1 }, - { null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, - { sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null }, - { sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null }, - { null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1 }, - { null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1 }, - { sMt1, null, null, null, sMt1, null, null, null, null }, - { null, sMt1, null, sMt1, null, null, null, null, null }, - { sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null }, - { null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2 } }; + { sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null }, + { sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1 }, + { null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null }, + { sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1 }, + { null, null, null, sMt1, null, sMt1, sMt1, null, sMt1 }, + { null, sMt1, null, null, sMt1, null, null, sMt2, null }, + { sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, + { null, sMt1, null, null, sMt2, null, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null }, + { null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, null, sMt2, null, null, sMt2, null }, + { null, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, + { null, sMt1, null, sMt1, null, null, null, sMt1, sMt2 }, + { null, sMt1, null, null, null, sMt1, sMt2, sMt1, null }, + { null, sMt1, null, sMt1, null, sMt1, null, null, sMt2 }, + { null, sMt1, null, sMt1, null, sMt1, sMt2, null, null }, + { null, sMt2, null, null, sMt1, null, null, sMt1, null }, + { null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1 }, + { null, sMt2, null, null, sMt2, null, null, sMt1, null }, + { null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null }, + { null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, null, sMt2, null, sMt1, sMt1, null }, + { sMt1, null, null, null, sMt2, null, null, null, sMt2 }, + { null, null, sMt1, null, sMt2, null, sMt2, null, null }, + { sMt1, null, null, null, sMt2, null, null, null, null }, + { null, null, sMt1, null, sMt2, null, null, null, null }, + { sMt1, sMt2, null, null, null, null, null, null, null }, + { sMt2, sMt1, null, null, null, null, null, null, null }, + { sMt1, null, null, sMt2, null, null, null, null, null }, + { sMt2, null, null, sMt1, null, null, null, null, null }, + { sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null }, + { null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null }, + { null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, null, null, null, sMt1, null, null, null, null }, + { null, sMt1, null, sMt1, null, null, null, null, null }, + { sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null }, + { null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2 } }; public static List sSingleNonBlockDamagableRecipeList_validsShapes1 = new ArrayList<>(44); public static boolean sSingleNonBlockDamagableRecipeList_validsShapes1_update = false; public static List sSingleNonBlockDamagableRecipeList_warntOutput = new ArrayList<>(50); @@ -397,10 +397,8 @@ public class GT_ModHandler { if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) { result = null; } else { - result = GT_Utility.copyAmount( - aAmount, - GameRegistry.findItemStack(aModID, aItem, (int) aAmount), - aReplacement); + result = GT_Utility + .copyAmount(aAmount, GameRegistry.findItemStack(aModID, aItem, (int) aAmount), aReplacement); } if (result == null) { @@ -413,10 +411,10 @@ public class GT_ModHandler { reason = "the item was not found in the game registry"; } String log_message = "getModItem call: object \"" + aItem - + "\" with mod id \"" - + aModID - + "\" has returned null because " - + reason; + + "\" with mod id \"" + + aModID + + "\" has returned null because " + + reason; GT_Log.out.println(log_message); new Exception().printStackTrace(GT_Log.out); } @@ -472,8 +470,8 @@ public class GT_ModHandler { if (aValue <= 0) return false; try { Class.forName("ic2.core.IC2") - .getMethod("addValuableOre", IRecipeInput.class, int.class) - .invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue); + .getMethod("addValuableOre", IRecipeInput.class, int.class) + .invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue); } catch (Throwable e) { /* Do nothing */ } @@ -492,21 +490,21 @@ public class GT_ModHandler { if (aChance <= 0) return false; try { GT_Utility.callMethod( - GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), - "addDrop", - true, - false, - true, - GT_Utility.copyOrNull(aOutput), - aChance); + GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), + "addDrop", + true, + false, + true, + GT_Utility.copyOrNull(aOutput), + aChance); GT_Utility.callMethod( - GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), - "addRecipe", - true, - true, - false, - GT_Utility.copyOrNull(aOutput), - aChance); + GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true, true), + "addRecipe", + true, + true, + false, + GT_Utility.copyOrNull(aOutput), + aChance); } catch (Throwable e) { /* Do nothing */ } @@ -534,7 +532,7 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || GT_Utility.getContainerItem(aInput, false) != null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.smelting, aInput, true)) return false; FurnaceRecipes.smelting() - .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); + .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); return true; } @@ -546,21 +544,21 @@ public class GT_ModHandler { boolean temp = false; if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = true; return (RA.addAlloySmelterRecipe( - aInput, - OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0) - : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0) - : OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null, - aOutput, - 130, - 3, - hidden)); + aInput, + OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0) + : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0) + : OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null, + aOutput, + 130, + 3, + hidden)); } /** * LiquidTransposer Recipe for both directions */ public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, - ItemStack aFullContainer, int aMJ) { + ItemStack aFullContainer, int aMJ) { return true; } @@ -568,7 +566,7 @@ public class GT_ModHandler { * LiquidTransposer Recipe for filling Containers */ public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, - ItemStack aFullContainer, int aMJ) { + ItemStack aFullContainer, int aMJ) { return true; } @@ -576,7 +574,7 @@ public class GT_ModHandler { * LiquidTransposer Recipe for emptying Containers */ public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, - ItemStack aEmptyContainer, int aMJ) { + ItemStack aEmptyContainer, int aMJ) { return true; } @@ -608,7 +606,7 @@ public class GT_ModHandler { } public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - int aChance) { + int aChance) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false); } @@ -617,12 +615,12 @@ public class GT_ModHandler { } public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - boolean aOverwrite) { + boolean aOverwrite) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite); } public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, - boolean aOverwrite) { + boolean aOverwrite) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite); } @@ -630,24 +628,24 @@ public class GT_ModHandler { * Adds Several Pulverizer-Type Recipes. */ public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, - ItemStack aOutput3, int aChance3, boolean aOverwrite) { + ItemStack aOutput3, int aChance3, boolean aOverwrite) { aOutput1 = GT_OreDictUnificator.get(true, aOutput1); aOutput2 = GT_OreDictUnificator.get(true, aOutput2); if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false; if (GT_Utility.getContainerItem(aInput, false) == null) { RA.addPulveriserRecipe( - aInput, - new ItemStack[] { aOutput1, aOutput2, aOutput3 }, - new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 }, - 400, - 2); + aInput, + new ItemStack[] { aOutput1, aOutput2, aOutput3 }, + new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 }, + 400, + 2); } return true; } public static boolean addPulverisationRecipe(ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray, - int aEUt, int aRecipeDurationInTicks) { + int aEUt, int aRecipeDurationInTicks) { ItemStack[] aUnifiedOutputArray = new ItemStack[aOutputArray.length]; int counter = 0; @@ -663,12 +661,12 @@ public class GT_ModHandler { } public static boolean addImmersiveEngineeringRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - int aChance2, ItemStack aOutput3, int aChance3) { + int aChance2, ItemStack aOutput3, int aChance3) { return true; } public static boolean addMagneticraftRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, - ItemStack aOutput3, int aChance3) { + ItemStack aOutput3, int aChance3) { return true; } @@ -683,7 +681,7 @@ public class GT_ModHandler { * Induction Smelter Recipes and Alloy Smelter Recipes */ public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt, boolean aAllowSecondaryInputEmpty) { + int aEUt, boolean aAllowSecondaryInputEmpty) { if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false; aOutput1 = GT_OreDictUnificator.get(true, aOutput1); return RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt); @@ -693,7 +691,7 @@ public class GT_ModHandler { * Induction Smelter Recipes for TE */ public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, - ItemStack aOutput2, int aEnergy, int aChance) { + ItemStack aOutput2, int aEnergy, int aChance) { return true; } @@ -704,7 +702,7 @@ public class GT_ModHandler { aOutput = GT_OreDictUnificator.get(true, aOutput); if (aInput == null || aOutput == null) return false; FurnaceRecipes.smelting() - .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); + .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); return true; } @@ -712,32 +710,33 @@ public class GT_ModHandler { * Adds GT versions of the IC2 recipes from the supplied IC2RecipeList. */ public static void addIC2RecipesToGT(Map aIC2RecipeList, - GT_Recipe.GT_Recipe_Map aGTRecipeMap, boolean aAddGTRecipe, boolean aRemoveIC2Recipe, - boolean aExcludeGTIC2Items) { + GT_Recipe.GT_Recipe_Map aGTRecipeMap, boolean aAddGTRecipe, boolean aRemoveIC2Recipe, + boolean aExcludeGTIC2Items) { Map aRecipesToRemove = new HashMap<>(); for (Entry iRecipeInputRecipeOutputEntry : aIC2RecipeList.entrySet()) { if (!iRecipeInputRecipeOutputEntry.getValue().items.isEmpty()) { for (ItemStack tStack : (iRecipeInputRecipeOutputEntry.getKey()).getInputs()) { if (GT_Utility.isStackValid(tStack)) { if (aAddGTRecipe - && (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) { + && (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) { try { if (aExcludeGTIC2Items && ((tStack.getUnlocalizedName() - .contains("gt.metaitem.01") - || tStack.getUnlocalizedName() - .contains("gt.blockores") - || tStack.getUnlocalizedName() - .contains("ic2.itemCrushed") - || tStack.getUnlocalizedName() - .contains("ic2.itemPurifiedCrushed")))) + .contains("gt.metaitem.01") + || tStack.getUnlocalizedName() + .contains("gt.blockores") + || tStack.getUnlocalizedName() + .contains("ic2.itemCrushed") + || tStack.getUnlocalizedName() + .contains("ic2.itemPurifiedCrushed")))) continue; switch (aGTRecipeMap.mUnlocalizedName) { - case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> aGTRecipeMap.addRecipe( + case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> aGTRecipeMap + .addRecipe( true, new ItemStack[] { GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry.getKey() - .getAmount(), - tStack) }, + iRecipeInputRecipeOutputEntry.getKey() + .getAmount(), + tStack) }, iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), null, null, @@ -747,19 +746,19 @@ public class GT_ModHandler { 2, 0); case "gt.recipe.thermalcentrifuge" -> aGTRecipeMap.addRecipe( - true, - new ItemStack[] { GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry.getKey() - .getAmount(), - tStack) }, - iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), - null, - null, - null, - null, - 500, - 48, - 0); + true, + new ItemStack[] { GT_Utility.copyAmount( + iRecipeInputRecipeOutputEntry.getKey() + .getAmount(), + tStack) }, + iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), + null, + null, + null, + null, + 500, + 48, + 0); } } catch (Exception e) { System.err.println(e); @@ -835,13 +834,13 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false; RA.addThermalCentrifugeRecipe( - aInput, - aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, - aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, - aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, - aChances, - 500, - 48); + aInput, + aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, + aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, + aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, + aChances, + 500, + 48); return true; } @@ -849,12 +848,12 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false; RA.addThermalCentrifugeRecipe( - aInput, - aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, - aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, - aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, - 500, - 48); + aInput, + aOutput.length >= 1 ? (ItemStack) aOutput[0] : null, + aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, + aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, + 500, + 48); return true; } @@ -865,23 +864,23 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false; RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getWater(aWaterAmount), - aChances, - 500, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getWater(aWaterAmount), + aChances, + 500, + 16); RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getDistilledWater(aWaterAmount / 5), - aChances, - 300, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getDistilledWater(aWaterAmount / 5), + aChances, + 300, + 16); return true; } @@ -889,21 +888,21 @@ public class GT_ModHandler { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false; RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getWater(aWaterAmount), - 500, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getWater(aWaterAmount), + 500, + 16); RA.addOreWasherRecipe( - aInput, - (ItemStack) aOutput[0], - (ItemStack) aOutput[1], - (ItemStack) aOutput[2], - GT_ModHandler.getDistilledWater(aWaterAmount / 5), - 300, - 16); + aInput, + (ItemStack) aOutput[0], + (ItemStack) aOutput[1], + (ItemStack) aOutput[2], + GT_ModHandler.getDistilledWater(aWaterAmount / 5), + 300, + 16); return true; } @@ -934,14 +933,8 @@ public class GT_ModHandler { try { NBTTagCompound tNBT = new NBTTagCompound(); tNBT.setInteger("amplification", aValue); - GT_Utility.callMethod( - ic2.api.recipe.Recipes.matterAmplifier, - "addRecipe", - false, - false, - false, - aAmplifier, - tNBT); + GT_Utility + .callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT); } catch (Throwable e) { /* Do nothing */ } @@ -956,11 +949,7 @@ public class GT_ModHandler { if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false; try { mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList() - .add( - new ShapedOreRecipe( - GT_Utility.copyOrNull( - aResult), - aRecipe)); + .add(new ShapedOreRecipe(GT_Utility.copyOrNull(aResult), aRecipe)); } catch (Throwable e) { return addCraftingRecipe(GT_Utility.copyOrNull(aResult), aRecipe); } @@ -983,25 +972,25 @@ public class GT_ModHandler { * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ public static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, Object[] aRecipe) { return addCraftingRecipe( - aResult, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - aRecipe); + aResult, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + aRecipe); } /** @@ -1046,34 +1035,34 @@ public class GT_ModHandler { */ public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { return addCraftingRecipe( - aResult, - new Enchantment[0], - new int[0], - (aBitMask & RecipeBits.MIRRORED) != 0, - (aBitMask & RecipeBits.BUFFERED) != 0, - (aBitMask & RecipeBits.KEEPNBT) != 0, - (aBitMask & RecipeBits.DISMANTLEABLE) != 0, - (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, - (aBitMask & RecipeBits.REVERSIBLE) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0, - (aBitMask & RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0, - (aBitMask & RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0, - (aBitMask & RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0, - (aBitMask & RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0, - aRecipe); + aResult, + new Enchantment[0], + new int[0], + (aBitMask & RecipeBits.MIRRORED) != 0, + (aBitMask & RecipeBits.BUFFERED) != 0, + (aBitMask & RecipeBits.KEEPNBT) != 0, + (aBitMask & RecipeBits.DISMANTLEABLE) != 0, + (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, + (aBitMask & RecipeBits.REVERSIBLE) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0, + (aBitMask & RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0, + (aBitMask & RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0, + (aBitMask & RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0, + (aBitMask & RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0, + aRecipe); } /** * Internal realisation of the Crafting Recipe adding Process. */ private static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, - boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, - boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, - boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, - boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, + boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return false; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -1086,10 +1075,9 @@ public class GT_ModHandler { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack - || aRecipe[i] instanceof ItemData - || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) - aRecipe[i] = aRecipe[i].toString(); + || aRecipe[i] instanceof ItemData + || aRecipe[i] instanceof String + || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); } try { @@ -1108,7 +1096,7 @@ public class GT_ModHandler { if (s.length() > 3) throw new IllegalArgumentException(); for (char c : s.toString() - .toCharArray()) { + .toCharArray()) { switch (c) { case 'b' -> { tRecipeList.add(c); @@ -1185,8 +1173,8 @@ public class GT_ModHandler { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { GT_Log.err.println( - "WARNING: Missing Item for shaped Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + "WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return false; @@ -1234,8 +1222,7 @@ public class GT_ModHandler { ItemData[] tData = new ItemData[9]; int x = -1; for (char chr : shape.toString() - .toCharArray()) - tData[++x] = tItemDataMap.get(chr); + .toCharArray()) tData[++x] = tItemDataMap.get(chr); if (GT_Utility.arrayContainsNonNull(tData)) GT_OreDictUnificator.addItemData(aResult, new ItemData(tData)); } @@ -1244,7 +1231,7 @@ public class GT_ModHandler { ItemStack[] tRecipe = new ItemStack[9]; int x = -1; for (char chr : shape.toString() - .toCharArray()) { + .toCharArray()) { tRecipe[++x] = tItemStackMap.get(chr); if (tRecipe[x] != null && Items.feather.getDamage(tRecipe[x]) == W) Items.feather.setDamage(tRecipe[x], 0); @@ -1260,25 +1247,25 @@ public class GT_ModHandler { if (aResult == null || aResult.stackSize <= 0) return false; if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT - || aRemoveAllOtherShapedsWithSameOutput - || aRemoveAllOtherNativeRecipes) { + || aRemoveAllOtherShapedsWithSameOutput + || aRemoveAllOtherNativeRecipes) { if (tDoWeCareIfThereWasARecipe || !aBuffered) tThereWasARecipe = removeRecipeByOutput( - aResult, - !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - aRemoveAllOtherShapedsWithSameOutput, - aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) || tThereWasARecipe; else removeRecipeByOutputDelayed(aResult); } if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tDoWeCareIfThereWasARecipe && !tThereWasARecipe) { ArrayList tList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); int tList_sS = tList.size(); for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { IRecipe tRecipe = tList.get(i); if (sSpecialRecipeClasses.contains( - tRecipe.getClass() - .getName())) + tRecipe.getClass() + .getName())) continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { tList.remove(i--); @@ -1295,23 +1282,23 @@ public class GT_ModHandler { if (tThereWasARecipe || !aOnlyAddIfThereIsAnyRecipeOutputtingThis) { if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add( - new GT_Shaped_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe).setMirrored(aMirrored)); + new GT_Shaped_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe).setMirrored(aMirrored)); else GameRegistry.addRecipe( - new GT_Shaped_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe).setMirrored(aMirrored)); + new GT_Shaped_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe).setMirrored(aMirrored)); } return true; } @@ -1320,16 +1307,16 @@ public class GT_ModHandler { * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ public static boolean addShapelessEnchantingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, Object[] aRecipe) { return addShapelessCraftingRecipe( - aResult, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - true, - false, - false, - false, - aRecipe); + aResult, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + true, + false, + false, + false, + aRecipe); } /** @@ -1337,9 +1324,9 @@ public class GT_ModHandler { */ public static boolean addShapelessCraftingRecipe(ItemStack aResult, Object[] aRecipe) { return addShapelessCraftingRecipe( - aResult, - RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, - aRecipe); + aResult, + RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, + aRecipe); } /** @@ -1347,31 +1334,30 @@ public class GT_ModHandler { */ public static boolean addShapelessCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { return addShapelessCraftingRecipe( - aResult, - new Enchantment[0], - new int[0], - (aBitMask & RecipeBits.BUFFERED) != 0, - (aBitMask & RecipeBits.KEEPNBT) != 0, - (aBitMask & RecipeBits.DISMANTLEABLE) != 0, - (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, - aRecipe); + aResult, + new Enchantment[0], + new int[0], + (aBitMask & RecipeBits.BUFFERED) != 0, + (aBitMask & RecipeBits.KEEPNBT) != 0, + (aBitMask & RecipeBits.DISMANTLEABLE) != 0, + (aBitMask & RecipeBits.NOT_REMOVABLE) == 0, + aRecipe); } /** * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ private static boolean addShapelessCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, - boolean aRemovable, Object[] aRecipe) { + int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, + Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aRecipe == null || aRecipe.length <= 0) return false; for (byte i = 0; i < aRecipe.length; i++) { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack - || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) - aRecipe[i] = aRecipe[i].toString(); + || aRecipe[i] instanceof String + || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); } try { ItemStack[] tRecipe = new ItemStack[9]; @@ -1379,8 +1365,8 @@ public class GT_ModHandler { for (Object tObject : aRecipe) { if (tObject == null) { if (D1) GT_Log.err.println( - "WARNING: Missing Item for shapeless Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + "WARNING: Missing Item for shapeless Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); return false; } @@ -1406,23 +1392,23 @@ public class GT_ModHandler { GT_Utility.updateItemStack(aResult); if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add( - new GT_Shapeless_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe)); + new GT_Shapeless_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe)); else GameRegistry.addRecipe( - new GT_Shapeless_Recipe( - GT_Utility.copyOrNull(aResult), - aDismantleable, - aRemovable, - aKeepNBT, - aEnchantmentsAdded, - aEnchantmentLevelsAdded, - aRecipe)); + new GT_Shapeless_Recipe( + GT_Utility.copyOrNull(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe)); return true; } @@ -1432,12 +1418,12 @@ public class GT_ModHandler { public static boolean removeFurnaceSmelting(ItemStack aInput) { if (aInput != null) { for (ItemStack tInput : FurnaceRecipes.smelting() - .getSmeltingList() - .keySet()) { + .getSmeltingList() + .keySet()) { if (GT_Utility.isStackValid(tInput) && GT_Utility.areStacksEqual(aInput, tInput, true)) { FurnaceRecipes.smelting() - .getSmeltingList() - .remove(tInput); + .getSmeltingList() + .remove(tInput); return true; } } @@ -1451,11 +1437,10 @@ public class GT_ModHandler { public static boolean removeFurnaceSmeltingByOutput(ItemStack aOutput) { if (aOutput != null) { return FurnaceRecipes.smelting() - .getSmeltingList() - .values() - .removeIf( - tOutput -> GT_Utility.isStackValid(tOutput) - && GT_Utility.areStacksEqual(aOutput, tOutput, true)); + .getSmeltingList() + .values() + .removeIf( + tOutput -> GT_Utility.isStackValid(tOutput) && GT_Utility.areStacksEqual(aOutput, tOutput, true)); } return false; } @@ -1469,8 +1454,7 @@ public class GT_ModHandler { public static ItemStack removeRecipe(ItemStack... aRecipe) { if (aRecipe == null) return null; if (Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return null; + .noneMatch(Objects::nonNull)) return null; ItemStack rReturn = null; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1482,16 +1466,16 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); ArrayList tList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); int tList_sS = tList.size(); try { for (int i = 0; i < tList_sS; i++) { for (; i < tList_sS; i++) { if ((!(tList.get(i) instanceof IGT_CraftingRecipe) - || ((IGT_CraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i) - .matches(aCrafting, DW)) { + || ((IGT_CraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i) + .matches(aCrafting, DW)) { rReturn = tList.get(i) - .getCraftingResult(aCrafting); + .getCraftingResult(aCrafting); if (rReturn != null) tList.remove(i--); tList_sS = tList.size(); } @@ -1511,8 +1495,7 @@ public class GT_ModHandler { if (aRecipe == null) return; if (Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return; + .noneMatch(Objects::nonNull)) return; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1528,18 +1511,17 @@ public class GT_ModHandler { @SuppressWarnings("unchecked") public static void bulkRemoveByRecipe(List toRemove) { ArrayList tList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); GT_FML_LOGGER.info("BulkRemoveByRecipe: tList: " + tList.size() + " toRemove: " + toRemove.size()); Set tListToRemove = tList.parallelStream() - .filter(tRecipe -> { - if ((tRecipe instanceof IGT_CraftingRecipe) - && !((IGT_CraftingRecipe) tRecipe).isRemovable()) - return false; - return toRemove.stream() - .anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW)); - }) - .collect(Collectors.toSet()); + .filter(tRecipe -> { + if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) + return false; + return toRemove.stream() + .anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW)); + }) + .collect(Collectors.toSet()); tList.removeIf(tListToRemove::contains); } @@ -1550,7 +1532,7 @@ public class GT_ModHandler { } public static boolean removeRecipeByOutputDelayed(ItemStack aOutput, boolean aIgnoreNBT, - boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { + boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { if (sBufferCraftingRecipes && (aIgnoreNBT && !aNotRemoveShapelessRecipes && !aOnlyRemoveNativeHandlers)) // Too lazy to handle deferred versions of the parameters that aren't used very often return delayedRemovalByOutput.add(aOutput); @@ -1568,32 +1550,31 @@ public class GT_ModHandler { * @return if it has removed at least one Recipe. */ public static boolean removeRecipeByOutput(ItemStack aOutput, boolean aIgnoreNBT, - boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { + boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) { if (aOutput == null) return false; boolean rReturn = false; ArrayList tList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); aOutput = GT_OreDictUnificator.get(aOutput); int tList_sS = tList.size(); for (int i = 0; i < tList_sS; i++) { IRecipe tRecipe = tList.get(i); if (aNotRemoveShapelessRecipes - && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) - continue; + && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) continue; if (aOnlyRemoveNativeHandlers) { if (!sNativeRecipeClasses.contains( - tRecipe.getClass() - .getName())) + tRecipe.getClass() + .getName())) continue; } else { if (sSpecialRecipeClasses.contains( - tRecipe.getClass() - .getName())) + tRecipe.getClass() + .getName())) continue; } ItemStack tStack = tRecipe.getRecipeOutput(); if ((!(tRecipe instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe) tRecipe).isRemovable()) - && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { + && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) { tList.remove(i--); tList_sS = tList.size(); rReturn = true; @@ -1604,33 +1585,27 @@ public class GT_ModHandler { public static boolean bulkRemoveRecipeByOutput(List toRemove) { ArrayList tList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); Set setToRemove = toRemove.parallelStream() - .map(GT_OreDictUnificator::get_nocopy) - .collect(Collectors.toSet()); + .map(GT_OreDictUnificator::get_nocopy) + .collect(Collectors.toSet()); GT_FML_LOGGER.info("BulkRemoveRecipeByOutput: tList: " + tList.size() + " setToRemove: " + setToRemove.size()); Set tListToRemove = tList.parallelStream() - .filter(tRecipe -> { - if ((tRecipe instanceof IGT_CraftingRecipe) - && !((IGT_CraftingRecipe) tRecipe).isRemovable()) - return false; - if (sSpecialRecipeClasses.contains( - tRecipe.getClass() - .getName())) - return false; - final ItemStack tStack = GT_OreDictUnificator.get_nocopy( - tRecipe.getRecipeOutput()); - return setToRemove.stream() - .anyMatch( - aOutput -> GT_Utility.areStacksEqual( - tStack, - aOutput, - true)); - }) - .collect(Collectors.toSet()); + .filter(tRecipe -> { + if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) + return false; + if (sSpecialRecipeClasses.contains( + tRecipe.getClass() + .getName())) + return false; + final ItemStack tStack = GT_OreDictUnificator.get_nocopy(tRecipe.getRecipeOutput()); + return setToRemove.stream() + .anyMatch(aOutput -> GT_Utility.areStacksEqual(tStack, aOutput, true)); + }) + .collect(Collectors.toSet()); tList.removeIf(tListToRemove::contains); return true; @@ -1661,7 +1636,7 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); List tList = CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); synchronized (sAllRecipeList) { if (sAllRecipeList.size() != tList.size()) { sAllRecipeList.clear(); @@ -1693,12 +1668,12 @@ public class GT_ModHandler { if (tIndex == 2) { assert tStack1 != null && tStack2 != null; if (tStack1.getItem() == tStack2.getItem() && tStack1.stackSize == 1 - && tStack2.stackSize == 1 - && tStack1.getItem() - .isRepairable()) { + && tStack2.stackSize == 1 + && tStack1.getItem() + .isRepairable()) { int tNewDamage = tStack1.getMaxDamage() + tStack1.getItemDamage() - - tStack2.getItemDamage() - + tStack1.getMaxDamage() / 20; + - tStack2.getItemDamage() + + tStack1.getMaxDamage() / 20; return new ItemStack(tStack1.getItem(), 1, Math.max(tNewDamage, 0)); } } @@ -1727,8 +1702,7 @@ public class GT_ModHandler { @SuppressWarnings("unchecked") public static ItemStack getRecipeOutput(boolean aUncopiedStack, boolean allowOreDict, ItemStack... aRecipe) { if (aRecipe == null || Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return null; + .noneMatch(Objects::nonNull)) return null; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1739,7 +1713,7 @@ public class GT_ModHandler { }, 3, 3); for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]); ArrayList tList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); boolean found = false; for (IRecipe iRecipe : tList) { @@ -1756,7 +1730,7 @@ public class GT_ModHandler { if (tOutput == null || tOutput.stackSize <= 0) { // Seriously, who would ever do that shit? if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException( - "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); } else { if (aUncopiedStack) return tOutput; return GT_Utility.copyOrNull(tOutput); @@ -1775,22 +1749,22 @@ public class GT_ModHandler { sSingleNonBlockDamagableRecipeList.clear(); if (sSingleNonBlockDamagableRecipeList.isEmpty()) { for (IRecipe tRecipe : CraftingManager.getInstance() - .getRecipeList()) { + .getRecipeList()) { ItemStack tStack = tRecipe.getRecipeOutput(); if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 - && tStack.getMaxDamage() > 0 - && !(tStack.getItem() instanceof ItemBlock) - && !(tStack.getItem() instanceof IReactorComponent) - && !isElectricItem(tStack) - && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { + && tStack.getMaxDamage() > 0 + && !(tStack.getItem() instanceof ItemBlock) + && !(tStack.getItem() instanceof IReactorComponent) + && !isElectricItem(tStack) + && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) { if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) { if (tRecipe instanceof ShapedOreRecipe) { boolean temp = true; for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) if (tObject != null) { if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null - || ((ItemStack) tObject).getMaxStackSize() < 2 - || ((ItemStack) tObject).getMaxDamage() > 0 - || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { + || ((ItemStack) tObject).getMaxStackSize() < 2 + || ((ItemStack) tObject).getMaxDamage() > 0 + || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { temp = false; break; } @@ -1804,8 +1778,8 @@ public class GT_ModHandler { boolean temp = true; for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) { if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 - || tObject.getMaxDamage() > 0 - || tObject.getItem() instanceof ItemBlock)) { + || tObject.getMaxDamage() > 0 + || tObject.getItem() instanceof ItemBlock)) { temp = false; break; } @@ -1818,11 +1792,11 @@ public class GT_ModHandler { } } GT_Log.out.println( - "GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() - + " Recipes for recycling." - + (sSingleNonBlockDamagableRecipeList.size() > 1024 - ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." - : E)); + "GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + + " Recipes for recycling." + + (sSingleNonBlockDamagableRecipeList.size() > 1024 + ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." + : E)); } List rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe); if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) @@ -1836,10 +1810,10 @@ public class GT_ModHandler { */ public static List getRecipeOutputs(ItemStack... aRecipe) { return getRecipeOutputs( - CraftingManager.getInstance() - .getRecipeList(), - false, - aRecipe); + CraftingManager.getInstance() + .getRecipeList(), + false, + aRecipe); } private static List bufferedRecipes = null; @@ -1851,25 +1825,21 @@ public class GT_ModHandler { public static List getRecipeOutputsBuffered(ItemStack... aRecipe) { if (bufferedRecipes == null) bufferedRecipes = CraftingManager.getInstance() - .getRecipeList() - .stream() - .filter( - tRecipe -> !(tRecipe instanceof ShapelessRecipes) - && !(tRecipe instanceof ShapelessOreRecipe) - && !(tRecipe instanceof IGT_CraftingRecipe)) - .filter(tRecipe -> { - try { - ItemStack tOutput = tRecipe.getRecipeOutput(); - if (tOutput.stackSize == 1 - && tOutput.getMaxDamage() > 0 - && tOutput.getMaxStackSize() - == 1) { - return true; - } - } catch (Exception ignored) {} - return false; - }) - .collect(Collectors.toList()); + .getRecipeList() + .stream() + .filter( + tRecipe -> !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe) + && !(tRecipe instanceof IGT_CraftingRecipe)) + .filter(tRecipe -> { + try { + ItemStack tOutput = tRecipe.getRecipeOutput(); + if (tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1) { + return true; + } + } catch (Exception ignored) {} + return false; + }) + .collect(Collectors.toList()); return getRecipeOutputs(bufferedRecipes, false, aRecipe); } @@ -1880,8 +1850,7 @@ public class GT_ModHandler { public static List getRecipeOutputs(List aList, boolean aDeleteFromList, ItemStack... aRecipe) { List rList = new ArrayList<>(); if (aRecipe == null || Arrays.stream(aRecipe) - .noneMatch(Objects::nonNull)) - return rList; + .noneMatch(Objects::nonNull)) return rList; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @Override @@ -1893,23 +1862,21 @@ public class GT_ModHandler { if (!aDeleteFromList) { HashSet stacks = new HashSet<>(); aList.stream() - .filter(tRecipe -> { - if (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe - || tRecipe instanceof IGT_CraftingRecipe) - return false; - try { - return tRecipe.matches(aCrafting, DW); - } catch (Throwable e) { - e.printStackTrace(GT_Log.err); - return false; - } - }) - .forEach(tRecipe -> stacks.add(tRecipe.getCraftingResult(aCrafting))); + .filter(tRecipe -> { + if (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe + || tRecipe instanceof IGT_CraftingRecipe) return false; + try { + return tRecipe.matches(aCrafting, DW); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + return false; + } + }) + .forEach(tRecipe -> stacks.add(tRecipe.getCraftingResult(aCrafting))); rList = stacks.stream() - .filter( - tOutput -> tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 - && tOutput.getMaxStackSize() == 1) - .collect(Collectors.toList()); + .filter( + tOutput -> tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1) + .collect(Collectors.toList()); } else for (Iterator iterator = aList.iterator(); iterator.hasNext();) { IRecipe tRecipe = iterator.next(); boolean matched = false; @@ -1925,7 +1892,7 @@ public class GT_ModHandler { if (tOutput == null || tOutput.stackSize <= 0) { // Seriously, who would ever do that shit? if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException( - "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); + "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that."); continue; } if (tOutput.stackSize != 1) continue; @@ -1947,7 +1914,7 @@ public class GT_ModHandler { @Deprecated public static ItemStack getMaceratorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { return GT_Utility.copyOrNull( - getMachineOutput(aInput, getMaceratorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + getMachineOutput(aInput, getMaceratorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); } /** @@ -1956,7 +1923,7 @@ public class GT_ModHandler { @Deprecated public static ItemStack getExtractorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { return GT_Utility.copyOrNull( - getMachineOutput(aInput, getExtractorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); + getMachineOutput(aInput, getExtractorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); } /** @@ -1965,12 +1932,7 @@ public class GT_ModHandler { @Deprecated public static ItemStack getCompressorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { return GT_Utility.copyOrNull( - getMachineOutput( - aInput, - getCompressorRecipeList(), - aRemoveInput, - new NBTTagCompound(), - aOutputSlot)[0]); + getMachineOutput(aInput, getCompressorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]); } /** @@ -1979,11 +1941,11 @@ public class GT_ModHandler { public static ItemStack getSmeltingOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) { if (aInput == null || aInput.stackSize < 1) return null; ItemStack rStack = GT_OreDictUnificator.get( - FurnaceRecipes.smelting() - .getSmeltingResult(aInput)); + FurnaceRecipes.smelting() + .getSmeltingResult(aInput)); if (rStack != null && (aOutputSlot == null || (GT_Utility.areStacksEqual(rStack, aOutputSlot) - && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) { + && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) { if (aRemoveInput) aInput.stackSize--; return rStack; } @@ -1996,16 +1958,15 @@ public class GT_ModHandler { * Checks also if there is enough Space in the Output Slots. */ public static ItemStack[] getMachineOutput(ItemStack aInput, Map aRecipeList, - boolean aRemoveInput, NBTTagCompound rRecipeMetaData, ItemStack... aOutputSlots) { + boolean aRemoveInput, NBTTagCompound rRecipeMetaData, ItemStack... aOutputSlots) { if (aOutputSlots == null || aOutputSlots.length <= 0) return new ItemStack[0]; if (aInput == null) return new ItemStack[aOutputSlots.length]; try { for (Entry tEntry : aRecipeList.entrySet()) { if (tEntry.getKey() - .matches(aInput)) { + .matches(aInput)) { if (tEntry.getKey() - .getAmount() - <= aInput.stackSize) { + .getAmount() <= aInput.stackSize) { ItemStack[] tList = tEntry.getValue().items.toArray(new ItemStack[0]); if (tList.length == 0) break; ItemStack[] rList = new ItemStack[aOutputSlots.length]; @@ -2013,8 +1974,8 @@ public class GT_ModHandler { for (byte i = 0; i < aOutputSlots.length && i < tList.length; i++) { if (tList[i] != null) { if (aOutputSlots[i] == null || (GT_Utility.areStacksEqual(tList[i], aOutputSlots[i]) - && tList[i].stackSize + aOutputSlots[i].stackSize - <= aOutputSlots[i].getMaxStackSize())) { + && tList[i].stackSize + aOutputSlots[i].stackSize + <= aOutputSlots[i].getMaxStackSize())) { rList[i] = GT_Utility.copyOrNull(tList[i]); } else { return new ItemStack[aOutputSlots.length]; @@ -2023,7 +1984,7 @@ public class GT_ModHandler { } if (aRemoveInput) aInput.stackSize -= tEntry.getKey() - .getAmount(); + .getAmount(); return rList; } break; @@ -2073,7 +2034,7 @@ public class GT_ModHandler { * @return the actually used Energy. */ public static int chargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, - boolean aSimulate) { + boolean aSimulate) { try { if (isElectricItem(aStack)) { int tTier = ((ic2.api.item.IElectricItem) aStack.getItem()).getTier(aStack); @@ -2082,8 +2043,8 @@ public class GT_ModHandler { aCharge = (int) Math.min(aCharge, V[Math.max(0, Math.min(V.length - 1, tTier))]); if (aCharge > 0) { int rCharge = (int) Math.max( - 0.0, - ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, true, aSimulate)); + 0.0, + ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, true, aSimulate)); return rCharge + (rCharge * 4 > aTier ? aTier : 0); } } @@ -2102,7 +2063,7 @@ public class GT_ModHandler { * @return the Energy got from the Item. */ public static int dischargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, - boolean aSimulate, boolean aIgnoreDischargability) { + boolean aSimulate, boolean aIgnoreDischargability) { try { // if (isElectricItem(aStack) && (aIgnoreDischargability || // ((ic2.api.item.IElectricItem)aStack.getItem()).canProvideEnergy(aStack))) { @@ -2110,21 +2071,20 @@ public class GT_ModHandler { int tTier = ((ic2.api.item.IElectricItem) aStack.getItem()).getTier(aStack); if (tTier < 0 || tTier == aTier || aTier == Integer.MAX_VALUE) { if (!aIgnoreLimit && tTier >= 0) aCharge = (int) Math.min( - aCharge, - V[Math.max(0, Math.min(V.length - 1, tTier))] - + B[Math.max(0, Math.min(V.length - 1, tTier))]); + aCharge, + V[Math.max(0, Math.min(V.length - 1, tTier))] + B[Math.max(0, Math.min(V.length - 1, tTier))]); if (aCharge > 0) { // int rCharge = Math.max(0, ic2.api.item.ElectricItem.manager.discharge(aStack, aCharge + // (aCharge * 4 > aTier ? aTier : 0), tTier, T, aSimulate)); int rCharge = (int) Math.max( - 0, - ic2.api.item.ElectricItem.manager.discharge( - aStack, - aCharge + (aCharge * 4 > aTier ? aTier : 0), - tTier, - true, - !aIgnoreDischargability, - aSimulate)); + 0, + ic2.api.item.ElectricItem.manager.discharge( + aStack, + aCharge + (aCharge * 4 > aTier ? aTier : 0), + tTier, + true, + !aIgnoreDischargability, + aSimulate)); return rCharge - (rCharge * 4 > aTier ? aTier : 0); } } @@ -2185,27 +2145,27 @@ public class GT_ModHandler { return GT_ModHandler.useElectricItem(aStack, aDecharge, (EntityPlayer) aPlayer); } return GT_ModHandler.dischargeElectricItem(aStack, aDecharge, Integer.MAX_VALUE, true, false, true) - >= aDecharge; + >= aDecharge; } } else if (aStack.getItem() - .isDamageable()) { - if (aPlayer == null) { - aStack.setItemDamage(aStack.getItemDamage() + aDamage); - } else { - aStack.damageItem(aDamage, aPlayer); - } - if (aStack.getItemDamage() >= aStack.getMaxDamage()) { - aStack.setItemDamage(aStack.getMaxDamage() + 1); - ItemStack tStack = GT_Utility.getContainerItem(aStack, true); - if (tStack != null) { - aStack.func_150996_a(tStack.getItem()); - aStack.setItemDamage(tStack.getItemDamage()); - aStack.stackSize = tStack.stackSize; - aStack.setTagCompound(tStack.getTagCompound()); - } - } - return true; - } + .isDamageable()) { + if (aPlayer == null) { + aStack.setItemDamage(aStack.getItemDamage() + aDamage); + } else { + aStack.damageItem(aDamage, aPlayer); + } + if (aStack.getItemDamage() >= aStack.getMaxDamage()) { + aStack.setItemDamage(aStack.getMaxDamage() + 1); + ItemStack tStack = GT_Utility.getContainerItem(aStack, true); + if (tStack != null) { + aStack.func_150996_a(tStack.getItem()); + aStack.setItemDamage(tStack.getItemDamage()); + aStack.stackSize = tStack.stackSize; + aStack.setTagCompound(tStack.getTagCompound()); + } + } + return true; + } return false; } @@ -2219,14 +2179,14 @@ public class GT_ModHandler { if (tPlayer.capabilities.isCreativeMode) return true; if (isElectricItem(aStack) && ic2.api.item.ElectricItem.manager.getCharge(aStack) > 1000.0d) { if (consumeSolderingMaterial(tPlayer) - || (aExternalInventory != null && consumeSolderingMaterial(aExternalInventory))) { + || (aExternalInventory != null && consumeSolderingMaterial(aExternalInventory))) { if (canUseElectricItem(aStack, 10000)) { return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer); } GT_ModHandler.useElectricItem( - aStack, - (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), - (EntityPlayer) aPlayer); + aStack, + (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), + (EntityPlayer) aPlayer); return false; } } @@ -2294,7 +2254,7 @@ public class GT_ModHandler { public static boolean isElectricItem(ItemStack aStack) { try { return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem - && ((IElectricItem) aStack.getItem()).getTier(aStack) < Integer.MAX_VALUE; + && ((IElectricItem) aStack.getItem()).getTier(aStack) < Integer.MAX_VALUE; } catch (Throwable e) { /* Do nothing */ } @@ -2304,7 +2264,7 @@ public class GT_ModHandler { public static boolean isElectricItem(ItemStack aStack, byte aTier) { try { return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem - && ((IElectricItem) aStack.getItem()).getTier(aStack) == aTier; + && ((IElectricItem) aStack.getItem()).getTier(aStack) == aTier; } catch (Throwable e) { /* Do nothing */ } @@ -2429,37 +2389,37 @@ public class GT_ModHandler { public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) {} public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput) {} + ItemStack secondaryOutput) {} public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput, int secondaryChance) {} + ItemStack secondaryOutput, int secondaryChance) {} public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) {} public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput) {} + ItemStack secondaryOutput) {} public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput, int secondaryChance) {} + ItemStack secondaryOutput, int secondaryChance) {} public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput) {} + ItemStack primaryOutput) {} public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput, ItemStack secondaryOutput) {} + ItemStack primaryOutput, ItemStack secondaryOutput) {} public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {} + ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {} public static void addSmelterBlastOre(Materials aMaterial) {} public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {} public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, - boolean reversible) {} + boolean reversible) {} public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, - int chance, boolean reversible) {} + int chance, boolean reversible) {} public static void addMagmaticFuel(String fluidName, int energy) {} diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java index db997c3640..750bf91c6c 100644 --- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java +++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java @@ -75,10 +75,8 @@ public class GT_Multiblock_Tooltip_Builder { private static final String TT_mod = StatCollector.translateToLocal("GT5U.MBTT.Mod"); private static final String TT_air = StatCollector.translateToLocal("GT5U.MBTT.Air"); private static final String[] TT_dots = IntStream.range(0, 16) - .mapToObj( - i -> StatCollector.translateToLocal( - "structurelib.blockhint." + i + ".name")) - .toArray(String[]::new); + .mapToObj(i -> StatCollector.translateToLocal("structurelib.blockhint." + i + ".name")) + .toArray(String[]::new); public GT_Multiblock_Tooltip_Builder() { iLines = new LinkedList<>(); @@ -132,12 +130,7 @@ public class GT_Multiblock_Tooltip_Builder { */ public GT_Multiblock_Tooltip_Builder addPollutionAmount(int pollution) { iLines.add( - TT_causes + COLON - + EnumChatFormatting.DARK_PURPLE - + pollution - + " " - + EnumChatFormatting.GRAY - + TT_pps); + TT_causes + COLON + EnumChatFormatting.DARK_PURPLE + pollution + " " + EnumChatFormatting.GRAY + TT_pps); return this; } @@ -175,19 +168,19 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder beginVariableStructureBlock(int wmin, int wmax, int hmin, int hmax, int lmin, - int lmax, boolean hollow) { + int lmax, boolean hollow) { sLines.add( - TT_dimensions + COLON - + wmin - + (wmin != wmax ? "-" + wmax : "") - + "x" - + hmin - + (hmin != hmax ? "-" + hmax : "") - + "x" - + lmin - + (lmin != lmax ? "-" + lmax : "") - + " (WxHxL) " - + (hollow ? TT_hollow : "")); + TT_dimensions + COLON + + wmin + + (wmin != wmax ? "-" + wmax : "") + + "x" + + hmin + + (hmin != hmax ? "-" + hmax : "") + + "x" + + lmin + + (lmin != lmax ? "-" + lmax : "") + + " (WxHxL) " + + (hollow ? TT_hollow : "")); sLines.add(TT_structure + COLON); return this; } @@ -258,7 +251,7 @@ public class GT_Multiblock_Tooltip_Builder { * @return Instance this method was called on. */ public GT_Multiblock_Tooltip_Builder addCasingInfoRange(String casingName, int minCount, int maxCount, - boolean isTiered) { + boolean isTiered) { sLines.add(TAB + minCount + "x - " + maxCount + "x " + casingName + (isTiered ? " " + TT_tiered : "")); return this; } @@ -557,25 +550,25 @@ public class GT_Multiblock_Tooltip_Builder { */ public void toolTipFinisher(String mod) { iLines.add( - TT_hold + " " - + EnumChatFormatting.BOLD - + "[LSHIFT]" - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY - + " " - + TT_todisplay); + TT_hold + " " + + EnumChatFormatting.BOLD + + "[LSHIFT]" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + " " + + TT_todisplay); iLines.add(TT_mod + COLON + EnumChatFormatting.GREEN + mod + EnumChatFormatting.GRAY); hLines.add(TT_structurehint); iArray = iLines.toArray(new String[0]); sArray = sLines.toArray(new String[0]); // e.getKey() - 1 because 1 dot is meta 0. hArray = Stream.concat( - hLines.stream(), - hBlocks.asMap() - .entrySet() - .stream() - .map(e -> TT_dots[e.getKey() - 1] + COLON + String.join(SEPARATOR, e.getValue()))) - .toArray(String[]::new); + hLines.stream(), + hBlocks.asMap() + .entrySet() + .stream() + .map(e -> TT_dots[e.getKey() - 1] + COLON + String.join(SEPARATOR, e.getValue()))) + .toArray(String[]::new); } public String[] getInformation() { diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index b8072f7b3b..85e423b032 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -75,23 +75,22 @@ public class GT_OreDictUnificator { } public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aOverwrite, - boolean aAlreadyRegistered) { + boolean aAlreadyRegistered) { if (aMaterial == null || aPrefix == null - || GT_Utility.isStackInvalid(aStack) - || Items.feather.getDamage(aStack) == W) - return; + || GT_Utility.isStackInvalid(aStack) + || Items.feather.getDamage(aStack) == W) return; isAddingOre++; aStack = GT_Utility.copyAmount(1, aStack); if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack); addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack)); if (aOverwrite || GT_Utility.isStackInvalid( - sName2StackMap.get( - aPrefix.get(aMaterial) - .toString()))) + sName2StackMap.get( + aPrefix.get(aMaterial) + .toString()))) sName2StackMap.put( - aPrefix.get(aMaterial) - .toString(), - aStack); + aPrefix.get(aMaterial) + .toString(), + aStack); isAddingOre--; } @@ -131,7 +130,7 @@ public class GT_OreDictUnificator { } public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, - boolean aNoInvalidAmounts) { + boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && aAmount < 1) return null; final ItemStack stackFromName = sName2StackMap.get(aName.toString()); if (stackFromName != null) return GT_Utility.copyAmount(aAmount, stackFromName); @@ -183,8 +182,7 @@ public class GT_OreDictUnificator { if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() - || (aUseBlackList && tPrefixMaterial.mBlackListed)) - return GT_Utility.copyOrNull(aStack); + || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copyOrNull(aStack); if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return GT_Utility.copyOrNull(aStack); @@ -220,8 +218,7 @@ public class GT_OreDictUnificator { if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() - || (aUseBlackList && tPrefixMaterial.mBlackListed)) - return aStack; + || (aUseBlackList && tPrefixMaterial.mBlackListed)) return aStack; if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return aStack; @@ -339,22 +336,21 @@ public class GT_OreDictUnificator { sItemStack2DataMap.put(new GT_ItemStack2(aStack), aData); if (aData.hasValidMaterialData()) { long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 - : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M; + : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M; for (MaterialStack tMaterial : aData.mByProducts) tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 - : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M; + : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M; if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack); } if (mRunThroughTheList) { if (GregTech_API.sLoadStarted) { mRunThroughTheList = false; for (Entry tEntry : sItemStack2DataMap.entrySet()) if (!tEntry.getValue() - .hasValidPrefixData() - || tEntry.getValue().mPrefix.mAllowNormalRecycling) + .hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling) GT_RecipeRegistrator.registerMaterialRecycling( - tEntry.getKey() - .toStack(), - tEntry.getValue()); + tEntry.getKey() + .toStack(), + tEntry.getValue()); } } else { if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling) @@ -367,7 +363,7 @@ public class GT_OreDictUnificator { } public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, - boolean aBlackListed) { + boolean aBlackListed) { if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return; if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++) setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); @@ -546,6 +542,6 @@ public class GT_OreDictUnificator { String aName = aOreName == null ? E : aOreName.toString(); return GT_Utility.isStringValid(aName) ? Collections.unmodifiableList(OreDictionary.getOres(aName)) - : Collections.emptyList(); + : Collections.emptyList(); } } diff --git a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java index e19c8c904b..3555b8938d 100644 --- a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java +++ b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java @@ -29,7 +29,7 @@ public class GT_OverclockCalculator { * duration) */ private int mEUtIncreasePerOC = 2, mDurationDecreasePerOC = 1, mDuration = 0, mParallel = 1, mRecipeHeat = 0, - mMultiHeat = 0, mHeatPerfectOC = 2; + mMultiHeat = 0, mHeatPerfectOC = 2; /** * @mHeatOC - Whether to enable overclocking with heat like the EBF every 1800 heat difference * @mOneTickDiscount - Whether to give EUt Discount when the duration goes below one tick @@ -213,7 +213,7 @@ public class GT_OverclockCalculator { mDuration = (int) Math.ceil(mDuration * mSpeedBoost); if (mHeatOC) { while (mRecipeHeat + HEAT_PERFECT_OVERCLOCK_THRESHOLD <= mMultiHeat - && mRecipeEUt * mParallel * mRecipeAmps << 2 < mEUt * mAmps) { + && mRecipeEUt * mParallel * mRecipeAmps << 2 < mEUt * mAmps) { if (mDuration < 1) { break; } @@ -228,7 +228,7 @@ public class GT_OverclockCalculator { int tTier = GT_Utility.getTier(mEUt); int tTierDifference = tTier - 1; long tNextConsumption = ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount)) - << mEUtIncreasePerOC; + << mEUtIncreasePerOC; while (tTierDifference > 0 && tNextConsumption < mEUt * mAmps) { mRecipeEUt <<= mEUtIncreasePerOC; mDuration >>= mDurationDecreasePerOC; @@ -237,7 +237,7 @@ public class GT_OverclockCalculator { } } else { long tNextConsumption = ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount)) - << mEUtIncreasePerOC; + << mEUtIncreasePerOC; while (tNextConsumption < mEUt * mAmps) { if (mDuration <= 1) { break; diff --git a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java index 52561a063d..17e46aebf2 100644 --- a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java +++ b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java @@ -19,6 +19,6 @@ public class GT_PCBFactoryManager { public static Materials getPlasticMaterialFromTier(int aTier) { return mPlasticTiers.inverse() - .get(aTier); + .get(aTier); } } diff --git a/src/main/java/gregtech/api/util/GT_ParallelHelper.java b/src/main/java/gregtech/api/util/GT_ParallelHelper.java index 0914d2be29..4ae33cd48d 100644 --- a/src/main/java/gregtech/api/util/GT_ParallelHelper.java +++ b/src/main/java/gregtech/api/util/GT_ParallelHelper.java @@ -209,7 +209,7 @@ public class GT_ParallelHelper { public ItemStack[] getItemOutputs() { if (!mBuilt || !mCalculateOutputs) { throw new IllegalStateException( - "Tried to get item outputs before building or without enabling calculation of outputs"); + "Tried to get item outputs before building or without enabling calculation of outputs"); } return mItemOutputs; } @@ -220,7 +220,7 @@ public class GT_ParallelHelper { public FluidStack[] getFluidOutputs() { if (!mBuilt || !mCalculateOutputs) { throw new IllegalStateException( - "Tried to get fluid outputs before building or without enabling calculation of outputs"); + "Tried to get fluid outputs before building or without enabling calculation of outputs"); } return mFluidOutputs; } @@ -290,7 +290,7 @@ public class GT_ParallelHelper { float tRecipeEUt = mRecipe.mEUt * mEUtModifier; // Consume inputs to determine normal parallel for (; mCurrentParallel < mMaxParallel / mBatchModifier - && tCurrentUsage < (mAvailableEUt - tRecipeEUt); mCurrentParallel++) { + && tCurrentUsage < (mAvailableEUt - tRecipeEUt); mCurrentParallel++) { if (mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs)) { tCurrentUsage += tRecipeEUt; } else { @@ -302,7 +302,7 @@ public class GT_ParallelHelper { if (mBatchMode) { int tExtraParallels = 0; while (tExtraParallels < mCurrentParallel * (mBatchModifier - 1) - && mRecipe.isRecipeInputEqual(false, false, tFluidInputs, tItemInputs)) { + && mRecipe.isRecipeInputEqual(false, false, tFluidInputs, tItemInputs)) { mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs); tExtraParallels++; } @@ -320,7 +320,7 @@ public class GT_ParallelHelper { mItemOutputs[i] = null; } else { ItemStack tItem = mRecipe.getOutput(i) - .copy(); + .copy(); tItem.stackSize *= mCurrentParallel; mItemOutputs[i] = tItem; } @@ -334,7 +334,7 @@ public class GT_ParallelHelper { mFluidOutputs[i] = null; } else { FluidStack tFluid = mRecipe.getFluidOutput(i) - .copy(); + .copy(); tFluid.amount *= mCurrentParallel; mFluidOutputs[i] = tFluid; } @@ -394,9 +394,9 @@ public class GT_ParallelHelper { continue; } if (tHatch.isFluidLocked() && tLockedFluidName != null - && !tLockedFluidName.equals( - tFluidOutput.getFluid() - .getName())) { + && !tLockedFluidName.equals( + tFluidOutput.getFluid() + .getName())) { continue; } } @@ -412,7 +412,7 @@ public class GT_ParallelHelper { // now that all partial/restricted hatches have been counted, create a priority queue for our outputs // the lowest priority fluid is the number of complete parallel crafts we can support PriorityQueue> aParallelQueue = new PriorityQueue<>( - Comparator.comparing(MutableTriple::getLeft)); + Comparator.comparing(MutableTriple::getLeft)); for (Entry> entry : tParallels.entrySet()) { aParallelQueue.add(new MutableTriple<>(entry.getValue().left, entry.getValue().right, entry.getKey())); } @@ -491,7 +491,7 @@ public class GT_ParallelHelper { // now that all partial stacks have been counted, create a priority queue for our outputs // the lowest priority item is the number of complete parallel crafts we can support PriorityQueue> aParallelQueue = new PriorityQueue<>( - Comparator.comparing(MutableTriple::getLeft)); + Comparator.comparing(MutableTriple::getLeft)); for (Entry> entry : tParallels.entrySet()) { aParallelQueue.add(new MutableTriple<>(entry.getValue().left, entry.getValue().right, entry.getKey())); } diff --git a/src/main/java/gregtech/api/util/GT_PlayedSound.java b/src/main/java/gregtech/api/util/GT_PlayedSound.java index cdafc010d7..05d61e9833 100644 --- a/src/main/java/gregtech/api/util/GT_PlayedSound.java +++ b/src/main/java/gregtech/api/util/GT_PlayedSound.java @@ -29,8 +29,8 @@ public class GT_PlayedSound { public boolean equals(Object aObject) { if (aObject instanceof GT_PlayedSound) { return ((GT_PlayedSound) aObject).mX == mX && ((GT_PlayedSound) aObject).mY == mY - && ((GT_PlayedSound) aObject).mZ == mZ - && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName); + && ((GT_PlayedSound) aObject).mZ == mZ + && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName); } return false; } diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 6d4dda838a..aa8956c504 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -193,8 +193,8 @@ public class GT_Recipe implements Comparable { // only used for GT_RecipeBuilder. Should not be called otherwise GT_Recipe(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, FluidStack[] mFluidOutputs, - int[] mChances, Object mSpecialItems, int mDuration, int mEUt, int mSpecialValue, boolean mEnabled, - boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, String[] neiDesc) { + int[] mChances, Object mSpecialItems, int mDuration, int mEUt, int mSpecialValue, boolean mEnabled, + boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, boolean mNeedsEmptyOutput, String[] neiDesc) { this.mInputs = mInputs; this.mOutputs = mOutputs; this.mFluidInputs = mFluidInputs; @@ -215,7 +215,7 @@ public class GT_Recipe implements Comparable { } public GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { if (aInputs == null) aInputs = new ItemStack[0]; if (aOutputs == null) aOutputs = new ItemStack[0]; if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; @@ -302,18 +302,18 @@ public class GT_Recipe implements Comparable { // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, - int aSpecialValue, int aType) { + int aSpecialValue, int aType) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, - null, - null, - null, - null, - 0, - 0, - Math.max(1, aSpecialValue)); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, + null, + null, + null, + null, + 0, + 0, + Math.max(1, aSpecialValue)); if (mInputs.length > 0 && aSpecialValue > 0) { switch (aType) { @@ -344,18 +344,18 @@ public class GT_Recipe implements Comparable { } public GT_Recipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, - int aSpecialValue) { + int aSpecialValue) { this( - true, - null, - null, - null, - null, - new FluidStack[] { aInput1, aInput2 }, - new FluidStack[] { aOutput1 }, - Math.max(aDuration, 1), - aEUt, - Math.max(Math.min(aSpecialValue, 160000000), 0)); + true, + null, + null, + null, + null, + new FluidStack[] { aInput1, aInput2 }, + new FluidStack[] { aOutput1 }, + Math.max(aDuration, 1), + aEUt, + Math.max(Math.min(aSpecialValue, 160000000), 0)); if (mInputs.length > 1) { GT_Recipe_Map.sFusionRecipes.addRecipe(this); } @@ -363,35 +363,35 @@ public class GT_Recipe implements Comparable { public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - aDuration, - aEUt, - 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1, aOutput2 }, + null, + null, + null, + null, + aDuration, + aEUt, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sLatheRecipes.addRecipe(this); } } public GT_Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, - ItemStack aOutput4, int aDuration, int aEUt) { + ItemStack aOutput4, int aDuration, int aEUt) { this( - true, - new ItemStack[] { aInput1, - aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + new ItemStack[] { aInput1, + aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null }, + new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sDistillationRecipes.addRecipe(this); } @@ -399,20 +399,20 @@ public class GT_Recipe implements Comparable { public GT_Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { this( - true, - new ItemStack[] { aInput1, - GT_ModHandler.getIC2Item( - "industrialTnt", - aInput2 > 0 ? Math.min(aInput2, 64) : 1, - new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1)) }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - 20, - 30, - 0); + true, + new ItemStack[] { aInput1, + GT_ModHandler.getIC2Item( + "industrialTnt", + aInput2 > 0 ? Math.min(aInput2, 64) : 1, + new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1)) }, + new ItemStack[] { aOutput1, aOutput2 }, + null, + null, + null, + null, + 20, + 30, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sImplosionRecipes.addRecipe(this); } @@ -420,16 +420,16 @@ public class GT_Recipe implements Comparable { public GT_Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) { this( - true, - new ItemStack[] { aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize) }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + new ItemStack[] { aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize) }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sBenderRecipes.addRecipe(this); } @@ -437,34 +437,34 @@ public class GT_Recipe implements Comparable { public GT_Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) { this( - true, - aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sAlloySmelterRecipes.addRecipe(this); } } public GT_Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, - ItemStack aOutput2) { + ItemStack aOutput2) { this( - true, - aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput1, aOutput2 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - Math.max(aEUt, 1), - 0); + true, + aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 }, + new ItemStack[] { aOutput1, aOutput2 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + Math.max(aEUt, 1), + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sCannerRecipes.addRecipe(this); } @@ -472,16 +472,16 @@ public class GT_Recipe implements Comparable { public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - 120, - 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + 120, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sVacuumRecipes.addRecipe(this); } @@ -489,16 +489,16 @@ public class GT_Recipe implements Comparable { public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt, int VACUUM) { this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1 }, - null, - null, - null, - null, - Math.max(aDuration, 1), - aEUt, - 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + null, + Math.max(aDuration, 1), + aEUt, + 0); if (mInputs.length > 0 && mOutputs[0] != null) { GT_Recipe_Map.sVacuumRecipes.addRecipe(this); } @@ -506,16 +506,16 @@ public class GT_Recipe implements Comparable { public GT_Recipe(FluidStack aInput1, FluidStack aOutput1, int aDuration, int aEUt) { this( - false, - null, - null, - null, - null, - new FluidStack[] { aInput1 }, - new FluidStack[] { aOutput1 }, - Math.max(aDuration, 1), - aEUt, - 0); + false, + null, + null, + null, + null, + new FluidStack[] { aInput1 }, + new FluidStack[] { aOutput1 }, + Math.max(aDuration, 1), + aEUt, + 0); if (mFluidInputs.length > 0 && mFluidOutputs[0] != null) { GT_Recipe_Map.sVacuumRecipes.addRecipe(this); } @@ -523,18 +523,18 @@ public class GT_Recipe implements Comparable { // Dummy GT_Recipe maker... public GT_Recipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { this( - true, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + true, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } public static void reInit() { @@ -600,13 +600,13 @@ public class GT_Recipe implements Comparable { } public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, - ItemStack... aInputs) { + ItemStack... aInputs) { return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, 1, aFluidInputs, aInputs); } // For non-multiplied recipe amount values public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, - FluidStack[] aFluidInputs, ItemStack... aInputs) { + FluidStack[] aFluidInputs, ItemStack... aInputs) { return isRecipeInputEqual(aDecreaseStacksizeBySuccess, aDontCheckStackSizes, 1, aFluidInputs, aInputs); } @@ -632,7 +632,7 @@ public class GT_Recipe implements Comparable { * set to {@code true}! You'll get weird behavior. */ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, - int amountMultiplier, FluidStack[] aFluidInputs, ItemStack... aInputs) { + int amountMultiplier, FluidStack[] aFluidInputs, ItemStack... aInputs) { if (mInputs.length > 0 && aInputs == null) return false; if (mFluidInputs.length > 0 && aFluidInputs == null) return false; @@ -695,14 +695,8 @@ public class GT_Recipe implements Comparable { if (GT_OreDictUnificator.isInputStackEqual(providedItem, unifiedItemCost)) { if (GTppRecipeHelper) { // Please see JavaDoc on GTppRecipeHelper for why this is here. if (GT_Utility.areStacksEqual(providedItem, Ic2Items.FluidCell.copy(), true) - || GT_Utility.areStacksEqual( - providedItem, - ItemList.Tool_DataStick.get(1L), - true) - || GT_Utility.areStacksEqual( - providedItem, - ItemList.Tool_DataOrb.get(1L), - true)) { + || GT_Utility.areStacksEqual(providedItem, ItemList.Tool_DataStick.get(1L), true) + || GT_Utility.areStacksEqual(providedItem, ItemList.Tool_DataOrb.get(1L), true)) { if (!GT_Utility.areStacksEqual(providedItem, recipeItemCost, false)) continue; } } @@ -808,23 +802,23 @@ public class GT_Recipe implements Comparable { public void reloadOwner() { setOwner( - Loader.instance() - .activeModContainer()); + Loader.instance() + .activeModContainer()); final List excludedClasses = Arrays.asList( - "java.lang.Thread", - "gregtech.api.util.GT_Recipe", - "gregtech.api.util.GT_RecipeBuilder", - "gregtech.api.util.GT_Recipe$GT_Recipe_Map", - "gregtech.common.GT_RecipeAdder"); + "java.lang.Thread", + "gregtech.api.util.GT_Recipe", + "gregtech.api.util.GT_RecipeBuilder", + "gregtech.api.util.GT_Recipe$GT_Recipe_Map", + "gregtech.common.GT_RecipeAdder"); if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace) { List toAdd = new ArrayList<>(); for (StackTraceElement stackTrace : Thread.currentThread() - .getStackTrace()) { + .getStackTrace()) { if (excludedClasses.stream() - .noneMatch( - c -> stackTrace.getClassName() - .equals(c))) { + .noneMatch( + c -> stackTrace.getClassName() + .equals(c))) { toAdd.add(stackTrace); } } @@ -844,9 +838,9 @@ public class GT_Recipe implements Comparable { */ public void setOwner(String modId) { for (ModContainer mod : Loader.instance() - .getModList()) { + .getModList()) { if (mod.getModId() - .equals(modId)) { + .equals(modId)) { setOwner(mod); return; } @@ -904,7 +898,7 @@ public class GT_Recipe implements Comparable { } } if (invalidCount > 0) throw new RuntimeException( - "There are " + invalidCount + " invalid assembly line recipe(s)! Check GregTech.log for details!"); + "There are " + invalidCount + " invalid assembly line recipe(s)! Check GregTech.log for details!"); } public ItemStack mResearchItem; @@ -923,16 +917,16 @@ public class GT_Recipe implements Comparable { * if you set one yourself, it will give you one of the RunetimeExceptions! */ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, - FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { this( - aResearchItem, - aResearchTime, - aInputs, - aFluidInputs, - aOutput, - aDuration, - aEUt, - new ItemStack[aInputs.length][]); + aResearchItem, + aResearchTime, + aInputs, + aFluidInputs, + aOutput, + aDuration, + aEUt, + new ItemStack[aInputs.length][]); int tPersistentHash = 1; for (ItemStack tInput : aInputs) tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(tInput, true, false); @@ -952,7 +946,7 @@ public class GT_Recipe implements Comparable { * if you don't set one yourself, it will break a lot of stuff! */ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, - FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) { + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) { mResearchItem = aResearchItem; mResearchTime = aResearchTime; mInputs = aInputs; @@ -978,7 +972,7 @@ public class GT_Recipe implements Comparable { GT_ItemStack thisOutput = new GT_ItemStack(mOutput); GT_ItemStack thisResearch = new GT_ItemStack(mResearchItem); int miscRecipeDataHash = Arrays.deepHashCode( - new Object[] { totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime }); + new Object[] { totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime }); result = prime * result + inputFluidHash; result = prime * result + inputHash; result = prime * result + miscRecipeDataHash; @@ -1031,7 +1025,7 @@ public class GT_Recipe implements Comparable { } return this.mDuration == other.mDuration && this.mEUt == other.mEUt - && this.mResearchTime == other.mResearchTime; + && this.mResearchTime == other.mResearchTime; } public int getPersistentHash() { @@ -1043,22 +1037,22 @@ public class GT_Recipe implements Comparable { @Override public String toString() { return "GT_Recipe_AssemblyLine{" + "mResearchItem=" - + mResearchItem - + ", mResearchTime=" - + mResearchTime - + ", mInputs=" - + Arrays.toString(mInputs) - + ", mFluidInputs=" - + Arrays.toString(mFluidInputs) - + ", mOutput=" - + mOutput - + ", mDuration=" - + mDuration - + ", mEUt=" - + mEUt - + ", mOreDictAlt=" - + Arrays.toString(mOreDictAlt) - + '}'; + + mResearchItem + + ", mResearchTime=" + + mResearchTime + + ", mInputs=" + + Arrays.toString(mInputs) + + ", mFluidInputs=" + + Arrays.toString(mFluidInputs) + + ", mOutput=" + + mOutput + + ", mDuration=" + + mDuration + + ", mEUt=" + + mEUt + + ", mOreDictAlt=" + + Arrays.toString(mOreDictAlt) + + '}'; } /** @@ -1088,893 +1082,891 @@ public class GT_Recipe implements Comparable { static final String TEXTURES_GUI_BASICMACHINES = "textures/gui/basicmachines"; public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map( - new HashSet<>(500), - "gt.recipe.orewasher", - "Ore Washing Plant", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OreWasher"), - 1, - 3, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("orewasher", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW); + new HashSet<>(500), + "gt.recipe.orewasher", + "Ore Washing Plant", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OreWasher"), + 1, + 3, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("orewasher", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW); public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map( - new HashSet<>(1000), - "gt.recipe.thermalcentrifuge", - "Thermal Centrifuge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ThermalCentrifuge"), - 1, - 3, - 1, - 0, - 2, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("thermalcentrifuge", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1000), + "gt.recipe.thermalcentrifuge", + "Thermal Centrifuge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ThermalCentrifuge"), + 1, + 3, + 1, + 0, + 2, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("thermalcentrifuge", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map( - new HashSet<>(750), - "gt.recipe.compressor", - "Compressor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Compressor"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR) - .setRecipeConfigFile("compressor", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM); + new HashSet<>(750), + "gt.recipe.compressor", + "Compressor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Compressor"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR) + .setRecipeConfigFile("compressor", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM); public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map( - new HashSet<>(250), - "gt.recipe.extractor", - "Extractor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extractor"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setRecipeConfigFile("extractor", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM); + new HashSet<>(250), + "gt.recipe.extractor", + "Extractor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extractor"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setRecipeConfigFile("extractor", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM); public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler( - new HashSet<>(0), - "ic.recipe.recycler", - "Recycler", - "ic2.recycler", - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Recycler"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE) - .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW); + new HashSet<>(0), + "ic.recipe.recycler", + "Recycler", + "ic2.recycler", + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Recycler"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE) + .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW); public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace( - new HashSet<>(0), - "mc.recipe.furnace", - "Furnace", - "smelting", - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); + new HashSet<>(0), + "mc.recipe.furnace", + "Furnace", + "smelting", + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave( - new HashSet<>(0), - "gt.recipe.microwave", - "Microwave", - "smelting", - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(0), + "gt.recipe.microwave", + "Microwave", + "smelting", + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "E_Furnace"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.scanner", - "Scanner", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Scanner"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE) - .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.scanner", + "Scanner", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Scanner"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE) + .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map( - new HashSet<>(200), - "gt.recipe.rockbreaker", - "Rock Breaker", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "RockBreaker"), - 2, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT); + new HashSet<>(200), + "gt.recipe.rockbreaker", + "Rock Breaker", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "RockBreaker"), + 2, + 1, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map( - new HashSet<>(1000), - "gt.recipe.byproductlist", - "Ore Byproduct List", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 6, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1000), + "gt.recipe.byproductlist", + "Ore Byproduct List", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 6, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sReplicatorFakeRecipes = new ReplicatorFakeMap( - new HashSet<>(100), - "gt.recipe.replicator", - "Replicator", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Replicator"), - 0, - 1, - 0, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM) - .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.replicator", + "Replicator", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Replicator"), + 0, + 1, + 0, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM) + .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); // public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet<>(30), // "gt.recipe.scanner", "Scanner", null, Mods.GregTech.getResourcePath(BASIC_MACHINES, "Default"), 1, 1, 1, 0, // 1, E, 1, E, true, // true); public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map_AssemblyLineFake( - new HashSet<>(110), - "gt.recipe.fakeAssemblylineProcess", - "Assemblyline Process", - null, - GregTech.getResourcePath("textures", "gui", "FakeAssemblyline"), - 16, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .setUsualFluidInputCount(4) - .setDisableOptimize(true); + new HashSet<>(110), + "gt.recipe.fakeAssemblylineProcess", + "Assemblyline Process", + null, + GregTech.getResourcePath("textures", "gui", "FakeAssemblyline"), + 16, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .setUsualFluidInputCount(4) + .setDisableOptimize(true); /** * Usually, but not always, you should use {@link GT_RecipeConstants#UniversalArcFurnace} instead. */ public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map( - new HashSet<>(20000), - "gt.recipe.plasmaarcfurnace", - "Plasma Arc Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaArcFurnace"), - 1, - 9, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); + new HashSet<>(20000), + "gt.recipe.plasmaarcfurnace", + "Plasma Arc Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaArcFurnace"), + 1, + 9, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); /** * Usually, but not always, you should use {@link GT_RecipeConstants#UniversalArcFurnace} instead. */ public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map( - new HashSet<>(20000), - "gt.recipe.arcfurnace", - "Arc Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ArcFurnace"), - 1, - 9, - 1, - 1, - 3, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); + new HashSet<>(20000), + "gt.recipe.arcfurnace", + "Arc Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ArcFurnace"), + 1, + 9, + 1, + 1, + 3, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("arcfurnace", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer( - new HashSet<>(5), - "gt.recipe.printer", - "Printer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Printer"), - 1, - 1, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_PAGE_BLANK) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED) - .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_STICK) - .setRecipeConfigFile("printer", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(5), + "gt.recipe.printer", + "Printer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Printer"), + 1, + 1, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_PAGE_BLANK) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED) + .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_STICK) + .setRecipeConfigFile("printer", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sSifterRecipes = new GT_Recipe_Map( - new HashSet<>(105), - "gt.recipe.sifter", - "Sifter", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Sifter"), - 1, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN) - .setRecipeConfigFile("sifter", FIRST_ITEM_INPUT); + new HashSet<>(105), + "gt.recipe.sifter", + "Sifter", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Sifter"), + 1, + 9, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN) + .setRecipeConfigFile("sifter", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sPressRecipes = new GT_Recipe_Map_FormingPress( - new HashSet<>(300), - "gt.recipe.press", - "Forming Press", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Press3"), - 6, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_PRESS_1) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_PRESS_2) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PRESS_3) - .setRecipeConfigFile("press", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.press", + "Forming Press", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Press3"), + 6, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_PRESS_1) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_PRESS_2) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PRESS_3) + .setRecipeConfigFile("press", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sLaserEngraverRecipes = new GT_Recipe_Map( - new HashSet<>(810), - "gt.recipe.laserengraver", - "Precision Laser Engraver", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LaserEngraver2"), - 4, - 4, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_LENS) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("laserengraving", FIRST_ITEM_OUTPUT) - .setUsualFluidInputCount(2) - .setUsualFluidOutputCount(2); + new HashSet<>(810), + "gt.recipe.laserengraver", + "Precision Laser Engraver", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LaserEngraver2"), + 4, + 4, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_LENS) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("laserengraving", FIRST_ITEM_OUTPUT) + .setUsualFluidInputCount(2) + .setUsualFluidOutputCount(2); public static final GT_Recipe_Map sMixerRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.mixer", - "Mixer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Mixer6"), - 9, - 4, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("mixer", FIRST_ITEM_OR_FLUID_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW); + new HashSet<>(900), + "gt.recipe.mixer", + "Mixer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Mixer6"), + 9, + 4, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("mixer", FIRST_ITEM_OR_FLUID_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW); public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.autoclave", - "Autoclave", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Autoclave4"), - 2, - 4, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_GEM) - .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("autoclave", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.autoclave", + "Autoclave", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Autoclave4"), + 2, + 4, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_GEM) + .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("autoclave", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map( - new HashSet<>(50), - "gt.recipe.electromagneticseparator", - "Electromagnetic Separator", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ElectromagneticSeparator"), - 1, - 3, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("electromagneticseparator", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT); + new HashSet<>(50), + "gt.recipe.electromagneticseparator", + "Electromagnetic Separator", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ElectromagneticSeparator"), + 1, + 3, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("electromagneticseparator", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.polarizer", - "Electromagnetic Polarizer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Polarizer"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("polarizer", FIRST_ITEM_INPUT); + new HashSet<>(300), + "gt.recipe.polarizer", + "Electromagnetic Polarizer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Polarizer"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("polarizer", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator( - new HashSet<>(16600), - "gt.recipe.macerator", - "Pulverization", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Macerator4"), - 1, - 4, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) - .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("pulveriser", FIRST_ITEM_INPUT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM) - .setSlotOverlaySteam(true, GT_UITextures.OVERLAY_SLOT_DUST_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM); + new HashSet<>(16600), + "gt.recipe.macerator", + "Pulverization", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Macerator4"), + 1, + 4, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST) + .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("pulveriser", FIRST_ITEM_INPUT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM) + .setSlotOverlaySteam(true, GT_UITextures.OVERLAY_SLOT_DUST_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM); public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map( - new HashSet<>(2550), - "gt.recipe.chemicalbath", - "Chemical Bath", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalBath"), - 1, - 3, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) - .setRecipeConfigFile("chemicalbath", FIRST_ITEM_INPUT); + new HashSet<>(2550), + "gt.recipe.chemicalbath", + "Chemical Bath", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalBath"), + 1, + 3, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW) + .setRecipeConfigFile("chemicalbath", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner( - new HashSet<>(2100), - "gt.recipe.fluidcanner", - "Fluid Canning Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidCanner"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); + new HashSet<>(2100), + "gt.recipe.fluidcanner", + "Fluid Canning Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidCanner"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map( - new HashSet<>(450), - "gt.recipe.brewer", - "Brewing Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PotionBrewer"), - 1, - 0, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON) - .setRecipeConfigFile("brewing", FIRST_FLUIDSTACK_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(450), + "gt.recipe.brewer", + "Brewing Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PotionBrewer"), + 1, + 0, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON) + .setRecipeConfigFile("brewing", FIRST_FLUIDSTACK_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sFluidHeaterRecipes = new GT_Recipe_Map( - new HashSet<>(10), - "gt.recipe.fluidheater", - "Fluid Heater", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidHeater"), - 1, - 0, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_HEATER_1) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_HEATER_2) - .setRecipeConfigFile("fluidheater", FIRST_FLUIDSTACK_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(10), + "gt.recipe.fluidheater", + "Fluid Heater", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidHeater"), + 1, + 0, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_HEATER_1) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_HEATER_2) + .setRecipeConfigFile("fluidheater", FIRST_FLUIDSTACK_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sDistilleryRecipes = new GT_Recipe_Map( - new HashSet<>(400), - "gt.recipe.distillery", - "Distillery", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Distillery"), - 1, - 1, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_BEAKER_1) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_BEAKER_2) - .setRecipeConfigFile("distillery", FIRST_FLUIDSTACK_OUTPUT) - .setRecipeSpecialHandler(r -> { - int aInput = r.mFluidInputs[0].amount, aOutput = r.mFluidOutputs[0].amount, - aDuration = r.mDuration; - - // reduce the batch size if fluid amount is exceeding - int tScale = (Math.max(aInput, aOutput) + 999) / 1000; - if (tScale <= 0) tScale = 1; - if (tScale > 1) { - // trying to find whether there is a better factor - for (int i = tScale; i <= 5; i++) { - if (aInput % i == 0 && aDuration % i == 0) { - tScale = i; - break; - } - } - for (int i = tScale; i <= 5; i++) { - if (aInput % i == 0 && aDuration % i == 0 && aOutput % i == 0) { - tScale = i; - break; - } - } - aInput = (aInput + tScale - 1) / tScale; - aOutput = aOutput / tScale; - if (!isArrayEmptyOrNull(r.mOutputs)) { - ItemData tData = GT_OreDictUnificator.getItemData(r.mOutputs[0]); - if (tData != null && (tData.mPrefix == OrePrefixes.dust - || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) { - r.mOutputs[0] = GT_OreDictUnificator.getDust( - tData.mMaterial.mMaterial, - tData.mMaterial.mAmount * r.mOutputs[0].stackSize / tScale); - } else { - if (r.mOutputs[0].stackSize / tScale == 0) r.mOutputs[0] = GT_Values.NI; - else r.mOutputs[0] = GT_Utility.copyAmount( - r.mOutputs[0].stackSize / tScale, - r.mOutputs[0]); - } - } - aDuration = (aDuration + tScale - 1) / tScale; - r.mFluidInputs[0] = GT_Utility.copyAmount(aInput, r.mFluidInputs[0]); - r.mFluidOutputs[0] = GT_Utility.copyAmount(aOutput, r.mFluidOutputs[0]); - r.mDuration = aDuration; - } - }) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(400), + "gt.recipe.distillery", + "Distillery", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Distillery"), + 1, + 1, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_BEAKER_1) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_BEAKER_2) + .setRecipeConfigFile("distillery", FIRST_FLUIDSTACK_OUTPUT) + .setRecipeSpecialHandler(r -> { + int aInput = r.mFluidInputs[0].amount, aOutput = r.mFluidOutputs[0].amount, aDuration = r.mDuration; + + // reduce the batch size if fluid amount is exceeding + int tScale = (Math.max(aInput, aOutput) + 999) / 1000; + if (tScale <= 0) tScale = 1; + if (tScale > 1) { + // trying to find whether there is a better factor + for (int i = tScale; i <= 5; i++) { + if (aInput % i == 0 && aDuration % i == 0) { + tScale = i; + break; + } + } + for (int i = tScale; i <= 5; i++) { + if (aInput % i == 0 && aDuration % i == 0 && aOutput % i == 0) { + tScale = i; + break; + } + } + aInput = (aInput + tScale - 1) / tScale; + aOutput = aOutput / tScale; + if (!isArrayEmptyOrNull(r.mOutputs)) { + ItemData tData = GT_OreDictUnificator.getItemData(r.mOutputs[0]); + if (tData != null && (tData.mPrefix == OrePrefixes.dust + || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) { + r.mOutputs[0] = GT_OreDictUnificator.getDust( + tData.mMaterial.mMaterial, + tData.mMaterial.mAmount * r.mOutputs[0].stackSize / tScale); + } else { + if (r.mOutputs[0].stackSize / tScale == 0) r.mOutputs[0] = GT_Values.NI; + else r.mOutputs[0] = GT_Utility + .copyAmount(r.mOutputs[0].stackSize / tScale, r.mOutputs[0]); + } + } + aDuration = (aDuration + tScale - 1) / tScale; + r.mFluidInputs[0] = GT_Utility.copyAmount(aInput, r.mFluidInputs[0]); + r.mFluidOutputs[0] = GT_Utility.copyAmount(aOutput, r.mFluidOutputs[0]); + r.mDuration = aDuration; + } + }) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sFermentingRecipes = new GT_Recipe_Map( - new HashSet<>(50), - "gt.recipe.fermenter", - "Fermenter", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Fermenter"), - 0, - 0, - 0, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("fermenting", FIRST_FLUIDSTACK_OUTPUT); + new HashSet<>(50), + "gt.recipe.fermenter", + "Fermenter", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Fermenter"), + 0, + 0, + 0, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("fermenting", FIRST_FLUIDSTACK_OUTPUT); public static final GT_Recipe_Map sFluidSolidficationRecipes = new GT_Recipe_Map( - new HashSet<>(35000), - "gt.recipe.fluidsolidifier", - "Fluid Solidifier", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidSolidifier"), - 1, - 1, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLD) - .setRecipeConfigFile("fluidsolidifier", FIRST_ITEM_OUTPUT) - .setRecipeSpecialHandler(r -> { - if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { - if (Materials.PhasedGold.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; - else if (Materials.PhasedIron.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; - } - }) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(35000), + "gt.recipe.fluidsolidifier", + "Fluid Solidifier", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidSolidifier"), + 1, + 1, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLD) + .setRecipeConfigFile("fluidsolidifier", FIRST_ITEM_OUTPUT) + .setRecipeSpecialHandler(r -> { + if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { + if (Materials.PhasedGold.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; + else if (Materials.PhasedIron.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; + } + }) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sFluidExtractionRecipes = new GT_Recipe_Map( - new HashSet<>(15000), - "gt.recipe.fluidextractor", - "Fluid Extractor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidExtractor"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setRecipeConfigFile("fluidextractor", FIRST_ITEM_INPUT) - .setRecipeSpecialHandler(r -> { - if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { - if (Materials.PhasedGold.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; - else if (Materials.PhasedIron.getMolten(1) - .isFluidEqual(r.mFluidInputs[0])) - r.mFluidInputs = new FluidStack[] { - Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; - } - }) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(15000), + "gt.recipe.fluidextractor", + "Fluid Extractor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FluidExtractor"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setRecipeConfigFile("fluidextractor", FIRST_ITEM_INPUT) + .setRecipeSpecialHandler(r -> { + if (ArrayUtils.isNotEmpty(r.mFluidInputs)) { + if (Materials.PhasedGold.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.VibrantAlloy.getMolten(r.mFluidInputs[0].amount) }; + else if (Materials.PhasedIron.getMolten(1) + .isFluidEqual(r.mFluidInputs[0])) + r.mFluidInputs = new FluidStack[] { + Materials.PulsatingIron.getMolten(r.mFluidInputs[0].amount) }; + } + }) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sBoxinatorRecipes = new GT_Recipe_Map( - new HashSet<>(2500), - "gt.recipe.packager", - "Packager", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Packager"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_BOX) - .setRecipeConfigFile("boxing", FIRST_ITEM_OUTPUT) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_BOXED) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(2500), + "gt.recipe.packager", + "Packager", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Packager"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_BOX) + .setRecipeConfigFile("boxing", FIRST_ITEM_OUTPUT) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_BOXED) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sUnboxinatorRecipes = new GT_Recipe_Map_Unboxinator( - new HashSet<>(2500), - "gt.recipe.unpackager", - "Unpackager", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Unpackager"), - 1, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOXED) - .setRecipeConfigFile("unboxing", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(2500), + "gt.recipe.unpackager", + "Unpackager", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Unpackager"), + 1, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOXED) + .setRecipeConfigFile("unboxing", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); /** * Usually, but not always, you should use {@link GT_RecipeConstants#Fusion} instead. */ public static final GT_Recipe_Map sFusionRecipes = new GT_Recipe_Map_FluidOnly( - new HashSet<>(50), - "gt.recipe.fusionreactor", - "Fusion Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FusionReactor"), - 0, - 0, - 0, - 2, - 1, - "Start: ", - 1, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .useComparatorForNEI(true) - .setUsualFluidInputCount(2) - .setRecipeConfigFile("fusion", FIRST_FLUID_OUTPUT) - .setDisableOptimize(true) - .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE); + new HashSet<>(50), + "gt.recipe.fusionreactor", + "Fusion Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "FusionReactor"), + 0, + 0, + 0, + 2, + 1, + "Start: ", + 1, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .useComparatorForNEI(true) + .setUsualFluidInputCount(2) + .setRecipeConfigFile("fusion", FIRST_FLUID_OUTPUT) + .setDisableOptimize(true) + .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE); /** * Usually, but not always, you should use {@link GT_RecipeConstants#Fusion} instead. */ public static final GT_Recipe_Map sComplexFusionRecipes = new GT_Recipe_Map_ComplexFusion( - new HashSet<>(50), - "gt.recipe.complexfusionreactor", - "Complex Fusion Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ComplexFusionReactor"), - 3, - 0, - 0, - 2, - 1, - "Start: ", - 1, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(16) - .setUsualFluidOutputCount(16) - .setNEITransferRect(new Rectangle(79, 34, 18, 18)) - .setLogoPos(80, 61) - .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE) - .setDisableOptimize(true); + new HashSet<>(50), + "gt.recipe.complexfusionreactor", + "Complex Fusion Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ComplexFusionReactor"), + 3, + 0, + 0, + 2, + 1, + "Start: ", + 1, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(16) + .setUsualFluidOutputCount(16) + .setNEITransferRect(new Rectangle(79, 34, 18, 18)) + .setLogoPos(80, 61) + .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE) + .setDisableOptimize(true); public static final GT_Recipe_Map sCentrifugeRecipes = new GT_Recipe_Map( - new HashSet<>(1200), - "gt.recipe.centrifuge", - "Centrifuge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Centrifuge"), - 2, - 6, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setRecipeConfigFile("centrifuge", FIRST_ITEM_OR_FLUID_INPUT) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(1200), + "gt.recipe.centrifuge", + "Centrifuge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Centrifuge"), + 2, + 6, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setRecipeConfigFile("centrifuge", FIRST_ITEM_OR_FLUID_INPUT) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sElectrolyzerRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.electrolyzer", - "Electrolyzer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Electrolyzer"), - 2, - 6, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CHARGER) - .setRecipeConfigFile("electrolyzer", FIRST_ITEM_OR_FLUID_INPUT) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(300), + "gt.recipe.electrolyzer", + "Electrolyzer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Electrolyzer"), + 2, + 6, + 0, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CHARGER) + .setRecipeConfigFile("electrolyzer", FIRST_ITEM_OR_FLUID_INPUT) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); /** * Use {@link GT_RecipeConstants#COIL_HEAT} as heat level. */ public static final GT_Recipe_Map sBlastRecipes = new GT_Recipe_Map( - new HashSet<>(800), - "gt.recipe.blastfurnace", - "Blast Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 6, - 6, - 1, - 0, - 1, - "Heat Capacity: ", - 1, - " K", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("blastfurnace", FIRST_ITEM_INPUT) - .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); + new HashSet<>(800), + "gt.recipe.blastfurnace", + "Blast Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 6, + 6, + 1, + 0, + 1, + "Heat Capacity: ", + 1, + " K", + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("blastfurnace", FIRST_ITEM_INPUT) + .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); /** * Use {@link GT_RecipeConstants#COIL_HEAT} as heat level. */ public static final GT_Recipe_Map sPlasmaForgeRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(20), - "gt.recipe.plasmaforge", - "DTPF", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), - 9, - 9, - 0, - 0, - 1, - "Heat Capacity: ", - 1, - " K", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(9) - .setUsualFluidOutputCount(9) - .setDisableOptimize(true) - .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); + new HashSet<>(20), + "gt.recipe.plasmaforge", + "DTPF", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), + 9, + 9, + 0, + 0, + 1, + "Heat Capacity: ", + 1, + " K", + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(9) + .setUsualFluidOutputCount(9) + .setDisableOptimize(true) + .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE); public static final GT_Recipe_Map sTranscendentPlasmaMixerRecipes = new TranscendentPlasmaMixerRecipeMap( - new HashSet<>(20), - "gt.recipe.transcendentplasmamixerrecipes", - "Transcendent Plasma Mixer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), - 1, - 0, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setDisableOptimize(true); + new HashSet<>(20), + "gt.recipe.transcendentplasmamixerrecipes", + "Transcendent Plasma Mixer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "PlasmaForge"), + 1, + 0, + 0, + 0, + 1, + "", + 0, + "", + false, + true).setDisableOptimize(true); public static class GT_FakeSpaceProjectRecipe extends GT_Recipe { public final String projectName; public GT_FakeSpaceProjectRecipe(boolean aOptimize, ItemStack[] aInputs, FluidStack[] aFluidInputs, - int aDuration, int aEUt, int aSpecialValue, String projectName) { + int aDuration, int aEUt, int aSpecialValue, String projectName) { super(aOptimize, aInputs, null, null, null, aFluidInputs, null, aDuration, aEUt, aSpecialValue); this.projectName = projectName; } } public static final GT_Recipe_Map sFakeSpaceProjectRecipes = new GT_Recipe_Map( - new HashSet<>(20), - "gt.recipe.fakespaceprojects", - "Space Projects", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 12, - 0, - 0, - 0, - 1, - translateToLocal("gt.specialvalue.stages") + " ", - 1, - "", - false, - true) { + new HashSet<>(20), + "gt.recipe.fakespaceprojects", + "Space Projects", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 12, + 0, + 0, + 0, + 1, + translateToLocal("gt.specialvalue.stages") + " ", + 1, + "", + false, + true) { IDrawable projectTexture; @Override public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory, - IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, - IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, - Supplier progressSupplier, Pos2d windowOffset) { + IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, + IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, + Supplier progressSupplier, Pos2d windowOffset) { ModularWindow.Builder builder = super.createNEITemplate( - itemInputsInventory, - itemOutputsInventory, - specialSlotInventory, - fluidInputsInventory, - fluidOutputsInventory, - progressSupplier, - windowOffset); + itemInputsInventory, + itemOutputsInventory, + specialSlotInventory, + fluidInputsInventory, + fluidOutputsInventory, + progressSupplier, + windowOffset); addRecipeSpecificDrawable( - builder, - windowOffset, - () -> projectTexture, - new Pos2d(124, 28), - new Size(18, 18)); + builder, + windowOffset, + () -> projectTexture, + new Pos2d(124, 28), + new Size(18, 18)); return builder; } @@ -1990,7 +1982,7 @@ public class GT_Recipe implements Comparable { @Override protected List handleNEIItemInputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { super.handleNEIItemOutputTooltip(currentTip, pStack); if (pStack.item != null && pStack.item.getItem() instanceof GT_FluidDisplayItem) return currentTip; currentTip.add(GRAY + translateToLocal("Item Count: ") + formatNumbers(pStack.realStackSize)); @@ -2001,7 +1993,7 @@ public class GT_Recipe implements Comparable { public void drawNEIOverlays(GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack stack : neiCachedRecipe.mInputs) { if (stack instanceof GT_NEI_DefaultHandler.FixedPositionedStack && stack.item != null - && !(stack.item.getItem() instanceof GT_FluidDisplayItem)) { + && !(stack.item.getItem() instanceof GT_FluidDisplayItem)) { int stackSize = ((GT_NEI_DefaultHandler.FixedPositionedStack) stack).realStackSize; String displayString; if (stack.item.stackSize > 9999) { @@ -2013,86 +2005,79 @@ public class GT_Recipe implements Comparable { } } if (neiCachedRecipe.mRecipe instanceof GT_FakeSpaceProjectRecipe) { - ISpaceProject project = SpaceProjectManager.getProject( - ((GT_FakeSpaceProjectRecipe) neiCachedRecipe.mRecipe).projectName); + ISpaceProject project = SpaceProjectManager + .getProject(((GT_FakeSpaceProjectRecipe) neiCachedRecipe.mRecipe).projectName); if (project != null) { projectTexture = project.getTexture(); - GuiDraw.drawStringC( - EnumChatFormatting.BOLD + project.getLocalizedName(), - 85, - 0, - 0x404040, - false); + GuiDraw + .drawStringC(EnumChatFormatting.BOLD + project.getLocalizedName(), 85, 0, 0x404040, false); } } } @Override public void addProgressBarUI(ModularWindow.Builder builder, Supplier progressSupplier, - Pos2d windowOffset) { + Pos2d windowOffset) { int bar1Width = 17; int bar2Width = 18; builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> progressSupplier.get() - * ((float) (bar1Width + bar2Width) / bar1Width)) - .setSynced(false, false) - .setPos(new Pos2d(70, 28).add(windowOffset)) - .setSize(bar1Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress(() -> progressSupplier.get() * ((float) (bar1Width + bar2Width) / bar1Width)) + .setSynced(false, false) + .setPos(new Pos2d(70, 28).add(windowOffset)) + .setSize(bar1Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> (progressSupplier.get() - - ((float) bar1Width / (bar1Width + bar2Width))) - * ((float) (bar1Width + bar2Width) / bar2Width)) - .setSynced(false, false) - .setPos(new Pos2d(106, 28).add(windowOffset)) - .setSize(bar2Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress( + () -> (progressSupplier.get() - ((float) bar1Width / (bar1Width + bar2Width))) + * ((float) (bar1Width + bar2Width) / bar2Width)) + .setSynced(false, false) + .setPos(new Pos2d(106, 28).add(windowOffset)) + .setSize(bar2Width, 72)); } }.useModularUI(true) - .setRenderRealStackSizes(false) - .setUsualFluidInputCount(4) - .setNEIBackgroundOffset(2, 23) - .setLogoPos(152, 83) - .setDisableOptimize(true); + .setRenderRealStackSizes(false) + .setUsualFluidInputCount(4) + .setNEIBackgroundOffset(2, 23) + .setLogoPos(152, 83) + .setDisableOptimize(true); public static class TranscendentPlasmaMixerRecipeMap extends GT_Recipe_Map { public TranscendentPlasmaMixerRecipeMap(Collection aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - useModularUI(true); - setUsualFluidInputCount(16); - setUsualFluidOutputCount(1); - setProgressBarPos(86, 44); - setLogoPos(87, 81); - setNEIBackgroundSize(172, 100); - } - - @Override - public List getItemInputPositions(int itemInputCount) { - return UIHelper.getGridPositions(itemInputCount, 60, 8, 1); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); + useModularUI(true); + setUsualFluidInputCount(16); + setUsualFluidOutputCount(1); + setProgressBarPos(86, 44); + setLogoPos(87, 81); + setNEIBackgroundSize(172, 100); + } + + @Override + public List getItemInputPositions(int itemInputCount) { + return UIHelper.getGridPositions(itemInputCount, 60, 8, 1); } @Override @@ -2110,8 +2095,8 @@ public class GT_Recipe implements Comparable { // These look odd because recipeInfo.recipe.mEUt is actually the EU per litre of fluid processed, not // the EU/t. drawNEIText( - recipeInfo, - GT_Utility.trans("152", "Total: ") + formatNumbers(1000L * recipeInfo.recipe.mEUt) + " EU"); + recipeInfo, + GT_Utility.trans("152", "Total: ") + formatNumbers(1000L * recipeInfo.recipe.mEUt) + " EU"); // 1000 / (20 ticks * 5 seconds) = 10L/t. 10L/t * x EU/L = 10 * x EU/t. drawNEIText(recipeInfo, "Average: " + formatNumbers(10L * recipeInfo.recipe.mEUt) + " EU/t"); } @@ -2121,247 +2106,236 @@ public class GT_Recipe implements Comparable { * Uses {@link GT_RecipeConstants#ADDITIVE_AMOUNT} for coal/charcoal amount. */ public static final GT_Recipe_Map sPrimitiveBlastRecipes = new GT_Recipe_Map( - new HashSet<>(200), - "gt.recipe.primitiveblastfurnace", - "Primitive Blast Furnace", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 3, - 3, - 1, - 0, - 1, - E, - 1, - E, - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeEmitter(builder -> { - Optional rr = builder.validateInputCount(1, 2) - .validateOutputCount(1, 2) - .validateNoInputFluid() - .validateNoOutputFluid() - .noOptimize() - .build(); - if (!rr.isPresent()) return Collections.emptyList(); - ItemStack aInput1 = builder.getItemInputBasic(0); - ItemStack aInput2 = builder.getItemInputBasic(1); - ItemStack aOutput1 = builder.getItemOutput(0); - ItemStack aOutput2 = builder.getItemOutput(1); - if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) - return Collections.emptyList(); - int aCoalAmount = builder.getMetadata(ADDITIVE_AMOUNT); - if (aCoalAmount <= 0) return Collections.emptyList(); - GT_RecipeTemplate coll = asTemplate(rr.get()); - for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { - coll.derive() - .setInputs(aInput1, aInput2, coal.getGems(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); - coll.derive() - .setInputs(aInput1, aInput2, coal.getDust(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); - } - int aDuration = builder.duration; - if (Railcraft.isModLoaded()) { - coll.derive() - .setInputs(aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)) - .setDuration(aDuration * 2 / 3); - } - if (GTPlusPlus.isModLoaded()) { - ItemStack cactusCoke = GT_ModHandler.getModItem( - GTPlusPlus.ID, - "itemCactusCoke", - aCoalAmount * 2L); - ItemStack sugarCoke = GT_ModHandler.getModItem( - GTPlusPlus.ID, - "itemSugarCoke", - aCoalAmount * 2L); - coll.derive() - .setInputs(aInput1, aInput2, cactusCoke) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) - .setDuration(aDuration * 2 / 3); - coll.derive() - .setInputs(aInput1, aInput2, sugarCoke) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) - .setDuration(aDuration * 2 / 3); - } - if ((aInput1 == null || aInput1.stackSize <= 6) && (aInput2 == null || aInput2.stackSize <= 6) - && (aOutput1 == null || aOutput1.stackSize <= 6) - && (aOutput2 == null || aOutput2.stackSize <= 6)) { - // we don't use GT_Utility.mul() here. It does not have the truncating we need here. - aInput1 = GT_Utility.multiplyStack(10L, aInput1); - aInput2 = GT_Utility.multiplyStack(10L, aInput2); - aOutput1 = GT_Utility.multiplyStack(10L, aOutput1); - aOutput2 = GT_Utility.multiplyStack(10L, aOutput2); - for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { - coll.derive() - .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) - .setDuration(aDuration * 10); - coll.derive() - .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) - .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) - .setDuration(aDuration * 10); - } - if (Railcraft.isModLoaded()) { - coll.derive() - .setInputs(aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)) - .setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)) - .setDuration(aDuration * 20 / 3); - } - } - return coll.getAll(); - }) - .setRecipeConfigFile("primitiveblastfurnace", FIRST_ITEM_INPUT); + new HashSet<>(200), + "gt.recipe.primitiveblastfurnace", + "Primitive Blast Furnace", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 3, + 3, + 1, + 0, + 1, + E, + 1, + E, + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeEmitter(builder -> { + Optional rr = builder.validateInputCount(1, 2) + .validateOutputCount(1, 2) + .validateNoInputFluid() + .validateNoOutputFluid() + .noOptimize() + .build(); + if (!rr.isPresent()) return Collections.emptyList(); + ItemStack aInput1 = builder.getItemInputBasic(0); + ItemStack aInput2 = builder.getItemInputBasic(1); + ItemStack aOutput1 = builder.getItemOutput(0); + ItemStack aOutput2 = builder.getItemOutput(1); + if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) + return Collections.emptyList(); + int aCoalAmount = builder.getMetadata(ADDITIVE_AMOUNT); + if (aCoalAmount <= 0) return Collections.emptyList(); + GT_RecipeTemplate coll = asTemplate(rr.get()); + for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { + coll.derive() + .setInputs(aInput1, aInput2, coal.getGems(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); + coll.derive() + .setInputs(aInput1, aInput2, coal.getDust(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)); + } + int aDuration = builder.duration; + if (Railcraft.isModLoaded()) { + coll.derive() + .setInputs(aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)) + .setDuration(aDuration * 2 / 3); + } + if (GTPlusPlus.isModLoaded()) { + ItemStack cactusCoke = GT_ModHandler + .getModItem(GTPlusPlus.ID, "itemCactusCoke", aCoalAmount * 2L); + ItemStack sugarCoke = GT_ModHandler + .getModItem(GTPlusPlus.ID, "itemSugarCoke", aCoalAmount * 2L); + coll.derive() + .setInputs(aInput1, aInput2, cactusCoke) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) + .setDuration(aDuration * 2 / 3); + coll.derive() + .setInputs(aInput1, aInput2, sugarCoke) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount * 2)) + .setDuration(aDuration * 2 / 3); + } + if ((aInput1 == null || aInput1.stackSize <= 6) && (aInput2 == null || aInput2.stackSize <= 6) + && (aOutput1 == null || aOutput1.stackSize <= 6) + && (aOutput2 == null || aOutput2.stackSize <= 6)) { + // we don't use GT_Utility.mul() here. It does not have the truncating we need here. + aInput1 = GT_Utility.multiplyStack(10L, aInput1); + aInput2 = GT_Utility.multiplyStack(10L, aInput2); + aOutput1 = GT_Utility.multiplyStack(10L, aOutput1); + aOutput2 = GT_Utility.multiplyStack(10L, aOutput2); + for (Materials coal : new Materials[] { Materials.Coal, Materials.Charcoal }) { + coll.derive() + .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) + .setDuration(aDuration * 10); + coll.derive() + .setInputs(aInput1, aInput2, coal.getBlocks(aCoalAmount)) + .setOutputs(aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)) + .setDuration(aDuration * 10); + } + if (Railcraft.isModLoaded()) { + coll.derive() + .setInputs(aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)) + .setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)) + .setDuration(aDuration * 20 / 3); + } + } + return coll.getAll(); + }) + .setRecipeConfigFile("primitiveblastfurnace", FIRST_ITEM_INPUT); /** * Uses {@link GT_RecipeConstants#ADDITIVE_AMOUNT} for TNT/ITNT/... amount. Value is truncated to [0, 64] */ public static final GT_Recipe_Map sImplosionRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.implosioncompressor", - "Implosion Compressor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 2, - 2, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_IMPLOSION) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXPLOSIVE) - .setRecipeConfigFile("implosion", FIRST_ITEM_INPUT) - .setRecipeEmitter(b -> { - switch (b.getItemInputsBasic().length) { - case 0: - return Collections.emptyList(); - case 1: - break; - default: - return b.build() - .map(Collections::singletonList) - .orElse(Collections.emptyList()); - } - Optional t = b.noOptimize() - .duration(20) - .eut(30) - .validateInputCount(1, 1) - .validateOutputCount(1, 1) - .build(); - if (!t.isPresent()) return Collections.emptyList(); - ItemStack input = b.getItemInputBasic(0); - GT_RecipeTemplate coll = asTemplate(t.get()); - int tExplosives = Math.min(b.getMetadata(ADDITIVE_AMOUNT), 64); - int tGunpowder = tExplosives << 1; // Worst - int tDynamite = Math.max(1, tExplosives >> 1); // good - int tTNT = tExplosives; // Slightly better - int tITNT = Math.max(1, tExplosives >> 2); // the best - if (tGunpowder < 65) coll.derive() - .setInputs(input, ItemList.Block_Powderbarrel.get(tGunpowder)); - if (tDynamite < 17) coll.derive() - .setInputs( - input, - GT_ModHandler.getIC2Item("dynamite", tDynamite, null)); - coll.derive() - .setInputs(input, new ItemStack(Blocks.tnt, tTNT)); - coll.derive() - .setInputs(input, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)); - return coll.getAll(); - }) - .setDisableOptimize(true) - .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); + new HashSet<>(900), + "gt.recipe.implosioncompressor", + "Implosion Compressor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 2, + 2, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_IMPLOSION) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXPLOSIVE) + .setRecipeConfigFile("implosion", FIRST_ITEM_INPUT) + .setRecipeEmitter(b -> { + switch (b.getItemInputsBasic().length) { + case 0: + return Collections.emptyList(); + case 1: + break; + default: + return b.build() + .map(Collections::singletonList) + .orElse(Collections.emptyList()); + } + Optional t = b.noOptimize() + .duration(20) + .eut(30) + .validateInputCount(1, 1) + .validateOutputCount(1, 1) + .build(); + if (!t.isPresent()) return Collections.emptyList(); + ItemStack input = b.getItemInputBasic(0); + GT_RecipeTemplate coll = asTemplate(t.get()); + int tExplosives = Math.min(b.getMetadata(ADDITIVE_AMOUNT), 64); + int tGunpowder = tExplosives << 1; // Worst + int tDynamite = Math.max(1, tExplosives >> 1); // good + int tTNT = tExplosives; // Slightly better + int tITNT = Math.max(1, tExplosives >> 2); // the best + if (tGunpowder < 65) coll.derive() + .setInputs(input, ItemList.Block_Powderbarrel.get(tGunpowder)); + if (tDynamite < 17) coll.derive() + .setInputs(input, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)); + coll.derive() + .setInputs(input, new ItemStack(Blocks.tnt, tTNT)); + coll.derive() + .setInputs(input, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)); + return coll.getAll(); + }) + .setDisableOptimize(true) + .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sVacuumRecipes = new GT_Recipe_Map( - new HashSet<>(305), - "gt.recipe.vacuumfreezer", - "Vacuum Freezer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - E, - 1, - E, - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setRecipeConfigFile("vacuumfreezer", FIRST_ITEM_INPUT) - .setRecipeEmitter(b -> { - b.noOptimize(); - FluidStack in, out; - if (isArrayOfLength(b.getItemInputsBasic(), 1) && isArrayOfLength(b.getItemOutputs(), 1) - && isArrayEmptyOrNull(b.getFluidInputs()) - && isArrayEmptyOrNull(b.getFluidOutputs()) - && (in = GT_Utility.getFluidForFilledItem(b.getItemInputBasic(0), true)) != null - && (out = GT_Utility.getFluidForFilledItem(b.getItemOutput(0), true)) != null) { - return Arrays.asList( - b.build() - .get(), - b.fluidInputs(in) - .fluidOutputs(out) - .noItemInputs() - .noItemOutputs() - .build() - .get()); - } - return buildOrEmpty(b); - }) - .setUsualFluidInputCount(2); + new HashSet<>(305), + "gt.recipe.vacuumfreezer", + "Vacuum Freezer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + E, + 1, + E, + false, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setRecipeConfigFile("vacuumfreezer", FIRST_ITEM_INPUT) + .setRecipeEmitter(b -> { + b.noOptimize(); + FluidStack in, out; + if (isArrayOfLength(b.getItemInputsBasic(), 1) && isArrayOfLength(b.getItemOutputs(), 1) + && isArrayEmptyOrNull(b.getFluidInputs()) + && isArrayEmptyOrNull(b.getFluidOutputs()) + && (in = GT_Utility.getFluidForFilledItem(b.getItemInputBasic(0), true)) != null + && (out = GT_Utility.getFluidForFilledItem(b.getItemOutput(0), true)) != null) { + return Arrays.asList( + b.build() + .get(), + b.fluidInputs(in) + .fluidOutputs(out) + .noItemInputs() + .noItemOutputs() + .build() + .get()); + } + return buildOrEmpty(b); + }) + .setUsualFluidInputCount(2); /** * using {@code .addTo(sChemicalRecipes)} will cause the recipe to be added to single block recipe map ONLY! * use {@link GT_RecipeConstants#UniversalChemical} to add to both. */ public static final GT_Recipe_Map sChemicalRecipes = new GT_Recipe_Map( - new HashSet<>(1170), - "gt.recipe.chemicalreactor", - "Chemical Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalReactor"), - 2, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_2) - .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2) - .setRecipeConfigFile("chemicalreactor", FIRST_ITEM_OR_FLUID_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); + new HashSet<>(1170), + "gt.recipe.chemicalreactor", + "Chemical Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "ChemicalReactor"), + 2, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_2) + .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2) + .setRecipeConfigFile("chemicalreactor", FIRST_ITEM_OR_FLUID_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT); /** * using {@code .addTo(sChemicalRecipes)} will cause the recipe to be added to multiblock recipe map ONLY! * use {@link GT_RecipeConstants#UniversalChemical} to add to both. */ public static final GT_Recipe_Map sMultiblockChemicalRecipes = // - new GT_Recipe_Map_LargeChemicalReactor().setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, - ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(6) - .setUsualFluidOutputCount(6) - .setDisableOptimize(true); + new GT_Recipe_Map_LargeChemicalReactor() + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(6) + .setUsualFluidOutputCount(6) + .setDisableOptimize(true); public static final GT_Recipe_Map sDistillationRecipes = // - new GT_Recipe_Map_DistillationTower().setRecipeConfigFile("distillation", FIRST_FLUIDSTACK_INPUT) - .setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, - ProgressBar.Direction.RIGHT) - .setUsualFluidOutputCount(11) - .setDisableOptimize(true); + new GT_Recipe_Map_DistillationTower().setRecipeConfigFile("distillation", FIRST_FLUIDSTACK_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setUsualFluidOutputCount(11) + .setDisableOptimize(true); public static final GT_Recipe_Map_OilCracker sCrackingRecipes = (GT_Recipe_Map_OilCracker) // new GT_Recipe_Map_OilCracker().setRecipeConfigFile("cracking", FIRST_FLUIDSTACK_INPUT) - .setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, - ProgressBar.Direction.RIGHT) - .setUsualFluidInputCount(2); + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT) + .setUsualFluidInputCount(2); /** * @deprecated Use sCrackingRecipes instead */ @@ -2369,676 +2343,672 @@ public class GT_Recipe implements Comparable { public static final GT_Recipe_Map sCrakingRecipes = sCrackingRecipes; public static final GT_Recipe_Map sPyrolyseRecipes = new GT_Recipe_Map( - new HashSet<>(150), - "gt.recipe.pyro", - "Pyrolyse Oven", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 2, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setDisableOptimize(true) - .setRecipeConfigFile("pyrolyse", FIRST_ITEM_INPUT); + new HashSet<>(150), + "gt.recipe.pyro", + "Pyrolyse Oven", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 2, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setDisableOptimize(true) + .setRecipeConfigFile("pyrolyse", FIRST_ITEM_INPUT); public static final GT_Recipe_Map sWiremillRecipes = new GT_Recipe_Map( - new HashSet<>(450), - "gt.recipe.wiremill", - "Wiremill", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Wiremill"), - 2, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WIREMILL) - .setRecipeConfigFile("wiremill", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_WIREMILL, ProgressBar.Direction.RIGHT); + new HashSet<>(450), + "gt.recipe.wiremill", + "Wiremill", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Wiremill"), + 2, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WIREMILL) + .setRecipeConfigFile("wiremill", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_WIREMILL, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sBenderRecipes = new GT_Recipe_Map( - new HashSet<>(5000), - "gt.recipe.metalbender", - "Bending Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Bender"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BENDER) - .setRecipeConfigFile("bender", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_BENDING, ProgressBar.Direction.RIGHT); + new HashSet<>(5000), + "gt.recipe.metalbender", + "Bending Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Bender"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BENDER) + .setRecipeConfigFile("bender", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_BENDING, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sAlloySmelterRecipes = new GT_Recipe_Map( - new HashSet<>(12000), - "gt.recipe.alloysmelter", - "Alloy Smelter", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "AlloySmelter"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) - .setRecipeEmitter(b -> { - if (Materials.Graphite.contains(b.getItemInputBasic(0))) return Collections.emptyList(); - if (GT_Utility.isArrayOfLength(b.getItemInputsBasic(), 1)) { - ItemStack aInput1 = b.getItemInputBasic(0); - if (((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) - || (OrePrefixes.gem.contains(aInput1)))) - return Collections.emptyList(); - } - return buildOrEmpty( - b.validateNoInputFluid() - .validateNoOutputFluid() - .validateInputCount(1, 2) - .validateOutputCount(1, 1)); - }) - .setRecipeConfigFile( - "alloysmelting", - r -> GT_Config.getStackConfigName( - GT_Utility.isArrayOfLength(r.mInputs, 1) ? r.mInputs[0] : r.mOutputs[0])) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); + new HashSet<>(12000), + "gt.recipe.alloysmelter", + "Alloy Smelter", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "AlloySmelter"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE) + .setRecipeEmitter(b -> { + if (Materials.Graphite.contains(b.getItemInputBasic(0))) return Collections.emptyList(); + if (GT_Utility.isArrayOfLength(b.getItemInputsBasic(), 1)) { + ItemStack aInput1 = b.getItemInputBasic(0); + if (((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) + || (OrePrefixes.gem.contains(aInput1)))) return Collections.emptyList(); + } + return buildOrEmpty( + b.validateNoInputFluid() + .validateNoOutputFluid() + .validateInputCount(1, 2) + .validateOutputCount(1, 1)); + }) + .setRecipeConfigFile( + "alloysmelting", + r -> GT_Config + .getStackConfigName(GT_Utility.isArrayOfLength(r.mInputs, 1) ? r.mInputs[0] : r.mOutputs[0])) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM); public static final GT_Recipe_Map sAssemblerRecipes = new GT_Recipe_Map_Assembler( - new HashSet<>(8200), - "gt.recipe.assembler", - "Assembler", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Assembler2"), - 9, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) - .setRecipeConfigFile("assembling", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); + new HashSet<>(8200), + "gt.recipe.assembler", + "Assembler", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Assembler2"), + 9, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) + .setRecipeConfigFile("assembling", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sCircuitAssemblerRecipes = new GT_Recipe_Map_Assembler( - new HashSet<>(605), - "gt.recipe.circuitassembler", - "Circuit Assembler", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "CircuitAssembler"), - 6, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setNEIUnificateOutput(!NEICustomDiagrams.isModLoaded()) - .setRecipeConfigFile("circuitassembler", FIRST_ITEM_OUTPUT) - .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) - .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER, ProgressBar.Direction.RIGHT); + new HashSet<>(605), + "gt.recipe.circuitassembler", + "Circuit Assembler", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "CircuitAssembler"), + 6, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setNEIUnificateOutput(!NEICustomDiagrams.isModLoaded()) + .setRecipeConfigFile("circuitassembler", FIRST_ITEM_OUTPUT) + .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT) + .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sCannerRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.canner", - "Canning Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Canner"), - 2, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CANNER) - .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) - .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); + new HashSet<>(900), + "gt.recipe.canner", + "Canning Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Canner"), + 2, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CANNER) + .setRecipeConfigFile("canning", FIRST_ITEM_INPUT) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER) + .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT); @Deprecated public static final GT_Recipe_Map sCNCRecipes = new GT_Recipe_Map( - new HashSet<>(100), - "gt.recipe.cncmachine", - "CNC Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 2, - 1, - 2, - 1, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.cncmachine", + "CNC Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 2, + 1, + 2, + 1, + 1, + E, + 1, + E, + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sLatheRecipes = new GT_Recipe_Map( - new HashSet<>(1150), - "gt.recipe.lathe", - "Lathe", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Lathe"), - 1, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_ROD_1) - .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_ROD_2) - .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeConfigFile("lathe", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_LATHE, ProgressBar.Direction.RIGHT) - .addSpecialTexture(5, 18, 98, 24, GT_UITextures.PROGRESSBAR_LATHE_BASE); + new HashSet<>(1150), + "gt.recipe.lathe", + "Lathe", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Lathe"), + 1, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_ROD_1) + .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_ROD_2) + .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeConfigFile("lathe", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_LATHE, ProgressBar.Direction.RIGHT) + .addSpecialTexture(5, 18, 98, 24, GT_UITextures.PROGRESSBAR_LATHE_BASE); public static final GT_Recipe_Map sCutterRecipes = new GT_Recipe_Map( - new HashSet<>(5125), - "gt.recipe.cuttingsaw", - "Cutting Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Cutter4"), - 2, - 4, - 1, - 1, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOX) - .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED) - .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) - .setRecipeEmitter(b -> { - b.validateInputCount(1, 2) - .validateOutputCount(1, 4) - .validateNoOutputFluid(); - if (b.getFluidInputs() != null || !b.isValid()) - return buildOrEmpty(b.validateInputFluidCount(1, 1)); - int aDuration = b.getDuration(), aEUt = b.getEUt(); - Collection ret = new ArrayList<>(); - b.copy() - .fluidInputs(Materials.Water.getFluid(GT_Utility.clamp(aDuration * aEUt / 320, 4, 1000))) - .duration(aDuration * 2) - .build() - .ifPresent(ret::add); - b.copy() - .fluidInputs( - GT_ModHandler.getDistilledWater(GT_Utility.clamp(aDuration * aEUt / 426, 3, 750))) - .duration(aDuration * 2) - .build() - .ifPresent(ret::add); - b.fluidInputs(Materials.Lubricant.getFluid(GT_Utility.clamp(aDuration * aEUt / 1280, 1, 250))) - .duration(aDuration) - .build() - .ifPresent(ret::add); - return ret; - }) - .setRecipeConfigFile("cutting", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_CUT, ProgressBar.Direction.RIGHT); + new HashSet<>(5125), + "gt.recipe.cuttingsaw", + "Cutting Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Cutter4"), + 2, + 4, + 1, + 1, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOX) + .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED) + .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST) + .setRecipeEmitter(b -> { + b.validateInputCount(1, 2) + .validateOutputCount(1, 4) + .validateNoOutputFluid(); + if (b.getFluidInputs() != null || !b.isValid()) + return buildOrEmpty(b.validateInputFluidCount(1, 1)); + int aDuration = b.getDuration(), aEUt = b.getEUt(); + Collection ret = new ArrayList<>(); + b.copy() + .fluidInputs(Materials.Water.getFluid(GT_Utility.clamp(aDuration * aEUt / 320, 4, 1000))) + .duration(aDuration * 2) + .build() + .ifPresent(ret::add); + b.copy() + .fluidInputs(GT_ModHandler.getDistilledWater(GT_Utility.clamp(aDuration * aEUt / 426, 3, 750))) + .duration(aDuration * 2) + .build() + .ifPresent(ret::add); + b.fluidInputs(Materials.Lubricant.getFluid(GT_Utility.clamp(aDuration * aEUt / 1280, 1, 250))) + .duration(aDuration) + .build() + .ifPresent(ret::add); + return ret; + }) + .setRecipeConfigFile("cutting", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_CUT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sSlicerRecipes = new GT_Recipe_Map( - new HashSet<>(20), - "gt.recipe.slicer", - "Slicing Machine", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Slicer"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_SQUARE) - .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE) - .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_SLICER_SLICED) - .setRecipeConfigFile("slicer", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_SLICE, ProgressBar.Direction.RIGHT); + new HashSet<>(20), + "gt.recipe.slicer", + "Slicing Machine", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Slicer"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_SQUARE) + .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE) + .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_SLICER_SLICED) + .setRecipeConfigFile("slicer", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_SLICE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sExtruderRecipes = new GT_Recipe_Map( - new HashSet<>(13000), - "gt.recipe.extruder", - "Extruder", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extruder"), - 2, - 1, - 2, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE) - .setRecipeConfigFile("extruder", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRUDE, ProgressBar.Direction.RIGHT); + new HashSet<>(13000), + "gt.recipe.extruder", + "Extruder", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Extruder"), + 2, + 1, + 2, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE) + .setRecipeConfigFile("extruder", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRUDE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sHammerRecipes = new GT_Recipe_Map( - new HashSet<>(3800), - "gt.recipe.hammer", - "Forge Hammer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Hammer"), - 2, - 2, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setUsualFluidInputCount(2) - .setUsualFluidOutputCount(2) - .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_HAMMER) - .setRecipeConfigFile("forgehammer", FIRST_ITEM_OUTPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) - .addSpecialTexture(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE) - .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM) - .setProgressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM) - .addSpecialTextureSteam(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM); + new HashSet<>(3800), + "gt.recipe.hammer", + "Forge Hammer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Hammer"), + 2, + 2, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setUsualFluidInputCount(2) + .setUsualFluidOutputCount(2) + .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_HAMMER) + .setRecipeConfigFile("forgehammer", FIRST_ITEM_OUTPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) + .addSpecialTexture(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE) + .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM) + .setProgressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM) + .addSpecialTextureSteam(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM); public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map( - new HashSet<>(2), - "gt.recipe.uuamplifier", - "Amplifabricator", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Amplifabricator"), - 1, - 0, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUA) - .setRecipeConfigFile("amplifier", FIRST_ITEM_INPUT) - .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); + new HashSet<>(2), + "gt.recipe.uuamplifier", + "Amplifabricator", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Amplifabricator"), + 1, + 0, + 1, + 0, + 1, + E, + 1, + E, + true, + true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUA) + .setRecipeConfigFile("amplifier", FIRST_ITEM_INPUT) + .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sMassFabFakeRecipes = new GT_Recipe_Map( - new HashSet<>(2), - "gt.recipe.massfab", - "Mass Fabrication", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Massfabricator"), - 1, - 0, - 1, - 0, - 8, - E, - 1, - E, - true, - true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUA) - .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUM) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(2), + "gt.recipe.massfab", + "Mass Fabrication", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Massfabricator"), + 1, + 0, + 1, + 0, + 8, + E, + 1, + E, + true, + true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUA) + .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUM) + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sDieselFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(20), - "gt.recipe.dieselgeneratorfuel", - "Combustion Generator Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(20), + "gt.recipe.dieselgeneratorfuel", + "Combustion Generator Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sExtremeDieselFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(20), - "gt.recipe.extremedieselgeneratorfuel", - "Extreme Diesel Engine Fuel", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(20), + "gt.recipe.extremedieselgeneratorfuel", + "Extreme Diesel Engine Fuel", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sTurbineFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(25), - "gt.recipe.gasturbinefuel", - "Gas Turbine Fuel", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(25), + "gt.recipe.gasturbinefuel", + "Gas Turbine Fuel", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel( - new HashSet<>(10), - "gt.recipe.thermalgeneratorfuel", - "Thermal Generator Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - false); + new HashSet<>(10), + "gt.recipe.thermalgeneratorfuel", + "Thermal Generator Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + false); public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(15), - "gt.recipe.semifluidboilerfuels", - "Semifluid Boiler Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(15), + "gt.recipe.semifluidboilerfuels", + "Semifluid Boiler Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sPlasmaFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(100), - "gt.recipe.plasmageneratorfuels", - "Plasma Generator Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); - public static final GT_Recipe_Map_Fuel sMagicFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(100), - "gt.recipe.magicfuels", - "Magic Energy Absorber Fuels", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); - public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.smallnaquadahreactor", - "Naquadah Reactor MkI", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); - public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.largenaquadahreactor", - "Naquadah Reactor MkII", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); - public static final GT_Recipe_Map_Fuel sHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.fluidnaquadahreactor", - "Naquadah Reactor MkIII", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(100), + "gt.recipe.plasmageneratorfuels", + "Plasma Generator Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + public static final GT_Recipe_Map_Fuel sMagicFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( + new HashSet<>(100), + "gt.recipe.magicfuels", + "Magic Energy Absorber Fuels", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( + new HashSet<>(1), + "gt.recipe.smallnaquadahreactor", + "Naquadah Reactor MkI", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( + new HashSet<>(1), + "gt.recipe.largenaquadahreactor", + "Naquadah Reactor MkII", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + public static final GT_Recipe_Map_Fuel sHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( + new HashSet<>(1), + "gt.recipe.fluidnaquadahreactor", + "Naquadah Reactor MkIII", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sExtremeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.hugenaquadahreactor", - "Naquadah Reactor MkIV", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.hugenaquadahreactor", + "Naquadah Reactor MkIV", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sUltraHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.extrahugenaquadahreactor", - "Naquadah Reactor MkV", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.extrahugenaquadahreactor", + "Naquadah Reactor MkV", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map_Fuel sFluidNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(1), - "gt.recipe.fluidfuelnaquadahreactor", - "Fluid Naquadah Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); + new HashSet<>(1), + "gt.recipe.fluidfuelnaquadahreactor", + "Fluid Naquadah Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 0, + 0, + 1, + "Fuel Value: ", + 1000, + " EU", + true, + true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map( - new HashSet<>(300), - "gt.recipe.largeelectrolyzer", - "Large(PA) Electrolyzer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 1, - 9, - 0, - 0, - 1, - "", - 0, - "", - true, - false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblockNoCircuit); + new HashSet<>(300), + "gt.recipe.largeelectrolyzer", + "Large(PA) Electrolyzer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 1, + 9, + 0, + 0, + 1, + "", + 0, + "", + true, + false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblockNoCircuit); public static final GT_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map( - new HashSet<>(1200), - "gt.recipe.largecentrifuge", - "Large(PA) Centrifuge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 1, - 9, - 0, - 0, - 1, - "", - 0, - "", - true, - false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) - .setDisableOptimize(true); + new HashSet<>(1200), + "gt.recipe.largecentrifuge", + "Large(PA) Centrifuge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 1, + 9, + 0, + 0, + 1, + "", + 0, + "", + true, + false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) + .setDisableOptimize(true); public static final GT_Recipe_Map sMultiblockMixerRecipes = new GT_Recipe_Map( - new HashSet<>(900), - "gt.recipe.largemixer", - "Large(PA) Mixer", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 9, - 3, - 0, - 0, - 1, - "", - 0, - "", - true, - false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) - .setDisableOptimize(true); - public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = (GT_Recipe_Map_LargeBoilerFakeFuels) new GT_Recipe_Map_LargeBoilerFakeFuels().setProgressBar( - GT_UITextures.PROGRESSBAR_ARROW, - ProgressBar.Direction.RIGHT) - .setDisableOptimize( - true); + new HashSet<>(900), + "gt.recipe.largemixer", + "Large(PA) Mixer", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 9, + 3, + 0, + 0, + 1, + "", + 0, + "", + true, + false).setRecipeEmitter(GT_RecipeMapUtil::buildRecipeForMultiblock) + .setDisableOptimize(true); + public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = (GT_Recipe_Map_LargeBoilerFakeFuels) new GT_Recipe_Map_LargeBoilerFakeFuels() + .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT) + .setDisableOptimize(true); public static final GT_Recipe_Map sNanoForge = new GT_Recipe_Map( - new HashSet<>(10), - "gt.recipe.nanoforge", - "Nano Forge", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 6, - 2, - 2, - 1, - 1, - "Tier: ", - 1, - "", - false, - true).useModularUI(true) - .setUsualFluidInputCount(3) - .setDisableOptimize(true) - .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_LENS) - .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); + new HashSet<>(10), + "gt.recipe.nanoforge", + "Nano Forge", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 6, + 2, + 2, + 1, + 1, + "Tier: ", + 1, + "", + false, + true).useModularUI(true) + .setUsualFluidInputCount(3) + .setDisableOptimize(true) + .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_LENS) + .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT); public static final GT_Recipe_Map sPCBFactory = new GT_Recipe_Map( - new HashSet<>(10), - "gt.recipe.pcbfactory", - "PCB Factory", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - 6, - 9, - 3, - 1, - 1, - E, - 0, - E, - true, - true).useModularUI(true) - .setUsualFluidInputCount(3) - .setUsualFluidOutputCount(0) - .setDisableOptimize(true) - .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT) - .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - List result = new ArrayList<>(); - int bitmap = recipeInfo.recipe.mSpecialValue; - if ((bitmap & 0b1) > 0) { - result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 1); - } else if ((bitmap & 0b10) > 0) { - result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 2); - } else if ((bitmap & 0b100) > 0) { - result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 3); - } - if ((bitmap & 0b1000) > 0) { - result.add(GT_Utility.trans("337", "Upgrade Required: ") + GT_Utility.trans("338", "Bio")); - } - return result; - }); - - public static final GT_Recipe_Map_IC2NuclearFake sIC2NuclearFakeRecipe = (GT_Recipe_Map_IC2NuclearFake) new GT_Recipe_Map_IC2NuclearFake().setDisableOptimize( - true); + new HashSet<>(10), + "gt.recipe.pcbfactory", + "PCB Factory", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + 6, + 9, + 3, + 1, + 1, + E, + 0, + E, + true, + true).useModularUI(true) + .setUsualFluidInputCount(3) + .setUsualFluidOutputCount(0) + .setDisableOptimize(true) + .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT) + .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { + List result = new ArrayList<>(); + int bitmap = recipeInfo.recipe.mSpecialValue; + if ((bitmap & 0b1) > 0) { + result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 1); + } else if ((bitmap & 0b10) > 0) { + result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 2); + } else if ((bitmap & 0b100) > 0) { + result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 3); + } + if ((bitmap & 0b1000) > 0) { + result.add(GT_Utility.trans("337", "Upgrade Required: ") + GT_Utility.trans("338", "Bio")); + } + return result; + }); + + public static final GT_Recipe_Map_IC2NuclearFake sIC2NuclearFakeRecipe = (GT_Recipe_Map_IC2NuclearFake) new GT_Recipe_Map_IC2NuclearFake() + .setDisableOptimize(true); static { sCentrifugeRecipes.addDownstream(sMultiblockCentrifugeRecipes.deepCopyInput()); sMixerRecipes.addDownstream(sMultiblockMixerRecipes.deepCopyInput()); sElectrolyzerRecipes.addDownstream(sMultiblockElectrolyzerRecipes.deepCopyInput()); sDieselFuels.addDownstream( - IGT_RecipeMap.newRecipeMap( - b -> b.build() - .map(sLargeBoilerFakeFuels::addDieselRecipe) - .map(Collections::singletonList) - .orElse(Collections.emptyList()))); + IGT_RecipeMap.newRecipeMap( + b -> b.build() + .map(sLargeBoilerFakeFuels::addDieselRecipe) + .map(Collections::singletonList) + .orElse(Collections.emptyList()))); sDenseLiquidFuels.addDownstream( - IGT_RecipeMap.newRecipeMap( - b -> b.build() - .map(sLargeBoilerFakeFuels::addDenseLiquidRecipe) - .map(Collections::singletonList) - .orElse(Collections.emptyList()))); + IGT_RecipeMap.newRecipeMap( + b -> b.build() + .map(sLargeBoilerFakeFuels::addDenseLiquidRecipe) + .map(Collections::singletonList) + .orElse(Collections.emptyList()))); } /** @@ -3070,7 +3040,7 @@ public class GT_Recipe implements Comparable { public final String mNEISpecialValuePre, mNEISpecialValuePost; public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, - mMinimalInputFluids, mAmperage; + mMinimalInputFluids, mAmperage; public final boolean mNEIAllowed, mShowVoltageAmperageInNEI; /** @@ -3144,10 +3114,10 @@ public class GT_Recipe implements Comparable { public Pos2d progressBarPos = new Pos2d(78, 24); public Rectangle neiTransferRect = new Rectangle( - progressBarPos.x - (16 / 2), - progressBarPos.y, - progressBarSize.width + 16, - progressBarSize.height); + progressBarPos.x - (16 / 2), + progressBarPos.y, + progressBarSize.width + 16, + progressBarSize.height); /** * Image size in direction of progress. Used for non-smooth rendering. @@ -3214,10 +3184,9 @@ public class GT_Recipe implements Comparable { * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general. */ public GT_Recipe_Map(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { sMappings.add(this); mNEIAllowed = aNEIAllowed; mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI; @@ -3236,16 +3205,16 @@ public class GT_Recipe implements Comparable { GregTech_API.sItemStackMappings.add(mRecipeItemMap); GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName); mUniqueIdentifier = String.format( - "%s_%d_%d_%d_%d_%d", - aUnlocalizedName, - aAmperage, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputFluids, - aMinimalInputItems); + "%s_%d_%d_%d_%d_%d", + aUnlocalizedName, + aAmperage, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputFluids, + aMinimalInputItems); progressBarTexture = new FallbackableUITexture( - UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), - GT_UITextures.PROGRESSBAR_ARROW); + UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), + GT_UITextures.PROGRESSBAR_ARROW); colorOverride = GT_GUIColorOverride.get(ModularUITextures.VANILLA_BACKGROUND.location); if (sIndexedMappings.put(mUniqueIdentifier, this) != null) throw new IllegalArgumentException("Duplicate recipe map registered: " + mUniqueIdentifier); @@ -3253,26 +3222,26 @@ public class GT_Recipe implements Comparable { @Deprecated public GT_Recipe_Map(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed, boolean aNEIUnificateOutput) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed, + boolean aNEIUnificateOutput) { this( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); setNEIUnificateOutput(aNEIUnificateOutput); } @@ -3302,11 +3271,11 @@ public class GT_Recipe implements Comparable { } public GT_Recipe_Map setSlotOverlay(boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial, - IDrawable slotOverlay) { + IDrawable slotOverlay) { useModularUI(true); this.slotOverlays.put( - (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), - slotOverlay); + (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), + slotOverlay); return this; } @@ -3315,19 +3284,16 @@ public class GT_Recipe implements Comparable { } public GT_Recipe_Map setSlotOverlay(boolean isFluid, boolean isOutput, IDrawable slotOverlay) { - return setSlotOverlay(isFluid, isOutput, true, slotOverlay).setSlotOverlay( - isFluid, - isOutput, - false, - slotOverlay); + return setSlotOverlay(isFluid, isOutput, true, slotOverlay) + .setSlotOverlay(isFluid, isOutput, false, slotOverlay); } public GT_Recipe_Map setSlotOverlaySteam(boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial, - SteamTexture slotOverlay) { + SteamTexture slotOverlay) { useModularUI(true); this.slotOverlaysSteam.put( - (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), - slotOverlay); + (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)), + slotOverlay); return this; } @@ -3336,20 +3302,16 @@ public class GT_Recipe implements Comparable { } public GT_Recipe_Map setSlotOverlaySteam(boolean isOutput, SteamTexture slotOverlay) { - return setSlotOverlaySteam(false, isOutput, true, false, slotOverlay).setSlotOverlaySteam( - false, - isOutput, - false, - false, - slotOverlay); + return setSlotOverlaySteam(false, isOutput, true, false, slotOverlay) + .setSlotOverlaySteam(false, isOutput, false, false, slotOverlay); } public GT_Recipe_Map setProgressBar(UITexture progressBarTexture, ProgressBar.Direction progressBarDirection) { return setProgressBarWithFallback( - new FallbackableUITexture( - UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), - progressBarTexture), - progressBarDirection); + new FallbackableUITexture( + UITexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName), + progressBarTexture), + progressBarDirection); } public GT_Recipe_Map setProgressBar(UITexture progressBarTexture) { @@ -3361,7 +3323,7 @@ public class GT_Recipe implements Comparable { * add unique textures, yet other packs don't need to make textures for every recipemap. */ public GT_Recipe_Map setProgressBarWithFallback(FallbackableUITexture progressBarTexture, - ProgressBar.Direction progressBarDirection) { + ProgressBar.Direction progressBarDirection) { useModularUI(true); this.progressBarTexture = progressBarTexture; this.progressBarDirection = progressBarDirection; @@ -3370,9 +3332,9 @@ public class GT_Recipe implements Comparable { public GT_Recipe_Map setProgressBarSteam(SteamTexture progressBarTexture) { return setProgressBarSteamWithFallback( - new FallbackableSteamTexture( - SteamTexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName + "_%s"), - progressBarTexture)); + new FallbackableSteamTexture( + SteamTexture.fullImage(GregTech.ID, "gui/progressbar/" + mUnlocalizedName + "_%s"), + progressBarTexture)); } public GT_Recipe_Map setProgressBarSteamWithFallback(FallbackableSteamTexture progressBarTexture) { @@ -3406,15 +3368,15 @@ public class GT_Recipe implements Comparable { public GT_Recipe_Map addSpecialTexture(int width, int height, int x, int y, IDrawable texture) { useModularUI(true); - specialTextures.add( - new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); + specialTextures + .add(new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); return this; } public GT_Recipe_Map addSpecialTextureSteam(int width, int height, int x, int y, SteamTexture texture) { useModularUI(true); - specialTexturesSteam.add( - new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); + specialTexturesSteam + .add(new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y)))); return this; } @@ -3469,7 +3431,7 @@ public class GT_Recipe implements Comparable { * Change how recipes are emitted by a particular recipe builder. Can emit multiple recipe per builder. */ public GT_Recipe_Map setRecipeEmitter( - Function> func) { + Function> func) { this.recipeEmitter = func; return this; } @@ -3480,7 +3442,7 @@ public class GT_Recipe implements Comparable { * Unlike {@link #setRecipeEmitter(Function)}, this one does not clear the existing recipe being emitted, if any */ public GT_Recipe_Map combineRecipeEmitter( - Function> func) { + Function> func) { // move recipeEmitter to local variable, so lambda capture the function itself instead of this Function> cur = recipeEmitter; this.recipeEmitter = b -> Iterables.concat(cur.apply(b), func.apply(b)); @@ -3572,55 +3534,55 @@ public class GT_Recipe implements Comparable { } public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return addRecipe( - new GT_Recipe( - aOptimize, - aInputs, - aOutputs, - aSpecial, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + new GT_Recipe( + aOptimize, + aInputs, + aOutputs, + aSpecial, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + int aDuration, int aEUt, int aSpecialValue) { return addRecipe( - new GT_Recipe( - false, - null, - null, - null, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue), + new GT_Recipe( false, - false, - false); + null, + null, + null, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue), + false, + false, + false); } public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return addRecipe( - new GT_Recipe( - aOptimize, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + new GT_Recipe( + aOptimize, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } public GT_Recipe addRecipe(GT_Recipe aRecipe) { @@ -3628,13 +3590,13 @@ public class GT_Recipe implements Comparable { } protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, - boolean aHidden) { + boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems) return null; if (aCheckForCollisions - && findRecipe(null, false, true, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null) + && findRecipe(null, false, true, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null) return null; return add(aRecipe); } @@ -3644,21 +3606,21 @@ public class GT_Recipe implements Comparable { * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + int aEUt, int aSpecialValue) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } /** @@ -3666,60 +3628,60 @@ public class GT_Recipe implements Comparable { * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes */ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)); } public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, boolean hidden) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, boolean hidden) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue), - hidden); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue), + hidden); } public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, ItemStack[][] aAlt, boolean hidden) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, ItemStack[][] aAlt, boolean hidden) { return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe_WithAlt( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue, - aAlt), - hidden); + aCheckForCollisions, + new GT_Recipe_WithAlt( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue, + aAlt), + hidden); } /** @@ -3741,10 +3703,9 @@ public class GT_Recipe implements Comparable { for (GT_Recipe r : recipes) { if (recipeConfigCategory != null) { String configKey = recipeConfigKeyConvertor.apply(r); - if (configKey != null && (r.mDuration = GregTech_API.sRecipeFile.get( - recipeConfigCategory, - configKey, - r.mDuration)) <= 0) { + if (configKey != null + && (r.mDuration = GregTech_API.sRecipeFile.get(recipeConfigCategory, configKey, r.mDuration)) + <= 0) { continue; } } @@ -3766,8 +3727,7 @@ public class GT_Recipe implements Comparable { if (specialHandler != null) r = specialHandler.apply(r); if (r == null) continue; if (checkForCollision - && findRecipe(null, false, true, Long.MAX_VALUE, r.mFluidInputs, r.mInputs) != null) - continue; + && findRecipe(null, false, true, Long.MAX_VALUE, r.mFluidInputs, r.mInputs) != null) continue; ret.add(add(r)); } if (!ret.isEmpty()) { @@ -3796,13 +3756,12 @@ public class GT_Recipe implements Comparable { mRecipeList.add(aRecipe); for (FluidStack aFluid : aRecipe.mFluidInputs) { if (aFluid != null) { - Collection tList = mRecipeFluidMap.computeIfAbsent( - aFluid.getFluid(), - k -> new HashSet<>(1)); + Collection tList = mRecipeFluidMap + .computeIfAbsent(aFluid.getFluid(), k -> new HashSet<>(1)); tList.add(aRecipe); mRecipeFluidNameMap.add( - aFluid.getFluid() - .getName()); + aFluid.getFluid() + .getName()); } } if (aRecipe.mFluidOutputs.length != 0) { @@ -3828,7 +3787,7 @@ public class GT_Recipe implements Comparable { */ public boolean containsInput(ItemStack aStack) { return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) - || mRecipeItemMap.containsKey(new GT_ItemStack(aStack, true))); + || mRecipeItemMap.containsKey(new GT_ItemStack(aStack, true))); } /** @@ -3846,43 +3805,43 @@ public class GT_Recipe implements Comparable { } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, - FluidStack[] aFluids, ItemStack... aInputs) { + FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe( - aTileEntity, - null, - aNotUnificated, - aDontCheckStackSizes, - aVoltage, - aFluids, - null, - aInputs); + aTileEntity, + null, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + null, + aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) { return findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aDontCheckStackSizes, - aVoltage, - aFluids, - null, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + null, + aInputs); } public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { return findRecipe(aTileEntity, aRecipe, aNotUnificated, false, aVoltage, aFluids, aSpecialSlot, aInputs); } @@ -3904,8 +3863,8 @@ public class GT_Recipe implements Comparable { * @return the Recipe it has found or null for no matching Recipe */ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, - ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, + ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; @@ -3933,18 +3892,18 @@ public class GT_Recipe implements Comparable { // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered - && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { Collection tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack, true)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -3953,7 +3912,7 @@ public class GT_Recipe implements Comparable { if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { Collection tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } @@ -4002,8 +3961,8 @@ public class GT_Recipe implements Comparable { @Nullable public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { byte overlayKey = (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) - + (index == 0 ? 4 : 0) - + (isSpecial ? 8 : 0)); + + (index == 0 ? 4 : 0) + + (isSpecial ? 8 : 0)); if (slotOverlays.containsKey(overlayKey)) { return slotOverlays.get(overlayKey); } @@ -4013,8 +3972,8 @@ public class GT_Recipe implements Comparable { @Nullable public SteamTexture getOverlayForSlotSteam(boolean isFluid, boolean isOutput, int index, boolean isSpecial) { byte overlayKey = (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) - + (index == 0 ? 4 : 0) - + (isSpecial ? 8 : 0)); + + (index == 0 ? 4 : 0) + + (isSpecial ? 8 : 0)); if (slotOverlaysSteam.containsKey(overlayKey)) { return slotOverlaysSteam.get(overlayKey); } @@ -4057,92 +4016,92 @@ public class GT_Recipe implements Comparable { * Adds slot backgrounds, progressBar, etc. */ public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory, - IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, - IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, - Supplier progressSupplier, Pos2d windowOffset) { + IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, + IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, + Supplier progressSupplier, Pos2d windowOffset) { ModularWindow.Builder builder = ModularWindow.builder(neiBackgroundSize) - .setBackground(ModularUITextures.VANILLA_BACKGROUND); + .setBackground(ModularUITextures.VANILLA_BACKGROUND); UIHelper.forEachSlots( - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(itemInputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(itemOutputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - (i, backgrounds, pos) -> { - if (usesSpecialSlot()) builder.widget( - SlotWidget.phantom(specialSlotInventory, 0) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)); - }, - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(fluidInputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - (i, backgrounds, pos) -> builder.widget( - SlotWidget.phantom(fluidOutputsInventory, i) - .setBackground(backgrounds) - .setPos(pos) - .setSize(18, 18)), - ModularUITextures.ITEM_SLOT, - ModularUITextures.FLUID_SLOT, - this, - mUsualInputCount, - mUsualOutputCount, - getUsualFluidInputCount(), - getUsualFluidOutputCount(), - SteamVariant.NONE, - windowOffset); + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(itemInputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(itemOutputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + (i, backgrounds, pos) -> { + if (usesSpecialSlot()) builder.widget( + SlotWidget.phantom(specialSlotInventory, 0) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)); + }, + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(fluidInputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + (i, backgrounds, pos) -> builder.widget( + SlotWidget.phantom(fluidOutputsInventory, i) + .setBackground(backgrounds) + .setPos(pos) + .setSize(18, 18)), + ModularUITextures.ITEM_SLOT, + ModularUITextures.FLUID_SLOT, + this, + mUsualInputCount, + mUsualOutputCount, + getUsualFluidInputCount(), + getUsualFluidOutputCount(), + SteamVariant.NONE, + windowOffset); addProgressBarUI(builder, progressSupplier, windowOffset); addGregTechLogoUI(builder, windowOffset); for (Pair> specialTexture : specialTextures) { builder.widget( - new DrawableWidget().setDrawable(specialTexture.getLeft()) - .setSize( - specialTexture.getRight() - .getLeft()) - .setPos( - specialTexture.getRight() - .getRight() - .add(windowOffset))); + new DrawableWidget().setDrawable(specialTexture.getLeft()) + .setSize( + specialTexture.getRight() + .getLeft()) + .setPos( + specialTexture.getRight() + .getRight() + .add(windowOffset))); } return builder; } public void addProgressBarUI(ModularWindow.Builder builder, Supplier progressSupplier, - Pos2d windowOffset) { + Pos2d windowOffset) { builder.widget( - new ProgressBar().setTexture(getProgressBarTexture(), 20) - .setDirection(progressBarDirection) - .setProgress(progressSupplier) - .setSynced(false, false) - .setPos(progressBarPos.add(windowOffset)) - .setSize(progressBarSize)); + new ProgressBar().setTexture(getProgressBarTexture(), 20) + .setDirection(progressBarDirection) + .setProgress(progressSupplier) + .setSynced(false, false) + .setPos(progressBarPos.add(windowOffset)) + .setSize(progressBarSize)); } public void addGregTechLogoUI(ModularWindow.Builder builder, Pos2d windowOffset) { builder.widget( - new DrawableWidget().setDrawable(logo) - .setSize(logoSize) - .setPos(logoPos.add(windowOffset))); + new DrawableWidget().setDrawable(logo) + .setSize(logoSize) + .setPos(logoPos.add(windowOffset))); } public void addRecipeSpecificDrawable(ModularWindow.Builder builder, Pos2d windowOffset, - Supplier supplier, Pos2d pos, Size size) { + Supplier supplier, Pos2d pos, Size size) { builder.widget( - new DrawableWidget().setDrawable(supplier) - .setSize(size) - .setPos(pos.add(windowOffset))); + new DrawableWidget().setDrawable(supplier) + .setSize(size) + .setPos(pos.add(windowOffset))); } /** @@ -4202,8 +4161,8 @@ public class GT_Recipe implements Comparable { if (!(originalPower instanceof UnspecifiedEUPower)) { originalPower.computePowerUsageAndDuration(recipe.mEUt, recipe.mDuration); drawNEIText( - recipeInfo, - GT_Utility.trans("275", "Original voltage: ") + originalPower.getVoltageString()); + recipeInfo, + GT_Utility.trans("275", "Original voltage: ") + originalPower.getVoltageString()); } } if (amperage != null && !amperage.equals("unspecified") && !amperage.equals("1")) { @@ -4243,8 +4202,8 @@ public class GT_Recipe implements Comparable { } } else if (neiSpecialInfoFormatter != null) { drawNEITextMultipleLines( - recipeInfo, - neiSpecialInfoFormatter.format(recipeInfo, this::formatSpecialValue)); + recipeInfo, + neiSpecialInfoFormatter.format(recipeInfo, this::formatSpecialValue)); } else { drawOptionalNEIText(recipeInfo, getNEISpecialInfo(recipeInfo.recipe.mSpecialValue)); } @@ -4273,7 +4232,7 @@ public class GT_Recipe implements Comparable { protected String formatSpecialValue(int specialValue) { return mNEISpecialValuePre + formatNumbers((long) specialValue * mNEISpecialValueMultiplier) - + mNEISpecialValuePost; + + mNEISpecialValuePost; } protected void drawNEIRecipeOwnerInfo(NEIRecipeInfo recipeInfo) { @@ -4281,27 +4240,27 @@ public class GT_Recipe implements Comparable { if (GT_Mod.gregtechproxy.mNEIRecipeOwner) { if (recipe.owners.size() > 1) { drawNEIText( - recipeInfo, - EnumChatFormatting.ITALIC + GT_Utility.trans("273", "Original Recipe by: ") - + recipe.owners.get(0) - .getName()); + recipeInfo, + EnumChatFormatting.ITALIC + GT_Utility.trans("273", "Original Recipe by: ") + + recipe.owners.get(0) + .getName()); for (int i = 1; i < recipe.owners.size(); i++) { drawNEIText( - recipeInfo, - EnumChatFormatting.ITALIC + GT_Utility.trans("274", "Modified by: ") - + recipe.owners.get(i) - .getName()); + recipeInfo, + EnumChatFormatting.ITALIC + GT_Utility.trans("274", "Modified by: ") + + recipe.owners.get(i) + .getName()); } } else if (recipe.owners.size() > 0) { drawNEIText( - recipeInfo, - EnumChatFormatting.ITALIC + GT_Utility.trans("272", "Recipe by: ") - + recipe.owners.get(0) - .getName()); + recipeInfo, + EnumChatFormatting.ITALIC + GT_Utility.trans("272", "Recipe by: ") + + recipe.owners.get(0) + .getName()); } } if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null - && !recipe.stackTraces.isEmpty()) { + && !recipe.stackTraces.isEmpty()) { drawNEIText(recipeInfo, "stackTrace:"); // todo: good way to show all stacktraces for (StackTraceElement stackTrace : recipe.stackTraces.get(0)) { @@ -4333,10 +4292,10 @@ public class GT_Recipe implements Comparable { @SuppressWarnings("SameParameterValue") protected void drawNEIText(NEIRecipeInfo recipeInfo, String text, int xStart, int yShift) { Minecraft.getMinecraft().fontRenderer.drawString( - text, - xStart, - recipeInfo.yPos, - neiTextColorOverride != -1 ? neiTextColorOverride : 0x000000); + text, + xStart, + recipeInfo.yPos, + neiTextColorOverride != -1 ? neiTextColorOverride : 0x000000); recipeInfo.yPos += yShift; } @@ -4353,13 +4312,13 @@ public class GT_Recipe implements Comparable { } public List handleNEIItemTooltip(ItemStack stack, List currentTip, - GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { + GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) { for (PositionedStack pStack : neiCachedRecipe.mInputs) { if (stack == pStack.item) { if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { currentTip = handleNEIItemInputTooltip( - currentTip, - (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); + currentTip, + (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); } break; } @@ -4368,8 +4327,8 @@ public class GT_Recipe implements Comparable { if (stack == pStack.item) { if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) { currentTip = handleNEIItemOutputTooltip( - currentTip, - (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); + currentTip, + (GT_NEI_DefaultHandler.FixedPositionedStack) pStack); } break; } @@ -4378,7 +4337,7 @@ public class GT_Recipe implements Comparable { } protected List handleNEIItemInputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isNotConsumed()) { currentTip.add(GRAY + GT_Utility.trans("151", "Does not get consumed in the process")); } @@ -4386,7 +4345,7 @@ public class GT_Recipe implements Comparable { } protected List handleNEIItemOutputTooltip(List currentTip, - GT_NEI_DefaultHandler.FixedPositionedStack pStack) { + GT_NEI_DefaultHandler.FixedPositionedStack pStack) { if (pStack.isChanceBased()) { currentTip.add(GRAY + GT_Utility.trans("150", "Chance: ") + pStack.getChanceText()); } @@ -4420,13 +4379,13 @@ public class GT_Recipe implements Comparable { @SuppressWarnings("SameParameterValue") protected void drawNEIOverlayText(String text, PositionedStack stack, int color, float scale, boolean shadow, - Alignment alignment) { + Alignment alignment) { FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; int width = fontRenderer.getStringWidth(text); int x = (int) ((stack.relx + 8 + 8 * alignment.x) / scale) - (width / 2 * (alignment.x + 1)); int y = (int) ((stack.rely + 8 + 8 * alignment.y) / scale) - - (fontRenderer.FONT_HEIGHT / 2 * (alignment.y + 1)) - - (alignment.y - 1) / 2; + - (fontRenderer.FONT_HEIGHT / 2 * (alignment.y + 1)) + - (alignment.y - 1) / 2; GlStateManager.pushMatrix(); GlStateManager.scale(scale, scale, 1); @@ -4436,12 +4395,12 @@ public class GT_Recipe implements Comparable { protected void drawNEIOverlayText(String text, PositionedStack stack) { drawNEIOverlayText( - text, - stack, - colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), - 0.5f, - false, - Alignment.TopLeft); + text, + stack, + colorOverride.getTextColorOrDefault("nei_overlay_yellow", 0xFDD835), + 0.5f, + false, + Alignment.TopLeft); } public void updateNEITextColorOverride() { @@ -4494,26 +4453,25 @@ public class GT_Recipe implements Comparable { private static final int yOrigin = 8; public GT_Recipe_Map_LargeNEI(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); useModularUI(true); setLogoPos(80, 62); } @@ -4540,19 +4498,19 @@ public class GT_Recipe implements Comparable { @Override public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory, - IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, - IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, - Supplier progressSupplier, Pos2d windowOffset) { + IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory, + IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory, + Supplier progressSupplier, Pos2d windowOffset) { // Delay setter so that calls to #setUsualFluidInputCount and #setUsualFluidOutputCount are considered setNEIBackgroundSize(172, 82 + (Math.max(getItemRowCount() + getFluidRowCount() - 4, 0)) * 18); return super.createNEITemplate( - itemInputsInventory, - itemOutputsInventory, - specialSlotInventory, - fluidInputsInventory, - fluidOutputsInventory, - progressSupplier, - windowOffset); + itemInputsInventory, + itemOutputsInventory, + specialSlotInventory, + fluidInputsInventory, + fluidOutputsInventory, + progressSupplier, + windowOffset); } private int getItemRowCount() { @@ -4564,32 +4522,31 @@ public class GT_Recipe implements Comparable { } } - /** - * Display fluids where normally items are placed on NEI. - */ - public static class GT_Recipe_Map_FluidOnly extends GT_Recipe_Map { - - public GT_Recipe_Map_FluidOnly(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + /** + * Display fluids where normally items are placed on NEI. + */ + public static class GT_Recipe_Map_FluidOnly extends GT_Recipe_Map { + + public GT_Recipe_Map_FluidOnly(Collection aRecipeList, String aUnlocalizedName, String aLocalName, + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); useModularUI(true); } @@ -4610,26 +4567,25 @@ public class GT_Recipe implements Comparable { public abstract static class GT_Recipe_Map_NonGTRecipes extends GT_Recipe_Map { public GT_Recipe_Map_NonGTRecipes(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override @@ -4649,14 +4605,14 @@ public class GT_Recipe implements Comparable { @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return null; } @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { return null; } @@ -4667,22 +4623,22 @@ public class GT_Recipe implements Comparable { @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + int aEUt, int aSpecialValue) { return null; } @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { return null; } @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, boolean hidden) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, boolean hidden) { return null; } @@ -4715,26 +4671,25 @@ public class GT_Recipe implements Comparable { private final Map mRecipesByFluidInput = new HashMap<>(); public GT_Recipe_Map_Fuel(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); setDisableOptimize(true); } @@ -4751,41 +4706,41 @@ public class GT_Recipe implements Comparable { } public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, - int aFuelValueInEU) { + int aFuelValueInEU) { return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU); } public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, - int aChance, int aFuelValueInEU) { + int aChance, int aFuelValueInEU) { return addRecipe( - true, - new ItemStack[] { aInput }, - new ItemStack[] { aOutput }, - null, - new int[] { aChance }, - new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, - 0, - 0, - aFuelValueInEU); + true, + new ItemStack[] { aInput }, + new ItemStack[] { aOutput }, + null, + new int[] { aChance }, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, + 0, + 0, + aFuelValueInEU); } @Override public GT_Recipe add(GT_Recipe aRecipe) { aRecipe = super.add(aRecipe); if (aRecipe.mInputs != null && GT_Utility.getNonnullElementCount(aRecipe.mInputs) == 1 - && (aRecipe.mFluidInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 0)) { + && (aRecipe.mFluidInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 0)) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(aRecipe.mInputs[0], true); if (tFluid != null) { tFluid.amount = 0; mRecipesByFluidInput.put(tFluid.getUnlocalizedName(), aRecipe); } } else if ((aRecipe.mInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mInputs) == 0) - && aRecipe.mFluidInputs != null - && GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 1 - && aRecipe.mFluidInputs[0] != null) { - mRecipesByFluidInput.put(aRecipe.mFluidInputs[0].getUnlocalizedName(), aRecipe); - } + && aRecipe.mFluidInputs != null + && GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 1 + && aRecipe.mFluidInputs[0] != null) { + mRecipesByFluidInput.put(aRecipe.mFluidInputs[0].getUnlocalizedName(), aRecipe); + } return aRecipe; } @@ -4800,46 +4755,45 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Furnace extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Furnace(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null); return tOutput == null ? null - : new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - null, - null, - 128, - 4, - 0); + : new GT_Recipe( + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + null, + null, + 128, + 4, + 0); } @Override @@ -4854,64 +4808,61 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Microwave extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Microwave(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null); if (GT_Utility.areStacksEqual(aInputs[0], new ItemStack(Items.book, 1, W))) { return new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { - GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1)) }, - null, - null, - null, - null, - 32, - 4, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1)) }, + null, + null, + null, + null, + 32, + 4, + 0); } // Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of // Output and last check the Output itself for (ItemStack tStack : new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true), aInputs[0], - GT_Utility.getContainerItem(tOutput, true), tOutput }) - if (tStack != null) { + GT_Utility.getContainerItem(tOutput, true), tOutput }) if (tStack != null) { if (GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.netherrack, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), true) - || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), true)) { + || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), true) + || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), true)) { if (aTileEntity instanceof IGregTechTileEntity) { GT_Log.exp.println( - "Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE"); + "Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE"); ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4); } return null; @@ -4921,7 +4872,7 @@ public class GT_Recipe implements Comparable { if (tData != null) { if (tData.mMaterial != null && tData.mMaterial.mMaterial != null) { if (tData.mMaterial.mMaterial.contains(SubTag.METAL) - || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { if (aTileEntity instanceof IGregTechTileEntity) { GT_Log.exp.println("Microwave Explosion due to METAL insertion"); ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4); @@ -4938,7 +4889,7 @@ public class GT_Recipe implements Comparable { } for (MaterialStack tMaterial : tData.mByProducts) if (tMaterial != null) { if (tMaterial.mMaterial.contains(SubTag.METAL) - || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { + || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) { if (aTileEntity instanceof IGregTechTileEntity) { GT_Log.exp.println("Microwave Explosion due to METAL insertion"); ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4); @@ -4964,17 +4915,17 @@ public class GT_Recipe implements Comparable { } return tOutput == null ? null - : new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - null, - null, - 32, - 4, - 0); + : new GT_Recipe( + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + null, + null, + 32, + 4, + 0); } @Override @@ -4989,47 +4940,46 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Unboxinator extends GT_Recipe_Map { public GT_Recipe_Map_Unboxinator(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || !ItemList.IC2_Scrapbox.isStackEqual(aInputs[0], false, true)) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); ItemStack tOutput = GT_ModHandler.getRandomScrapboxDrop(); if (tOutput == null) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); GT_Recipe rRecipe = new GT_Recipe( - false, - new ItemStack[] { ItemList.IC2_Scrapbox.get(1) }, - new ItemStack[] { tOutput }, - null, - null, - null, - null, - 16, - 1, - 0); + false, + new ItemStack[] { ItemList.IC2_Scrapbox.get(1) }, + new ItemStack[] { tOutput }, + null, + null, + null, + null, + 16, + 1, + 0); // It is not allowed to be buffered due to the random Output rRecipe.mCanBeBuffered = false; // Due to its randomness it is not good if there are Items in the Output Slot, because those Items could @@ -5050,72 +5000,70 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_FluidCanner extends GT_Recipe_Map { public GT_Recipe_Map_FluidCanner(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aVoltage, - aFluids, - aSpecialSlot, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aVoltage, + aFluids, + aSpecialSlot, + aInputs); if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || rRecipe != null - || !GregTech_API.sPostloadFinished) - return rRecipe; + || aInputs[0] == null + || rRecipe != null + || !GregTech_API.sPostloadFinished) return rRecipe; if (aFluids != null && aFluids.length > 0 && aFluids[0] != null) { ItemStack tOutput = GT_Utility.fillFluidContainer(aFluids[0], aInputs[0], false, true); FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); if (tFluid != null) rRecipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - new FluidStack[] { tFluid }, - null, - Math.max(tFluid.amount / 64, 16), - 1, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + new FluidStack[] { tFluid }, + null, + Math.max(tFluid.amount / 64, 16), + 1, + 0); } if (rRecipe == null) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInputs[0], true); if (tFluid != null) rRecipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true) }, - null, - null, - null, - new FluidStack[] { tFluid }, - Math.max(tFluid.amount / 64, 16), - 1, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true) }, + null, + null, + null, + new FluidStack[] { tFluid }, + Math.max(tFluid.amount / 64, 16), + 1, + 0); } if (rRecipe != null) rRecipe.mCanBeBuffered = false; return rRecipe; @@ -5124,7 +5072,7 @@ public class GT_Recipe implements Comparable { @Override public boolean containsInput(ItemStack aStack) { return aStack != null && (super.containsInput(aStack) || (aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)); + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)); } @Override @@ -5144,45 +5092,44 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Recycler extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Recycler(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; return new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null - : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, - null, - new int[] { 1250 }, - null, - null, - 45, - 1, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null + : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, + null, + new int[] { 1250 }, + null, + null, + 45, + 1, + 0); } @Override @@ -5196,47 +5143,47 @@ public class GT_Recipe implements Comparable { */ public static class GT_Recipe_Map_Compressor extends GT_Recipe_Map_NonGTRecipes { - public GT_Recipe_Map_Compressor(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + public GT_Recipe_Map_Compressor(Collection aRecipeList, String aUnlocalizedName, String aLocalName, + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.compressor.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.compressor.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5244,20 +5191,21 @@ public class GT_Recipe implements Comparable { null, 400, 2, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.compressor.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.compressor.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5267,46 +5215,46 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Extractor extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_Extractor(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.extractor.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.extractor.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5314,20 +5262,21 @@ public class GT_Recipe implements Comparable { null, 400, 2, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.extractor.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.extractor.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5337,46 +5286,47 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_ThermalCentrifuge extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_ThermalCentrifuge(Collection aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.centrifuge.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.centrifuge.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5384,20 +5334,21 @@ public class GT_Recipe implements Comparable { null, 400, 48, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.centrifuge.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.centrifuge.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5407,75 +5358,75 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_OreWasher extends GT_Recipe_Map_NonGTRecipes { public GT_Recipe_Map_OreWasher(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || aFluids == null - || aFluids.length < 1 - || !GT_ModHandler.isWater(aFluids[0])) - return null; + || aInputs[0] == null + || aFluids == null + || aFluids.length < 1 + || !GT_ModHandler.isWater(aFluids[0])) return null; if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe; ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); NBTTagCompound aRecipeMetaData = new NBTTagCompound(); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.oreWashing.getRecipes(), - true, - aRecipeMetaData, - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.oreWashing.getRecipes(), + true, + aRecipeMetaData, + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, new FluidStack[] { new FluidStack( - aFluids[0].getFluid(), - ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount")) }, + aFluids[0].getFluid(), + ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount")) }, null, 400, 16, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.oreWashing.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.oreWashing.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } @Override @@ -5495,52 +5446,51 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Macerator extends GT_Recipe_Map { public GT_Recipe_Map_Macerator(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || !GregTech_API.sPostloadFinished) return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); aRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); if (aRecipe != null) return aRecipe; try { - List tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher.getRecipe( - GT_Utility.copyAmount(1, aInputs[0])) - .getRandomizedOuputs(); + List tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher + .getRecipe(GT_Utility.copyAmount(1, aInputs[0])) + .getRandomizedOuputs(); if (tRecipeOutputs != null) { aRecipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - tRecipeOutputs.toArray(new ItemStack[0]), - null, - null, - null, - null, - 800, - 2, - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + tRecipeOutputs.toArray(new ItemStack[0]), + null, + null, + null, + null, + 800, + 2, + 0); aRecipe.mCanBeBuffered = false; aRecipe.mNeedsEmptyOutput = true; return aRecipe; @@ -5553,17 +5503,18 @@ public class GT_Recipe implements Comparable { ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]); ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput( - tComparedInput, - ic2.api.recipe.Recipes.macerator.getRecipes(), - true, - new NBTTagCompound(), - null, - null, - null); - return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe( + tComparedInput, + ic2.api.recipe.Recipes.macerator.getRecipes(), + true, + new NBTTagCompound(), + null, + null, + null); + return GT_Utility.arrayContainsNonNull(tOutputItems) + ? new GT_Recipe( false, new ItemStack[] { - GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, + GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) }, tOutputItems, null, null, @@ -5571,20 +5522,21 @@ public class GT_Recipe implements Comparable { null, 400, 2, - 0) : null; + 0) + : null; } @Override public boolean containsInput(ItemStack aStack) { return super.containsInput(aStack) || GT_Utility.arrayContainsNonNull( - GT_ModHandler.getMachineOutput( - GT_Utility.copyAmount(64, aStack), - ic2.api.recipe.Recipes.macerator.getRecipes(), - false, - new NBTTagCompound(), - null, - null, - null)); + GT_ModHandler.getMachineOutput( + GT_Utility.copyAmount(64, aStack), + ic2.api.recipe.Recipes.macerator.getRecipes(), + false, + new NBTTagCompound(), + null, + null, + null)); } } @@ -5594,31 +5546,30 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map { public GT_Recipe_Map_Assembler(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, true, aVoltage, aFluids, aSpecialSlot, aInputs); /* @@ -5633,10 +5584,9 @@ public class GT_Recipe implements Comparable { * break; } } if(rRecipe!= null) break; }else aInputs2.add(aInput); if(rRecipe!= null) break; } } */ if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || rRecipe == null - || !GregTech_API.sPostloadFinished) - return rRecipe; + || aInputs[0] == null + || rRecipe == null + || !GregTech_API.sPostloadFinished) return rRecipe; for (ItemStack aInput : aInputs) { if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, false, true)) { @@ -5655,41 +5605,40 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_FormingPress extends GT_Recipe_Map { public GT_Recipe_Map_FormingPress(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, - ItemStack... aInputs) { + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, + ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aDontCheckStackSizes, - aVoltage, - aFluids, - aSpecialSlot, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + aSpecialSlot, + aInputs); if (aInputs == null || aInputs.length < 2 || !GregTech_API.sPostloadFinished) return rRecipe; if (rRecipe == null) return findRenamingRecipe(aInputs); for (ItemStack aMold : aInputs) { @@ -5731,16 +5680,16 @@ public class GT_Recipe implements Comparable { ItemStack output = GT_Utility.copyAmount(1, input); output.setStackDisplayName(mold.getDisplayName()); GT_Recipe recipe = new GT_Recipe( - false, - new ItemStack[] { ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input) }, - new ItemStack[] { output }, - null, - null, - null, - null, - 128, - 8, - 0); + false, + new ItemStack[] { ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input) }, + new ItemStack[] { output }, + null, + null, + null, + null, + 128, + 8, + 0); recipe.mCanBeBuffered = false; return recipe; } @@ -5752,46 +5701,44 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_Printer extends GT_Recipe_Map { public GT_Recipe_Map_Printer(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, - long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe rRecipe = super.findRecipe( - aTileEntity, - aRecipe, - aNotUnificated, - aVoltage, - aFluids, - aSpecialSlot, - aInputs); + aTileEntity, + aRecipe, + aNotUnificated, + aVoltage, + aFluids, + aSpecialSlot, + aInputs); if (aInputs == null || aInputs.length <= 0 - || aInputs[0] == null - || aFluids == null - || aFluids.length <= 0 - || aFluids[0] == null - || !GregTech_API.sPostloadFinished) - return rRecipe; + || aInputs[0] == null + || aFluids == null + || aFluids.length <= 0 + || aFluids[0] == null + || !GregTech_API.sPostloadFinished) return rRecipe; Dyes aDye = null; for (Dyes tDye : Dyes.VALUES) if (tDye.isFluidDye(aFluids[0])) { @@ -5803,58 +5750,57 @@ public class GT_Recipe implements Comparable { if (rRecipe == null) { ItemStack tOutput = GT_ModHandler.getAllRecipeOutput( - aTileEntity == null ? null : aTileEntity.getWorld(), - aInputs[0], - aInputs[0], - aInputs[0], - aInputs[0], - ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), - aInputs[0], - aInputs[0], - aInputs[0], - aInputs[0]); + aTileEntity == null ? null : aTileEntity.getWorld(), + aInputs[0], + aInputs[0], + aInputs[0], + aInputs[0], + ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), + aInputs[0], + aInputs[0], + aInputs[0], + aInputs[0]); if (tOutput != null) return addRecipe( - new GT_Recipe( - true, - new ItemStack[] { GT_Utility.copyAmount(8, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, - null, - 256, - 2, - 0), - false, - false, - true); + new GT_Recipe( + true, + new ItemStack[] { GT_Utility.copyAmount(8, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, + null, + 256, + 2, + 0), + false, + false, + true); tOutput = GT_ModHandler.getAllRecipeOutput( - aTileEntity == null ? null : aTileEntity.getWorld(), - aInputs[0], - ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1)); + aTileEntity == null ? null : aTileEntity.getWorld(), + aInputs[0], + ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1)); if (tOutput != null) return addRecipe( - new GT_Recipe( - true, - new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, - new ItemStack[] { tOutput }, - null, - null, - new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, - null, - 32, - 2, - 0), - false, - false, - true); + new GT_Recipe( + true, + new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) }, + new ItemStack[] { tOutput }, + null, + null, + new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) }, + null, + 32, + 2, + 0), + false, + false, + true); } else { if (aInputs[0].getItem() == Items.paper) { if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null; NBTTagCompound tNBT = aSpecialSlot.getTagCompound(); if (tNBT == null || GT_Utility.isStringInvalid(tNBT.getString("title")) - || GT_Utility.isStringInvalid(tNBT.getString("author"))) - return null; + || GT_Utility.isStringInvalid(tNBT.getString("author"))) return null; rRecipe = rRecipe.copy(); rRecipe.mCanBeBuffered = false; @@ -5879,10 +5825,10 @@ public class GT_Recipe implements Comparable { rRecipe = rRecipe.copy(); rRecipe.mCanBeBuffered = false; rRecipe.mOutputs[0].setTagCompound( - GT_Utility.getNBTContainingString( - new NBTTagCompound(), - "GT.PunchCardData", - tNBT.getString("GT.PunchCardData"))); + GT_Utility.getNBTContainingString( + new NBTTagCompound(), + "GT.PunchCardData", + tNBT.getString("GT.PunchCardData"))); return rRecipe; } } @@ -5908,45 +5854,45 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_LargeBoilerFakeFuels extends GT_Recipe_Map { private static final List ALLOWED_SOLID_FUELS = Arrays.asList( - GregTech_API.sMachineFile.mConfig.getStringList( - "LargeBoiler.allowedFuels", - ConfigCategories.machineconfig.toString(), - new String[] { "gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7" }, - "Allowed fuels for the Large Titanium Boiler and Large Tungstensteel Boiler")); + GregTech_API.sMachineFile.mConfig.getStringList( + "LargeBoiler.allowedFuels", + ConfigCategories.machineconfig.toString(), + new String[] { "gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7" }, + "Allowed fuels for the Large Titanium Boiler and Large Tungstensteel Boiler")); public GT_Recipe_Map_LargeBoilerFakeFuels() { super( - new HashSet<>(55), - "gt.recipe.largeboilerfakefuels", - "Large Boiler", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(55), + "gt.recipe.largeboilerfakefuels", + "Large Boiler", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true); GT_Recipe explanatoryRecipe = new GT_Recipe( - true, - new ItemStack[] {}, - new ItemStack[] {}, - null, - null, - null, - null, - 1, - 1, - 1); + true, + new ItemStack[] {}, + new ItemStack[] {}, + null, + null, + null, + null, + 1, + 1, + 1); explanatoryRecipe.setNeiDesc( - "Not all solid fuels are listed.", - "Any item that burns in a", - "vanilla furnace will burn in", - "a Large Bronze or Steel Boiler."); + "Not all solid fuels are listed.", + "Any item that burns in a", + "vanilla furnace will burn in", + "a Large Bronze or Steel Boiler."); addRecipe(explanatoryRecipe); } @@ -5987,19 +5933,19 @@ public class GT_Recipe implements Comparable { allowedFuel = ALLOWED_SOLID_FUELS.contains(registryName + ":" + fuelItemStack.getItemDamage()); } return addRecipe( - new GT_Recipe( - true, - new ItemStack[] { fuelItemStack }, - new ItemStack[] {}, - null, - null, - null, - null, - 1, - 0, - GT_ModHandler.getFuelValue(fuelItemStack) / 1600), - ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600, - allowedFuel); + new GT_Recipe( + true, + new ItemStack[] { fuelItemStack }, + new ItemStack[] {}, + null, + null, + null, + null, + 1, + 0, + GT_ModHandler.getFuelValue(fuelItemStack) / 1600), + ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600, + allowedFuel); } private GT_Recipe addRecipe(GT_Recipe recipe, double baseBurnTime, boolean isAllowedFuel) { @@ -6018,18 +5964,18 @@ public class GT_Recipe implements Comparable { if (isAllowedFuel) { recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - String.format("Titanium Boiler: %.4f", titaniumBurnTime), - String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime)); + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + String.format("Steel Boiler: %.4f", steelBurnTime), + String.format("Titanium Boiler: %.4f", titaniumBurnTime), + String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime)); } else { recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - "Titanium Boiler: Not allowed", - "Tungstenst. Boiler: Not allowed"); + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + String.format("Steel Boiler: %.4f", steelBurnTime), + "Titanium Boiler: Not allowed", + "Tungstenst. Boiler: Not allowed"); } return super.addRecipe(recipe); @@ -6046,11 +5992,11 @@ public class GT_Recipe implements Comparable { steelBurnTime -= steelBurnTime % 0.05; recipe.setNeiDesc( - "Burn time in seconds:", - String.format("Bronze Boiler: %.4f", bronzeBurnTime), - String.format("Steel Boiler: %.4f", steelBurnTime), - "Titanium Boiler: Not allowed", - "Tungstenst. Boiler: Not allowed"); + "Burn time in seconds:", + String.format("Bronze Boiler: %.4f", bronzeBurnTime), + String.format("Steel Boiler: %.4f", steelBurnTime), + "Titanium Boiler: Not allowed", + "Tungstenst. Boiler: Not allowed"); return super.addRecipe(recipe); } @@ -6060,21 +6006,21 @@ public class GT_Recipe implements Comparable { public GT_Recipe_Map_IC2NuclearFake() { super( - new HashSet<>(10), - "gt.recipe.ic2nuke", - "Fission", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), - 1, - 1, - 1, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(10), + "gt.recipe.ic2nuke", + "Fission", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "Default"), + 1, + 1, + 1, + 0, + 1, + E, + 1, + E, + true, + true); setLogo(GT_UITextures.PICTURE_RADIATION_WARNING); setLogoPos(152, 24); setNEIBackgroundSize(172, 60); @@ -6093,27 +6039,27 @@ public class GT_Recipe implements Comparable { * @return added fake recipe */ public GT_Recipe addBreederCell(ItemStack input, ItemStack output, boolean reflector, int heatStep, - int heatMultiplier, int requiredPulses) { + int heatMultiplier, int requiredPulses) { return addFakeRecipe( - input, - output, - reflector ? "Neutron reflecting breeder cell" : "Heat neutral Breeder Cell", - String.format("Every %d reactor hull heat", heatStep), - String.format("increase speed by %d00%%", heatMultiplier), - String.format("Required pulses: %d", requiredPulses)); + input, + output, + reflector ? "Neutron reflecting breeder cell" : "Heat neutral Breeder Cell", + String.format("Every %d reactor hull heat", heatStep), + String.format("increase speed by %d00%%", heatMultiplier), + String.format("Required pulses: %d", requiredPulses)); } public GT_Recipe addFakeRecipe(ItemStack input, ItemStack output, String... neiDesc) { GT_Recipe r = new GT_Recipe( - new ItemStack[] { input }, - new ItemStack[] { output }, - null, - new int[] { 10000 }, - null, - null, - 0, - 0, - 0); + new ItemStack[] { input }, + new ItemStack[] { output }, + null, + new int[] { 10000 }, + null, + null, + 0, + 0, + 0); r.setNeiDesc(neiDesc); return addRecipe(r, true, true, false); } @@ -6126,27 +6072,27 @@ public class GT_Recipe implements Comparable { public GT_Recipe_Map_LargeChemicalReactor() { super( - new HashSet<>(1000), - "gt.recipe.largechemicalreactor", - "Large Chemical Reactor", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), - TOTAL_INPUT_COUNT, - OUTPUT_COUNT, - 0, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(1000), + "gt.recipe.largechemicalreactor", + "Large Chemical Reactor", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "LCRNEI"), + TOTAL_INPUT_COUNT, + OUTPUT_COUNT, + 0, + 0, + 1, + E, + 1, + E, + true, + true); } @Override public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, - int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { aOptimize = false; ArrayList adjustedInputs = new ArrayList<>(); ArrayList adjustedOutputs = new ArrayList<>(); @@ -6164,19 +6110,19 @@ public class GT_Recipe implements Comparable { if (inputFluidContent != null) { inputFluidContent.amount *= input.stackSize; if (inputFluidContent.getFluid() - .getName() - .equals("ic2steam")) { + .getName() + .equals("ic2steam")) { inputFluidContent = GT_ModHandler.getSteam(inputFluidContent.amount); } adjustedFluidInputs.add(inputFluidContent); } else { ItemData itemData = GT_OreDictUnificator.getItemData(input); if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mMaterial.mMaterial == Materials.Empty) { + && itemData.mMaterial.mMaterial == Materials.Empty) { continue; } else { if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mPrefix == OrePrefixes.cell) { + && itemData.mPrefix == OrePrefixes.cell) { ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); if (dustStack != null) { adjustedInputs.add(dustStack); @@ -6208,15 +6154,15 @@ public class GT_Recipe implements Comparable { if (outputFluidContent != null) { outputFluidContent.amount *= output.stackSize; if (outputFluidContent.getFluid() - .getName() - .equals("ic2steam")) { + .getName() + .equals("ic2steam")) { outputFluidContent = GT_ModHandler.getSteam(outputFluidContent.amount); } adjustedFluidOutputs.add(outputFluidContent); } else { ItemData itemData = GT_OreDictUnificator.getItemData(output); if (!(itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mMaterial.mMaterial == Materials.Empty)) { + && itemData.mMaterial.mMaterial == Materials.Empty)) { adjustedOutputs.add(output); } } @@ -6229,16 +6175,16 @@ public class GT_Recipe implements Comparable { aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[0]); return super.addRecipe( - aOptimize, - aInputs, - aOutputs, - aSpecial, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + aOptimize, + aInputs, + aOutputs, + aSpecial, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } } @@ -6246,21 +6192,21 @@ public class GT_Recipe implements Comparable { public GT_Recipe_Map_DistillationTower() { super( - new HashSet<>(110), - "gt.recipe.distillationtower", - "Distillation Tower", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "DistillationTower"), - 2, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(110), + "gt.recipe.distillationtower", + "Distillation Tower", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "DistillationTower"), + 2, + 1, + 0, + 0, + 1, + E, + 1, + E, + true, + true); setLogoPos(80, 62); } @@ -6297,21 +6243,21 @@ public class GT_Recipe implements Comparable { public GT_Recipe_Map_OilCracker() { super( - new HashSet<>(70), - "gt.recipe.craker", - "Oil Cracker", - null, - GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OilCracker"), - 1, - 1, - 1, - 2, - 1, - E, - 1, - E, - true, - true); + new HashSet<>(70), + "gt.recipe.craker", + "Oil Cracker", + null, + GregTech.getResourcePath(TEXTURES_GUI_BASICMACHINES, "OilCracker"), + 1, + 1, + 1, + 2, + 1, + E, + 1, + E, + true, + true); } @Override @@ -6319,16 +6265,16 @@ public class GT_Recipe implements Comparable { GT_Recipe ret = super.add(aRecipe); if (ret != null && ret.mFluidInputs != null && ret.mFluidInputs.length > 1 && ret.mFluidInputs[1] != null) { mValidCatalystFluidNames.add( - ret.mFluidInputs[1].getFluid() - .getName()); + ret.mFluidInputs[1].getFluid() + .getName()); } return ret; } public boolean isValidCatalystFluid(FluidStack aFluidStack) { return mValidCatalystFluidNames.contains( - aFluidStack.getFluid() - .getName()); + aFluidStack.getFluid() + .getName()); } } @@ -6337,42 +6283,42 @@ public class GT_Recipe implements Comparable { ItemStack[][] mOreDictAlt; GT_Recipe_WithAlt(ItemStack[] mInputs, ItemStack[] mOutputs, FluidStack[] mFluidInputs, - FluidStack[] mFluidOutputs, int[] mChances, Object mSpecialItems, int mDuration, int mEUt, - int mSpecialValue, boolean mEnabled, boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, - boolean mNeedsEmptyOutput, String[] neiDesc, ItemStack[][] mOreDictAlt) { + FluidStack[] mFluidOutputs, int[] mChances, Object mSpecialItems, int mDuration, int mEUt, + int mSpecialValue, boolean mEnabled, boolean mHidden, boolean mFakeRecipe, boolean mCanBeBuffered, + boolean mNeedsEmptyOutput, String[] neiDesc, ItemStack[][] mOreDictAlt) { super( - mInputs, - mOutputs, - mFluidInputs, - mFluidOutputs, - mChances, - mSpecialItems, - mDuration, - mEUt, - mSpecialValue, - mEnabled, - mHidden, - mFakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc); + mInputs, + mOutputs, + mFluidInputs, + mFluidOutputs, + mChances, + mSpecialItems, + mDuration, + mEUt, + mSpecialValue, + mEnabled, + mHidden, + mFakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc); this.mOreDictAlt = mOreDictAlt; } public GT_Recipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, - int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue, ItemStack[][] aAlt) { + int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue, ItemStack[][] aAlt) { super( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); mOreDictAlt = aAlt; } @@ -6395,101 +6341,100 @@ public class GT_Recipe implements Comparable { private static class ReplicatorFakeMap extends GT_Recipe_Map { public ReplicatorFakeMap(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, + int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, - Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, - int aSpecialValue) { + Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, + int aSpecialValue) { AtomicInteger ai = new AtomicInteger(); Optional.ofNullable(GT_OreDictUnificator.getAssociation(aOutputs[0])) - .map(itemData -> itemData.mMaterial) - .map(materialsStack -> materialsStack.mMaterial) - .map(materials -> materials.mElement) - .map(Element::getMass) - .ifPresent(e -> { - aFluidInputs[0].amount = (int) GT_MetaTileEntity_Replicator.cubicFluidMultiplier(e); - ai.set(GT_Utility.safeInt(aFluidInputs[0].amount * 512L, 1)); - }); + .map(itemData -> itemData.mMaterial) + .map(materialsStack -> materialsStack.mMaterial) + .map(materials -> materials.mElement) + .map(Element::getMass) + .ifPresent(e -> { + aFluidInputs[0].amount = (int) GT_MetaTileEntity_Replicator.cubicFluidMultiplier(e); + ai.set(GT_Utility.safeInt(aFluidInputs[0].amount * 512L, 1)); + }); return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - ai.get(), - aEUt, - aSpecialValue)); + aCheckForCollisions, + new GT_Recipe( + false, + aInputs, + aOutputs, + aSpecial, + null, + aFluidInputs, + aFluidOutputs, + ai.get(), + aEUt, + aSpecialValue)); } } public static class GT_Recipe_Map_ComplexFusion extends GT_Recipe_Map { public GT_Recipe_Map_ComplexFusion(Collection aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, - int aDuration, int aEUt, int aSpecialValue) { + int aDuration, int aEUt, int aSpecialValue) { return addRecipe( - new GT_Recipe( - false, - null, - null, - null, - aOutputChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue), + new GT_Recipe( false, - false, - false); + null, + null, + null, + aOutputChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue), + false, + false, + false); } @Override @@ -6506,26 +6451,26 @@ public class GT_Recipe implements Comparable { public static class GT_Recipe_Map_AssemblyLineFake extends GT_Recipe_Map { public GT_Recipe_Map_AssemblyLineFake(Collection aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { + String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, + int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); setNEITransferRect(new Rectangle(146, 26, 10, 18)); } @@ -6551,35 +6496,32 @@ public class GT_Recipe implements Comparable { @Override public void addProgressBarUI(ModularWindow.Builder builder, Supplier progressSupplier, - Pos2d windowOffset) { + Pos2d windowOffset) { int bar1Width = 17; int bar2Width = 18; builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> progressSupplier.get() - * ((float) (bar1Width + bar2Width) / bar1Width)) - .setSynced(false, false) - .setPos(new Pos2d(88, 8).add(windowOffset)) - .setSize(bar1Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress(() -> progressSupplier.get() * ((float) (bar1Width + bar2Width) / bar1Width)) + .setSynced(false, false) + .setPos(new Pos2d(88, 8).add(windowOffset)) + .setSize(bar1Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) - .setDirection(ProgressBar.Direction.RIGHT) - .setProgress( - () -> (progressSupplier.get() - - ((float) bar1Width / (bar1Width + bar2Width))) - * ((float) (bar1Width + bar2Width) / bar2Width)) - .setSynced(false, false) - .setPos(new Pos2d(124, 8).add(windowOffset)) - .setSize(bar2Width, 72)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18) + .setDirection(ProgressBar.Direction.RIGHT) + .setProgress( + () -> (progressSupplier.get() - ((float) bar1Width / (bar1Width + bar2Width))) + * ((float) (bar1Width + bar2Width) / bar2Width)) + .setSynced(false, false) + .setPos(new Pos2d(124, 8).add(windowOffset)) + .setSize(bar2Width, 72)); builder.widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18) - .setDirection(ProgressBar.Direction.UP) - .setProgress(progressSupplier) - .setSynced(false, false) - .setPos(new Pos2d(146, 26).add(windowOffset)) - .setSize(10, 18)); + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18) + .setDirection(ProgressBar.Direction.UP) + .setProgress(progressSupplier) + .setSynced(false, false) + .setPos(new Pos2d(146, 26).add(windowOffset)) + .setSize(10, 18)); } } } diff --git a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java index bd3e35c2a1..bb061eb2dc 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java @@ -38,7 +38,7 @@ public class GT_RecipeBuilder { static { boolean tmp; if (System.getProperties() - .containsKey("gt.recipebuilder.debug")) { + .containsKey("gt.recipebuilder.debug")) { tmp = Boolean.getBoolean("gt.recipebuilder.debug"); } else { // turn on debug by default in dev mode @@ -72,10 +72,10 @@ public class GT_RecipeBuilder { GT_RecipeBuilder() {} private GT_RecipeBuilder(ItemStack[] inputsBasic, Object[] inputsOreDict, ItemStack[] outputs, ItemStack[][] alts, - FluidStack[] fluidInputs, FluidStack[] fluidOutputs, int[] chances, Object special, int duration, int eut, - int specialValue, boolean enabled, boolean hidden, boolean fakeRecipe, boolean mCanBeBuffered, - boolean mNeedsEmptyOutput, String[] neiDesc, boolean optimize, - Map, Object> additionalData) { + FluidStack[] fluidInputs, FluidStack[] fluidOutputs, int[] chances, Object special, int duration, int eut, + int specialValue, boolean enabled, boolean hidden, boolean fakeRecipe, boolean mCanBeBuffered, + boolean mNeedsEmptyOutput, String[] neiDesc, boolean optimize, + Map, Object> additionalData) { this.inputsBasic = inputsBasic; this.inputsOreDict = inputsOreDict; this.outputs = outputs; @@ -99,9 +99,9 @@ public class GT_RecipeBuilder { private static FluidStack[] fix(FluidStack[] fluidInputs) { return Arrays.stream(fluidInputs) - .filter(Objects::nonNull) - .map(GT_FluidStack::new) - .toArray(FluidStack[]::new); + .filter(Objects::nonNull) + .map(GT_FluidStack::new) + .toArray(FluidStack[]::new); } private static ItemStack[] fix(ItemStack[] inputs) { @@ -114,7 +114,7 @@ public class GT_RecipeBuilder { private static boolean containsNull(Object[] arr) { return arr == null || Arrays.stream(arr) - .anyMatch(Objects::isNull); + .anyMatch(Objects::isNull); } private static void handleNullRecipeComponents(String componentType) { @@ -168,9 +168,9 @@ public class GT_RecipeBuilder { if (ores.isEmpty()) continue; int size = ((Number) arr[1]).intValue(); alts[i] = ores.stream() - .map(s -> GT_Utility.copyAmount(size, s)) - .filter(GT_Utility::isStackValid) - .toArray(ItemStack[]::new); + .map(s -> GT_Utility.copyAmount(size, s)) + .filter(GT_Utility::isStackValid) + .toArray(ItemStack[]::new); } else if (input == null) { handleNullRecipeComponents("recipe oredict input"); alts[i] = new ItemStack[0]; @@ -179,8 +179,8 @@ public class GT_RecipeBuilder { } } inputsBasic = Arrays.stream(alts) - .map(ss -> ss.length > 0 ? ss[0] : null) - .toArray(ItemStack[]::new); + .map(ss -> ss.length > 0 ? ss[0] : null) + .toArray(ItemStack[]::new); // optimize cannot handle recipes with alts return noOptimize(); } @@ -368,25 +368,25 @@ public class GT_RecipeBuilder { */ public GT_RecipeBuilder copy() { return new GT_RecipeBuilder( - copy(inputsBasic), - copy(inputsOreDict), - copy(outputs), - copy(alts), - copy(fluidInputs), - copy(fluidOutputs), - copy(chances), - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc, - optimize, - additionalData); + copy(inputsBasic), + copy(inputsOreDict), + copy(outputs), + copy(alts), + copy(fluidInputs), + copy(fluidOutputs), + copy(chances), + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc, + optimize, + additionalData); } /** @@ -394,25 +394,25 @@ public class GT_RecipeBuilder { */ public GT_RecipeBuilder copyNoMetadata() { return new GT_RecipeBuilder( - copy(inputsBasic), - copy(inputsOreDict), - copy(outputs), - copy(alts), - copy(fluidInputs), - copy(fluidOutputs), - copy(chances), - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc, - optimize, - Collections.emptyMap()); + copy(inputsBasic), + copy(inputsOreDict), + copy(outputs), + copy(alts), + copy(fluidInputs), + copy(fluidOutputs), + copy(chances), + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc, + optimize, + Collections.emptyMap()); } public ItemStack getItemInputBasic(int index) { @@ -582,23 +582,23 @@ public class GT_RecipeBuilder { preBuildChecks(); optimize(); return Optional.of( - decorate( - new GT_Recipe( - inputsBasic, - outputs, - fluidInputs, - fluidOutputs, - chances, - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc))); + decorate( + new GT_Recipe( + inputsBasic, + outputs, + fluidInputs, + fluidOutputs, + chances, + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc))); } public GT_RecipeBuilder forceOreDictInput() { @@ -614,24 +614,24 @@ public class GT_RecipeBuilder { preBuildChecks(); // no optimize. return Optional.of( - decorate( - new GT_Recipe.GT_Recipe_WithAlt( - inputsBasic, - outputs, - fluidInputs, - fluidOutputs, - chances, - special, - duration, - eut, - specialValue, - enabled, - hidden, - fakeRecipe, - mCanBeBuffered, - mNeedsEmptyOutput, - neiDesc, - alts))); + decorate( + new GT_Recipe.GT_Recipe_WithAlt( + inputsBasic, + outputs, + fluidInputs, + fluidOutputs, + chances, + special, + duration, + eut, + specialValue, + enabled, + hidden, + fakeRecipe, + mCanBeBuffered, + mNeedsEmptyOutput, + neiDesc, + alts))); } private void preBuildChecks() { @@ -715,8 +715,8 @@ public class GT_RecipeBuilder { public final static class MetadataIdentifier { - private static final Map, MetadataIdentifier> allIdentifiers = Collections.synchronizedMap( - new HashMap<>()); + private static final Map, MetadataIdentifier> allIdentifiers = Collections + .synchronizedMap(new HashMap<>()); private final Class clazz; private final String identifier; diff --git a/src/main/java/gregtech/api/util/GT_RecipeConstants.java b/src/main/java/gregtech/api/util/GT_RecipeConstants.java index bdb3346454..2b97bc4f71 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeConstants.java +++ b/src/main/java/gregtech/api/util/GT_RecipeConstants.java @@ -23,64 +23,54 @@ public class GT_RecipeConstants { * Set to true to signal the recipe require low gravity. do nothing if recipe set specialValue explicitly. Can * coexist with CLEANROOM just fine */ - public static final GT_RecipeBuilder.MetadataIdentifier LOW_GRAVITY = GT_RecipeBuilder.MetadataIdentifier.create( - Boolean.class, - "low_gravity"); + public static final GT_RecipeBuilder.MetadataIdentifier LOW_GRAVITY = GT_RecipeBuilder.MetadataIdentifier + .create(Boolean.class, "low_gravity"); /** * Set to true to signal the recipe require cleanroom. do nothing if recipe set specialValue explicitly. Can coexist * with LOW_GRAVITY just fine */ - public static final GT_RecipeBuilder.MetadataIdentifier CLEANROOM = GT_RecipeBuilder.MetadataIdentifier.create( - Boolean.class, - "cleanroom"); + public static final GT_RecipeBuilder.MetadataIdentifier CLEANROOM = GT_RecipeBuilder.MetadataIdentifier + .create(Boolean.class, "cleanroom"); /** * Common additive to use in recipe, e.g. for PBF, this is coal amount. */ - public static final GT_RecipeBuilder.MetadataIdentifier ADDITIVE_AMOUNT = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "additives"); + public static final GT_RecipeBuilder.MetadataIdentifier ADDITIVE_AMOUNT = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "additives"); /** * Used for fusion reactor. Denotes ignition threshold. */ - public static final GT_RecipeBuilder.MetadataIdentifier FUSION_THRESHOLD = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "fusion_threshold"); + public static final GT_RecipeBuilder.MetadataIdentifier FUSION_THRESHOLD = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "fusion_threshold"); /** * Research time in a scanner used in ticks. */ - public static final GT_RecipeBuilder.MetadataIdentifier RESEARCH_TIME = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "research_time"); + public static final GT_RecipeBuilder.MetadataIdentifier RESEARCH_TIME = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "research_time"); /** * Fuel type. TODO should we use enum directly? */ - public static final GT_RecipeBuilder.MetadataIdentifier FUEL_TYPE = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "fuel_type"); + public static final GT_RecipeBuilder.MetadataIdentifier FUEL_TYPE = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "fuel_type"); /** * Fuel value. */ - public static final GT_RecipeBuilder.MetadataIdentifier FUEL_VALUE = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "fuel_value"); + public static final GT_RecipeBuilder.MetadataIdentifier FUEL_VALUE = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "fuel_value"); /** * Fuel value. */ - public static final GT_RecipeBuilder.MetadataIdentifier COIL_HEAT = GT_RecipeBuilder.MetadataIdentifier.create( - Integer.class, - "coil_heat"); + public static final GT_RecipeBuilder.MetadataIdentifier COIL_HEAT = GT_RecipeBuilder.MetadataIdentifier + .create(Integer.class, "coil_heat"); /** * Research item used by assline recipes. */ - public static final GT_RecipeBuilder.MetadataIdentifier RESEARCH_ITEM = GT_RecipeBuilder.MetadataIdentifier.create( - ItemStack.class, - "research_item"); + public static final GT_RecipeBuilder.MetadataIdentifier RESEARCH_ITEM = GT_RecipeBuilder.MetadataIdentifier + .create(ItemStack.class, "research_item"); /** * For assembler. It accepts a single item as oredict. It looks like no one uses this anyway... */ - public static final GT_RecipeBuilder.MetadataIdentifier OREDICT_INPUT = GT_RecipeBuilder.MetadataIdentifier.create( - Object.class, - "oredict_input"); + public static final GT_RecipeBuilder.MetadataIdentifier OREDICT_INPUT = GT_RecipeBuilder.MetadataIdentifier + .create(Object.class, "oredict_input"); /** * Add fusion recipes. Dispatcher between complex fusion (which accepts arbitrarily many input/outputs) and classic @@ -88,8 +78,7 @@ public class GT_RecipeConstants { */ public static final IGT_RecipeMap Fusion = IGT_RecipeMap.newRecipeMap(builder -> { if (GT_Utility.isArrayEmptyOrNull(builder.getFluidInputs()) - || GT_Utility.isArrayEmptyOrNull(builder.getFluidOutputs())) - return Collections.emptyList(); + || GT_Utility.isArrayEmptyOrNull(builder.getFluidOutputs())) return Collections.emptyList(); if (builder.getFluidInputs().length > 2 || builder.getFluidOutputs().length > 2) return GT_Recipe_Map.sComplexFusionRecipes.doAdd(builder); return GT_Recipe_Map.sFusionRecipes.doAdd(builder); @@ -101,8 +90,7 @@ public class GT_RecipeConstants { */ public static final IGT_RecipeMap UniversalArcFurnace = IGT_RecipeMap.newRecipeMap(builder -> { if (!GT_Utility.isArrayOfLength(builder.getItemInputsBasic(), 1) - || GT_Utility.isArrayEmptyOrNull(builder.getItemOutputs())) - return Collections.emptyList(); + || GT_Utility.isArrayEmptyOrNull(builder.getItemOutputs())) return Collections.emptyList(); int aDuration = builder.getDuration(); if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", builder.getItemInputBasic(0), aDuration)) <= 0) { return Collections.emptyList(); @@ -113,13 +101,13 @@ public class GT_RecipeConstants { int tPlasmaAmount = (int) Math.max(1L, aDuration / (mat.getMass() * 16L)); GT_RecipeBuilder b2 = builder.copy(); b2.fluidInputs(mat.getPlasma(tPlasmaAmount)) - .fluidOutputs(mat.getGas(tPlasmaAmount)); + .fluidOutputs(mat.getGas(tPlasmaAmount)); ret.addAll(GT_Recipe_Map.sPlasmaArcFurnaceRecipes.doAdd(b2)); } ret.addAll( - GT_Recipe_Map.sArcFurnaceRecipes.doAdd( - builder.copy() - .fluidInputs(Materials.Oxygen.getGas(aDuration)))); + GT_Recipe_Map.sArcFurnaceRecipes.doAdd( + builder.copy() + .fluidInputs(Materials.Oxygen.getGas(aDuration)))); return ret; }); @@ -135,12 +123,12 @@ public class GT_RecipeConstants { } } return GT_Utility.concat( - builder.copy() - .addTo(GT_Recipe_Map.sChemicalRecipes), - convertCellToFluid(builder, false) - // LCR does not need cleanroom, for now. - .metadata(CLEANROOM, false) - .addTo(GT_Recipe_Map.sMultiblockChemicalRecipes)); + builder.copy() + .addTo(GT_Recipe_Map.sChemicalRecipes), + convertCellToFluid(builder, false) + // LCR does not need cleanroom, for now. + .metadata(CLEANROOM, false) + .addTo(GT_Recipe_Map.sMultiblockChemicalRecipes)); }); /** @@ -150,11 +138,11 @@ public class GT_RecipeConstants { */ public static final IGT_RecipeMap AssemblyLine = IGT_RecipeMap.newRecipeMap(builder -> { Optional rr = builder.forceOreDictInput() - .validateInputCount(4, 16) - .validateOutputCount(1, 1) - .validateOutputFluidCount(-1, 0) - .validateInputFluidCount(0, 4) - .buildWithAlt(); + .validateInputCount(4, 16) + .validateOutputCount(1, 1) + .validateOutputFluidCount(-1, 0) + .validateInputFluidCount(0, 4) + .buildWithAlt(); if (!rr.isPresent()) return Collections.emptyList(); GT_Recipe.GT_Recipe_WithAlt r = rr.get(); ItemStack[][] mOreDictAlt = r.mOreDictAlt; @@ -174,21 +162,21 @@ public class GT_RecipeConstants { tPersistentHash *= 31; } else if (input instanceof Object[]objs) { Arrays.sort( - alts, - Comparator.comparing( - s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) - .thenComparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).name) - .thenComparingInt(Items.feather::getDamage) - .thenComparingInt(s -> s.stackSize)); + alts, + Comparator + .comparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).modId) + .thenComparing(s -> GameRegistry.findUniqueIdentifierFor(s.getItem()).name) + .thenComparingInt(Items.feather::getDamage) + .thenComparingInt(s -> s.stackSize)); tPersistentHash = tPersistentHash * 31 + (objs[0] == null ? "" : objs[0].toString()).hashCode(); tPersistentHash = tPersistentHash * 31 + ((Number) objs[1]).intValue(); } GT_Log.err.println( - "addAssemblingLineRecipe " + aResearchItem.getDisplayName() - + " --> " - + aOutput.getUnlocalizedName() - + " there is some null item in that recipe"); + "addAssemblingLineRecipe " + aResearchItem.getDisplayName() + + " --> " + + aOutput.getUnlocalizedName() + + " there is some null item in that recipe"); } tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aResearchItem, true, false); tPersistentHash = tPersistentHash * 31 + GT_Utility.persistentHash(aOutput, true, false); @@ -202,40 +190,40 @@ public class GT_RecipeConstants { tPersistentHash = tPersistentHash * 31 + r.mEUt; Collection ret = new ArrayList<>(3); ret.add( - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { aResearchItem }, - new ItemStack[] { aOutput }, - new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result") }, - null, - null, - aResearchTime, - 30, - -201)); // means it's scanned + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new ItemStack[] { aResearchItem }, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result") }, + null, + null, + aResearchTime, + 30, + -201)); // means it's scanned ret.add( - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( - false, - r.mInputs, - new ItemStack[] { aOutput }, - new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Reads Research result") }, - r.mFluidInputs, - null, - r.mDuration, - r.mEUt, - 0, - r.mOreDictAlt, - false)); - - GT_Recipe.GT_Recipe_AssemblyLine tRecipe = new GT_Recipe.GT_Recipe_AssemblyLine( - aResearchItem, - aResearchTime, + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( + false, r.mInputs, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Reads Research result") }, r.mFluidInputs, - aOutput, + null, r.mDuration, r.mEUt, - r.mOreDictAlt); + 0, + r.mOreDictAlt, + false)); + + GT_Recipe.GT_Recipe_AssemblyLine tRecipe = new GT_Recipe.GT_Recipe_AssemblyLine( + aResearchItem, + aResearchTime, + r.mInputs, + r.mFluidInputs, + aOutput, + r.mDuration, + r.mEUt, + r.mOreDictAlt); tRecipe.setPersistentHash(tPersistentHash); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(tRecipe); GT_AssemblyLineUtils.addRecipeToCache(tRecipe); @@ -250,9 +238,9 @@ public class GT_RecipeConstants { Collection ret = new ArrayList<>(); for (ItemStack input : GT_OreDictUnificator.getOresImmutable(builder.getMetadata(OREDICT_INPUT))) { ret.addAll( - builder.copy() - .itemInputs(GT_RecipeMapUtil.appendArray(builder.getItemInputsBasic(), input)) - .addTo(GT_Recipe_Map.sAssemblerRecipes)); + builder.copy() + .itemInputs(GT_RecipeMapUtil.appendArray(builder.getItemInputsBasic(), input)) + .addTo(GT_Recipe_Map.sAssemblerRecipes)); } return ret; }); @@ -265,20 +253,18 @@ public class GT_RecipeConstants { */ public static IGT_RecipeMap Fuel = IGT_RecipeMap.newRecipeMap(builder -> { builder.validateInputCount(1, 1) - .validateNoInputFluid() - .validateOutputCount(-1, 0) - .validateNoOutputFluid(); + .validateNoInputFluid() + .validateOutputCount(-1, 0) + .validateNoOutputFluid(); if (!builder.isValid()) return Collections.emptyList(); int fuelType = builder.getMetadata(FUEL_TYPE); builder.metadata( - FUEL_VALUE, - GregTech_API.sRecipeFile.get( - "fuel_" + fuelType, - builder.getItemInputBasic(0), - builder.getMetadata(FUEL_VALUE))); + FUEL_VALUE, + GregTech_API.sRecipeFile + .get("fuel_" + fuelType, builder.getItemInputBasic(0), builder.getMetadata(FUEL_VALUE))); return FuelType.get(fuelType) - .getTarget() - .doAdd(builder); + .getTarget() + .doAdd(builder); }); public enum FuelType { diff --git a/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java b/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java index ee524c913c..4f7f2e199b 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java +++ b/src/main/java/gregtech/api/util/GT_RecipeMapUtil.java @@ -31,31 +31,31 @@ public class GT_RecipeMapUtil { }; public static final Function FIRST_FLUID_INPUT = r -> isArrayEmptyOrNull(r.mFluidInputs) ? null - : r.mFluidInputs[0].getFluid() - .getName(); + : r.mFluidInputs[0].getFluid() + .getName(); public static final Function FIRST_FLUID_OUTPUT = r -> isArrayEmptyOrNull(r.mFluidInputs) ? null - : r.mFluidOutputs[0].getFluid() - .getName(); + : r.mFluidOutputs[0].getFluid() + .getName(); public static final Function FIRST_FLUIDSTACK_INPUT = r -> isArrayEmptyOrNull(r.mFluidInputs) - ? null - : r.mFluidInputs[0].getUnlocalizedName(); + ? null + : r.mFluidInputs[0].getUnlocalizedName(); public static final Function FIRST_FLUIDSTACK_OUTPUT = r -> isArrayEmptyOrNull(r.mFluidOutputs) - ? null - : r.mFluidOutputs[0].getUnlocalizedName(); + ? null + : r.mFluidOutputs[0].getUnlocalizedName(); public static final Function FIRST_ITEM_INPUT = r -> isArrayEmptyOrNull(r.mInputs) ? null - : getStackConfigName(r.mInputs[0]); + : getStackConfigName(r.mInputs[0]); public static final Function FIRST_ITEM_OUTPUT = r -> isArrayEmptyOrNull(r.mOutputs) ? null - : getStackConfigName(r.mOutputs[0]); + : getStackConfigName(r.mOutputs[0]); public static final Function FIRST_ITEM_OR_FLUID_INPUT = r -> isArrayEmptyOrNull(r.mInputs) - ? isArrayEmptyOrNull(r.mFluidInputs) ? null - : r.mFluidInputs[0].getFluid() - .getName() - : getStackConfigName(r.mInputs[0]); + ? isArrayEmptyOrNull(r.mFluidInputs) ? null + : r.mFluidInputs[0].getFluid() + .getName() + : getStackConfigName(r.mInputs[0]); public static final Function FIRST_ITEM_OR_FLUID_OUTPUT = r -> isArrayEmptyOrNull(r.mOutputs) - ? isArrayEmptyOrNull(r.mFluidOutputs) ? null - : r.mFluidOutputs[0].getFluid() - .getName() - : getStackConfigName(r.mOutputs[0]); + ? isArrayEmptyOrNull(r.mFluidOutputs) ? null + : r.mFluidOutputs[0].getFluid() + .getName() + : getStackConfigName(r.mOutputs[0]); private static final Map addonRecipeMaps = new HashMap<>(); private static final Multimap> delayedActions = ArrayListMultimap.create(); @@ -93,17 +93,17 @@ public class GT_RecipeMapUtil { cellToFluid(itemInputs, fluidInputs, removeIntegratedCircuit, null); cellToFluid(itemOutputs, fluidOutputs, removeIntegratedCircuit, chances); return b.itemInputs(itemInputs.toArray(new ItemStack[0])) - .itemOutputs(itemOutputs.toArray(new ItemStack[0]), chances != null ? chances.toArray() : null) - .fluidInputs(fluidInputs.toArray(new FluidStack[0])) - .fluidOutputs(fluidOutputs.toArray(new FluidStack[0])); + .itemOutputs(itemOutputs.toArray(new ItemStack[0]), chances != null ? chances.toArray() : null) + .fluidInputs(fluidInputs.toArray(new FluidStack[0])) + .fluidOutputs(fluidOutputs.toArray(new FluidStack[0])); } private static void cellToFluid(List items, List fluids, boolean removeIntegratedCircuit, - TIntList chances) { + TIntList chances) { for (int i = items.size() - 1; i >= 0; i--) { ItemStack item = items.get(i); if (GT_Utility.getFluidForFilledItem(item, true) != null || GT_Utility.isCellEmpty(item) - || (removeIntegratedCircuit && GT_Utility.isAnyIntegratedCircuit(item))) { + || (removeIntegratedCircuit && GT_Utility.isAnyIntegratedCircuit(item))) { fluids.add(GT_Utility.convertCellToFluid(item)); items.remove(i); if (chances != null) chances.removeAt(i); @@ -113,8 +113,8 @@ public class GT_RecipeMapUtil { public static List buildOrEmpty(GT_RecipeBuilder builder) { return builder.build() - .map(Collections::singletonList) - .orElse(Collections.emptyList()); + .map(Collections::singletonList) + .orElse(Collections.emptyList()); } /** @@ -128,12 +128,12 @@ public class GT_RecipeMapUtil { * end up with a bunch of weird concurrency bugs. */ public static void registerRecipeMap(String identifier, IGT_RecipeMap recipeMap, - RecipeMapDependency... dependencies) { + RecipeMapDependency... dependencies) { String modId = Loader.instance() - .activeModContainer() - .getModId(); + .activeModContainer() + .getModId(); if (GregTech.ID.equals(modId)) throw new IllegalStateException( - "do not register recipe map under the name of gregtech! do it in your own preinit!"); + "do not register recipe map under the name of gregtech! do it in your own preinit!"); String id = modId + "@" + identifier; addonRecipeMaps.put(id, recipeMap); for (Consumer action : delayedActions.get(id)) { diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java index 2c08e461b7..a9e8f5cc09 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java @@ -45,84 +45,83 @@ public class GT_RecipeRegistrator { private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0); private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R"; private static final RecipeShape[] sShapes = new RecipeShape[] { - new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null), - new RecipeShape(sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null), - new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1), - new RecipeShape(null, null, null, sMt1, null, sMt1, sMt1, null, sMt1), - new RecipeShape(null, sMt1, null, null, sMt1, null, null, sMt2, null), - new RecipeShape(sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, null, null, sMt2, null, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, null, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, sMt1, null, sMt2, null, null, sMt2, null), - new RecipeShape(null, sMt1, null, sMt1, null, null, null, sMt1, sMt2), - new RecipeShape(null, sMt1, null, null, null, sMt1, sMt2, sMt1, null), - new RecipeShape(null, sMt1, null, sMt1, null, sMt1, null, null, sMt2), - new RecipeShape(null, sMt1, null, sMt1, null, sMt1, sMt2, null, null), - new RecipeShape(null, sMt2, null, null, sMt1, null, null, sMt1, null), - new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1), - new RecipeShape(null, sMt2, null, null, sMt2, null, null, sMt1, null), - new RecipeShape(null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null), - new RecipeShape(null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1), - new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, null), - new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, sMt2), - new RecipeShape(null, null, sMt1, null, sMt2, null, sMt2, null, null), - new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, null), - new RecipeShape(null, null, sMt1, null, sMt2, null, null, null, null), - new RecipeShape(sMt1, sMt2, null, null, null, null, null, null, null), - new RecipeShape(sMt2, sMt1, null, null, null, null, null, null, null), - new RecipeShape(sMt1, null, null, sMt2, null, null, null, null, null), - new RecipeShape(sMt2, null, null, sMt1, null, null, null, null, null), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null), - new RecipeShape(null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1), - new RecipeShape(null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null), - new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null), - new RecipeShape(null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1), - new RecipeShape(null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1), - new RecipeShape(sMt1, null, null, null, sMt1, null, null, null, null), - new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null), - new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null), - new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2) }; + new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null), + new RecipeShape(sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null), + new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1), + new RecipeShape(null, null, null, sMt1, null, sMt1, sMt1, null, sMt1), + new RecipeShape(null, sMt1, null, null, sMt1, null, null, sMt2, null), + new RecipeShape(sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, null, null, sMt2, null, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, null, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, sMt1, null, sMt2, null, null, sMt2, null), + new RecipeShape(null, sMt1, null, sMt1, null, null, null, sMt1, sMt2), + new RecipeShape(null, sMt1, null, null, null, sMt1, sMt2, sMt1, null), + new RecipeShape(null, sMt1, null, sMt1, null, sMt1, null, null, sMt2), + new RecipeShape(null, sMt1, null, sMt1, null, sMt1, sMt2, null, null), + new RecipeShape(null, sMt2, null, null, sMt1, null, null, sMt1, null), + new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1), + new RecipeShape(null, sMt2, null, null, sMt2, null, null, sMt1, null), + new RecipeShape(null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null), + new RecipeShape(null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1), + new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, null), + new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, sMt2), + new RecipeShape(null, null, sMt1, null, sMt2, null, sMt2, null, null), + new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, null), + new RecipeShape(null, null, sMt1, null, sMt2, null, null, null, null), + new RecipeShape(sMt1, sMt2, null, null, null, null, null, null, null), + new RecipeShape(sMt2, sMt1, null, null, null, null, null, null, null), + new RecipeShape(sMt1, null, null, sMt2, null, null, null, null, null), + new RecipeShape(sMt2, null, null, sMt1, null, null, null, null, null), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null), + new RecipeShape(null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1), + new RecipeShape(null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null), + new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null), + new RecipeShape(null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1), + new RecipeShape(null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1), + new RecipeShape(sMt1, null, null, null, sMt1, null, null, null, null), + new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null), + new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null), + new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2) }; public static final Field SHAPED_ORE_RECIPE_WIDTH = ReflectionHelper.findField(ShapedOreRecipe.class, "width"); public static final Field SHAPED_ORE_RECIPE_HEIGHT = ReflectionHelper.findField(ShapedOreRecipe.class, "height"); private static volatile Map> indexedRecipeListCache; private static final String[][] sShapesA = new String[][] { null, null, null, - { "Helmet", s_P + s_P + s_P, s_P + s_H + s_P }, - { "ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P }, - { "Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P }, - { "Boots", s_P + " " + s_P, s_P + s_H + s_P }, - { "Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " " }, - { "Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " " }, - { "Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " " }, - { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, - { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, - { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, - { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, - { "Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " " }, - { "Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I }, - { "Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H }, - { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, - { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, - { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, - { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, - { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, - { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, { "Knive", s_H + s_P, s_R + s_F }, - { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_P + s_F, s_R + s_H }, - { "Knive", s_P + s_F, s_R + s_H }, null, null, null, null, - { "WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H }, null, null, null, - { "Shears", s_H + s_P, s_P + s_F }, { "Shears", s_H + s_P, s_P + s_F }, - { "Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " " }, - { "Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R } }; + { "Helmet", s_P + s_P + s_P, s_P + s_H + s_P }, + { "ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P }, + { "Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P }, { "Boots", s_P + " " + s_P, s_P + s_H + s_P }, + { "Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " " }, + { "Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " " }, + { "Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " " }, + { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, + { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " }, + { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, + { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R }, + { "Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " " }, + { "Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I }, + { "Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H }, + { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, + { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H }, + { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, + { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H }, + { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, + { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, { "Knive", s_H + s_P, s_R + s_F }, + { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_P + s_F, s_R + s_H }, + { "Knive", s_P + s_F, s_R + s_H }, null, null, null, null, + { "WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H }, null, null, null, + { "Shears", s_H + s_P, s_P + s_F }, { "Shears", s_H + s_P, s_P + s_F }, + { "Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " " }, + { "Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R } }; public static volatile int VERSION = 509; static { @@ -131,37 +130,36 @@ public class GT_RecipeRegistrator { } public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByproduct) { + MaterialStack aByproduct) { if (GT_Utility.isStackInvalid(aStack)) return; if (aByproduct != null) { aByproduct = aByproduct.clone(); aByproduct.mAmount /= aStack.stackSize; } GT_OreDictUnificator.addItemData( - GT_Utility.copyAmount(1, aStack), - new ItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct)); + GT_Utility.copyAmount(1, aStack), + new ItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct)); } public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) { if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) - || aData == null - || !aData.hasValidMaterialData() - || !aData.mMaterial.mMaterial.mAutoGenerateRecycleRecipes - || aData.mMaterial.mAmount <= 0 - || GT_Utility.getFluidForFilledItem(aStack, false) != null - || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) - return; + || aData == null + || !aData.hasValidMaterialData() + || !aData.mMaterial.mMaterial.mAutoGenerateRecycleRecipes + || aData.mMaterial.mAmount <= 0 + || GT_Utility.getFluidForFilledItem(aStack, false) != null + || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) return; registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null); registerReverseSmelting( - GT_Utility.copyAmount(1, aStack), - aData.mMaterial.mMaterial, - aData.mMaterial.mAmount, - true); + GT_Utility.copyAmount(1, aStack), + aData.mMaterial.mMaterial, + aData.mMaterial.mAmount, + true); registerReverseFluidSmelting( - GT_Utility.copyAmount(1, aStack), - aData.mMaterial.mMaterial, - aData.mMaterial.mAmount, - aData.getByProduct(0)); + GT_Utility.copyAmount(1, aStack), + aData.mMaterial.mMaterial, + aData.mMaterial.mAmount, + aData.getByProduct(0)); registerReverseArcSmelting(GT_Utility.copyAmount(1, aStack), aData); } @@ -171,20 +169,18 @@ public class GT_RecipeRegistrator { * @param aMaterialAmount the amount of it in Material Units. */ public static void registerReverseFluidSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByproduct) { + MaterialStack aByproduct) { if (aStack == null || aMaterial == null - || aMaterial.mSmeltInto.mStandardMoltenFluid == null - || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) - || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0) - return; + || aMaterial.mSmeltInto.mStandardMoltenFluid == null + || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) + || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0) return; ItemData tData = GT_OreDictUnificator.getItemData(aStack); boolean tHide = aStack.getUnlocalizedName() - .startsWith("gt.blockmachines") - && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); + .startsWith("gt.blockmachines") && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); if (GT_Mod.gregtechproxy.mHideRecyclingRecipes && tData != null - && tData.hasValidPrefixData() - && !(tData.mPrefix == OrePrefixes.dust || tData.mPrefix == OrePrefixes.ingot - || tData.mPrefix == OrePrefixes.block | tData.mPrefix == OrePrefixes.plate)) { + && tData.hasValidPrefixData() + && !(tData.mPrefix == OrePrefixes.dust || tData.mPrefix == OrePrefixes.ingot + || tData.mPrefix == OrePrefixes.block | tData.mPrefix == OrePrefixes.plate)) { tHide = true; } // boolean tHide = (aMaterial != Materials.Iron && aMaterial!= @@ -193,29 +189,23 @@ public class GT_RecipeRegistrator { // tHide=false; // } RA.addFluidSmelterRecipe( - GT_Utility.copyAmount(1, aStack), - aByproduct == null - || (tData != null && tData.hasValidPrefixData() && tData.mPrefix == OrePrefixes.toolHeadDrill) - ? null - : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) - || !aByproduct.mMaterial.contains(SubTag.METAL) - ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) - ? GT_OreDictUnificator.getDust( - Materials.Ash, - aByproduct.mAmount / 2) - : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) - ? GT_OreDictUnificator.getDustOrIngot( - aByproduct.mMaterial.mSmeltInto, - aByproduct.mAmount) - : null - : GT_OreDictUnificator.getIngotOrDust( - aByproduct.mMaterial.mSmeltInto, - aByproduct.mAmount), - aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), - 10000, - (int) Math.max(1, (24 * aMaterialAmount) / M), - Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), - tHide); + GT_Utility.copyAmount(1, aStack), + aByproduct == null + || (tData != null && tData.hasValidPrefixData() && tData.mPrefix == OrePrefixes.toolHeadDrill) + ? null + : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) + ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) + ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) + : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) + ? GT_OreDictUnificator + .getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) + : null + : GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), + aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), + 10000, + (int) Math.max(1, (24 * aMaterialAmount) / M), + Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), + tHide); } /** @@ -225,36 +215,35 @@ public class GT_RecipeRegistrator { * @param aAllowAlloySmelter if it is allowed to be recycled inside the Alloy Smelter. */ public static void registerReverseSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - boolean aAllowAlloySmelter) { + boolean aAllowAlloySmelter) { if (aStack == null || aMaterial == null - || aMaterialAmount <= 0 - || aMaterial.contains(SubTag.NO_SMELTING) - || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL)) - || (aMaterial.getProcessingMaterialTierEU() > TierEU.IV)) - return; + || aMaterialAmount <= 0 + || aMaterial.contains(SubTag.NO_SMELTING) + || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL)) + || (aMaterial.getProcessingMaterialTierEU() > TierEU.IV)) return; if (aMaterial == Materials.Naquadah || aMaterial == Materials.NaquadahEnriched) return; aMaterialAmount /= aStack.stackSize; boolean tHide = (aMaterial != Materials.Iron) && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); if (aAllowAlloySmelter) GT_ModHandler.addSmeltingAndAlloySmeltingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount), - tHide); + GT_Utility.copyAmount(1, aStack), + GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount), + tHide); else GT_ModHandler.addSmeltingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); + GT_Utility.copyAmount(1, aStack), + GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); } public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) { + MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) { registerReverseArcSmelting( - aStack, - new ItemData( - aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), - aByProduct01, - aByProduct02, - aByProduct03)); + aStack, + new ItemData( + aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), + aByProduct01, + aByProduct02, + aByProduct03)); } public static void registerReverseArcSmelting(ItemStack aStack, ItemData aData) { @@ -266,9 +255,8 @@ public class GT_RecipeRegistrator { for (MaterialStack tMaterial : aData.getAllMaterialStacks()) { if (tMaterial.mMaterial == Materials.Iron || tMaterial.mMaterial == Materials.Copper - || tMaterial.mMaterial == Materials.WroughtIron - || tMaterial.mMaterial == Materials.AnnealedCopper) - tIron = true; + || tMaterial.mMaterial == Materials.WroughtIron + || tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true; if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) { tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto; @@ -315,41 +303,41 @@ public class GT_RecipeRegistrator { boolean tHide = !tIron && GT_Mod.gregtechproxy.mHideRecyclingRecipes; if (aData.mPrefix == OrePrefixes.toolHeadDrill) { RA.addArcFurnaceRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial) }, - null, - 90, - (int) Math.max(16, tAmount / M), - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial) }, + null, + 90, + (int) Math.max(16, tAmount / M), + tHide); } else { RA.addArcFurnaceRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(3)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(5)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(6)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(7)), - GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(8)) }, - null, - (int) Math.max(16, tAmount / M), - 90, - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(3)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(5)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(6)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(7)), + GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(8)) }, + null, + (int) Math.max(16, tAmount / M), + 90, + tHide); } } public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount, - MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { + MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) { registerReverseMacerating( - aStack, - new ItemData( - aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), - aByProduct01, - aByProduct02, - aByProduct03), - aAllowHammer); + aStack, + new ItemData( + aMaterial == null ? null : new MaterialStack(aMaterial, aMaterialAmount), + aByProduct01, + aByProduct02, + aByProduct03), + aAllowHammer); } public static void registerReverseMacerating(ItemStack aStack, ItemData aData, boolean aAllowHammer) { @@ -371,42 +359,41 @@ public class GT_RecipeRegistrator { boolean tHide = (aData.mMaterial.mMaterial != Materials.Iron) && (GT_Mod.gregtechproxy.mHideRecyclingRecipes); if (aData.mPrefix == OrePrefixes.toolHeadDrill) { RA.addPulveriserRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial) }, - null, - aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), - 4, - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial) }, + null, + aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), + 4, + tHide); } else { RA.addPulveriserRecipe( - aStack, - new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial), - GT_OreDictUnificator.getDust(aData.getByProduct(0)), - GT_OreDictUnificator.getDust(aData.getByProduct(1)), - GT_OreDictUnificator.getDust(aData.getByProduct(2)) }, - null, - aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), - 4, - tHide); + aStack, + new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial), + GT_OreDictUnificator.getDust(aData.getByProduct(0)), + GT_OreDictUnificator.getDust(aData.getByProduct(1)), + GT_OreDictUnificator.getDust(aData.getByProduct(2)) }, + null, + aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M), + 4, + tHide); } if (aAllowHammer) for (MaterialStack tMaterial : aData.getAllMaterialStacks()) if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL) - && tMaterial.mMaterial != Materials.Glass) { - if (RA.addForgeHammerRecipe( - GT_Utility.copyAmount(1, aStack), - GT_OreDictUnificator.getDust(aData.mMaterial), - 200, - 30)) - break; - } + && tMaterial.mMaterial != Materials.Glass) { + if (RA.addForgeHammerRecipe( + GT_Utility.copyAmount(1, aStack), + GT_OreDictUnificator.getDust(aData.mMaterial), + 200, + 30)) break; + } } /** * Place Materials which you want to replace in Non-GT-Recipes here (warning HUGHE impact on loading times!) */ private static final Materials[] VANILLA_MATS = { Cobalt, Gold, Iron, Lead, FierySteel, Void, Bronze, Diamond, Ruby, - Sapphire, Steel, IronWood, Steeleaf, Knightmetal, Thaumium, DarkSteel, }; + Sapphire, Steel, IronWood, Steeleaf, Knightmetal, Thaumium, DarkSteel, }; /** * You give this Function a Material and it will scan almost everything for adding recycling Recipes and replacing @@ -417,7 +404,7 @@ public class GT_RecipeRegistrator { * @param aRecipeReplacing allows to replace the Recipe with a Plate variant */ public static synchronized void registerUsagesForMaterials(String aPlate, boolean aRecipeReplacing, - ItemStack... aMats) { + ItemStack... aMats) { for (ItemStack aMat : aMats) { aMat = GT_Utility.copyOrNull(aMat); @@ -439,10 +426,8 @@ public class GT_RecipeRegistrator { for (RecipeShape tRecipe : sShapes) { for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputsBuffered(tRecipe.shape)) { GT_OreDictUnificator.addItemData( - tCrafted, - new ItemData( - aItemData.mMaterial.mMaterial, - aItemData.mMaterial.mAmount * tRecipe.amount1)); + tCrafted, + new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tRecipe.amount1)); // // GT_Log.out.println("###################################################################################"); // GT_Log.out.println("registerUsagesForMaterials used aPlate: "+aPlate); @@ -475,7 +460,7 @@ public class GT_RecipeRegistrator { Map> result = new IdentityHashMap<>(); @SuppressWarnings("unchecked") ArrayList allRecipeList = (ArrayList) CraftingManager.getInstance() - .getRecipeList(); + .getRecipeList(); // filter using the empty slots in the shape. // if the empty slots doesn't match, the recipe will definitely fail SetMultimap, RecipeShape> filter = HashMultimap.create(); @@ -493,33 +478,33 @@ public class GT_RecipeRegistrator { buffer.clear(); ItemStack tStack = tRecipe.getRecipeOutput(); if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 - && tStack.getMaxDamage() > 0 - && !(tStack.getItem() instanceof ItemBlock) - && !(tStack.getItem() instanceof IReactorComponent) - && !GT_ModHandler.isElectricItem(tStack) - && !GT_Utility.isStackInList(tStack, GT_ModHandler.sNonReplaceableItems)) { + && tStack.getMaxDamage() > 0 + && !(tStack.getItem() instanceof ItemBlock) + && !(tStack.getItem() instanceof IReactorComponent) + && !GT_ModHandler.isElectricItem(tStack) + && !GT_Utility.isStackInList(tStack, GT_ModHandler.sNonReplaceableItems)) { if (tRecipe instanceof ShapedOreRecipe) { ShapedOreRecipe tShapedRecipe = (ShapedOreRecipe) tRecipe; if (checkRecipeShape( - buffer, - tShapedRecipe.getInput(), - getRecipeWidth(tShapedRecipe), - getRecipeHeight(tShapedRecipe))) { + buffer, + tShapedRecipe.getInput(), + getRecipeWidth(tShapedRecipe), + getRecipeHeight(tShapedRecipe))) { for (RecipeShape s : filter.get(buffer)) { result.computeIfAbsent(s, k -> new ArrayList<>()) - .add(tRecipe); + .add(tRecipe); } } } else if (tRecipe instanceof ShapedRecipes) { ShapedRecipes tShapedRecipe = (ShapedRecipes) tRecipe; if (checkRecipeShape( - buffer, - tShapedRecipe.recipeItems, - getRecipeWidth(tShapedRecipe), - getRecipeHeight(tShapedRecipe))) { + buffer, + tShapedRecipe.recipeItems, + getRecipeWidth(tShapedRecipe), + getRecipeHeight(tShapedRecipe))) { for (RecipeShape s : filter.get(buffer)) { result.computeIfAbsent(s, k -> new ArrayList<>()) - .add(tRecipe); + .add(tRecipe); } } } else { @@ -527,7 +512,7 @@ public class GT_RecipeRegistrator { // unknown recipe type. cannot determine empty slots. we choose to add to the recipe list for // all shapes result.computeIfAbsent(s, k -> new ArrayList<>()) - .add(tRecipe); + .add(tRecipe); } } } @@ -536,7 +521,7 @@ public class GT_RecipeRegistrator { } private static boolean checkRecipeShape(List emptySlotIndexesBuffer, Object[] input, int tRecipeWidth, - int tRecipeHeight) { + int tRecipeHeight) { for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { if (x >= tRecipeWidth || y >= tRecipeHeight) { @@ -549,9 +534,9 @@ public class GT_RecipeRegistrator { continue; } if (tObject instanceof ItemStack - && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 - || ((ItemStack) tObject).getMaxDamage() > 0 - || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { + && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 + || ((ItemStack) tObject).getMaxDamage() > 0 + || ((ItemStack) tObject).getItem() instanceof ItemBlock)) { return false; } if (tObject instanceof List && ((List) tObject).isEmpty()) { @@ -574,45 +559,41 @@ public class GT_RecipeRegistrator { for (int i = 0; i < sShapes.length; i++) { RecipeShape tRecipe = sShapes[i]; - for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs( - getRecipeList(tRecipe), - true, - tRecipe.shape)) { + for (ItemStack tCrafted : GT_ModHandler + .getRecipeOutputs(getRecipeList(tRecipe), true, tRecipe.shape)) { if (aItemData != null && aItemData.hasValidPrefixMaterialData()) GT_OreDictUnificator.addItemData( - tCrafted, - new ItemData( - aItemData.mMaterial.mMaterial, - aItemData.mMaterial.mAmount * tRecipe.amount1, - new MaterialStack( - tMaterial, - OrePrefixes.stick.mMaterialAmount * tRecipe.amount2))); + tCrafted, + new ItemData( + aItemData.mMaterial.mMaterial, + aItemData.mMaterial.mAmount * tRecipe.amount1, + new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tRecipe.amount2))); if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) { assert aItemData != null; if (GregTech_API.sRecipeFile.get( - ConfigCategories.Recipes.recipereplacements, - aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], - true)) { + ConfigCategories.Recipes.recipereplacements, + aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], + true)) { if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe.shape))) { switch (sShapesA[i].length) { case 2 -> GT_ModHandler.addCraftingRecipe( - tStack, - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), - OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); + tStack, + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), + OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); case 3 -> GT_ModHandler.addCraftingRecipe( - tStack, - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, - s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), - aItemData }); + tStack, + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, + s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), + aItemData }); default -> GT_ModHandler.addCraftingRecipe( - tStack, - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], - s_P.charAt(0), aPlate, s_R.charAt(0), - OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData }); + tStack, + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], + s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), + s_I.charAt(0), aItemData }); } } } @@ -633,12 +614,12 @@ public class GT_RecipeRegistrator { */ public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt) { registerWiremillRecipes( - aMaterial, - baseDuration, - calculateRecipeEU(aMaterial, aEUt), - OrePrefixes.ingot, - OrePrefixes.stick, - 2); + aMaterial, + baseDuration, + calculateRecipeEU(aMaterial, aEUt), + OrePrefixes.ingot, + OrePrefixes.stick, + 2); } /** @@ -652,96 +633,96 @@ public class GT_RecipeRegistrator { * @param multiplier amount of wires created from 1 ingot */ public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt, OrePrefixes prefix1, - OrePrefixes prefix2, int multiplier) { + OrePrefixes prefix2, int multiplier) { GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 1L), - GT_Utility.getIntegratedCircuit(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, multiplier), - baseDuration, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 1L), + GT_Utility.getIntegratedCircuit(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, multiplier), + baseDuration, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 2L / multiplier), - GT_Utility.getIntegratedCircuit(2), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), - (int) (baseDuration * 1.5f), - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 2L / multiplier), + GT_Utility.getIntegratedCircuit(2), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), + (int) (baseDuration * 1.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 4L / multiplier), - GT_Utility.getIntegratedCircuit(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), - baseDuration * 2, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 4L / multiplier), + GT_Utility.getIntegratedCircuit(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), + baseDuration * 2, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 8L / multiplier), - GT_Utility.getIntegratedCircuit(8), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), - (int) (baseDuration * 2.5f), - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 8L / multiplier), + GT_Utility.getIntegratedCircuit(8), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), + (int) (baseDuration * 2.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 12L / multiplier), - GT_Utility.getIntegratedCircuit(12), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), - baseDuration * 3, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 12L / multiplier), + GT_Utility.getIntegratedCircuit(12), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), + baseDuration * 3, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 16L / multiplier), - GT_Utility.getIntegratedCircuit(16), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), - (int) (baseDuration * 3.5f), - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 16L / multiplier), + GT_Utility.getIntegratedCircuit(16), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), + (int) (baseDuration * 3.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 2L / multiplier), - GT_Utility.getIntegratedCircuit(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), - baseDuration / 2, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 2L / multiplier), + GT_Utility.getIntegratedCircuit(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), + baseDuration / 2, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 4L / multiplier), - GT_Utility.getIntegratedCircuit(2), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), - baseDuration, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 4L / multiplier), + GT_Utility.getIntegratedCircuit(2), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), + baseDuration, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 8L / multiplier), - GT_Utility.getIntegratedCircuit(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), - (int) (baseDuration * 1.5f), - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 8L / multiplier), + GT_Utility.getIntegratedCircuit(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), + (int) (baseDuration * 1.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 16L / multiplier), - GT_Utility.getIntegratedCircuit(8), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), - baseDuration * 2, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 16L / multiplier), + GT_Utility.getIntegratedCircuit(8), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), + baseDuration * 2, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 24L / multiplier), - GT_Utility.getIntegratedCircuit(12), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), - (int) (baseDuration * 2.5f), - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 24L / multiplier), + GT_Utility.getIntegratedCircuit(12), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), + (int) (baseDuration * 2.5f), + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 32L / multiplier), - GT_Utility.getIntegratedCircuit(16), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), - baseDuration * 3, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 32L / multiplier), + GT_Utility.getIntegratedCircuit(16), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), + baseDuration * 3, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix1, aMaterial, 1L), - GT_Utility.getIntegratedCircuit(3), - GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L * multiplier), - baseDuration, - aEUt); + GT_OreDictUnificator.get(prefix1, aMaterial, 1L), + GT_Utility.getIntegratedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L * multiplier), + baseDuration, + aEUt); GT_Values.RA.addWiremillRecipe( - GT_OreDictUnificator.get(prefix2, aMaterial, 1L), - GT_Utility.getIntegratedCircuit(3), - GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 2L * multiplier), - baseDuration / 2, - aEUt); + GT_OreDictUnificator.get(prefix2, aMaterial, 1L), + GT_Utility.getIntegratedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 2L * multiplier), + baseDuration / 2, + aEUt); } public static boolean hasVanillaRecipes(Materials materials) { return Arrays.stream(VANILLA_MATS) - .anyMatch(mat -> mat == materials); + .anyMatch(mat -> mat == materials); } private static int getRecipeWidth(ShapedOreRecipe r) { diff --git a/src/main/java/gregtech/api/util/GT_RenderingWorld.java b/src/main/java/gregtech/api/util/GT_RenderingWorld.java index 4ada7decab..7220b921a5 100644 --- a/src/main/java/gregtech/api/util/GT_RenderingWorld.java +++ b/src/main/java/gregtech/api/util/GT_RenderingWorld.java @@ -61,7 +61,7 @@ public class GT_RenderingWorld implements IBlockAccess { ChunkPosition key = new ChunkPosition(x, y, z); infos.put(key, new BlockInfo(block, meta)); index.computeIfAbsent(new ChunkCoordIntPair(x >> 4, z >> 4), p -> new HashSet<>()) - .add(key); + .add(key); } public void unregister(int x, int y, int z, Block block, int meta) { @@ -130,8 +130,8 @@ public class GT_RenderingWorld implements IBlockAccess { public FMLEventHandler() { FMLCommonHandler.instance() - .bus() - .register(this); + .bus() + .register(this); } @SubscribeEvent(priority = EventPriority.HIGHEST) @@ -150,10 +150,10 @@ public class GT_RenderingWorld implements IBlockAccess { public void onChunkUnloaded(ChunkEvent.Unload e) { if (!e.world.isRemote) return; Set set = index.remove( - e.getChunk() - .getChunkCoordIntPair()); + e.getChunk() + .getChunkCoordIntPair()); if (set != null) infos.keySet() - .removeAll(set); + .removeAll(set); } @SubscribeEvent diff --git a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java index 02bc0ba0bf..95a1a0bb66 100644 --- a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java @@ -17,7 +17,7 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec private final int[] mEnchantmentLevelsAdded; public GT_Shaped_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, - Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { + Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { super(aResult, aRecipe); mEnchantmentsAdded = aEnchantmentsAdded; mEnchantmentLevelsAdded = aEnchantmentLevelsAdded; @@ -33,11 +33,11 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec if (aGrid.getStackInSlot(i) != null) { if (tStack != null) { if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i) - .hasTagCompound()) - || (tStack.hasTagCompound() && !tStack.getTagCompound() - .equals( - aGrid.getStackInSlot(i) - .getTagCompound()))) + .hasTagCompound()) || (tStack.hasTagCompound() + && !tStack.getTagCompound() + .equals( + aGrid.getStackInSlot(i) + .getTagCompound()))) return false; } tStack = aGrid.getStackInSlot(i); @@ -57,11 +57,11 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec // Keeping NBT if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i) - .hasTagCompound()) { + .hasTagCompound()) { rStack.setTagCompound( - (NBTTagCompound) aGrid.getStackInSlot(i) - .getTagCompound() - .copy()); + (NBTTagCompound) aGrid.getStackInSlot(i) + .getTagCompound() + .copy()); break; } } @@ -71,21 +71,21 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); int tCharge = 0; for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem( - aGrid.getStackInSlot(i), - Integer.MAX_VALUE, - Integer.MAX_VALUE, - true, - true, - true); + aGrid.getStackInSlot(i), + Integer.MAX_VALUE, + Integer.MAX_VALUE, + true, + true, + true); if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); } // Add Enchantments for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment( - rStack, - mEnchantmentsAdded[i], - EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) - + mEnchantmentLevelsAdded[i]); + rStack, + mEnchantmentsAdded[i], + EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + + mEnchantmentLevelsAdded[i]); // Update the Stack again GT_Utility.updateItemStack(rStack); diff --git a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java index 93ba33da31..582dd7cc10 100644 --- a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java @@ -17,7 +17,7 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft private final int[] mEnchantmentLevelsAdded; public GT_Shapeless_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT, - Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { + Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) { super(aResult, aRecipe); mEnchantmentsAdded = aEnchantmentsAdded; mEnchantmentLevelsAdded = aEnchantmentLevelsAdded; @@ -33,11 +33,11 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft if (aGrid.getStackInSlot(i) != null) { if (tStack != null) { if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i) - .hasTagCompound()) - || (tStack.hasTagCompound() && !tStack.getTagCompound() - .equals( - aGrid.getStackInSlot(i) - .getTagCompound()))) + .hasTagCompound()) || (tStack.hasTagCompound() + && !tStack.getTagCompound() + .equals( + aGrid.getStackInSlot(i) + .getTagCompound()))) return false; } tStack = aGrid.getStackInSlot(i); @@ -57,11 +57,11 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft // Keeping NBT if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) { if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i) - .hasTagCompound()) { + .hasTagCompound()) { rStack.setTagCompound( - (NBTTagCompound) aGrid.getStackInSlot(i) - .getTagCompound() - .copy()); + (NBTTagCompound) aGrid.getStackInSlot(i) + .getTagCompound() + .copy()); break; } } @@ -71,21 +71,21 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true); int tCharge = 0; for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem( - aGrid.getStackInSlot(i), - Integer.MAX_VALUE, - Integer.MAX_VALUE, - true, - true, - true); + aGrid.getStackInSlot(i), + Integer.MAX_VALUE, + Integer.MAX_VALUE, + true, + true, + true); if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false); } // Add Enchantments for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment( - rStack, - mEnchantmentsAdded[i], - EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) - + mEnchantmentLevelsAdded[i]); + rStack, + mEnchantmentsAdded[i], + EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack) + + mEnchantmentLevelsAdded[i]); // Update the Stack again GT_Utility.updateItemStack(rStack); diff --git a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java index 806d892365..f46159a89f 100644 --- a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java +++ b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java @@ -36,20 +36,20 @@ public class GT_Single_Recipe_Check { protected final int totalFluidCost; protected GT_Single_Recipe_Check(GT_MetaTileEntity_MultiBlockBase multiBlockBase, GT_Recipe recipe, - ImmutableMap itemCost, ImmutableMap fluidCost) { + ImmutableMap itemCost, ImmutableMap fluidCost) { this.multiBlockBase = multiBlockBase; this.recipe = recipe; this.itemCost = itemCost; this.fluidCost = fluidCost; this.totalItemCost = itemCost.values() - .stream() - .mapToInt(Integer::intValue) - .sum(); + .stream() + .mapToInt(Integer::intValue) + .sum(); this.totalFluidCost = fluidCost.values() - .stream() - .mapToInt(Integer::intValue) - .sum(); + .stream() + .mapToInt(Integer::intValue) + .sum(); } public GT_Recipe getRecipe() { @@ -68,9 +68,9 @@ public class GT_Single_Recipe_Check { itemMap = new HashMap<>(); for (ItemStack itemStack : multiBlockBase.getStoredInputs()) { itemMap.merge( - GT_Utility.ItemId.createNoCopy(itemStack), - itemStack, - (a, b) -> a.stackSize >= b.stackSize ? a : b); + GT_Utility.ItemId.createNoCopy(itemStack), + itemStack, + (a, b) -> a.stackSize >= b.stackSize ? a : b); } for (Map.Entry entry : itemCost.entrySet()) { @@ -200,33 +200,31 @@ public class GT_Single_Recipe_Check { tag.setTag("outputs", writeList(recipe.mOutputs, GT_Utility::saveItem)); tag.setIntArray("chances", recipe.mChances); tag.setTag( - "fInputs", - writeList( - recipe.mFluidInputs, - s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); + "fInputs", + writeList(recipe.mFluidInputs, s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); tag.setTag( - "fOutputs", - writeList( - recipe.mFluidOutputs, - s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); + "fOutputs", + writeList( + recipe.mFluidOutputs, + s -> s == null ? new NBTTagCompound() : s.writeToNBT(new NBTTagCompound()))); tag.setInteger("eut", recipe.mEUt); tag.setInteger("duration", recipe.mDuration); tag.setInteger("specialValue", recipe.mSpecialValue); tag.setTag("itemCost", writeList(itemCost.entrySet(), e -> { NBTTagCompound ret = new NBTTagCompound(); ret.setTag( - "id", - e.getKey() - .writeToNBT()); + "id", + e.getKey() + .writeToNBT()); ret.setInteger("count", e.getValue()); return ret; })); tag.setTag("fluidCost", writeList(fluidCost.entrySet(), e -> { NBTTagCompound ret = new NBTTagCompound(); ret.setString( - "id", - e.getKey() - .getName()); + "id", + e.getKey() + .getName()); ret.setInteger("count", e.getValue()); return ret; })); @@ -253,7 +251,7 @@ public class GT_Single_Recipe_Check { @Nullable public static GT_Single_Recipe_Check tryLoad(GT_MetaTileEntity_MultiBlockBase parent, - GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag) { + GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag) { GT_Recipe found = tryFindRecipe(parent, recipeMap, tag); if (found == null) return null; return new GT_Single_Recipe_Check(parent, found, loadItemCost(tag), loadFluidCost(tag)); @@ -261,52 +259,46 @@ public class GT_Single_Recipe_Check { protected static ImmutableMap loadFluidCost(NBTTagCompound tag) { return GT_Utility.streamCompounds(tag.getTagList("fluidCost", Constants.NBT.TAG_COMPOUND)) - .collect( - GT_Utility.toImmutableMapSerial( - t -> FluidRegistry.getFluid(t.getString("id")), - t -> t.getInteger("count"))); + .collect( + GT_Utility + .toImmutableMapSerial(t -> FluidRegistry.getFluid(t.getString("id")), t -> t.getInteger("count"))); } protected static ImmutableMap loadItemCost(NBTTagCompound tag) { return GT_Utility.streamCompounds(tag.getTagList("itemCost", Constants.NBT.TAG_COMPOUND)) - .collect( - GT_Utility.toImmutableMapSerial( - t -> GT_Utility.ItemId.create(t.getCompoundTag("id")), - t -> t.getInteger("count"))); + .collect( + GT_Utility.toImmutableMapSerial( + t -> GT_Utility.ItemId.create(t.getCompoundTag("id")), + t -> t.getInteger("count"))); } protected static GT_Recipe tryFindRecipe(GT_MetaTileEntity_MultiBlockBase parent, GT_Recipe.GT_Recipe_Map recipeMap, - NBTTagCompound tag) { + NBTTagCompound tag) { if (tag == null || tag.hasNoTags()) return null; ItemStack[] inputs = GT_Utility.streamCompounds(tag.getTagList("inputs", Constants.NBT.TAG_COMPOUND)) - .map(GT_Utility::loadItem) - .toArray(ItemStack[]::new); + .map(GT_Utility::loadItem) + .toArray(ItemStack[]::new); ItemStack[] outputs = GT_Utility.streamCompounds(tag.getTagList("outputs", Constants.NBT.TAG_COMPOUND)) - .map(GT_Utility::loadItem) - .toArray(ItemStack[]::new); + .map(GT_Utility::loadItem) + .toArray(ItemStack[]::new); FluidStack[] fInputs = GT_Utility.streamCompounds(tag.getTagList("fInputs", Constants.NBT.TAG_COMPOUND)) - .map(FluidStack::loadFluidStackFromNBT) - .toArray(FluidStack[]::new); + .map(FluidStack::loadFluidStackFromNBT) + .toArray(FluidStack[]::new); FluidStack[] fOutputs = GT_Utility.streamCompounds(tag.getTagList("fOutputs", Constants.NBT.TAG_COMPOUND)) - .map(FluidStack::loadFluidStackFromNBT) - .toArray(FluidStack[]::new); + .map(FluidStack::loadFluidStackFromNBT) + .toArray(FluidStack[]::new); int eut = tag.getInteger("eut"); - GT_Recipe found = recipeMap.findRecipe( - parent.getBaseMetaTileEntity(), - false, - GT_Values.V[GT_Utility.getTier(eut)], - fInputs, - inputs); + GT_Recipe found = recipeMap + .findRecipe(parent.getBaseMetaTileEntity(), false, GT_Values.V[GT_Utility.getTier(eut)], fInputs, inputs); int[] chances = tag.getIntArray("chances"); if (found == null || !GT_Utility.equals(inputs, found.mInputs) - || !Arrays.equals(fInputs, found.mFluidInputs) - || !GT_Utility.equals(outputs, found.mOutputs) - || !Arrays.equals(fOutputs, found.mFluidOutputs) - || !Arrays.equals(chances, found.mChances) - || found.mDuration != tag.getInteger("duration") - || found.mEUt != eut - || found.mSpecialValue != tag.getInteger("specialValue")) - return null; + || !Arrays.equals(fInputs, found.mFluidInputs) + || !GT_Utility.equals(outputs, found.mOutputs) + || !Arrays.equals(fOutputs, found.mFluidOutputs) + || !Arrays.equals(chances, found.mChances) + || found.mDuration != tag.getInteger("duration") + || found.mEUt != eut + || found.mSpecialValue != tag.getInteger("specialValue")) return null; return found; } @@ -384,10 +376,10 @@ public class GT_Single_Recipe_Check { } return new GT_Single_Recipe_Check( - multiBlockBase, - recipe, - itemCostBuilder.build(), - fluidCostBuilder.build()); + multiBlockBase, + recipe, + itemCostBuilder.build(), + fluidCostBuilder.build()); } } } diff --git a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java index 3996484935..99ed0370d8 100644 --- a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java +++ b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java @@ -26,8 +26,8 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch protected final ItemStack machineStack; protected GT_Single_Recipe_Check_Processing_Array(GT_MetaTileEntity_MultiBlockBase multiBlockBase, GT_Recipe recipe, - ImmutableMap itemCost, ImmutableMap fluidCost, - int recipeAmperage, ItemStack machineStack) { + ImmutableMap itemCost, ImmutableMap fluidCost, int recipeAmperage, + ItemStack machineStack) { super(multiBlockBase, recipe, itemCost, fluidCost); this.recipeAmperage = recipeAmperage; @@ -95,12 +95,8 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch if (totalItemCost > 0) { int remainingItemCost = totalItemCost * finalParallel; Map runningItemCost = itemCost.entrySet() - .stream() - .collect( - Collectors.toMap( - Map.Entry::getKey, - entry -> entry.getValue() - * finalParallel)); + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue() * finalParallel)); for (ItemStack itemStack : items) { GT_Utility.ItemId key = GT_Utility.ItemId.createNoCopy(itemStack); @@ -119,12 +115,8 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch if (totalFluidCost > 0) { int remainingFluidCost = totalFluidCost * finalParallel; Map runningFluidCost = fluidCost.entrySet() - .stream() - .collect( - Collectors.toMap( - Map.Entry::getKey, - entry -> entry.getValue() - * finalParallel)); + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue() * finalParallel)); for (FluidStack fluidStack : fluids) { Fluid key = fluidStack.getFluid(); @@ -147,17 +139,17 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch @Nullable public static GT_Single_Recipe_Check tryLoad(GT_MetaTileEntity_MultiBlockBase parent, - GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag, ItemStack machineStack) { + GT_Recipe.GT_Recipe_Map recipeMap, NBTTagCompound tag, ItemStack machineStack) { if (recipeMap == null || machineStack == null) return null; GT_Recipe found = tryFindRecipe(parent, recipeMap, tag); if (found == null) return null; return new GT_Single_Recipe_Check_Processing_Array( - parent, - found, - loadItemCost(tag), - loadFluidCost(tag), - recipeMap.mAmperage, - machineStack.copy()); + parent, + found, + loadItemCost(tag), + loadFluidCost(tag), + recipeMap.mAmperage, + machineStack.copy()); } public static Builder processingArrayBuilder(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { @@ -240,12 +232,12 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch } return new GT_Single_Recipe_Check_Processing_Array( - multiBlockBase, - recipe, - itemCostBuilder.build(), - fluidCostBuilder.build(), - recipeAmperage, - multiBlockBase.mInventory[1].copy()); + multiBlockBase, + recipe, + itemCostBuilder.build(), + fluidCostBuilder.build(), + recipeAmperage, + multiBlockBase.mInventory[1].copy()); } } } diff --git a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java index c17f73a147..5bbaa32007 100644 --- a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java +++ b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java @@ -41,8 +41,7 @@ public class GT_SpawnEventHandler { if (event.getResult() == Event.Result.DENY) return; if (event.entityLiving instanceof EntitySlime && !(((EntitySlime) event.entityLiving).getCustomNameTag() - .length() - > 0)) { + .length() > 0)) { if (event.getResult() == Event.Result.ALLOW) event.setResult(Event.Result.DEFAULT); } @@ -65,9 +64,10 @@ public class GT_SpawnEventHandler { if (check > maxRangeCheck) continue; final TileEntity tTile = event.entity.worldObj.getTileEntity(rep[0], rep[1], rep[2]); - if (tTile instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) tTile).getMetaTileEntity() instanceof GT_MetaTileEntity_MonsterRepellent) { - final int r = ((GT_MetaTileEntity_MonsterRepellent) ((BaseMetaTileEntity) tTile).getMetaTileEntity()).mRange; + if (tTile instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTile) + .getMetaTileEntity() instanceof GT_MetaTileEntity_MonsterRepellent) { + final int r = ((GT_MetaTileEntity_MonsterRepellent) ((BaseMetaTileEntity) tTile) + .getMetaTileEntity()).mRange; if (check <= Math.pow(r, 2)) { if (event.entityLiving instanceof EntitySlime) ((EntitySlime) event.entityLiving).setCustomNameTag("DoNotSpawnSlimes"); diff --git a/src/main/java/gregtech/api/util/GT_StructureUtility.java b/src/main/java/gregtech/api/util/GT_StructureUtility.java index 703e056bc9..2447bea63f 100644 --- a/src/main/java/gregtech/api/util/GT_StructureUtility.java +++ b/src/main/java/gregtech/api/util/GT_StructureUtility.java @@ -53,7 +53,7 @@ public class GT_StructureUtility { } public static IStructureElementNoPlacement ofHatchAdder(IGT_HatchAdder aHatchAdder, int aTextureIndex, - int aDots) { + int aDots) { return ofHatchAdder(aHatchAdder, aTextureIndex, StructureLibAPI.getBlockHint(), aDots - 1); } @@ -88,20 +88,9 @@ public class GT_StructureUtility { public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { ItemStack tFrameStack = getFrameStack(); if (!GT_Utility.isStackValid(tFrameStack) - || !(tFrameStack.getItem() instanceof ItemBlock tFrameStackItem)) - return false; - return tFrameStackItem.placeBlockAt( - tFrameStack, - null, - world, - x, - y, - z, - 6, - 0, - 0, - 0, - Items.feather.getDamage(tFrameStack)); + || !(tFrameStack.getItem() instanceof ItemBlock tFrameStackItem)) return false; + return tFrameStackItem + .placeBlockAt(tFrameStack, null, world, x, y, z, 6, 0, 0, 0, Items.feather.getDamage(tFrameStack)); } private ItemStack getFrameStack() { @@ -110,7 +99,7 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { ItemStack tFrameStack = getFrameStack(); if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) return BlocksToPlace.errored; @@ -119,36 +108,36 @@ public class GT_StructureUtility { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer chatter) { + IItemSource s, EntityPlayerMP actor, Consumer chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (check(t, world, x, y, z)) return SKIP; ItemStack tFrameStack = getFrameStack(); if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock)) return REJECT; // honestly, this is more like a programming error or pack issue return StructureUtility.survivalPlaceBlock( - tFrameStack, - ItemStackPredicate.NBTMode.IGNORE_KNOWN_INSIGNIFICANT_TAGS, - null, - false, - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + tFrameStack, + ItemStackPredicate.NBTMode.IGNORE_KNOWN_INSIGNIFICANT_TAGS, + null, + false, + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @@ -166,7 +155,7 @@ public class GT_StructureUtility { } public static IStructureElementNoPlacement ofHatchAdder(IGT_HatchAdder aHatchAdder, int aTextureIndex, - Block aHintBlock, int aHintMeta) { + Block aHintBlock, int aHintMeta) { if (aHatchAdder == null || aHintBlock == null) { throw new IllegalArgumentException(); } @@ -176,7 +165,7 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); } @Override @@ -188,8 +177,8 @@ public class GT_StructureUtility { } public static IStructureElement ofHatchAdder(IGT_HatchAdder aHatchAdder, int aTextureIndex, - Block aHintBlock, int aHintMeta, BiPredicate shouldSkip, - Function> aMetaId, final IStructureElement.PlaceResult acceptType) { + Block aHintBlock, int aHintMeta, BiPredicate shouldSkip, + Function> aMetaId, final IStructureElement.PlaceResult acceptType) { if (aHatchAdder == null) { throw new IllegalArgumentException(); } @@ -199,7 +188,7 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); } @Override @@ -216,7 +205,7 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { Class clazz = aMetaId.apply(t); if (clazz == null) return BlocksToPlace.createEmpty(); return BlocksToPlace.create(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is))); @@ -224,58 +213,48 @@ public class GT_StructureUtility { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer chatter) { + IItemSource s, EntityPlayerMP actor, Consumer chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (shouldSkip != null) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof IGregTechTileEntity - && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) - return SKIP; + && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT; Class clazz = aMetaId.apply(t); if (clazz == null) return REJECT; ItemStack taken = env.getSource() - .takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true); + .takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true); if (GT_Utility.isStackInvalid(taken)) { env.getChatter() - .accept( - new ChatComponentTranslation( - "GT5U.autoplace.error.no_mte.class_name", - clazz.getSimpleName())); + .accept( + new ChatComponentTranslation( + "GT5U.autoplace.error.no_mte.class_name", + clazz.getSimpleName())); return REJECT; } - if (StructureUtility.survivalPlaceBlock( - taken, - EXACT, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor()) == ACCEPT) - return acceptType; + if (StructureUtility + .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor()) + == ACCEPT) return acceptType; return REJECT; } }; } public static IStructureElement ofHatchAdder(IGT_HatchAdder aHatchAdder, int aTextureIndex, - Block aHintBlock, int aHintMeta, BiPredicate shouldSkip, ToIntFunction aMetaId) { + Block aHintBlock, int aHintMeta, BiPredicate shouldSkip, ToIntFunction aMetaId) { if (aHatchAdder == null) { throw new IllegalArgumentException(); } @@ -285,7 +264,7 @@ public class GT_StructureUtility { public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); return tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex); } @Override @@ -302,79 +281,70 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines); int meta = aMetaId.applyAsInt(t); if (meta < 0) return BlocksToPlace.createEmpty(); return BlocksToPlace.create( - ItemStackPredicate.from(item) - .setMeta(meta)); + ItemStackPredicate.from(item) + .setMeta(meta)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer chatter) { + IItemSource s, EntityPlayerMP actor, Consumer chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (shouldSkip != null) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity instanceof IGregTechTileEntity - && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) - return SKIP; + && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP; } if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT; GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines); int meta = aMetaId.applyAsInt(t); if (meta < 0) return REJECT; ItemStack taken = env.getSource() - .takeOne( - ItemStackPredicate.from(item) - .setMeta(meta), - true); + .takeOne( + ItemStackPredicate.from(item) + .setMeta(meta), + true); if (GT_Utility.isStackInvalid(taken)) { env.getChatter() - .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_mte.id", meta)); + .accept(new ChatComponentTranslation("GT5U.autoplace.error.no_mte.id", meta)); return REJECT; } - return StructureUtility.survivalPlaceBlock( - taken, - EXACT, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor()) == ACCEPT ? ACCEPT_STOP : REJECT; + return StructureUtility + .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor()) + == ACCEPT ? ACCEPT_STOP : REJECT; } }; } public static IStructureElement ofHatchAdderOptional(IGT_HatchAdder aHatchAdder, int textureIndex, - int dots, Block placeCasing, int placeCasingMeta) { + int dots, Block placeCasing, int placeCasingMeta) { return ofHatchAdderOptional( - aHatchAdder, - textureIndex, - StructureLibAPI.getBlockHint(), - dots - 1, - placeCasing, - placeCasingMeta); + aHatchAdder, + textureIndex, + StructureLibAPI.getBlockHint(), + dots - 1, + placeCasing, + placeCasingMeta); } public static IStructureElement ofHatchAdderOptional(IGT_HatchAdder aHatchAdder, int aTextureIndex, - Block aHintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { + Block aHintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { if (aHatchAdder == null || aHintBlock == null) { throw new IllegalArgumentException(); } @@ -385,8 +355,8 @@ public class GT_StructureUtility { TileEntity tileEntity = world.getTileEntity(x, y, z); Block worldBlock = world.getBlock(x, y, z); return (tileEntity instanceof IGregTechTileEntity - && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex)) - || (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); + && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex)) + || (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); } @Override @@ -403,18 +373,10 @@ public class GT_StructureUtility { @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer chatter) { + IItemSource s, EntityPlayerMP actor, Consumer chatter) { if (check(t, world, x, y, z)) return SKIP; - return StructureUtility.survivalPlaceBlock( - placeCasing, - placeCasingMeta, - world, - x, - y, - z, - s, - actor, - chatter); + return StructureUtility + .survivalPlaceBlock(placeCasing, placeCasingMeta, world, x, y, z, s, actor, chatter); } }; } @@ -425,7 +387,7 @@ public class GT_StructureUtility { * @see #ofCoil(BiPredicate, Function) */ public static IStructureElement ofCoil(BiConsumer aHeatingCoilSetter, - Function aHeatingCoilGetter) { + Function aHeatingCoilGetter) { return ofCoil((t, l) -> { aHeatingCoilSetter.accept(t, l); return true; @@ -441,7 +403,7 @@ public class GT_StructureUtility { * @param aHeatingCoilGetter Get the current heating level. Null means no coil recorded yet. */ public static IStructureElement ofCoil(BiPredicate aHeatingCoilSetter, - Function aHeatingCoilGetter) { + Function aHeatingCoilGetter) { if (aHeatingCoilSetter == null || aHeatingCoilGetter == null) { throw new IllegalArgumentException(); } @@ -452,7 +414,7 @@ public class GT_StructureUtility { Block block = world.getBlock(x, y, z); if (!(block instanceof IHeatingCoil)) return false; HeatingCoilLevel existingLevel = aHeatingCoilGetter.apply(t), - newLevel = ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)); + newLevel = ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)); if (existingLevel == null || existingLevel == HeatingCoilLevel.None) { return aHeatingCoilSetter.test(t, newLevel); } else { @@ -471,8 +433,8 @@ public class GT_StructureUtility { } private HeatingCoilLevel getHeatFromHint(ItemStack trigger) { - return HeatingCoilLevel.getFromTier( - (byte) Math.min(HeatingCoilLevel.getMaxTier(), Math.max(0, trigger.stackSize - 1))); + return HeatingCoilLevel + .getFromTier((byte) Math.min(HeatingCoilLevel.getMaxTier(), Math.max(0, trigger.stackSize - 1))); } @Override @@ -482,41 +444,40 @@ public class GT_StructureUtility { @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return BlocksToPlace.create(GregTech_API.sBlockCasings5, getMetaFromHint(trigger)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - IItemSource s, EntityPlayerMP actor, Consumer chatter) { + IItemSource s, EntityPlayerMP actor, Consumer chatter) { return survivalPlaceBlock( - t, - world, - x, - y, - z, - trigger, - AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); + t, + world, + x, + y, + z, + trigger, + AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { Block block = world.getBlock(x, y, z); boolean isCoil = block instanceof IHeatingCoil - && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) - == getHeatFromHint(trigger); + && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) == getHeatFromHint(trigger); if (isCoil) return SKIP; return StructureUtility.survivalPlaceBlock( - GregTech_API.sBlockCasings5, - getMetaFromHint(trigger), - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + GregTech_API.sBlockCasings5, + getMetaFromHint(trigger), + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @@ -526,7 +487,7 @@ public class GT_StructureUtility { return is -> { IMetaTileEntity tile = GT_Item_Machines.getMetaTileEntity(is); return tile != null && list.stream() - .anyMatch(c -> c.isInstance(tile)); + .anyMatch(c -> c.isInstance(tile)); }; } @@ -535,8 +496,8 @@ public class GT_StructureUtility { return is -> { IMetaTileEntity tile = GT_Item_Machines.getMetaTileEntity(is); return tile instanceof GT_MetaTileEntity_TieredMachineBlock - && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier <= aMaxTier - && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier >= aMinTier; + && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier <= aMaxTier + && ((GT_MetaTileEntity_TieredMachineBlock) tile).mTier >= aMinTier; }; } } diff --git a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java index cb702688cf..431ef34fa4 100644 --- a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java +++ b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java @@ -58,10 +58,9 @@ public class GT_TooltipDataCache { lines.add(key); // Fallback in case no lines could be found at all } return new TooltipData( - lines.subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), - lines.subList( - 0, - getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); + lines.subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())), + lines + .subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size()))); } /** diff --git a/src/main/java/gregtech/api/util/GT_Util.java b/src/main/java/gregtech/api/util/GT_Util.java index 177b391f5d..8a799a9616 100644 --- a/src/main/java/gregtech/api/util/GT_Util.java +++ b/src/main/java/gregtech/api/util/GT_Util.java @@ -39,46 +39,46 @@ public class GT_Util { if (t.getSecond() == null) continue; if (t.getSecond() instanceof Boolean) rNBT.setBoolean( - t.getFirst() - .toString(), - (Boolean) t.getSecond()); + t.getFirst() + .toString(), + (Boolean) t.getSecond()); else if (t.getSecond() instanceof Byte) rNBT.setByte( - t.getFirst() - .toString(), - (Byte) t.getSecond()); + t.getFirst() + .toString(), + (Byte) t.getSecond()); else if (t.getSecond() instanceof Short) rNBT.setShort( - t.getFirst() - .toString(), - (Short) t.getSecond()); + t.getFirst() + .toString(), + (Short) t.getSecond()); else if (t.getSecond() instanceof Integer) rNBT.setInteger( - t.getFirst() - .toString(), - (Integer) t.getSecond()); + t.getFirst() + .toString(), + (Integer) t.getSecond()); else if (t.getSecond() instanceof Long) rNBT.setLong( - t.getFirst() - .toString(), - (Long) t.getSecond()); + t.getFirst() + .toString(), + (Long) t.getSecond()); else if (t.getSecond() instanceof Float) rNBT.setFloat( - t.getFirst() - .toString(), - (Float) t.getSecond()); + t.getFirst() + .toString(), + (Float) t.getSecond()); else if (t.getSecond() instanceof Double) rNBT.setDouble( - t.getFirst() - .toString(), - (Double) t.getSecond()); + t.getFirst() + .toString(), + (Double) t.getSecond()); else if (t.getSecond() instanceof String) rNBT.setString( - t.getFirst() - .toString(), - (String) t.getSecond()); + t.getFirst() + .toString(), + (String) t.getSecond()); else if (t.getSecond() instanceof NBTBase) rNBT.setTag( - t.getFirst() - .toString(), - (NBTBase) t.getSecond()); + t.getFirst() + .toString(), + (NBTBase) t.getSecond()); else rNBT.setString( - t.getFirst() - .toString(), - t.getSecond() - .toString()); + t.getFirst() + .toString(), + t.getSecond() + .toString()); } return rNBT; @@ -101,7 +101,7 @@ public class GT_Util { /** Sets the TileEntity at the passed position, with the option of turning adjacent TileEntity updates off. */ public static TileEntity setTileEntity(World aWorld, int aX, int aY, int aZ, TileEntity aTileEntity, - boolean aCauseTileEntityUpdates) { + boolean aCauseTileEntityUpdates) { if (aCauseTileEntityUpdates) aWorld.setTileEntity(aX, aY, aZ, aTileEntity); else { Chunk tChunk = aWorld.getChunkFromChunkCoords(aX >> 4, aZ >> 4); @@ -115,7 +115,7 @@ public class GT_Util { } public static boolean setTileEntity(World aWorld, int aX, int aY, int aZ, Block aBlock, short aMeta, long aFlags, - boolean aRemoveGrassBelow) { + boolean aRemoveGrassBelow) { if (aRemoveGrassBelow) { final Block tBlock = aWorld.getBlock(aX, aY - 1, aZ); if (tBlock == Blocks.grass || tBlock == Blocks.mycelium) @@ -137,9 +137,7 @@ public class GT_Util { aChunk = aWorld.getChunkFromBlockCoords(aX, aZ); if (aChunk == null) { GT_Log.err.println( - "Some important Chunk does not exist for some reason at Coordinates X: " + aX - + " and Z: " - + aZ); + "Some important Chunk does not exist for some reason at Coordinates X: " + aX + " and Z: " + aZ); return false; } } @@ -150,15 +148,15 @@ public class GT_Util { /** Marks a Chunk dirty so it is saved */ public static boolean markChunkDirty(Object aTileEntity) { return aTileEntity instanceof TileEntity && markChunkDirty( - ((TileEntity) aTileEntity).getWorldObj(), - ((TileEntity) aTileEntity).xCoord, - ((TileEntity) aTileEntity).zCoord); + ((TileEntity) aTileEntity).getWorldObj(), + ((TileEntity) aTileEntity).xCoord, + ((TileEntity) aTileEntity).zCoord); } public static int mixRGBInt(int aRGB1, int aRGB2) { return getRGBInt( - new short[] { (short) ((getR(aRGB1) + getR(aRGB2)) >> 1), (short) ((getG(aRGB1) + getG(aRGB2)) >> 1), - (short) ((getB(aRGB1) + getB(aRGB2)) >> 1) }); + new short[] { (short) ((getR(aRGB1) + getR(aRGB2)) >> 1), (short) ((getG(aRGB1) + getG(aRGB2)) >> 1), + (short) ((getB(aRGB1) + getB(aRGB2)) >> 1) }); } public static int getRGBInt(short[] aColors) { @@ -183,7 +181,7 @@ public class GT_Util { public static short[] getRGBaArray(int aColors) { return new short[] { (short) ((aColors >>> 16) & 255), (short) ((aColors >>> 8) & 255), (short) (aColors & 255), - (short) ((aColors >>> 24) & 255) }; + (short) ((aColors >>> 24) & 255) }; } public static short getR(int aColors) { diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 12e5022ef0..8d9d0814dc 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -172,8 +172,8 @@ public class GT_Utility { // 1 is the magic index to get the cobblestone block. // See: GT_Block_Stones.java, GT_Block_Granites.java Function> materialToCobble = m -> Suppliers.memoize( - () -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m) - .get(1))::get; + () -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m) + .get(1))::get; sOreToCobble.put(OrePrefixes.oreBlackgranite, materialToCobble.apply(Materials.GraniteBlack)); sOreToCobble.put(OrePrefixes.oreRedgranite, materialToCobble.apply(Materials.GraniteRed)); sOreToCobble.put(OrePrefixes.oreMarble, materialToCobble.apply(Materials.Marble)); @@ -188,14 +188,14 @@ public class GT_Utility { public static int safeInt(long number) { return number > V[V.length - 1] ? safeInt(V[V.length - 1], 1) - : number < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) number; + : number < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) number; } public static Field getPublicField(Object aObject, String aField) { Field rField = null; try { rField = aObject.getClass() - .getDeclaredField(aField); + .getDeclaredField(aField); } catch (Throwable e) { /* Do nothing */ } @@ -206,7 +206,7 @@ public class GT_Utility { Field rField = null; try { rField = aObject.getClass() - .getDeclaredField(aField); + .getDeclaredField(aField); rField.setAccessible(true); } catch (Throwable e) { /* Do nothing */ @@ -240,7 +240,7 @@ public class GT_Utility { Method rMethod = null; try { rMethod = aObject.getClass() - .getMethod(aMethod, aParameterTypes); + .getMethod(aMethod, aParameterTypes); rMethod.setAccessible(true); } catch (Throwable e) { /* Do nothing */ @@ -251,10 +251,10 @@ public class GT_Utility { public static Field getField(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) { try { Field tField = (aObject instanceof Class) ? ((Class) aObject).getDeclaredField(aField) - : (aObject instanceof String) ? Class.forName((String) aObject) - .getDeclaredField(aField) - : aObject.getClass() - .getDeclaredField(aField); + : (aObject instanceof String) ? Class.forName((String) aObject) + .getDeclaredField(aField) + : aObject.getClass() + .getDeclaredField(aField); if (aPrivate) tField.setAccessible(true); return tField; } catch (Throwable e) { @@ -266,10 +266,10 @@ public class GT_Utility { public static Object getFieldContent(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) { try { Field tField = (aObject instanceof Class) ? ((Class) aObject).getDeclaredField(aField) - : (aObject instanceof String) ? Class.forName((String) aObject) - .getDeclaredField(aField) - : aObject.getClass() - .getDeclaredField(aField); + : (aObject instanceof String) ? Class.forName((String) aObject) + .getDeclaredField(aField) + : aObject.getClass() + .getDeclaredField(aField); if (aPrivate) tField.setAccessible(true); return tField.get(aObject instanceof Class || aObject instanceof String ? null : aObject); } catch (Throwable e) { @@ -287,7 +287,7 @@ public class GT_Utility { } public static Object callMethod(Object aObject, String aMethod, boolean aPrivate, boolean aUseUpperCasedDataTypes, - boolean aLogErrors, Object... aParameters) { + boolean aLogErrors, Object... aParameters) { try { Class[] tParameterTypes = new Class[aParameters.length]; for (byte i = 0; i < aParameters.length; i++) { @@ -309,8 +309,8 @@ public class GT_Utility { } Method tMethod = (aObject instanceof Class) ? ((Class) aObject).getMethod(aMethod, tParameterTypes) - : aObject.getClass() - .getMethod(aMethod, tParameterTypes); + : aObject.getClass() + .getMethod(aMethod, tParameterTypes); if (aPrivate) tMethod.setAccessible(true); return tMethod.invoke(aObject, aParameters); } catch (Throwable e) { @@ -320,14 +320,14 @@ public class GT_Utility { } public static Object callConstructor(String aClass, int aConstructorIndex, Object aReplacementObject, - boolean aLogErrors, Object... aParameters) { + boolean aLogErrors, Object... aParameters) { try { return callConstructor( - Class.forName(aClass), - aConstructorIndex, - aReplacementObject, - aLogErrors, - aParameters); + Class.forName(aClass), + aConstructorIndex, + aReplacementObject, + aLogErrors, + aParameters); } catch (Throwable e) { if (aLogErrors) e.printStackTrace(GT_Log.err); } @@ -335,7 +335,7 @@ public class GT_Utility { } public static Object callConstructor(Class aClass, int aConstructorIndex, Object aReplacementObject, - boolean aLogErrors, Object... aParameters) { + boolean aLogErrors, Object... aParameters) { if (aConstructorIndex < 0) { try { for (Constructor tConstructor : aClass.getConstructors()) { @@ -358,8 +358,7 @@ public class GT_Utility { public static String capitalizeString(String aString) { if (aString != null && aString.length() > 0) return aString.substring(0, 1) - .toUpperCase() - + aString.substring(1); + .toUpperCase() + aString.substring(1); return E; } @@ -387,11 +386,11 @@ public class GT_Utility { public static String getClassName(Object aObject) { if (aObject == null) return "null"; return aObject.getClass() - .getName() - .substring( - aObject.getClass() - .getName() - .lastIndexOf(".") + 1); + .getName() + .substring( + aObject.getClass() + .getName() + .lastIndexOf(".") + 1); } public static void removePotion(EntityLivingBase aPlayer, int aPotionIndex) { @@ -421,7 +420,7 @@ public class GT_Utility { if (aPlayer.inventory.armorInventory[i] != null) { if (aPlayer.inventory.armorInventory[i].getItem() instanceof GT_EnergyArmor_Item) { if ((((GT_EnergyArmor_Item) aPlayer.inventory.armorInventory[i].getItem()).mSpecials & 512) - != 0) { + != 0) { if (GT_ModHandler.canUseElectricItem(aPlayer.inventory.armorInventory[i], 10000)) { return true; } @@ -437,10 +436,10 @@ public class GT_Utility { } public static ItemStack suckOneItemStackAt(World aWorld, double aX, double aY, double aZ, double aL, double aH, - double aW) { + double aW) { for (EntityItem tItem : aWorld.getEntitiesWithinAABB( - EntityItem.class, - AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + aL, aY + aH, aZ + aW))) { + EntityItem.class, + AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + aL, aY + aH, aZ + aW))) { if (!tItem.isDead) { aWorld.removeEntity(tItem); tItem.setDead(); @@ -452,8 +451,8 @@ public class GT_Utility { public static byte getOppositeSide(int aSide) { return (byte) ForgeDirection.getOrientation(aSide) - .getOpposite() - .ordinal(); + .getOpposite() + .ordinal(); } public static byte getTier(long l) { @@ -508,8 +507,8 @@ public class GT_Utility { checkAvailabilities(); if (TE_CHECK && aTileEntity instanceof IItemDuct) return true; if (BC_CHECK && aTileEntity instanceof buildcraft.api.transport.IPipeTile) - return ((buildcraft.api.transport.IPipeTile) aTileEntity).isPipeConnected( - ForgeDirection.getOrientation(aSide)); + return ((buildcraft.api.transport.IPipeTile) aTileEntity) + .isPipeConnected(ForgeDirection.getOrientation(aSide)); return GregTech_API.mTranslocator && aTileEntity instanceof codechicken.translocator.TileItemTranslocator; } @@ -519,21 +518,21 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom, - int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, - byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { return moveStackIntoPipe( - aTileEntity1, - aTileEntity2, - aGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - true); + aTileEntity1, + aTileEntity2, + aGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + true); } /** @@ -542,36 +541,34 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom, - int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, - byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean dropItem) { + int aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean dropItem) { if (aTileEntity1 == null || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMaxMoveAtOnce <= 0 - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMinTargetStackSize <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMaxMoveAtOnce <= 0 + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; if (aTileEntity2 != null) { checkAvailabilities(); if (TE_CHECK && aTileEntity2 instanceof IItemDuct) { for (int aGrabSlot : aGrabSlots) { if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) { if (isAllowedToTakeFromSlot( - aTileEntity1, - aGrabSlot, - (byte) aGrabFrom, - aTileEntity1.getStackInSlot(aGrabSlot))) { + aTileEntity1, + aGrabSlot, + (byte) aGrabFrom, + aTileEntity1.getStackInSlot(aGrabSlot))) { if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) - <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { + <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { ItemStack tStack = copyAmount( - Math.min( - aTileEntity1.getStackInSlot(aGrabSlot).stackSize, - Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), - aTileEntity1.getStackInSlot(aGrabSlot)); - ItemStack rStack = ((IItemDuct) aTileEntity2).insertItem( - ForgeDirection.getOrientation(aPutTo), - copyOrNull(tStack)); + Math.min( + aTileEntity1.getStackInSlot(aGrabSlot).stackSize, + Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), + aTileEntity1.getStackInSlot(aGrabSlot)); + ItemStack rStack = ((IItemDuct) aTileEntity2) + .insertItem(ForgeDirection.getOrientation(aPutTo), copyOrNull(tStack)); byte tMovedItemCount = (byte) (tStack.stackSize - - (rStack == null ? 0 : rStack.stackSize)); + - (rStack == null ? 0 : rStack.stackSize)); if (tMovedItemCount >= 1 /* Math.max(aMinMoveAtOnce, aMinTargetStackSize) */) { // ((cofh.api.transport.IItemConduit)aTileEntity2).insertItem(ForgeDirection.getOrientation(aPutTo), // copyAmount(tMovedItemCount, tStack), F); @@ -589,23 +586,22 @@ public class GT_Utility { for (int aGrabSlot : aGrabSlots) { if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) { if (isAllowedToTakeFromSlot( - aTileEntity1, - aGrabSlot, - (byte) aGrabFrom, - aTileEntity1.getStackInSlot(aGrabSlot))) { + aTileEntity1, + aGrabSlot, + (byte) aGrabFrom, + aTileEntity1.getStackInSlot(aGrabSlot))) { if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) - <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { + <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { ItemStack tStack = copyAmount( - Math.min( - aTileEntity1.getStackInSlot(aGrabSlot).stackSize, - Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), - aTileEntity1.getStackInSlot(aGrabSlot)); - byte tMovedItemCount = (byte) ((buildcraft.api.transport.IPipeTile) aTileEntity2).injectItem( - copyOrNull(tStack), - false, - ForgeDirection.getOrientation(aPutTo)); + Math.min( + aTileEntity1.getStackInSlot(aGrabSlot).stackSize, + Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), + aTileEntity1.getStackInSlot(aGrabSlot)); + byte tMovedItemCount = (byte) ((buildcraft.api.transport.IPipeTile) aTileEntity2) + .injectItem(copyOrNull(tStack), false, ForgeDirection.getOrientation(aPutTo)); if (tMovedItemCount >= Math.max(aMinMoveAtOnce, aMinTargetStackSize)) { - tMovedItemCount = (byte) (((buildcraft.api.transport.IPipeTile) aTileEntity2).injectItem( + tMovedItemCount = (byte) (((buildcraft.api.transport.IPipeTile) aTileEntity2) + .injectItem( copyAmount(tMovedItemCount, tStack), true, ForgeDirection.getOrientation(aPutTo))); @@ -623,34 +619,34 @@ public class GT_Utility { ForgeDirection tDirection = ForgeDirection.getOrientation(aGrabFrom); if (aTileEntity1 instanceof TileEntity && tDirection != ForgeDirection.UNKNOWN - && tDirection.getOpposite() == ForgeDirection.getOrientation(aPutTo)) { + && tDirection.getOpposite() == ForgeDirection.getOrientation(aPutTo)) { int tX = ((TileEntity) aTileEntity1).xCoord + tDirection.offsetX, - tY = ((TileEntity) aTileEntity1).yCoord + tDirection.offsetY, - tZ = ((TileEntity) aTileEntity1).zCoord + tDirection.offsetZ; + tY = ((TileEntity) aTileEntity1).yCoord + tDirection.offsetY, + tZ = ((TileEntity) aTileEntity1).zCoord + tDirection.offsetZ; if (!hasBlockHitBox(((TileEntity) aTileEntity1).getWorldObj(), tX, tY, tZ) && dropItem) { for (int aGrabSlot : aGrabSlots) { if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) { if (isAllowedToTakeFromSlot( - aTileEntity1, - aGrabSlot, - (byte) aGrabFrom, - aTileEntity1.getStackInSlot(aGrabSlot))) { + aTileEntity1, + aGrabSlot, + (byte) aGrabFrom, + aTileEntity1.getStackInSlot(aGrabSlot))) { if (Math.max(aMinMoveAtOnce, aMinTargetStackSize) - <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { + <= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) { ItemStack tStack = copyAmount( - Math.min( - aTileEntity1.getStackInSlot(aGrabSlot).stackSize, - Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), - aTileEntity1.getStackInSlot(aGrabSlot)); + Math.min( + aTileEntity1.getStackInSlot(aGrabSlot).stackSize, + Math.min(aMaxMoveAtOnce, aMaxTargetStackSize)), + aTileEntity1.getStackInSlot(aGrabSlot)); EntityItem tEntity = new EntityItem( - ((TileEntity) aTileEntity1).getWorldObj(), - tX + 0.5, - tY + 0.5, - tZ + 0.5, - tStack); + ((TileEntity) aTileEntity1).getWorldObj(), + tX + 0.5, + tY + 0.5, + tZ + 0.5, + tStack); tEntity.motionX = tEntity.motionY = tEntity.motionZ = 0; ((TileEntity) aTileEntity1).getWorldObj() - .spawnEntityInWorld(tEntity); + .spawnEntityInWorld(tEntity); aTileEntity1.decrStackSize(aGrabSlot, tStack.stackSize); aTileEntity1.markDirty(); return (byte) tStack.stackSize; @@ -670,34 +666,31 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveStackFromSlotAToSlotB(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, - int aPutTo, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + int aPutTo, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { if (aTileEntity1 == null || aTileEntity2 == null - || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMaxMoveAtOnce <= 0 - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMaxTargetStackSize <= 0 + || aMinTargetStackSize <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMaxMoveAtOnce <= 0 + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; ItemStack tStack1 = aTileEntity1.getStackInSlot(aGrabFrom), tStack2 = aTileEntity2.getStackInSlot(aPutTo), - tStack3 = null; + tStack3 = null; if (tStack1 != null) { if (tStack2 != null && !areStacksEqual(tStack1, tStack2)) return 0; tStack3 = copyOrNull(tStack1); aMaxTargetStackSize = (byte) Math.min( - aMaxTargetStackSize, + aMaxTargetStackSize, + Math.min( + tStack3.getMaxStackSize(), Math.min( - tStack3.getMaxStackSize(), - Math.min( - tStack2 == null ? Integer.MAX_VALUE : tStack2.getMaxStackSize(), - aTileEntity2.getInventoryStackLimit()))); - tStack3.stackSize = Math.min( - tStack3.stackSize, - aMaxTargetStackSize - (tStack2 == null ? 0 : tStack2.stackSize)); + tStack2 == null ? Integer.MAX_VALUE : tStack2.getMaxStackSize(), + aTileEntity2.getInventoryStackLimit()))); + tStack3.stackSize = Math + .min(tStack3.stackSize, aMaxTargetStackSize - (tStack2 == null ? 0 : tStack2.stackSize)); if (tStack3.stackSize > aMaxMoveAtOnce) tStack3.stackSize = aMaxMoveAtOnce; if (tStack3.stackSize + (tStack2 == null ? 0 : tStack2.stackSize) - >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize) - && tStack3.stackSize >= aMinMoveAtOnce) { + >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize) && tStack3.stackSize >= aMinMoveAtOnce) { tStack3 = aTileEntity1.decrStackSize(aGrabFrom, tStack3.stackSize); aTileEntity1.markDirty(); if (tStack3 != null) { @@ -717,11 +710,11 @@ public class GT_Utility { public static boolean isAllowedToTakeFromSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack) { if (ForgeDirection.getOrientation(aSide) == ForgeDirection.UNKNOWN) { return isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 0, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 1, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 2, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 3, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 4, aStack) - || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 5, aStack); + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 1, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 2, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 3, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 4, aStack) + || isAllowedToTakeFromSlot(aTileEntity, aSlot, (byte) 5, aStack); } if (aTileEntity instanceof ISidedInventory) return ((ISidedInventory) aTileEntity).canExtractItem(aSlot, aStack, aSide); @@ -729,21 +722,20 @@ public class GT_Utility { } public static boolean isAllowedToPutIntoSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack, - byte aMaxStackSize) { + byte aMaxStackSize) { ItemStack tStack = aTileEntity.getStackInSlot(aSlot); if (tStack != null && (!areStacksEqual(tStack, aStack) || tStack.stackSize >= tStack.getMaxStackSize())) return false; if (ForgeDirection.getOrientation(aSide) == ForgeDirection.UNKNOWN) { return isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 0, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 1, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 2, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 3, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 4, aStack, aMaxStackSize) - || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 5, aStack, aMaxStackSize); + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 1, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 2, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 3, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 4, aStack, aMaxStackSize) + || isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 5, aStack, aMaxStackSize); } if (aTileEntity instanceof ISidedInventory - && !((ISidedInventory) aTileEntity).canInsertItem(aSlot, aStack, aSide)) - return false; + && !((ISidedInventory) aTileEntity).canInsertItem(aSlot, aStack, aSide)) return false; return aSlot < aTileEntity.getSizeInventory() && aTileEntity.isItemValidForSlot(aSlot, aStack); } @@ -753,34 +745,33 @@ public class GT_Utility { * @return the Amount of moved Items */ public static int moveMultipleItemStacks(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aStackAmount) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aStackAmount) { if (aTileEntity1 instanceof IInventory) return moveMultipleItemStacks( - (IInventory) aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aStackAmount, - true); + (IInventory) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aStackAmount, + true); return 0; } public static int moveMultipleItemStacks(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer, boolean aDoCheckChests) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer, boolean aDoCheckChests) { if (aTileEntity1 == null || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce - || aMaxStackTransfer == 0) - return 0; + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce + || aMaxStackTransfer == 0) return 0; // find where to take from final int[] tGrabSlots = new int[aTileEntity1.getSizeInventory()]; @@ -789,9 +780,8 @@ public class GT_Utility { for (int i : ((ISidedInventory) aTileEntity1).getAccessibleSlotsFromSide(aGrabFrom)) { final ItemStack s = aTileEntity1.getStackInSlot(i); if (s == null || !isAllowedToTakeFromSlot(aTileEntity1, i, aGrabFrom, s) - || s.stackSize < aMinMoveAtOnce - || !listContainsItem(aFilter, s, true, aInvertFilter)) - continue; + || s.stackSize < aMinMoveAtOnce + || !listContainsItem(aFilter, s, true, aInvertFilter)) continue; tGrabSlots[tGrabSlotsSize++] = i; } } else { @@ -807,17 +797,17 @@ public class GT_Utility { if (tGrabSlotsSize == 0) { // maybe source is a double chest. check it if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest) return moveFromAdjacentChests( - (TileEntityChest) aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer); + (TileEntityChest) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer); return 0; } @@ -846,33 +836,32 @@ public class GT_Utility { if (s == null) { tPutFreeSlots.add(slot); } else if ((s.stackSize < s.getMaxStackSize() && s.stackSize < tPutInventory.getInventoryStackLimit()) - && aMinMoveAtOnce <= s.getMaxStackSize() - s.stackSize) { - ItemId sID = ItemId.createNoCopy(s); - tPutItems.merge( - sID, - (Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) - - s.stackSize), - Integer::sum); - tPutItemStacks.computeIfAbsent(sID, k -> new ArrayList<>()) - .add(s); - } + && aMinMoveAtOnce <= s.getMaxStackSize() - s.stackSize) { + ItemId sID = ItemId.createNoCopy(s); + tPutItems.merge( + sID, + (Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) - s.stackSize), + Integer::sum); + tPutItemStacks.computeIfAbsent(sID, k -> new ArrayList<>()) + .add(s); + } } // target completely filled, bail out if (tPutItems.isEmpty() && tPutFreeSlots.isEmpty()) { // maybe target is a double chest. check it. if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest) return moveToAdjacentChests( - aTileEntity1, - (TileEntityChest) aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer); + aTileEntity1, + (TileEntityChest) aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer); return 0; } @@ -901,17 +890,17 @@ public class GT_Utility { for (int i = 0; i < putStack.size(); i++) { final ItemStack s = putStack.get(i); final int sToPut = Math.min( - Math.min( - Math.min(toPut, s.getMaxStackSize() - s.stackSize), - tPutInventory.getInventoryStackLimit() - s.stackSize), - aMaxTargetStackSize - s.stackSize); + Math.min( + Math.min(toPut, s.getMaxStackSize() - s.stackSize), + tPutInventory.getInventoryStackLimit() - s.stackSize), + aMaxTargetStackSize - s.stackSize); if (sToPut <= 0) continue; if (sToPut < aMinMoveAtOnce) continue; if (s.stackSize + sToPut < aMinTargetStackSize) continue; toPut -= sToPut; s.stackSize += sToPut; if (s.stackSize == s.getMaxStackSize() - || s.stackSize == tPutInventory.getInventoryStackLimit()) { + || s.stackSize == tPutInventory.getInventoryStackLimit()) { // this slot is full. remove this stack from candidate list putStack.remove(i); i--; @@ -941,29 +930,29 @@ public class GT_Utility { if (isAllowedToPutIntoSlot(tPutInventory, tPutSlot, aPutTo, tGrabStack, (byte) 64)) { // allowed, now do moving final int tMoved = moveStackFromSlotAToSlotB( - aTileEntity1, - tPutInventory, - grabSlot, - tPutSlot, - aMaxTargetStackSize, - aMinTargetStackSize, - (byte) (aMaxMoveAtOnce - tMovedItems), - aMinMoveAtOnce); + aTileEntity1, + tPutInventory, + grabSlot, + tPutSlot, + aMaxTargetStackSize, + aMinTargetStackSize, + (byte) (aMaxMoveAtOnce - tMovedItems), + aMinMoveAtOnce); if (tMoved > 0) { final ItemStack s = tPutInventory.getStackInSlot(tPutSlot); if (s != null) { // s might be null if tPutInventory is very special, e.g. infinity chest // if s is null, we will not mark this slot as target candidate for anything - final int spare = Math.min( - s.getMaxStackSize(), - tPutInventory.getInventoryStackLimit()) - s.stackSize; + final int spare = Math + .min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) + - s.stackSize; if (spare > 0) { final ItemId ssID = ItemId.createNoCopy(s); // add back to spare space count tPutItems.merge(ssID, spare, Integer::sum); // add to partially filled slot list tPutItemStacks.computeIfAbsent(ssID, k -> new ArrayList<>()) - .add(s); + .add(s); } // this is no longer free tPutFreeSlots.remove(i); @@ -991,34 +980,34 @@ public class GT_Utility { // check if source is a double chest, if yes, try move from the adjacent as well if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest) { final int tAmount = moveFromAdjacentChests( - (TileEntityChest) aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer - tStacksMoved); + (TileEntityChest) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer - tStacksMoved); if (tAmount != 0) return tAmount + tTotalItemsMoved; } // check if target is a double chest, if yes, try move to the adjacent as well if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest) { final int tAmount = moveToAdjacentChests( - aTileEntity1, - (TileEntityChest) aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer - tStacksMoved); + aTileEntity1, + (TileEntityChest) aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer - tStacksMoved); if (tAmount != 0) return tAmount + tTotalItemsMoved; } @@ -1030,18 +1019,18 @@ public class GT_Utility { final int tGrabInventorySize = tGrabSlots.length; for (int i = 0; i < tGrabInventorySize; i++) { final int tMoved = moveStackIntoPipe( - aTileEntity1, - aTileEntity2, - tGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aDoCheckChests); + aTileEntity1, + aTileEntity2, + tGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aDoCheckChests); if (tMoved == 0) return tTotalItemsMoved; else tTotalItemsMoved += tMoved; } @@ -1049,77 +1038,13 @@ public class GT_Utility { } private static int moveToAdjacentChests(IInventory aTileEntity1, TileEntityChest aTargetChest, byte aGrabFrom, - byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, - byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { + byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { if (aTargetChest.adjacentChestChecked) { if (aTargetChest.adjacentChestXNeg != null) { return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestXNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } else if (aTargetChest.adjacentChestZNeg != null) { - return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestZNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } else if (aTargetChest.adjacentChestXPos != null) { - return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestXPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } else if (aTargetChest.adjacentChestZPos != null) { - return moveMultipleItemStacks( - aTileEntity1, - aTargetChest.adjacentChestZPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aMaxStackTransfer, - false); - } - } - return 0; - } - - private static int moveFromAdjacentChests(TileEntityChest aChest, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { - if (aChest.adjacentChestXNeg != null) { - return moveMultipleItemStacks( - aChest.adjacentChestXNeg, - aTileEntity2, + aTileEntity1, + aTargetChest.adjacentChestXNeg, aGrabFrom, aPutTo, aFilter, @@ -1130,10 +1055,10 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); - } else if (aChest.adjacentChestZNeg != null) { - return moveMultipleItemStacks( - aChest.adjacentChestZNeg, - aTileEntity2, + } else if (aTargetChest.adjacentChestZNeg != null) { + return moveMultipleItemStacks( + aTileEntity1, + aTargetChest.adjacentChestZNeg, aGrabFrom, aPutTo, aFilter, @@ -1144,10 +1069,10 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); - } else if (aChest.adjacentChestXPos != null) { - return moveMultipleItemStacks( - aChest.adjacentChestXPos, - aTileEntity2, + } else if (aTargetChest.adjacentChestXPos != null) { + return moveMultipleItemStacks( + aTileEntity1, + aTargetChest.adjacentChestXPos, aGrabFrom, aPutTo, aFilter, @@ -1158,10 +1083,10 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); - } else if (aChest.adjacentChestZPos != null) { - return moveMultipleItemStacks( - aChest.adjacentChestZPos, - aTileEntity2, + } else if (aTargetChest.adjacentChestZPos != null) { + return moveMultipleItemStacks( + aTileEntity1, + aTargetChest.adjacentChestZPos, aGrabFrom, aPutTo, aFilter, @@ -1172,20 +1097,31 @@ public class GT_Utility { aMinMoveAtOnce, aMaxStackTransfer, false); + } } return 0; } - /** - * Moves Stack from Inv-Side to Inv-Side. - * - * @return the Amount of moved Items - */ - public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { - if (aTileEntity1 instanceof IInventory) return moveOneItemStack( - (IInventory) aTileEntity1, + private static int moveFromAdjacentChests(TileEntityChest aChest, Object aTileEntity2, byte aGrabFrom, byte aPutTo, + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) { + if (aChest.adjacentChestXNeg != null) { + return moveMultipleItemStacks( + aChest.adjacentChestXNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer, + false); + } else if (aChest.adjacentChestZNeg != null) { + return moveMultipleItemStacks( + aChest.adjacentChestZNeg, aTileEntity2, aGrabFrom, aPutTo, @@ -1195,7 +1131,60 @@ public class GT_Utility { aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, - true); + aMaxStackTransfer, + false); + } else if (aChest.adjacentChestXPos != null) { + return moveMultipleItemStacks( + aChest.adjacentChestXPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer, + false); + } else if (aChest.adjacentChestZPos != null) { + return moveMultipleItemStacks( + aChest.adjacentChestZPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aMaxStackTransfer, + false); + } + return 0; + } + + /** + * Moves Stack from Inv-Side to Inv-Side. + * + * @return the Amount of moved Items + */ + public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + if (aTileEntity1 instanceof IInventory) return moveOneItemStack( + (IInventory) aTileEntity1, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + true); return 0; } @@ -1203,14 +1192,13 @@ public class GT_Utility { * This is only because I needed an additional Parameter for the Double Chest Check. */ private static byte moveOneItemStack(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { if (aTileEntity1 == null || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; int[] tGrabSlots = null; if (aTileEntity1 instanceof ISidedInventory) @@ -1235,26 +1223,25 @@ public class GT_Utility { ItemStack tGrabStack = aTileEntity1.getStackInSlot(tGrabSlot); if (listContainsItem(aFilter, tGrabStack, true, aInvertFilter)) { if (tGrabStack.stackSize >= aMinMoveAtOnce - && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlot, aGrabFrom, tGrabStack)) { + && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlot, aGrabFrom, tGrabStack)) { for (int tPutSlot : tPutSlots) { if (isAllowedToPutIntoSlot( + (IInventory) aTileEntity2, + tPutSlot, + aPutTo, + tGrabStack, + aMaxTargetStackSize)) { + tMovedItemCount += moveStackFromSlotAToSlotB( + aTileEntity1, (IInventory) aTileEntity2, + tGrabSlot, tPutSlot, - aPutTo, - tGrabStack, - aMaxTargetStackSize)) { - tMovedItemCount += moveStackFromSlotAToSlotB( - aTileEntity1, - (IInventory) aTileEntity2, - tGrabSlot, - tPutSlot, - aMaxTargetStackSize, - aMinTargetStackSize, - (byte) (aMaxMoveAtOnce - tMovedItemCount), - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + (byte) (aMaxMoveAtOnce - tMovedItemCount), + aMinMoveAtOnce); if (tMovedItemCount >= aMaxMoveAtOnce - || (tMovedItemCount > 0 && aMaxTargetStackSize < 64)) - return tMovedItemCount; + || (tMovedItemCount > 0 && aMaxTargetStackSize < 64)) return tMovedItemCount; } } } @@ -1267,56 +1254,56 @@ public class GT_Utility { byte tAmount = 0; if (tTileEntity1.adjacentChestXNeg != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestXNeg, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestXNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity1.adjacentChestZNeg != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestZNeg, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestZNeg, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity1.adjacentChestXPos != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestXPos, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestXPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity1.adjacentChestZPos != null) { tAmount = moveOneItemStack( - tTileEntity1.adjacentChestZPos, - aTileEntity2, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + tTileEntity1.adjacentChestZPos, + aTileEntity2, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } if (tAmount != 0) return tAmount; } @@ -1326,56 +1313,56 @@ public class GT_Utility { byte tAmount = 0; if (tTileEntity2.adjacentChestXNeg != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestXNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestXNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZNeg != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestZNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestZNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestXPos != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestXPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestXPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZPos != null) { tAmount = moveOneItemStack( - aTileEntity1, - tTileEntity2.adjacentChestZPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + aTileEntity1, + tTileEntity2.adjacentChestZPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } if (tAmount != 0) return tAmount; } @@ -1383,18 +1370,18 @@ public class GT_Utility { } return moveStackIntoPipe( - aTileEntity1, - aTileEntity2, - tGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aDoCheckChests); + aTileEntity1, + aTileEntity2, + tGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aDoCheckChests); } /** @@ -1403,16 +1390,15 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveOneItemStackIntoSlot(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, int aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { if (aTileEntity1 == null || !(aTileEntity1 instanceof IInventory) - || aPutTo < 0 - || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aPutTo < 0 + || aMaxTargetStackSize <= 0 + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; int[] tGrabSlots = null; if (aTileEntity1 instanceof ISidedInventory) @@ -1425,30 +1411,30 @@ public class GT_Utility { if (aTileEntity2 instanceof IInventory) { for (int tGrabSlot : tGrabSlots) { if (listContainsItem( - aFilter, - ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), - true, - aInvertFilter)) { + aFilter, + ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), + true, + aInvertFilter)) { if (isAllowedToTakeFromSlot( - (IInventory) aTileEntity1, - tGrabSlot, - aGrabFrom, - ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot))) { + (IInventory) aTileEntity1, + tGrabSlot, + aGrabFrom, + ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot))) { if (isAllowedToPutIntoSlot( + (IInventory) aTileEntity2, + aPutTo, + (byte) 6, + ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), + aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB( + (IInventory) aTileEntity1, (IInventory) aTileEntity2, + tGrabSlot, aPutTo, - (byte) 6, - ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), - aMaxTargetStackSize)) { - byte tMovedItemCount = moveStackFromSlotAToSlotB( - (IInventory) aTileEntity1, - (IInventory) aTileEntity2, - tGrabSlot, - aPutTo, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce); if (tMovedItemCount > 0) return tMovedItemCount; } } @@ -1457,17 +1443,17 @@ public class GT_Utility { } moveStackIntoPipe( - ((IInventory) aTileEntity1), - aTileEntity2, - tGrabSlots, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce); + ((IInventory) aTileEntity1), + aTileEntity2, + tGrabSlots, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce); return 0; } @@ -1477,34 +1463,33 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveFromSlotToSlot(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, int aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { if (aTileEntity1 == null || aTileEntity2 == null - || aGrabFrom < 0 - || aPutTo < 0 - || aMaxTargetStackSize <= 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aGrabFrom < 0 + || aPutTo < 0 + || aMaxTargetStackSize <= 0 + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabFrom), true, aInvertFilter)) { if (isAllowedToTakeFromSlot(aTileEntity1, aGrabFrom, (byte) 6, aTileEntity1.getStackInSlot(aGrabFrom))) { if (isAllowedToPutIntoSlot( + aTileEntity2, + aPutTo, + (byte) 6, + aTileEntity1.getStackInSlot(aGrabFrom), + aMaxTargetStackSize)) { + byte tMovedItemCount = moveStackFromSlotAToSlotB( + aTileEntity1, aTileEntity2, + aGrabFrom, aPutTo, - (byte) 6, - aTileEntity1.getStackInSlot(aGrabFrom), - aMaxTargetStackSize)) { - byte tMovedItemCount = moveStackFromSlotAToSlotB( - aTileEntity1, - aTileEntity2, - aGrabFrom, - aPutTo, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce); if (tMovedItemCount > 0) return tMovedItemCount; } } @@ -1518,18 +1503,16 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) { if (fromTile == null || aGrabFrom < 0 - || aMinTargetStackSize <= 0 - || aMaxMoveAtOnce <= 0 - || aMinTargetStackSize > aMaxTargetStackSize - || aMinMoveAtOnce > aMaxMoveAtOnce) - return 0; + || aMinTargetStackSize <= 0 + || aMaxMoveAtOnce <= 0 + || aMinTargetStackSize > aMaxTargetStackSize + || aMinMoveAtOnce > aMaxMoveAtOnce) return 0; if (!listContainsItem(aFilter, fromTile.getStackInSlot(aGrabFrom), true, aInvertFilter) - || !isAllowedToTakeFromSlot(fromTile, aGrabFrom, (byte) 6, fromTile.getStackInSlot(aGrabFrom))) - return 0; + || !isAllowedToTakeFromSlot(fromTile, aGrabFrom, (byte) 6, fromTile.getStackInSlot(aGrabFrom))) return 0; if (toTile instanceof IInventory) { int[] tPutSlots = null; @@ -1544,20 +1527,20 @@ public class GT_Utility { byte tMovedItemCount = 0; for (int tPutSlot : tPutSlots) { if (isAllowedToPutIntoSlot( + (IInventory) toTile, + tPutSlot, + aPutTo, + fromTile.getStackInSlot(aGrabFrom), + aMaxTargetStackSize)) { + tMovedItemCount += moveStackFromSlotAToSlotB( + fromTile, (IInventory) toTile, + aGrabFrom, tPutSlot, - aPutTo, - fromTile.getStackInSlot(aGrabFrom), - aMaxTargetStackSize)) { - tMovedItemCount += moveStackFromSlotAToSlotB( - fromTile, - (IInventory) toTile, - aGrabFrom, - tPutSlot, - aMaxTargetStackSize, - aMinTargetStackSize, - (byte) (aMaxMoveAtOnce - tMovedItemCount), - aMinMoveAtOnce); + aMaxTargetStackSize, + aMinTargetStackSize, + (byte) (aMaxMoveAtOnce - tMovedItemCount), + aMinMoveAtOnce); if (tMovedItemCount >= aMaxMoveAtOnce) { return tMovedItemCount; } @@ -1569,95 +1552,95 @@ public class GT_Utility { if (tTileEntity2.adjacentChestChecked) { if (tTileEntity2.adjacentChestXNeg != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestXNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestXNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZNeg != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestZNeg, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestZNeg, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestXPos != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestXPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestXPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } else if (tTileEntity2.adjacentChestZPos != null) { tMovedItemCount = moveFromSlotToSide( - fromTile, - tTileEntity2.adjacentChestZPos, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - false); + fromTile, + tTileEntity2.adjacentChestZPos, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + false); } if (tMovedItemCount > 0) return tMovedItemCount; } } } return moveStackIntoPipe( - fromTile, - toTile, - new int[] { aGrabFrom }, - (byte) 6, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - aDoCheckChests); + fromTile, + toTile, + new int[] { aGrabFrom }, + (byte) 6, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + aDoCheckChests); } public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo, - List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, - byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { + List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, + byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { return moveFromSlotToSide( - fromTile, - toTile, - aGrabFrom, - aPutTo, - aFilter, - aInvertFilter, - aMaxTargetStackSize, - aMinTargetStackSize, - aMaxMoveAtOnce, - aMinMoveAtOnce, - true); + fromTile, + toTile, + aGrabFrom, + aPutTo, + aFilter, + aInvertFilter, + aMaxTargetStackSize, + aMinTargetStackSize, + aMaxMoveAtOnce, + aMinMoveAtOnce, + true); } public static boolean listContainsItem(Collection aList, ItemStack aStack, boolean aTIfListEmpty, - boolean aInvertFilter) { + boolean aInvertFilter) { if (aStack == null || aStack.stackSize < 1) return false; if (aList == null) return aTIfListEmpty; boolean tEmpty = true; @@ -1675,14 +1658,13 @@ public class GT_Utility { public static boolean areStacksOrToolsEqual(ItemStack aStack1, ItemStack aStack2) { if (aStack1 != null && aStack2 != null && aStack1.getItem() == aStack2.getItem()) { if (aStack1.getItem() - .isDamageable()) - return true; + .isDamageable()) return true; return ((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) - && (aStack1.getTagCompound() == null || aStack1.getTagCompound() - .equals(aStack2.getTagCompound())) - && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) - || Items.feather.getDamage(aStack1) == W - || Items.feather.getDamage(aStack2) == W); + && (aStack1.getTagCompound() == null || aStack1.getTagCompound() + .equals(aStack2.getTagCompound())) + && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) + || Items.feather.getDamage(aStack1) == W + || Items.feather.getDamage(aStack2) == W); } return false; } @@ -1693,9 +1675,9 @@ public class GT_Utility { public static boolean areFluidsEqual(FluidStack aFluid1, FluidStack aFluid2, boolean aIgnoreNBT) { return aFluid1 != null && aFluid2 != null - && aFluid1.getFluid() == aFluid2.getFluid() - && (aIgnoreNBT || ((aFluid1.tag == null) == (aFluid2.tag == null)) - && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag))); + && aFluid1.getFluid() == aFluid2.getFluid() + && (aIgnoreNBT || ((aFluid1.tag == null) == (aFluid2.tag == null)) + && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag))); } public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) { @@ -1704,13 +1686,13 @@ public class GT_Utility { public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { return aStack1 != null && aStack2 != null - && aStack1.getItem() == aStack2.getItem() - && (aIgnoreNBT || (((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) - && (aStack1.getTagCompound() == null || aStack1.getTagCompound() - .equals(aStack2.getTagCompound())))) - && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) - || Items.feather.getDamage(aStack1) == W - || Items.feather.getDamage(aStack2) == W); + && aStack1.getItem() == aStack2.getItem() + && (aIgnoreNBT || (((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null)) + && (aStack1.getTagCompound() == null || aStack1.getTagCompound() + .equals(aStack2.getTagCompound())))) + && (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2) + || Items.feather.getDamage(aStack1) == W + || Items.feather.getDamage(aStack2) == W); } /** @@ -1719,7 +1701,7 @@ public class GT_Utility { * Since ItemStack doesn't override equals and hashCode, you cannot just use Objects.equals */ public static boolean areStackListsEqual(List lhs, List rhs, boolean ignoreStackSize, - boolean ignoreNBT) { + boolean ignoreNBT) { if (lhs == null) return rhs == null; if (rhs == null) return false; if (lhs.size() != rhs.size()) return false; @@ -1730,12 +1712,12 @@ public class GT_Utility { } private static boolean areStacksEqualExtended(ItemStack lhs, ItemStack rhs, boolean ignoreStackSize, - boolean ignoreNBT) { + boolean ignoreNBT) { if (lhs == null) return rhs == null; if (rhs == null) return false; return lhs.getItem() == rhs.getItem() - && (ignoreNBT || Objects.equals(lhs.stackTagCompound, rhs.stackTagCompound)) - && (ignoreStackSize || lhs.stackSize == rhs.stackSize); + && (ignoreNBT || Objects.equals(lhs.stackTagCompound, rhs.stackTagCompound)) + && (ignoreStackSize || lhs.stackSize == rhs.stackSize); } public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2) { @@ -1744,17 +1726,17 @@ public class GT_Utility { public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { return areStacksEqual( - GT_OreDictUnificator.get_nocopy(aStack1), - GT_OreDictUnificator.get_nocopy(aStack2), - aIgnoreNBT); + GT_OreDictUnificator.get_nocopy(aStack1), + GT_OreDictUnificator.get_nocopy(aStack2), + aIgnoreNBT); } public static String getFluidName(Fluid aFluid, boolean aLocalized) { if (aFluid == null) return E; String rName = aLocalized ? aFluid.getLocalizedName(new FluidStack(aFluid, 0)) : aFluid.getUnlocalizedName(); if (rName.contains("fluid.") || rName.contains("tile.")) return capitalizeString( - rName.replaceAll("fluid.", E) - .replaceAll("tile.", E)); + rName.replaceAll("fluid.", E) + .replaceAll("tile.", E)); return rName; } @@ -1770,13 +1752,12 @@ public class GT_Utility { sFluidUnlocalizedNameToFluid.clear(); for (FluidContainerData tData : sFluidContainerList) { sFilledContainerToData.put(new GT_ItemStack(tData.filledContainer), tData); - Map tFluidToContainer = sEmptyContainerToFluidToData.get( - new GT_ItemStack(tData.emptyContainer)); + Map tFluidToContainer = sEmptyContainerToFluidToData + .get(new GT_ItemStack(tData.emptyContainer)); List tContainers = sFluidToContainers.get(tData.fluid.getFluid()); if (tFluidToContainer == null) { - sEmptyContainerToFluidToData.put( - new GT_ItemStack(tData.emptyContainer), - tFluidToContainer = new /* Concurrent */ HashMap<>()); + sEmptyContainerToFluidToData + .put(new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); GregTech_API.sFluidMappings.add(tFluidToContainer); } tFluidToContainer.put(tData.fluid.getFluid(), tData); @@ -1787,7 +1768,7 @@ public class GT_Utility { } else tContainers.add(tData.filledContainer); } for (Fluid tFluid : FluidRegistry.getRegisteredFluids() - .values()) { + .values()) { sFluidUnlocalizedNameToFluid.put(tFluid.getUnlocalizedName(), tFluid); } } @@ -1799,13 +1780,12 @@ public class GT_Utility { public static void addFluidContainerData(FluidContainerData aData) { sFluidContainerList.add(aData); sFilledContainerToData.put(new GT_ItemStack(aData.filledContainer), aData); - Map tFluidToContainer = sEmptyContainerToFluidToData.get( - new GT_ItemStack(aData.emptyContainer)); + Map tFluidToContainer = sEmptyContainerToFluidToData + .get(new GT_ItemStack(aData.emptyContainer)); List tContainers = sFluidToContainers.get(aData.fluid.getFluid()); if (tFluidToContainer == null) { - sEmptyContainerToFluidToData.put( - new GT_ItemStack(aData.emptyContainer), - tFluidToContainer = new /* Concurrent */ HashMap<>()); + sEmptyContainerToFluidToData + .put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>()); GregTech_API.sFluidMappings.add(tFluidToContainer); } tFluidToContainer.put(aData.fluid.getFluid(), aData); @@ -1826,7 +1806,7 @@ public class GT_Utility { } public static ItemStack fillFluidContainer(FluidStack aFluid, ItemStack aStack, boolean aRemoveFluidDirectly, - boolean aCheckIFluidContainerItems) { + boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack) || aFluid == null) return null; if (GT_ModHandler.isWater(aFluid) && ItemList.Bottle_Empty.isStackEqual(aStack)) { if (aFluid.amount >= 250) { @@ -1836,12 +1816,10 @@ public class GT_Utility { return null; } if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getFluid(aStack) == null - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) <= aFluid.amount) { - if (aRemoveFluidDirectly) aFluid.amount -= ((IFluidContainerItem) aStack.getItem()).fill( - aStack = copyAmount(1, aStack), - aFluid, - true); + && ((IFluidContainerItem) aStack.getItem()).getFluid(aStack) == null + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) <= aFluid.amount) { + if (aRemoveFluidDirectly) aFluid.amount -= ((IFluidContainerItem) aStack.getItem()) + .fill(aStack = copyAmount(1, aStack), aFluid, true); else((IFluidContainerItem) aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, true); return aStack; } @@ -1855,7 +1833,7 @@ public class GT_Utility { public static int calculateRecipeEU(Materials aMaterial, int defaultRecipeEUPerTick) { return aMaterial.getProcessingMaterialTierEU() == 0 ? defaultRecipeEUPerTick - : aMaterial.getProcessingMaterialTierEU(); + : aMaterial.getProcessingMaterialTierEU(); } public static ItemStack getFluidDisplayStack(Fluid aFluid) { @@ -1871,7 +1849,7 @@ public class GT_Utility { int tmp = 0; try { tmp = aFluid.getFluid() - .getID(); + .getID(); } catch (Exception e) { System.err.println(e); } @@ -1879,13 +1857,13 @@ public class GT_Utility { NBTTagCompound tNBT = new NBTTagCompound(); tNBT.setLong("mFluidDisplayAmount", aUseStackSize ? aFluid.amount : 0); tNBT.setLong( - "mFluidDisplayHeat", - aFluid.getFluid() - .getTemperature(aFluid)); + "mFluidDisplayHeat", + aFluid.getFluid() + .getTemperature(aFluid)); tNBT.setBoolean( - "mFluidState", - aFluid.getFluid() - .isGaseous(aFluid)); + "mFluidState", + aFluid.getFluid() + .isGaseous(aFluid)); tNBT.setBoolean("mHideStackSize", aHideStackSize); try { tNBT.setString("mFluidMaterialName", FLUID_MAP.get(aFluid.getFluid()).mName); @@ -1896,23 +1874,22 @@ public class GT_Utility { public static FluidStack getFluidFromDisplayStack(ItemStack aDisplayStack) { if (!isStackValid(aDisplayStack) || aDisplayStack.getItem() != ItemList.Display_Fluid.getItem() - || !aDisplayStack.hasTagCompound()) - return null; + || !aDisplayStack.hasTagCompound()) return null; Fluid tFluid = FluidRegistry.getFluid( - ItemList.Display_Fluid.getItem() - .getDamage(aDisplayStack)); + ItemList.Display_Fluid.getItem() + .getDamage(aDisplayStack)); return new FluidStack( - tFluid, - (int) aDisplayStack.getTagCompound() - .getLong("mFluidDisplayAmount")); + tFluid, + (int) aDisplayStack.getTagCompound() + .getLong("mFluidDisplayAmount")); } public static boolean containsFluid(ItemStack aStack, FluidStack aFluid, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack) || aFluid == null) return false; if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) - return aFluid.isFluidEqual( - ((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack))); + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) + return aFluid + .isFluidEqual(((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack))); FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); return tData != null && tData.fluid.isFluidEqual(aFluid); } @@ -1920,7 +1897,7 @@ public class GT_Utility { public static FluidStack getFluidForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack)) return null; if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) return ((IFluidContainerItem) aStack.getItem()).drain(copyAmount(1, aStack), Integer.MAX_VALUE, true); FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); return tData == null ? null : tData.fluid.copy(); @@ -1934,7 +1911,7 @@ public class GT_Utility { FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack)); if (tData != null) return copyAmount(1, tData.emptyContainer); if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { ((IFluidContainerItem) aStack.getItem()).drain(aStack = copyAmount(1, aStack), Integer.MAX_VALUE, true); return aStack; } @@ -1948,20 +1925,19 @@ public class GT_Utility { public static ItemStack getContainerItem(ItemStack aStack, boolean aCheckIFluidContainerItems) { if (isStackInvalid(aStack)) return null; if (aStack.getItem() - .hasContainerItem(aStack)) + .hasContainerItem(aStack)) return aStack.getItem() - .getContainerItem(aStack); + .getContainerItem(aStack); /** * These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items */ if (ItemList.Cell_Empty.isStackEqual(aStack, false, true)) return null; if (aStack.getItem() == Items.potionitem || aStack.getItem() == Items.experience_bottle - || ItemList.TF_Vial_FieryBlood.isStackEqual(aStack) - || ItemList.TF_Vial_FieryTears.isStackEqual(aStack)) - return ItemList.Bottle_Empty.get(1); + || ItemList.TF_Vial_FieryBlood.isStackEqual(aStack) + || ItemList.TF_Vial_FieryTears.isStackEqual(aStack)) return ItemList.Bottle_Empty.get(1); if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem - && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { + && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) { ItemStack tStack = copyAmount(1, aStack); ((IFluidContainerItem) aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true); if (!areStacksEqual(aStack, tStack)) return tStack; @@ -1985,17 +1961,18 @@ public class GT_Utility { } public static synchronized boolean removeIC2BottleRecipe(ItemStack aContainer, ItemStack aInput, - Map aRecipeList, ItemStack aOutput) { + Map aRecipeList, ItemStack aOutput) { if ((isStackInvalid(aInput) && isStackInvalid(aOutput) && isStackInvalid(aContainer)) || aRecipeList == null) return false; boolean rReturn = false; - Iterator> tIterator = aRecipeList.entrySet() - .iterator(); + Iterator> tIterator = aRecipeList + .entrySet() + .iterator(); aOutput = GT_OreDictUnificator.get(aOutput); while (tIterator.hasNext()) { Map.Entry tEntry = tIterator.next(); if (aInput == null || tEntry.getKey() - .matches(aContainer, aInput)) { + .matches(aContainer, aInput)) { List tList = tEntry.getValue().items; if (tList != null) for (ItemStack tOutput : tList) if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { @@ -2009,16 +1986,16 @@ public class GT_Utility { } public static synchronized boolean removeSimpleIC2MachineRecipe(ItemStack aInput, - Map aRecipeList, ItemStack aOutput) { + Map aRecipeList, ItemStack aOutput) { if ((isStackInvalid(aInput) && isStackInvalid(aOutput)) || aRecipeList == null) return false; boolean rReturn = false; Iterator> tIterator = aRecipeList.entrySet() - .iterator(); + .iterator(); aOutput = GT_OreDictUnificator.get(aOutput); while (tIterator.hasNext()) { Map.Entry tEntry = tIterator.next(); if (aInput == null || tEntry.getKey() - .matches(aInput)) { + .matches(aInput)) { List tList = tEntry.getValue().items; if (tList != null) for (ItemStack tOutput : tList) if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) { @@ -2032,38 +2009,34 @@ public class GT_Utility { } public static synchronized void bulkRemoveSimpleIC2MachineRecipe(Map toRemove, - Map aRecipeList) { + Map aRecipeList) { if (aRecipeList == null || aRecipeList.isEmpty()) return; toRemove.entrySet() - .removeIf(aEntry -> (isStackInvalid(aEntry.getKey()) && isStackInvalid(aEntry.getValue()))); - final Map finalToRemove = Maps.transformValues( - toRemove, - GT_OreDictUnificator::get_nocopy); + .removeIf(aEntry -> (isStackInvalid(aEntry.getKey()) && isStackInvalid(aEntry.getValue()))); + final Map finalToRemove = Maps + .transformValues(toRemove, GT_OreDictUnificator::get_nocopy); aRecipeList.entrySet() - .removeIf( - tEntry -> finalToRemove.entrySet() - .stream() - .anyMatch(aEntry -> { - final ItemStack aInput = aEntry.getKey(), - aOutput = aEntry.getValue(); - final List tList = tEntry.getValue().items; - - if (tList == null) return false; - if (aInput != null && !tEntry.getKey() - .matches(aInput)) - return false; - - return tList.stream() - .anyMatch( - tOutput -> (aOutput == null || areStacksEqual( - GT_OreDictUnificator.get(tOutput), - aOutput))); - })); + .removeIf( + tEntry -> finalToRemove.entrySet() + .stream() + .anyMatch(aEntry -> { + final ItemStack aInput = aEntry.getKey(), aOutput = aEntry.getValue(); + final List tList = tEntry.getValue().items; + + if (tList == null) return false; + if (aInput != null && !tEntry.getKey() + .matches(aInput)) return false; + + return tList.stream() + .anyMatch( + tOutput -> (aOutput == null + || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput))); + })); } public static boolean addSimpleIC2MachineRecipe(ItemStack aInput, Map aRecipeList, - NBTTagCompound aNBT, Object... aOutput) { + NBTTagCompound aNBT, Object... aOutput) { if (isStackInvalid(aInput) || aOutput.length == 0 || aRecipeList == null) return false; ItemData tOreName = GT_OreDictUnificator.getAssociation(aInput); for (Object o : aOutput) { @@ -2076,17 +2049,15 @@ public class GT_Utility { if (tStack.length > 0 && areStacksEqual(aInput, tStack[0])) return false; if (tOreName != null) { if (tOreName.toString() - .equals("dustAsh") - && tStack[0].getUnlocalizedName() - .equals("tile.volcanicAsh")) + .equals("dustAsh") + && tStack[0].getUnlocalizedName() + .equals("tile.volcanicAsh")) return false; - aRecipeList.put( - new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), - new RecipeOutput(aNBT, tStack)); + aRecipeList + .put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } else { - aRecipeList.put( - new RecipeInputItemStack(copyOrNull(aInput), aInput.stackSize), - new RecipeOutput(aNBT, tStack)); + aRecipeList + .put(new RecipeInputItemStack(copyOrNull(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } return true; } @@ -2114,9 +2085,8 @@ public class GT_Utility { tNBT.setString("author", aAuthor); NBTTagList tNBTList = new NBTTagList(); for (byte i = 0; i < aPages.length; i++) { - aPages[i] = GT_LanguageManager.addStringLocalization( - "Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), - aPages[i]); + aPages[i] = GT_LanguageManager + .addStringLocalization("Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), aPages[i]); if (i < 48) { if (aPages[i].length() < 256) tNBTList.appendTag(new NBTTagString(aPages[i])); else GT_Log.err.println("WARNING: String for written Book too long! -> " + aPages[i]); @@ -2126,20 +2096,20 @@ public class GT_Utility { } } tNBTList.appendTag( - new NBTTagString( - "Credits to " + aAuthor - + " for writing this Book. This was Book Nr. " - + sBookCount - + " at its creation. Gotta get 'em all!")); + new NBTTagString( + "Credits to " + aAuthor + + " for writing this Book. This was Book Nr. " + + sBookCount + + " at its creation. Gotta get 'em all!")); tNBT.setTag("pages", tNBTList); rStack.setTagCompound(tNBT); GT_Log.out.println( - "GT_Mod: Added Book to Book List - Mapping: '" + aMapping - + "' - Name: '" - + aTitle - + "' - Author: '" - + aAuthor - + "'"); + "GT_Mod: Added Book to Book List - Mapping: '" + aMapping + + "' - Name: '" + + aTitle + + "' - Author: '" + + aAuthor + + "'"); GregTech_API.sBookList.put(aMapping, rStack); return copyOrNull(rStack); } @@ -2154,36 +2124,36 @@ public class GT_Utility { } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength) { + float aSoundStrength) { return doSoundAtClient(aSoundResourceLocation, aTimeUntilNextSound, aSoundStrength, GT.getThePlayer()); } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, - Entity aEntity) { + Entity aEntity) { if (aEntity == null || aSoundName == null) return false; return doSoundAtClient( - aSoundName, - aTimeUntilNextSound, - aSoundStrength, - aEntity.posX, - aEntity.posY, - aEntity.posZ); + aSoundName, + aTimeUntilNextSound, + aSoundStrength, + aEntity.posX, + aEntity.posY, + aEntity.posZ); } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength, Entity aEntity) { + float aSoundStrength, Entity aEntity) { if (aEntity == null) return false; return doSoundAtClient( - aSoundResourceLocation.toString(), - aTimeUntilNextSound, - aSoundStrength, - aEntity.posX, - aEntity.posY, - aEntity.posZ); + aSoundResourceLocation.toString(), + aTimeUntilNextSound, + aSoundStrength, + aEntity.posX, + aEntity.posY, + aEntity.posZ); } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength, double aX, double aY, double aZ) { + float aSoundStrength, double aX, double aY, double aZ) { return doSoundAtClient(aSoundResourceLocation, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ); } @@ -2193,55 +2163,42 @@ public class GT_Utility { */ @Deprecated public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, - double aY, double aZ) { + double aY, double aZ) { if (aSoundName == null) return false; return doSoundAtClient( - new ResourceLocation(aSoundName), - aTimeUntilNextSound, - aSoundStrength, - 1.01818028F, - aX, - aY, - aZ); + new ResourceLocation(aSoundName), + aTimeUntilNextSound, + aSoundStrength, + 1.01818028F, + aX, + aY, + aZ); } public static boolean doSoundAtClient(SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength, - double aX, double aY, double aZ) { + double aX, double aY, double aZ) { return doSoundAtClient(aSound.resourceLocation, aTimeUntilNextSound, aSoundStrength, aX, aY, aZ); } public static boolean doSoundAtClient(SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength, - float aSoundModulation, double aX, double aY, double aZ) { + float aSoundModulation, double aX, double aY, double aZ) { return doSoundAtClient( - aSound.resourceLocation, - aTimeUntilNextSound, - aSoundStrength, - aSoundModulation, - aX, - aY, - aZ); + aSound.resourceLocation, + aTimeUntilNextSound, + aSoundStrength, + aSoundModulation, + aX, + aY, + aZ); } public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, - float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { + float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { if (!FMLCommonHandler.instance() - .getEffectiveSide() - .isClient() - || GT.getThePlayer() == null - || !GT.getThePlayer().worldObj.isRemote) - return false; + .getEffectiveSide() + .isClient() || GT.getThePlayer() == null || !GT.getThePlayer().worldObj.isRemote) return false; if (GregTech_API.sMultiThreadedSounds) new Thread( - new GT_Runnable_Sound( - GT.getThePlayer().worldObj, - aX, - aY, - aZ, - aTimeUntilNextSound, - aSoundResourceLocation, - aSoundStrength, - aSoundModulation), - "Sound Effect").start(); - else new GT_Runnable_Sound( + new GT_Runnable_Sound( GT.getThePlayer().worldObj, aX, aY, @@ -2249,7 +2206,17 @@ public class GT_Utility { aTimeUntilNextSound, aSoundResourceLocation, aSoundStrength, - aSoundModulation).run(); + aSoundModulation), + "Sound Effect").start(); + else new GT_Runnable_Sound( + GT.getThePlayer().worldObj, + aX, + aY, + aZ, + aTimeUntilNextSound, + aSoundResourceLocation, + aSoundStrength, + aSoundModulation).run(); return true; } @@ -2259,43 +2226,43 @@ public class GT_Utility { */ @Deprecated public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, - float aSoundModulation, double aX, double aY, double aZ) { + float aSoundModulation, double aX, double aY, double aZ) { if (isStringInvalid(aSoundName)) return false; return doSoundAtClient( - new ResourceLocation(aSoundName), - aTimeUntilNextSound, - aSoundStrength, - aSoundModulation, - aX, - aY, - aZ); + new ResourceLocation(aSoundName), + aTimeUntilNextSound, + aSoundStrength, + aSoundModulation, + aX, + aY, + aZ); } public static boolean sendSoundToPlayers(World aWorld, String aSoundName, float aSoundStrength, - float aSoundModulation, int aX, int aY, int aZ) { + float aSoundModulation, int aX, int aY, int aZ) { if (isStringInvalid(aSoundName) || aWorld == null || aWorld.isRemote) return false; NW.sendPacketToAllPlayersInRange( - aWorld, - new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), - aX, - aZ); + aWorld, + new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), + aX, + aZ); return true; } public static boolean sendSoundToPlayers(World aWorld, SoundResource sound, float aSoundStrength, - float aSoundModulation, int aX, int aY, int aZ) { + float aSoundModulation, int aX, int aY, int aZ) { if (aWorld == null || aWorld.isRemote) return false; NW.sendPacketToAllPlayersInRange( - aWorld, - new GT_Packet_Sound( - sound.resourceLocation.toString(), - aSoundStrength, - aSoundModulation, - aX, - (short) aY, - aZ), + aWorld, + new GT_Packet_Sound( + sound.resourceLocation.toString(), + aSoundStrength, + aSoundModulation, aX, - aZ); + (short) aY, + aZ), + aX, + aZ); return true; } @@ -2399,30 +2366,30 @@ public class GT_Utility { public static boolean isStringValid(Object aString) { return aString != null && !aString.toString() - .isEmpty(); + .isEmpty(); } public static boolean isStringInvalid(Object aString) { return aString == null || aString.toString() - .isEmpty(); + .isEmpty(); } public static boolean isStackValid(Object aStack) { return (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null - && ((ItemStack) aStack).stackSize >= 0; + && ((ItemStack) aStack).stackSize >= 0; } public static boolean isStackInvalid(Object aStack) { return aStack == null || !(aStack instanceof ItemStack) - || ((ItemStack) aStack).getItem() == null - || ((ItemStack) aStack).stackSize < 0; + || ((ItemStack) aStack).getItem() == null + || ((ItemStack) aStack).stackSize < 0; } public static boolean isDebugItem(ItemStack aStack) { return /* ItemList.Armor_Cheat.isStackEqual(aStack, T, T) || */ areStacksEqual( - GT_ModHandler.getIC2Item("debug", 1), - aStack, - true); + GT_ModHandler.getIC2Item("debug", 1), + aStack, + true); } public static ItemStack updateItemStack(ItemStack aStack) { @@ -2433,48 +2400,39 @@ public class GT_Utility { public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .isOpaqueCube(); + .isOpaqueCube(); } public static boolean isBlockAir(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .isAir(aWorld, aX, aY, aZ); + .isAir(aWorld, aX, aY, aZ); } public static boolean hasBlockHitBox(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - != null; + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null; } public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) { if (aReplaceCenter) if (aWorld.getBlock(aX, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - == null) - aWorld.setBlock(aX, aY, aZ, Blocks.fire); + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) == null) aWorld.setBlock(aX, aY, aZ, Blocks.fire); if (aWorld.getBlock(aX + 1, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX + 1, aY, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX + 1, aY, aZ) == null) aWorld.setBlock(aX + 1, aY, aZ, Blocks.fire); if (aWorld.getBlock(aX - 1, aY, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX - 1, aY, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX - 1, aY, aZ) == null) aWorld.setBlock(aX - 1, aY, aZ, Blocks.fire); if (aWorld.getBlock(aX, aY + 1, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY + 1, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY + 1, aZ) == null) aWorld.setBlock(aX, aY + 1, aZ, Blocks.fire); if (aWorld.getBlock(aX, aY - 1, aZ) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY - 1, aZ) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY - 1, aZ) == null) aWorld.setBlock(aX, aY - 1, aZ, Blocks.fire); if (aWorld.getBlock(aX, aY, aZ + 1) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ + 1) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ + 1) == null) aWorld.setBlock(aX, aY, aZ + 1, Blocks.fire); if (aWorld.getBlock(aX, aY, aZ - 1) - .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ - 1) - == null) + .getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ - 1) == null) aWorld.setBlock(aX, aY, aZ - 1, Blocks.fire); } @@ -2482,7 +2440,7 @@ public class GT_Utility { if (aInventory != null) for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) { ItemStack rStack = aInventory.getStackInSlot(i); if (isStackValid(rStack) && rStack.getItem() instanceof IProjectileItem - && ((IProjectileItem) rStack.getItem()).hasProjectile(aProjectileType, rStack)) + && ((IProjectileItem) rStack.getItem()).hasProjectile(aProjectileType, rStack)) return updateItemStack(rStack); } return null; @@ -2542,14 +2500,14 @@ public class GT_Utility { return (page << 7) + (startIndex + blockMeta); } throw new RuntimeException( - "Index out of range: [" + page - + "][" - + startIndex - + "+" - + blockMeta - + "=" - + (startIndex + blockMeta) - + "]"); + "Index out of range: [" + page + + "][" + + startIndex + + "+" + + blockMeta + + "=" + + (startIndex + blockMeta) + + "]"); } /** @@ -2584,9 +2542,9 @@ public class GT_Utility { } } throw new RuntimeException( - "Probably missing mapping or different texture class used for: " + blockFromBlock.getUnlocalizedName() - + " meta:" - + metaFromBlock); + "Probably missing mapping or different texture class used for: " + blockFromBlock.getUnlocalizedName() + + " meta:" + + metaFromBlock); } /** @@ -2741,8 +2699,8 @@ public class GT_Utility { public static float getHeatDamageFromItem(ItemStack aStack) { ItemData tData = GT_OreDictUnificator.getItemData(aStack); return tData == null ? 0 - : (tData.mPrefix == null ? 0 : tData.mPrefix.mHeatDamage) - + (tData.hasValidMaterialData() ? tData.mMaterial.mMaterial.mHeatDamage : 0); + : (tData.mPrefix == null ? 0 : tData.mPrefix.mHeatDamage) + + (tData.hasValidMaterialData() ? tData.mMaterial.mMaterial.mHeatDamage : 0); } public static int getRadioactivityLevel(ItemStack aStack) { @@ -2770,8 +2728,8 @@ public class GT_Utility { private static boolean applyHeatDamage(EntityLivingBase aEntity, float aDamage, DamageSource source) { if (aDamage > 0 && aEntity != null - && aEntity.getActivePotionEffect(Potion.fireResistance) == null - && !isWearingFullHeatHazmat(aEntity)) { + && aEntity.getActivePotionEffect(Potion.fireResistance) == null + && !isWearingFullHeatHazmat(aEntity)) { aEntity.attackEntityFrom(source, aDamage); return true; } @@ -2797,58 +2755,57 @@ public class GT_Utility { public static boolean applyRadioactivity(EntityLivingBase aEntity, int aLevel, int aAmountOfItems) { if (aLevel > 0 && aEntity != null - && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD - && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD - && !isWearingFullRadioHazmat(aEntity)) { + && aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD + && aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD + && !isWearingFullRadioHazmat(aEntity)) { PotionEffect tEffect = null; aEntity.addPotionEffect( - new PotionEffect( - Potion.moveSlowdown.id, - aLevel * 140 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.moveSlowdown.id, + aLevel * 140 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.digSlowdown.id, - aLevel * 150 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.digSlowdown.id, + aLevel * 150 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.confusion.id, - aLevel * 130 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.confusion)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.confusion.id, + aLevel * 130 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.confusion)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.weakness.id, - aLevel * 150 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.weakness)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.weakness.id, + aLevel * 150 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.weakness)) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - Potion.hunger.id, - aLevel * 130 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.hunger)) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + Potion.hunger.id, + aLevel * 130 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.hunger)) == null ? 0 : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); aEntity.addPotionEffect( - new PotionEffect( - 24 /* IC2 Radiation */, - aLevel * 180 * aAmountOfItems + Math.max( - 0, - ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null ? 0 - : tEffect.getDuration())), - Math.max(0, (5 * aLevel) / 7))); + new PotionEffect( + 24 /* IC2 Radiation */, + aLevel * 180 * aAmountOfItems + Math.max( + 0, + ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null ? 0 + : tEffect.getDuration())), + Math.max(0, (5 * aLevel) / 7))); return true; } return false; @@ -3027,12 +2984,12 @@ public class GT_Utility { public static boolean isStackInList(GT_ItemStack aStack, Collection aList) { return aStack != null - && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); + && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); } public static boolean isStackInList(GT_ItemStack2 aStack, Set aList) { return aStack != null - && (aList.contains(aStack) || aList.contains(new GT_ItemStack2(aStack.mItem, aStack.mStackSize, W))); + && (aList.contains(aStack) || aList.contains(new GT_ItemStack2(aStack.mItem, aStack.mStackSize, W))); } /** @@ -3047,9 +3004,9 @@ public class GT_Utility { public static > LinkedHashMap sortMapByValuesAcending(Map map) { return map.entrySet() - .stream() - .sorted(Entry.comparingByValue()) - .collect(CollectorUtils.entriesToMap(LinkedHashMap::new)); + .stream() + .sorted(Entry.comparingByValue()) + .collect(CollectorUtils.entriesToMap(LinkedHashMap::new)); } /** @@ -3059,7 +3016,7 @@ public class GT_Utility { List> tEntrySet = new LinkedList<>(aMap.entrySet()); tEntrySet.sort((aValue1, aValue2) -> { return aValue2.getValue() - .compareTo(aValue1.getValue()); // FB: RV - RV_NEGATING_RESULT_OF_COMPARETO + .compareTo(aValue1.getValue()); // FB: RV - RV_NEGATING_RESULT_OF_COMPARETO }); LinkedHashMap rMap = new LinkedHashMap<>(); for (Map.Entry tEntry : tEntrySet) rMap.put(tEntry.getKey(), tEntry.getValue()); @@ -3079,9 +3036,9 @@ public class GT_Utility { */ public static long translateMaterialToAmount(long aMaterialAmount, long aAmountPerUnit, boolean aRoundUp) { return Math.max( - 0, - ((aMaterialAmount * aAmountPerUnit) / M) - + (aRoundUp && (aMaterialAmount * aAmountPerUnit) % M > 0 ? 1 : 0)); + 0, + ((aMaterialAmount * aAmountPerUnit) / M) + + (aRoundUp && (aMaterialAmount * aAmountPerUnit) % M > 0 ? 1 : 0)); } /** @@ -3091,11 +3048,11 @@ public class GT_Utility { if (aDimensionID <= 1 && aDimensionID >= -1 && !GregTech_API.sDimensionalList.contains(aDimensionID)) return true; return !GregTech_API.sDimensionalList.contains(aDimensionID) - && DimensionManager.isDimensionRegistered(aDimensionID); + && DimensionManager.isDimensionRegistered(aDimensionID); } public static boolean moveEntityToDimensionAtCoords(Entity entity, int aDimension, double aX, double aY, - double aZ) { + double aZ) { // Credit goes to BrandonCore Author :!: if (entity == null || entity.worldObj.isRemote) return false; @@ -3104,8 +3061,8 @@ public class GT_Utility { World startWorld = entity.worldObj; WorldServer destinationWorld = FMLCommonHandler.instance() - .getMinecraftServerInstance() - .worldServerForDimension(aDimension); + .getMinecraftServerInstance() + .worldServerForDimension(aDimension); if (destinationWorld == null) { return false; @@ -3120,23 +3077,23 @@ public class GT_Utility { player.closeScreen(); // added player.dimension = aDimension; player.playerNetServerHandler.sendPacket( - new S07PacketRespawn( - player.dimension, - player.worldObj.difficultySetting, - destinationWorld.getWorldInfo() - .getTerrainType(), - player.theItemInWorldManager.getGameType())); + new S07PacketRespawn( + player.dimension, + player.worldObj.difficultySetting, + destinationWorld.getWorldInfo() + .getTerrainType(), + player.theItemInWorldManager.getGameType())); ((WorldServer) startWorld).getPlayerManager() - .removePlayer(player); + .removePlayer(player); startWorld.playerEntities.remove(player); startWorld.updateAllPlayersSleepingFlag(); int i = entity.chunkCoordX; int j = entity.chunkCoordZ; if ((entity.addedToChunk) && (startWorld.getChunkProvider() - .chunkExists(i, j))) { + .chunkExists(i, j))) { startWorld.getChunkFromChunkCoords(i, j) - .removeEntity(entity); + .removeEntity(entity); startWorld.getChunkFromChunkCoords(i, j).isModified = true; } startWorld.loadedEntityList.remove(entity); @@ -3173,7 +3130,7 @@ public class GT_Utility { EntityPlayerMP player = (EntityPlayerMP) entity; if (interDimensional) { player.mcServer.getConfigurationManager() - .func_72375_a(player, destinationWorld); + .func_72375_a(player, destinationWorld); } player.playerNetServerHandler.setPlayerLocation(aX, aY, aZ, player.rotationYaw, player.rotationPitch); } @@ -3184,21 +3141,21 @@ public class GT_Utility { EntityPlayerMP player = (EntityPlayerMP) entity; player.theItemInWorldManager.setWorld(destinationWorld); player.mcServer.getConfigurationManager() - .updateTimeAndWeatherForPlayer(player, destinationWorld); + .updateTimeAndWeatherForPlayer(player, destinationWorld); player.mcServer.getConfigurationManager() - .syncPlayerInventory(player); + .syncPlayerInventory(player); for (PotionEffect potionEffect : player.getActivePotionEffects()) { player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potionEffect)); } player.playerNetServerHandler.sendPacket( - new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); + new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); FMLCommonHandler.instance() - .firePlayerChangedDimensionEvent( - player, - startWorld.provider.dimensionId, - destinationWorld.provider.dimensionId); + .firePlayerChangedDimensionEvent( + player, + startWorld.provider.dimensionId, + destinationWorld.provider.dimensionId); } entity.setLocationAndAngles(aX, aY, aZ, entity.rotationYaw, entity.rotationPitch); @@ -3212,7 +3169,7 @@ public class GT_Utility { } public static int getCoordinateScan(ArrayList aList, EntityPlayer aPlayer, World aWorld, int aScanLevel, - int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { + int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) { if (aList == null) return 0; ArrayList tList = new ArrayList<>(); @@ -3223,59 +3180,52 @@ public class GT_Utility { final Block tBlock = aWorld.getBlock(aX, aY, aZ); tList.add( - "----- X: " + EnumChatFormatting.AQUA - + formatNumbers(aX) - + EnumChatFormatting.RESET - + " Y: " - + EnumChatFormatting.AQUA - + formatNumbers(aY) - + EnumChatFormatting.RESET - + " Z: " - + EnumChatFormatting.AQUA - + formatNumbers(aZ) - + EnumChatFormatting.RESET - + " D: " - + EnumChatFormatting.AQUA - + aWorld.provider.dimensionId - + EnumChatFormatting.RESET - + " -----"); + "----- X: " + EnumChatFormatting.AQUA + + formatNumbers(aX) + + EnumChatFormatting.RESET + + " Y: " + + EnumChatFormatting.AQUA + + formatNumbers(aY) + + EnumChatFormatting.RESET + + " Z: " + + EnumChatFormatting.AQUA + + formatNumbers(aZ) + + EnumChatFormatting.RESET + + " D: " + + EnumChatFormatting.AQUA + + aWorld.provider.dimensionId + + EnumChatFormatting.RESET + + " -----"); try { if (tTileEntity instanceof IInventory) tList.add( - GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE - + ((IInventory) tTileEntity).getInventoryName() - + EnumChatFormatting.RESET - + GT_Utility.trans("163", " MetaData: ") - + EnumChatFormatting.AQUA - + aWorld.getBlockMetadata(aX, aY, aZ) - + EnumChatFormatting.RESET); + GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE + + ((IInventory) tTileEntity).getInventoryName() + + EnumChatFormatting.RESET + + GT_Utility.trans("163", " MetaData: ") + + EnumChatFormatting.AQUA + + aWorld.getBlockMetadata(aX, aY, aZ) + + EnumChatFormatting.RESET); else tList.add( - GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE - + tBlock.getUnlocalizedName() - + EnumChatFormatting.RESET - + GT_Utility.trans("163", " MetaData: ") - + EnumChatFormatting.AQUA - + aWorld.getBlockMetadata(aX, aY, aZ) - + EnumChatFormatting.RESET); + GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE + + tBlock.getUnlocalizedName() + + EnumChatFormatting.RESET + + GT_Utility.trans("163", " MetaData: ") + + EnumChatFormatting.AQUA + + aWorld.getBlockMetadata(aX, aY, aZ) + + EnumChatFormatting.RESET); tList.add( - GT_Utility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW - + tBlock.getBlockHardness(aWorld, aX, aY, aZ) - + EnumChatFormatting.RESET - + GT_Utility.trans("165", " Blast Resistance: ") - + EnumChatFormatting.YELLOW - + tBlock.getExplosionResistance( - aPlayer, - aWorld, - aX, - aY, - aZ, - aPlayer.posX, - aPlayer.posY, - aPlayer.posZ) - + EnumChatFormatting.RESET); + GT_Utility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW + + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + + EnumChatFormatting.RESET + + GT_Utility.trans("165", " Blast Resistance: ") + + EnumChatFormatting.YELLOW + + tBlock + .getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ) + + EnumChatFormatting.RESET); if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add( - EnumChatFormatting.GOLD + GT_Utility.trans("166", "Is valid Beacon Pyramid Material") - + EnumChatFormatting.RESET); + EnumChatFormatting.GOLD + GT_Utility.trans("166", "Is valid Beacon Pyramid Material") + + EnumChatFormatting.RESET); } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } @@ -3283,23 +3233,23 @@ public class GT_Utility { try { if (tTileEntity instanceof IFluidHandler) { rEUAmount += 500; - final FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity).getTankInfo( - ForgeDirection.getOrientation(aSide)); + final FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity) + .getTankInfo(ForgeDirection.getOrientation(aSide)); if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) { tList.add( - GT_Utility.trans("167", "Tank ") + i - + ": " - + EnumChatFormatting.GREEN - + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) - + EnumChatFormatting.RESET - + " L / " - + EnumChatFormatting.YELLOW - + formatNumbers(tTanks[i].capacity) - + EnumChatFormatting.RESET - + " L " - + EnumChatFormatting.GOLD - + getFluidName(tTanks[i].fluid, true) - + EnumChatFormatting.RESET); + GT_Utility.trans("167", "Tank ") + i + + ": " + + EnumChatFormatting.GREEN + + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) + + EnumChatFormatting.RESET + + " L / " + + EnumChatFormatting.YELLOW + + formatNumbers(tTanks[i].capacity) + + EnumChatFormatting.RESET + + " L " + + EnumChatFormatting.GOLD + + getFluidName(tTanks[i].fluid, true) + + EnumChatFormatting.RESET); } } } catch (Throwable e) { @@ -3317,17 +3267,17 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.reactor.IReactor) { rEUAmount += 500; tList.add( - GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN - + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getHeat()) - + EnumChatFormatting.RESET - + " / " - + EnumChatFormatting.YELLOW - + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()) - + EnumChatFormatting.RESET); + GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN + + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getHeat()) + + EnumChatFormatting.RESET + + " / " + + EnumChatFormatting.YELLOW + + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()) + + EnumChatFormatting.RESET); tList.add( - GT_Utility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW - + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() - + EnumChatFormatting.RESET + GT_Utility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW + + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() + + EnumChatFormatting.RESET /* * + GT_Utility.trans("170"," Base EU Output: ")/* + * ((ic2.api.reactor.IReactor)tTileEntity).getOutput() @@ -3342,9 +3292,9 @@ public class GT_Utility { if (tAlignment != null) { rEUAmount += 100; tList.add( - GT_Utility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN - + tAlignment.getExtendedFacing() - + EnumChatFormatting.RESET); + GT_Utility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN + + tAlignment.getExtendedFacing() + + EnumChatFormatting.RESET); } } } catch (Throwable e) { @@ -3354,22 +3304,20 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.tile.IWrenchable) { rEUAmount += 100; tList.add( - GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN - + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() - + EnumChatFormatting.RESET - + GT_Utility.trans("172", " / Chance: ") - + EnumChatFormatting.YELLOW - + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) - + EnumChatFormatting.RESET - + "%"); + GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN + + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + + EnumChatFormatting.RESET + + GT_Utility.trans("172", " / Chance: ") + + EnumChatFormatting.YELLOW + + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) + + EnumChatFormatting.RESET + + "%"); tList.add( - ((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) - ? EnumChatFormatting.GREEN - + GT_Utility.trans("173", "You can remove this with a Wrench") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED - + GT_Utility.trans("174", "You can NOT remove this with a Wrench") - + EnumChatFormatting.RESET); + ((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) + ? EnumChatFormatting.GREEN + GT_Utility.trans("173", "You can remove this with a Wrench") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + GT_Utility.trans("174", "You can NOT remove this with a Wrench") + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3378,9 +3326,9 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) { rEUAmount += 200; tList.add( - GT_Utility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW - + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss() - + EnumChatFormatting.RESET); + GT_Utility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW + + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss() + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3389,14 +3337,14 @@ public class GT_Utility { if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) { rEUAmount += 200; tList.add( - GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW - + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getStored()) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()) - + EnumChatFormatting.RESET - + " EU"); + GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW + + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getStored()) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()) + + EnumChatFormatting.RESET + + " EU"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3405,8 +3353,8 @@ public class GT_Utility { if (tTileEntity instanceof IUpgradableMachine) { rEUAmount += 500; if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add( - EnumChatFormatting.GREEN + GT_Utility.trans("177", "Has Muffler Upgrade") - + EnumChatFormatting.RESET); + EnumChatFormatting.GREEN + GT_Utility.trans("177", "Has Muffler Upgrade") + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3422,13 +3370,13 @@ public class GT_Utility { rEUAmount += 400; int tValue = 0; if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress())) tList.add( - GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN - + formatNumbers(((IMachineProgress) tTileEntity).getProgress()) - + EnumChatFormatting.RESET - + " / " - + EnumChatFormatting.YELLOW - + formatNumbers(tValue) - + EnumChatFormatting.RESET); + GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN + + formatNumbers(((IMachineProgress) tTileEntity).getProgress()) + + EnumChatFormatting.RESET + + " / " + + EnumChatFormatting.YELLOW + + formatNumbers(tValue) + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3437,7 +3385,7 @@ public class GT_Utility { if (tTileEntity instanceof ICoverable) { rEUAmount += 300; final String tString = ((ICoverable) tTileEntity).getCoverInfoAtSide((byte) aSide) - .getBehaviorDescription(); + .getBehaviorDescription(); if (tString != null && !tString.equals(E)) tList.add(tString); } } catch (Throwable e) { @@ -3445,40 +3393,40 @@ public class GT_Utility { } try { if (tTileEntity instanceof IBasicEnergyContainer - && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { + && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) { tList.add( - GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputVoltage()) - + " (" - + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] - + ") " - + EnumChatFormatting.RESET - + GT_Utility.trans("182", " EU at ") - + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputAmperage()) - + EnumChatFormatting.RESET - + GT_Utility.trans("183", " A")); + GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputVoltage()) + + " (" + + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] + + ") " + + EnumChatFormatting.RESET + + GT_Utility.trans("182", " EU at ") + + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputAmperage()) + + EnumChatFormatting.RESET + + GT_Utility.trans("183", " A")); tList.add( - GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputVoltage()) - + " (" - + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] - + ") " - + EnumChatFormatting.RESET - + GT_Utility.trans("182", " EU at ") - + EnumChatFormatting.RED - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputAmperage()) - + EnumChatFormatting.RESET - + GT_Utility.trans("183", " A")); + GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputVoltage()) + + " (" + + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] + + ") " + + EnumChatFormatting.RESET + + GT_Utility.trans("182", " EU at ") + + EnumChatFormatting.RED + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputAmperage()) + + EnumChatFormatting.RESET + + GT_Utility.trans("183", " A")); tList.add( - GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) - + EnumChatFormatting.RESET - + " EU"); + GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) + + EnumChatFormatting.RESET + + " EU"); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); @@ -3486,16 +3434,16 @@ public class GT_Utility { try { if (tTileEntity instanceof IGregTechTileEntity) { tList.add( - GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE - + ((IGregTechTileEntity) tTileEntity).getOwnerName() - + EnumChatFormatting.RESET); + GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE + + ((IGregTechTileEntity) tTileEntity).getOwnerName() + + EnumChatFormatting.RESET); } } catch (Throwable e) { if (D1) e.printStackTrace(GT_Log.err); } try { if (tTileEntity instanceof IGregTechDeviceInformation - && ((IGregTechDeviceInformation) tTileEntity).isGivingInformation()) { + && ((IGregTechDeviceInformation) tTileEntity).isGivingInformation()) { tList.addAll(Arrays.asList(((IGregTechDeviceInformation) tTileEntity).getInfoData())); } } catch (Throwable e) { @@ -3507,41 +3455,41 @@ public class GT_Utility { if (crop.getScanLevel() < 4) crop.setScanLevel((byte) 4); if (crop.getCrop() != null) { tList.add( - GT_Utility.trans("187", "Type -- Crop-Name: ") + crop.getCrop() - .name() - + GT_Utility.trans("188", " Growth: ") - + crop.getGrowth() - + GT_Utility.trans("189", " Gain: ") - + crop.getGain() - + GT_Utility.trans("190", " Resistance: ") - + crop.getResistance()); + GT_Utility.trans("187", "Type -- Crop-Name: ") + crop.getCrop() + .name() + + GT_Utility.trans("188", " Growth: ") + + crop.getGrowth() + + GT_Utility.trans("189", " Gain: ") + + crop.getGain() + + GT_Utility.trans("190", " Resistance: ") + + crop.getResistance()); } tList.add( - GT_Utility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage() - + GT_Utility.trans("192", " Water: ") - + crop.getHydrationStorage() - + GT_Utility.trans("193", " Weed-Ex: ") - + crop.getWeedExStorage() - + GT_Utility.trans("194", " Scan-Level: ") - + crop.getScanLevel()); + GT_Utility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage() + + GT_Utility.trans("192", " Water: ") + + crop.getHydrationStorage() + + GT_Utility.trans("193", " Weed-Ex: ") + + crop.getWeedExStorage() + + GT_Utility.trans("194", " Scan-Level: ") + + crop.getScanLevel()); tList.add( - GT_Utility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients() - + GT_Utility.trans("196", " Humidity: ") - + crop.getHumidity() - + GT_Utility.trans("197", " Air-Quality: ") - + crop.getAirQuality()); + GT_Utility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients() + + GT_Utility.trans("196", " Humidity: ") + + crop.getHumidity() + + GT_Utility.trans("197", " Air-Quality: ") + + crop.getAirQuality()); if (crop.getCrop() != null) { final StringBuilder tStringB = new StringBuilder(); for (String tAttribute : crop.getCrop() - .attributes()) { + .attributes()) { tStringB.append(", ") - .append(tAttribute); + .append(tAttribute); } final String tString = tStringB.toString(); tList.add(GT_Utility.trans("198", "Attributes:") + tString.replaceFirst(",", E)); tList.add( - GT_Utility.trans("199", "Discovered by: ") + crop.getCrop() - .discoveredBy()); + GT_Utility.trans("199", "Discovered by: ") + crop.getCrop() + .discoveredBy()); } } } catch (Throwable e) { @@ -3566,33 +3514,33 @@ public class GT_Utility { if (aPlayer.capabilities.isCreativeMode) { final FluidStack tFluid = undergroundOilReadInformation(currentChunk); // -# to only read if (tFluid != null) tList.add( - EnumChatFormatting.GOLD + tFluid.getLocalizedName() - + EnumChatFormatting.RESET - + ": " - + EnumChatFormatting.YELLOW - + formatNumbers(tFluid.amount) - + EnumChatFormatting.RESET - + " L"); + EnumChatFormatting.GOLD + tFluid.getLocalizedName() + + EnumChatFormatting.RESET + + ": " + + EnumChatFormatting.YELLOW + + formatNumbers(tFluid.amount) + + EnumChatFormatting.RESET + + " L"); else tList.add( - EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing") - + EnumChatFormatting.RESET - + ": " - + EnumChatFormatting.YELLOW - + '0' - + EnumChatFormatting.RESET - + " L"); + EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing") + + EnumChatFormatting.RESET + + ": " + + EnumChatFormatting.YELLOW + + '0' + + EnumChatFormatting.RESET + + " L"); } // if(aPlayer.capabilities.isCreativeMode){ if (GT_Pollution.hasPollution(currentChunk)) { tList.add( - GT_Utility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED - + formatNumbers(GT_Pollution.getPollution(currentChunk)) - + EnumChatFormatting.RESET - + GT_Utility.trans("203", " gibbl")); + GT_Utility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED + + formatNumbers(GT_Pollution.getPollution(currentChunk)) + + EnumChatFormatting.RESET + + GT_Utility.trans("203", " gibbl")); } else { tList.add( - EnumChatFormatting.GREEN + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!") - + EnumChatFormatting.RESET); + EnumChatFormatting.GREEN + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!") + + EnumChatFormatting.RESET); } try { @@ -3606,19 +3554,19 @@ public class GT_Utility { } final BlockScanningEvent tEvent = new BlockScanningEvent( - aWorld, - aPlayer, - aX, - aY, - aZ, - (byte) aSide, - aScanLevel, - tBlock, - tTileEntity, - tList, - aClickX, - aClickY, - aClickZ); + aWorld, + aPlayer, + aX, + aY, + aZ, + (byte) aSide, + aScanLevel, + tBlock, + tTileEntity, + tList, + aClickX, + aClickY, + aClickZ); tEvent.mEUCost = rEUAmount; MinecraftForge.EVENT_BUS.post(tEvent); if (!tEvent.isCanceled()) aList.addAll(tList); @@ -3746,9 +3694,9 @@ public class GT_Utility { * there's no creative or 111 stack. */ public static boolean consumeItems(EntityPlayer player, ItemStack stack, gregtech.api.enums.Materials mat, - int count) { + int count) { if (stack != null && GT_OreDictUnificator.getItemData(stack).mMaterial.mMaterial == mat - && stack.stackSize >= count) { + && stack.stackSize >= count) { if ((!player.capabilities.isCreativeMode) && (stack.stackSize != 111)) stack.stackSize -= count; return true; } @@ -3776,14 +3724,14 @@ public class GT_Utility { public static float getBlockHardnessAt(World aWorld, int aX, int aY, int aZ) { return aWorld.getBlock(aX, aY, aZ) - .getBlockHardness(aWorld, aX, aY, aZ); + .getBlockHardness(aWorld, aX, aY, aZ); } public static FakePlayer getFakePlayer(IGregTechTileEntity aBaseMetaTileEntity) { if (aBaseMetaTileEntity.getWorld() instanceof WorldServer) { return FakePlayerFactory.get( - (WorldServer) aBaseMetaTileEntity.getWorld(), - new GameProfile(aBaseMetaTileEntity.getOwnerUuid(), aBaseMetaTileEntity.getOwnerName())); + (WorldServer) aBaseMetaTileEntity.getWorld(), + new GameProfile(aBaseMetaTileEntity.getOwnerUuid(), aBaseMetaTileEntity.getOwnerName())); } return null; } @@ -3792,13 +3740,13 @@ public class GT_Utility { if (aPlayer == null) return false; World aWorld = aPlayer.worldObj; BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( - aX, - aY, - aZ, - aWorld, - aWorld.getBlock(aX, aY, aZ), - aWorld.getBlockMetadata(aX, aY, aZ), - aPlayer); + aX, + aY, + aZ, + aWorld, + aWorld.getBlock(aX, aY, aZ), + aWorld.getBlockMetadata(aX, aY, aZ), + aPlayer); MinecraftForge.EVENT_BUS.post(event); if (!event.isCanceled()) { if (!isSimulate) return aWorld.setBlockToAir(aX, aY, aZ); @@ -3808,13 +3756,11 @@ public class GT_Utility { } public static boolean setBlockByFakePlayer(FakePlayer aPlayer, int aX, int aY, int aZ, Block aBlock, int aMeta, - boolean isSimulate) { + boolean isSimulate) { if (aPlayer == null) return false; World aWorld = aPlayer.worldObj; - BlockEvent.PlaceEvent event = ForgeEventFactory.onPlayerBlockPlace( - aPlayer, - new BlockSnapshot(aWorld, aX, aY, aZ, aBlock, aMeta), - ForgeDirection.UNKNOWN); + BlockEvent.PlaceEvent event = ForgeEventFactory + .onPlayerBlockPlace(aPlayer, new BlockSnapshot(aWorld, aX, aY, aZ, aBlock, aMeta), ForgeDirection.UNKNOWN); if (!event.isCanceled()) { if (!isSimulate) return aWorld.setBlock(aX, aY, aZ, aBlock, aMeta, 3); return true; @@ -3842,8 +3788,7 @@ public class GT_Utility { for (String tKey : aNBT.func_150296_c()) { NBTBase tValue = aNBT.getTag(tKey); if (tValue == null || (tValue instanceof NBTPrimitive && ((NBTPrimitive) tValue).func_150291_c() == 0) - || (tValue instanceof NBTTagString - && isStringInvalid(((NBTTagString) tValue).func_150285_a_()))) + || (tValue instanceof NBTTagString && isStringInvalid(((NBTTagString) tValue).func_150285_a_()))) tTagsToRemove.add(tKey); } for (String tKey : tTagsToRemove) aNBT.removeTag(tKey); @@ -3912,31 +3857,31 @@ public class GT_Utility { } public static void setProspectionData(ItemStack aStack, int aX, int aY, int aZ, int aDim, FluidStack aFluid, - String... aOres) { + String... aOres) { NBTTagCompound tNBT = getNBT(aStack); StringBuilder tData = new StringBuilder(aX + "," + aY + "," + aZ + "," + aDim + ","); if (aFluid != null) tData.append(aFluid.amount) - .append(",") - .append(aFluid.getLocalizedName()) - .append(","); // TODO - // CHECK - // IF - // THAT - // /5000 - // is - // needed - // (Not - // needed) + .append(",") + .append(aFluid.getLocalizedName()) + .append(","); // TODO + // CHECK + // IF + // THAT + // /5000 + // is + // needed + // (Not + // needed) for (String tString : aOres) { tData.append(tString) - .append(","); + .append(","); } tNBT.setString("prospection", tData.toString()); setNBT(aStack, tNBT); } public static void setAdvancedProspectionData(byte aTier, ItemStack aStack, int aX, short aY, int aZ, int aDim, - ArrayList aOils, ArrayList aOres, int aRadius) { + ArrayList aOils, ArrayList aOres, int aRadius) { setBookTitle(aStack, "Raw Prospection Data"); @@ -3959,9 +3904,9 @@ public class GT_Utility { tNBT.setString("prospection_oils", joinListToString(tOilsTransformed)); String tOilsPosStr = "X: " + Math.floorDiv(aX, 16 * 8) * 16 * 8 - + " Z: " - + Math.floorDiv(aZ, 16 * 8) * 16 * 8 - + "\n"; + + " Z: " + + Math.floorDiv(aZ, 16 * 8) * 16 * 8 + + "\n"; int xOff = aX - Math.floorDiv(aX, 16 * 8) * 16 * 8; xOff = xOff / 16; int xOffRemain = 7 - xOff; @@ -3987,9 +3932,9 @@ public class GT_Utility { tOilsPosStr = tOilsPosStr.concat("--------\n"); } tOilsPosStr = tOilsPosStr.concat( - " X: " + (Math.floorDiv(aX, 16 * 8) + 1) * 16 * 8 - + " Z: " - + (Math.floorDiv(aZ, 16 * 8) + 1) * 16 * 8); // +1 oilfied to find bottomright of [5] + " X: " + (Math.floorDiv(aX, 16 * 8) + 1) * 16 * 8 + + " Z: " + + (Math.floorDiv(aZ, 16 * 8) + 1) * 16 * 8); // +1 oilfied to find bottomright of [5] tNBT.setString("prospection_oils_pos", tOilsPosStr); @@ -4007,35 +3952,35 @@ public class GT_Utility { String[] tDataArray = tData.split(","); if (tDataArray.length > 6) { tNBT.setString( - "author", - " Dim: " + tDataArray[3] - + "X: " - + tDataArray[0] - + " Y: " - + tDataArray[1] - + " Z: " - + tDataArray[2]); + "author", + " Dim: " + tDataArray[3] + + "X: " + + tDataArray[0] + + " Y: " + + tDataArray[1] + + " Z: " + + tDataArray[2]); NBTTagList tNBTList = new NBTTagList(); StringBuilder tOres = new StringBuilder(" Prospected Ores: "); for (int i = 6; tDataArray.length > i; i++) { tOres.append(tDataArray[i]) - .append(" "); + .append(" "); } tNBTList.appendTag( - new NBTTagString( - "Tier " + tTier - + " Prospecting Data From: X" - + tDataArray[0] - + " Z:" - + tDataArray[2] - + " Dim:" - + tDataArray[3] - + " Produces " - + tDataArray[4] - + "L " - + tDataArray[5] - + " " - + tOres)); + new NBTTagString( + "Tier " + tTier + + " Prospecting Data From: X" + + tDataArray[0] + + " Z:" + + tDataArray[2] + + " Dim:" + + tDataArray[3] + + " Produces " + + tDataArray[4] + + "L " + + tDataArray[5] + + " " + + tOres)); tNBT.setTag("pages", tNBTList); } } else { // advanced prospection data @@ -4052,15 +3997,15 @@ public class GT_Utility { NBTTagList tNBTList = new NBTTagList(); String tPageText = "Prospector report\n" + tPos - + "\n\n" - + "Oils: " - + (tOils != null ? tOils.length : 0) - + "\n\n" - + "Ores within " - + tRadius - + " blocks\n\n" - + "Location is center of orevein\n\n" - + "Check NEI to confirm orevein type"; + + "\n\n" + + "Oils: " + + (tOils != null ? tOils.length : 0) + + "\n\n" + + "Ores within " + + tRadius + + " blocks\n\n" + + "Location is center of orevein\n\n" + + "Check NEI to confirm orevein type"; tNBTList.appendTag(new NBTTagString(tPageText)); if (tOres != null) fillBookWithList(tNBTList, "Ores Found %s\n\n", "\n", 7, tOres); @@ -4068,16 +4013,16 @@ public class GT_Utility { if (tOils != null) fillBookWithList(tNBTList, "Oils%s\n\n", "\n", 9, tOils); tPageText = """ - Oil notes + Oil notes - Prospects from NW to SE 576 chunks(9 8x8 oilfields) - around and gives min-max amount + Prospects from NW to SE 576 chunks(9 8x8 oilfields) + around and gives min-max amount - [1][2][3] - [4][5][6] - [7][8][9] + [1][2][3] + [4][5][6] + [7][8][9] - [5] - Prospector in this 8x8 area"""; + [5] - Prospector in this 8x8 area"""; tNBTList.appendTag(new NBTTagString(tPageText)); tPageText = "Corners of [5] are \n" + tOilsPosStr + "\n" + "P - Prospector in 8x8 field"; @@ -4090,7 +4035,7 @@ public class GT_Utility { } public static void fillBookWithList(NBTTagList aBook, String aPageHeader, String aListDelimiter, - int aItemsPerPage, String[] list) { + int aItemsPerPage, String[] list) { String aPageFormatter = " %d/%d"; int tTotalPages = list.length / aItemsPerPage + (list.length % aItemsPerPage > 0 ? 1 : 0); int tPage = 0; @@ -4099,7 +4044,7 @@ public class GT_Utility { tPageText = new StringBuilder(); for (int i = tPage * aItemsPerPage; i < (tPage + 1) * aItemsPerPage && i < list.length; i += 1) tPageText.append((tPageText.length() == 0) ? "" : aListDelimiter) - .append(list[i]); + .append(list[i]); if (tPageText.length() > 0) { String tPageCounter = tTotalPages > 1 ? String.format(aPageFormatter, tPage + 1, tTotalPages) : ""; @@ -4153,9 +4098,9 @@ public class GT_Utility { try { for (int i = 0; i < nbttaglist.tagCount(); ++i) { short short1 = nbttaglist.getCompoundTagAt(i) - .getShort("id"); + .getShort("id"); short short2 = nbttaglist.getCompoundTagAt(i) - .getShort("lvl"); + .getShort("lvl"); if (Enchantment.enchantmentsList[short1] != null) aBullshitModifier.calculateModifier(Enchantment.enchantmentsList[short1], short2); } @@ -4223,7 +4168,7 @@ public class GT_Utility { public static String toSubscript(long no) { char[] chars = Long.toString(no) - .toCharArray(); + .toCharArray(); for (int i = 0; i < chars.length; i++) { chars[i] += 8272; } @@ -4232,24 +4177,24 @@ public class GT_Utility { public static boolean isPartOfMaterials(ItemStack aStack, Materials aMaterials) { return GT_OreDictUnificator.getAssociation(aStack) != null - && GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials); + && GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials); } public static boolean isPartOfOrePrefix(ItemStack aStack, OrePrefixes aPrefix) { return GT_OreDictUnificator.getAssociation(aStack) != null - && GT_OreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix); + && GT_OreDictUnificator.getAssociation(aStack).mPrefix.equals(aPrefix); } public static final ImmutableSet ORE_BLOCK_CLASSES = ImmutableSet.of( - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores", - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres", - "gtPlusPlus.core.block.base.BlockBaseOre"); + "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores", + "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres", + "gtPlusPlus.core.block.base.BlockBaseOre"); public static boolean isOre(Block aBlock, int aMeta) { return (aBlock instanceof GT_Block_Ores_Abstract) || isOre(new ItemStack(aBlock, 1, aMeta)) - || ORE_BLOCK_CLASSES.contains( - aBlock.getClass() - .getName()); + || ORE_BLOCK_CLASSES.contains( + aBlock.getClass() + .getName()); } public static boolean isOre(ItemStack aStack) { @@ -4259,7 +4204,7 @@ public class GT_Utility { } for (int id : OreDictionary.getOreIDs(aStack)) { if (OreDictionary.getOreName(id) - .startsWith("ore")) { + .startsWith("ore")) { sOreTable.put(tItem, true); return true; } @@ -4277,8 +4222,8 @@ public class GT_Utility { // We take the modulus of the metadata by 16000 because that is the magic number to convert small ores to // regular ores. // See: GT_TileEntity_Ores.java - ItemData association = GT_OreDictUnificator.getAssociation( - new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000)); + ItemData association = GT_OreDictUnificator + .getAssociation(new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000)); if (association != null) { Supplier supplier = sOreToCobble.get(association.mPrefix); if (supplier != null) { @@ -4303,11 +4248,11 @@ public class GT_Utility { ItemStack stack = GT_OreDictUnificator.get(o, 1); if (stack == null) { Optional oStack = OreDictionary.getOres((String) o) - .stream() - .findAny(); + .stream() + .findAny(); if (oStack.isPresent()) { ItemStack copy = oStack.get() - .copy(); + .copy(); inputs.add(copy); } } else { @@ -4322,17 +4267,17 @@ public class GT_Utility { inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool); return Optional.of( - new GT_Recipe( - false, - new ItemStack[] { output }, - inputs.toArray(new ItemStack[0]), - null, - null, - null, - null, - 300, - 30, - 0)); + new GT_Recipe( + false, + new ItemStack[] { output }, + inputs.toArray(new ItemStack[0]), + null, + null, + null, + null, + 300, + 30, + 0)); } public static Optional reverseShapedRecipe(ItemStack output, Object... aRecipe) { @@ -4372,11 +4317,11 @@ public class GT_Utility { ItemStack stack = GT_OreDictUnificator.get(dictName, null, amount, false, true); if (stack == null) { Optional oStack = OreDictionary.getOres(dictName) - .stream() - .findAny(); + .stream() + .findAny(); if (oStack.isPresent()) { ItemStack copy = oStack.get() - .copy(); + .copy(); copy.stackSize = amount; inputs.add(copy); } @@ -4394,17 +4339,17 @@ public class GT_Utility { inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool); return Optional.of( - new GT_Recipe( - false, - new ItemStack[] { output }, - inputs.toArray(new ItemStack[0]), - null, - null, - null, - null, - 300, - 30, - 0)); + new GT_Recipe( + false, + new ItemStack[] { output }, + inputs.toArray(new ItemStack[0]), + null, + null, + null, + null, + 300, + 30, + 0)); } /** @@ -4421,8 +4366,8 @@ public class GT_Utility { public static long getNonnullElementCount(Object[] tArray) { return Arrays.stream(tArray) - .filter(Objects::nonNull) - .count(); + .filter(Objects::nonNull) + .count(); } public static int clamp(int val, int lo, int hi) { @@ -4456,8 +4401,8 @@ public class GT_Utility { public static int persistentHash(FluidStack aStack, boolean aUseStackSize, boolean aUseNBT) { if (aStack == null) return 0; int base = Objects.hashCode( - aStack.getFluid() - .getName()); + aStack.getFluid() + .getName()); if (aUseStackSize) base = base * 31 + aStack.amount; if (aUseNBT) base = base * 31 + Objects.hashCode(aStack.tag); @@ -4503,7 +4448,7 @@ public class GT_Utility { public static boolean isAnyIntegratedCircuit(ItemStack itemStack) { if (itemStack == null) return false; return itemStack.getItem() == ItemList.Circuit_Integrated.getItem() && 0 <= itemStack.getItemDamage() - && itemStack.getItemDamage() < 25; + && itemStack.getItemDamage() < 25; } public static byte convertRatioToRedstone(long used, long max, int threshold, boolean inverted) { @@ -4539,7 +4484,7 @@ public class GT_Utility { public static Stream streamCompounds(NBTTagList list) { if (list == null) return Stream.empty(); return IntStream.range(0, list.tagCount()) - .mapToObj(list::getCompoundTagAt); + .mapToObj(list::getCompoundTagAt); } public static boolean equals(ItemStack[] a, ItemStack[] b) { @@ -4557,13 +4502,13 @@ public class GT_Utility { * Guava ImmutableMap variant of Collectors.toMap. Optimized for serial streams. */ public static Collector> toImmutableMapSerial( - Function keyMapper, Function valueMapper) { + Function keyMapper, Function valueMapper) { // petty type inference cannot work out the correct type parameter return Collector., ImmutableMap>of( - ImmutableMap::builder, - (b, t) -> b.put(keyMapper.apply(t), valueMapper.apply(t)), - (b1, b2) -> b1.putAll(b2.build()), - ImmutableMap.Builder::build); + ImmutableMap::builder, + (b, t) -> b.put(keyMapper.apply(t), valueMapper.apply(t)), + (b1, b2) -> b1.putAll(b2.build()), + ImmutableMap.Builder::build); } public static boolean isArrayEmptyOrNull(Object[] arr) { @@ -4593,8 +4538,8 @@ public class GT_Utility { for (Collection list : lists) { if (list == null || list.isEmpty()) { colls1 = lists.stream() - .filter(c -> c != null && !c.isEmpty()) - .collect(Collectors.toList()); + .filter(c -> c != null && !c.isEmpty()) + .collect(Collectors.toList()); break; } } @@ -4610,8 +4555,8 @@ public class GT_Utility { @Override public Iterator iterator() { return colls.stream() - .flatMap(Collection::stream) - .iterator(); + .flatMap(Collection::stream) + .iterator(); } @Override @@ -4625,9 +4570,9 @@ public class GT_Utility { public static AutoValue_GT_Utility_ItemId create(NBTTagCompound tag) { return new AutoValue_GT_Utility_ItemId( - Item.getItemById(tag.getShort("item")), - tag.getShort("meta"), - tag.hasKey("tag", Constants.NBT.TAG_COMPOUND) ? tag.getCompoundTag("tag") : null); + Item.getItemById(tag.getShort("item")), + tag.getShort("meta"), + tag.hasKey("tag", Constants.NBT.TAG_COMPOUND) ? tag.getCompoundTag("tag") : null); } /** This method copies NBT, as it is mutable. */ @@ -4643,9 +4588,9 @@ public class GT_Utility { /** This method does not copy NBT in order to save time. Make sure not to mutate it! */ public static ItemId createNoCopy(ItemStack itemStack) { return new AutoValue_GT_Utility_ItemId( - itemStack.getItem(), - itemStack.getItemDamage(), - itemStack.getTagCompound()); + itemStack.getItem(), + itemStack.getItemDamage(), + itemStack.getTagCompound()); } protected abstract Item item(); diff --git a/src/main/java/gregtech/api/util/GT_UtilityClient.java b/src/main/java/gregtech/api/util/GT_UtilityClient.java index 2b4039a4c2..cf8ff6df86 100644 --- a/src/main/java/gregtech/api/util/GT_UtilityClient.java +++ b/src/main/java/gregtech/api/util/GT_UtilityClient.java @@ -14,10 +14,8 @@ import cpw.mods.fml.relauncher.ReflectionHelper; public class GT_UtilityClient { - private static final Field isDrawingField = ReflectionHelper.findField( - Tessellator.class, - "isDrawing", - "field_78415_z"); + private static final Field isDrawingField = ReflectionHelper + .findField(Tessellator.class, "isDrawing", "field_78415_z"); public static boolean isDrawing(Tessellator tess) { try { @@ -32,13 +30,12 @@ public class GT_UtilityClient { public static List getTooltip(ItemStack aStack, boolean aGuiStyle) { try { List tooltip = aStack.getTooltip( - Minecraft.getMinecraft().thePlayer, - Minecraft.getMinecraft().gameSettings.advancedItemTooltips); + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips); if (aGuiStyle) { tooltip.set( - 0, - (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor - + tooltip.get(0)); + 0, + (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor + tooltip.get(0)); for (int i = 1; i < tooltip.size(); i++) { tooltip.set(i, EnumChatFormatting.GRAY + tooltip.get(i)); } @@ -47,8 +44,8 @@ public class GT_UtilityClient { } catch (RuntimeException e) { // Collections.singletonList() can not be added to. we don't want that if (aGuiStyle) return Lists.newArrayList( - (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor - + aStack.getDisplayName()); + (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor + + aStack.getDisplayName()); return Lists.newArrayList(aStack.getDisplayName()); } } diff --git a/src/main/java/gregtech/api/util/IGT_HatchAdder.java b/src/main/java/gregtech/api/util/IGT_HatchAdder.java index dee0ac36ad..21796f172e 100644 --- a/src/main/java/gregtech/api/util/IGT_HatchAdder.java +++ b/src/main/java/gregtech/api/util/IGT_HatchAdder.java @@ -23,6 +23,6 @@ public interface IGT_HatchAdder { default IGT_HatchAdder orElse(IGT_HatchAdder fallback) { return (t, iGregTechTileEntity, aShort) -> IGT_HatchAdder.this.apply(t, iGregTechTileEntity, aShort) - || fallback.apply(t, iGregTechTileEntity, aShort); + || fallback.apply(t, iGregTechTileEntity, aShort); } } diff --git a/src/main/java/gregtech/api/util/LightingHelper.java b/src/main/java/gregtech/api/util/LightingHelper.java index 986ac9d3aa..ad4e00fb7a 100644 --- a/src/main/java/gregtech/api/util/LightingHelper.java +++ b/src/main/java/gregtech/api/util/LightingHelper.java @@ -228,11 +228,11 @@ public class LightingHelper { } else { renderBlocks.colorRedTopLeft = renderBlocks.colorRedBottomLeft = renderBlocks.colorRedBottomRight = renderBlocks.colorRedTopRight = rgb[0] - * lightness; + * lightness; renderBlocks.colorGreenTopLeft = renderBlocks.colorGreenBottomLeft = renderBlocks.colorGreenBottomRight = renderBlocks.colorGreenTopRight = rgb[1] - * lightness; + * lightness; renderBlocks.colorBlueTopLeft = renderBlocks.colorBlueBottomLeft = renderBlocks.colorBlueBottomRight = renderBlocks.colorBlueTopRight = rgb[2] - * lightness; + * lightness; renderBlocks.colorRedTopLeft *= aoTopLeft; renderBlocks.colorGreenTopLeft *= aoTopLeft; @@ -345,184 +345,160 @@ public class LightingHelper { float ratio = (float) (1.0F - renderBlocks.renderMinX); float aoLightValue = renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z); - renderBlocks.aoBrightnessXZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z - 1); - renderBlocks.aoBrightnessXZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z + 1); - renderBlocks.aoBrightnessXYNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z); - renderBlocks.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z - 1); - renderBlocks.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z + 1); - renderBlocks.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z - 1); - renderBlocks.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z); + renderBlocks.aoBrightnessXZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1); + renderBlocks.aoBrightnessXZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1); + renderBlocks.aoBrightnessXYNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z); + renderBlocks.aoBrightnessXYZNNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1); + renderBlocks.aoBrightnessXYZNNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1); + renderBlocks.aoBrightnessXYZNPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1); + renderBlocks.aoBrightnessXYZNPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1); renderBlocks.aoLightValueScratchXYNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + ratio); int brightnessMixedXYZNPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNN, - renderBlocks.aoBrightnessXYZNPN, - renderBlocks.aoBrightnessXYNP, - mixedBrightness); + renderBlocks.aoBrightnessXZNN, + renderBlocks.aoBrightnessXYZNPN, + renderBlocks.aoBrightnessXYNP, + mixedBrightness); int brightnessMixedXYZNNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNN, - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessXZNN, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNN, + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessXZNN, + mixedBrightness); int brightnessMixedXYZNNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessXYZNNP, - renderBlocks.aoBrightnessXZNP, - mixedBrightness); + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessXYZNNP, + renderBlocks.aoBrightnessXZNP, + mixedBrightness); int brightnessMixedXYZNPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNP, - renderBlocks.aoBrightnessXYNP, - renderBlocks.aoBrightnessXYZNPP, - mixedBrightness); + renderBlocks.aoBrightnessXZNP, + renderBlocks.aoBrightnessXYNP, + renderBlocks.aoBrightnessXYZNPP, + mixedBrightness); float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN + aoLightValue - + renderBlocks.aoLightValueScratchXYZNPN - + renderBlocks.aoLightValueScratchXYNP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZNPN + + renderBlocks.aoLightValueScratchXYNP) / 4.0F; float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN + renderBlocks.aoLightValueScratchXYNN - + renderBlocks.aoLightValueScratchXZNN - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchXZNN + + aoLightValue) / 4.0F; float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYNN + renderBlocks.aoLightValueScratchXYZNNP - + aoLightValue - + renderBlocks.aoLightValueScratchXZNP) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchXZNP) / 4.0F; float aoMixedXYZNPP = (aoLightValue + renderBlocks.aoLightValueScratchXZNP - + renderBlocks.aoLightValueScratchXYNP - + renderBlocks.aoLightValueScratchXYZNPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYNP + + renderBlocks.aoLightValueScratchXYZNPP) / 4.0F; aoTopLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ - + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); + + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); aoBottomLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * renderBlocks.renderMinZ - + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); + + aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); aoBottomRight = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * renderBlocks.renderMinZ - + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); + + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); aoTopRight = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * renderBlocks.renderMaxZ - + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); + + aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMaxY * renderBlocks.renderMaxZ, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMaxY * renderBlocks.renderMaxZ, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMaxY * renderBlocks.renderMinZ, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMaxY * renderBlocks.renderMinZ, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMinY * renderBlocks.renderMinZ, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMinY * renderBlocks.renderMinZ, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNPN, - brightnessMixedXYZNNN, - brightnessMixedXYZNNP, - renderBlocks.renderMinY * renderBlocks.renderMaxZ, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); + brightnessMixedXYZNPP, + brightnessMixedXYZNPN, + brightnessMixedXYZNNN, + brightnessMixedXYZNNP, + renderBlocks.renderMinY * renderBlocks.renderMaxZ, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ); } return this; @@ -554,184 +530,160 @@ public class LightingHelper { brightness = mixedBrightness; float aoLightValue = renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z); - renderBlocks.aoBrightnessXZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z - 1); - renderBlocks.aoBrightnessXZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y, - z + 1); - renderBlocks.aoBrightnessXYPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z); - renderBlocks.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z - 1); - renderBlocks.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y - 1, - z + 1); - renderBlocks.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z - 1); - renderBlocks.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - xOffset, - y + 1, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z); + renderBlocks.aoBrightnessXZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1); + renderBlocks.aoBrightnessXZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1); + renderBlocks.aoBrightnessXYPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z); + renderBlocks.aoBrightnessXYZPNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1); + renderBlocks.aoBrightnessXYZPNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1); + renderBlocks.aoBrightnessXYZPPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1); + renderBlocks.aoBrightnessXYZPPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1); renderBlocks.aoLightValueScratchXYPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); renderBlocks.aoLightValueScratchXYZPPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxX); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxX); int brightnessMixedXYZPPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZPP, - renderBlocks.aoBrightnessXYPP, - renderBlocks.aoBrightnessXYZPPP, - mixedBrightness); + renderBlocks.aoBrightnessXZPP, + renderBlocks.aoBrightnessXYPP, + renderBlocks.aoBrightnessXYZPPP, + mixedBrightness); int brightnessMixedXYZPNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYPN, - renderBlocks.aoBrightnessXYZPNP, - renderBlocks.aoBrightnessXZPP, - mixedBrightness); + renderBlocks.aoBrightnessXYPN, + renderBlocks.aoBrightnessXYZPNP, + renderBlocks.aoBrightnessXZPP, + mixedBrightness); int brightnessMixedXYZPNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZPNN, - renderBlocks.aoBrightnessXYPN, - renderBlocks.aoBrightnessXZPN, - mixedBrightness); + renderBlocks.aoBrightnessXYZPNN, + renderBlocks.aoBrightnessXYPN, + renderBlocks.aoBrightnessXZPN, + mixedBrightness); int brightnessMixedXYZPPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZPN, - renderBlocks.aoBrightnessXYZPPN, - renderBlocks.aoBrightnessXYPP, - mixedBrightness); + renderBlocks.aoBrightnessXZPN, + renderBlocks.aoBrightnessXYZPPN, + renderBlocks.aoBrightnessXYPP, + mixedBrightness); float aoMixedXYZPPP = (aoLightValue + renderBlocks.aoLightValueScratchXZPP - + renderBlocks.aoLightValueScratchXYPP - + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYPP + + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchXYPN + renderBlocks.aoLightValueScratchXYZPNP - + aoLightValue - + renderBlocks.aoLightValueScratchXZPP) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchXZPP) / 4.0F; float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchXYZPNN + renderBlocks.aoLightValueScratchXYPN - + renderBlocks.aoLightValueScratchXZPN - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchXZPN + + aoLightValue) / 4.0F; float aoMixedXYZPPN = (renderBlocks.aoLightValueScratchXZPN + aoLightValue - + renderBlocks.aoLightValueScratchXYZPPN - + renderBlocks.aoLightValueScratchXYPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPPN + + renderBlocks.aoLightValueScratchXYPP) / 4.0F; aoTopLeft = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxZ); aoBottomLeft = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinZ); aoBottomRight = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ) + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinZ); aoTopRight = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ); + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ) + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMinY * renderBlocks.renderMaxZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMinY * renderBlocks.renderMaxZ); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMinY * renderBlocks.renderMinZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinZ, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMinY * renderBlocks.renderMinZ); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), - renderBlocks.renderMaxY * renderBlocks.renderMinZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinZ, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinZ), + renderBlocks.renderMaxY * renderBlocks.renderMinZ); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZPPN, - brightnessMixedXYZPPP, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), - renderBlocks.renderMaxY * renderBlocks.renderMaxZ); + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZPPN, + brightnessMixedXYZPPP, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxZ, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ), + renderBlocks.renderMaxY * renderBlocks.renderMaxZ); } return this; @@ -764,184 +716,160 @@ public class LightingHelper { float ratio = (float) (1.0F - renderBlocks.renderMinY); float aoLightValue = renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z); - renderBlocks.aoBrightnessYZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z - 1); - renderBlocks.aoBrightnessYZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z); - renderBlocks.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z); + renderBlocks.aoBrightnessYZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1); + renderBlocks.aoBrightnessYZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1); + renderBlocks.aoBrightnessXYPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z); + renderBlocks.aoBrightnessXYZNNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZNNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1); + renderBlocks.aoBrightnessXYZPNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZPNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1); renderBlocks.aoLightValueScratchXYNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + ratio); int brightnessMixedXYZPNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNP, - renderBlocks.aoBrightnessXYZPNP, - renderBlocks.aoBrightnessXYPN, - mixedBrightness); + renderBlocks.aoBrightnessYZNP, + renderBlocks.aoBrightnessXYZPNP, + renderBlocks.aoBrightnessXYPN, + mixedBrightness); int brightnessMixedXYZPNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNN, - renderBlocks.aoBrightnessXYPN, - renderBlocks.aoBrightnessXYZPNN, - mixedBrightness); + renderBlocks.aoBrightnessYZNN, + renderBlocks.aoBrightnessXYPN, + renderBlocks.aoBrightnessXYZPNN, + mixedBrightness); int brightnessMixedXYZNNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessXYZNNN, - renderBlocks.aoBrightnessYZNN, - mixedBrightness); + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessXYZNNN, + renderBlocks.aoBrightnessYZNN, + mixedBrightness); int brightnessMixedXYZNNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNP, - renderBlocks.aoBrightnessXYNN, - renderBlocks.aoBrightnessYZNP, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNP, + renderBlocks.aoBrightnessXYNN, + renderBlocks.aoBrightnessYZNP, + mixedBrightness); float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP + aoLightValue - + renderBlocks.aoLightValueScratchXYZPNP - + renderBlocks.aoLightValueScratchXYPN) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPNP + + renderBlocks.aoLightValueScratchXYPN) / 4.0F; float aoMixedXYZPNN = (aoLightValue + renderBlocks.aoLightValueScratchYZNN - + renderBlocks.aoLightValueScratchXYPN - + renderBlocks.aoLightValueScratchXYZPNN) / 4.0F; + + renderBlocks.aoLightValueScratchXYPN + + renderBlocks.aoLightValueScratchXYZPNN) / 4.0F; float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYNN + renderBlocks.aoLightValueScratchXYZNNN - + aoLightValue - + renderBlocks.aoLightValueScratchYZNN) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZNN) / 4.0F; float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP + renderBlocks.aoLightValueScratchXYNN - + renderBlocks.aoLightValueScratchYZNP - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZNP + + aoLightValue) / 4.0F; aoTopLeft = (float) (aoMixedXYZNNP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); aoBottomLeft = (float) (aoMixedXYZNNP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); aoBottomRight = (float) (aoMixedXYZNNP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPNP * renderBlocks.renderMinZ * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); aoTopRight = (float) (aoMixedXYZNNP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMaxZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMaxZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMinZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMinZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMinZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMinZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMaxZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMaxZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); } return this; @@ -973,184 +901,160 @@ public class LightingHelper { brightness = mixedBrightness; float aoLightValue = renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXYNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z); - renderBlocks.aoBrightnessXYPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z); - renderBlocks.aoBrightnessYZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z - 1); - renderBlocks.aoBrightnessYZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z - 1); - renderBlocks.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - yOffset, - z + 1); - renderBlocks.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - yOffset, - z + 1); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXYNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z); + renderBlocks.aoBrightnessXYPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z); + renderBlocks.aoBrightnessYZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1); + renderBlocks.aoBrightnessYZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1); + renderBlocks.aoBrightnessXYZNPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZPPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1); + renderBlocks.aoBrightnessXYZNPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1); + renderBlocks.aoBrightnessXYZPPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1); renderBlocks.aoLightValueScratchXYNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchYZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchYZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZNPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZPPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZNPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); renderBlocks.aoLightValueScratchXYZPPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxY); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxY); int brightnessMixedXYZPPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPP, - renderBlocks.aoBrightnessXYZPPP, - renderBlocks.aoBrightnessXYPP, - mixedBrightness); + renderBlocks.aoBrightnessYZPP, + renderBlocks.aoBrightnessXYZPPP, + renderBlocks.aoBrightnessXYPP, + mixedBrightness); int brightnessMixedXYZPPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPN, - renderBlocks.aoBrightnessXYPP, - renderBlocks.aoBrightnessXYZPPN, - mixedBrightness); + renderBlocks.aoBrightnessYZPN, + renderBlocks.aoBrightnessXYPP, + renderBlocks.aoBrightnessXYZPPN, + mixedBrightness); int brightnessMixedXYZNPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYNP, - renderBlocks.aoBrightnessXYZNPN, - renderBlocks.aoBrightnessYZPN, - mixedBrightness); + renderBlocks.aoBrightnessXYNP, + renderBlocks.aoBrightnessXYZNPN, + renderBlocks.aoBrightnessYZPN, + mixedBrightness); int brightnessMixedXYZNPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNPP, - renderBlocks.aoBrightnessXYNP, - renderBlocks.aoBrightnessYZPP, - mixedBrightness); + renderBlocks.aoBrightnessXYZNPP, + renderBlocks.aoBrightnessXYNP, + renderBlocks.aoBrightnessYZPP, + mixedBrightness); float aoMixedXYZPPP = (renderBlocks.aoLightValueScratchYZPP + aoLightValue - + renderBlocks.aoLightValueScratchXYZPPP - + renderBlocks.aoLightValueScratchXYPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPPP + + renderBlocks.aoLightValueScratchXYPP) / 4.0F; float aoMixedXYZPPN = (aoLightValue + renderBlocks.aoLightValueScratchYZPN - + renderBlocks.aoLightValueScratchXYPP - + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; + + renderBlocks.aoLightValueScratchXYPP + + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXYNP + renderBlocks.aoLightValueScratchXYZNPN - + aoLightValue - + renderBlocks.aoLightValueScratchYZPN) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZPN) / 4.0F; float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXYZNPP + renderBlocks.aoLightValueScratchXYNP - + renderBlocks.aoLightValueScratchYZPP - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZPP + + aoLightValue) / 4.0F; aoTopLeft /* SE */ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); aoBottomLeft /* NE */ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMaxX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMaxX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); aoBottomRight /* NW */ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMinX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMinX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); aoTopRight /* SW */ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMinX - + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX - + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMinX + + aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX + + aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMaxZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMaxZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMinZ * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMinZ * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMinZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMinZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZPPP, - brightnessMixedXYZPPN, - brightnessMixedXYZNPN, - renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMaxZ * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPP, + brightnessMixedXYZPPP, + brightnessMixedXYZPPN, + brightnessMixedXYZNPN, + renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMaxZ * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX)); } return this; @@ -1183,184 +1087,160 @@ public class LightingHelper { float ratio = (float) (1.0F - renderBlocks.renderMinZ); float aoLightValue = renderBlocks.blockAccess.getBlock(x, y, z - 1) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y, - zOffset); - renderBlocks.aoBrightnessYZNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y - 1, - zOffset); - renderBlocks.aoBrightnessYZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y + 1, - zOffset); - renderBlocks.aoBrightnessXZPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y, - zOffset); - renderBlocks.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y + 1, - zOffset); - renderBlocks.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y + 1, - zOffset); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset); + renderBlocks.aoBrightnessYZNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset); + renderBlocks.aoBrightnessYZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset); + renderBlocks.aoBrightnessXZPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset); + renderBlocks.aoBrightnessXYZNNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZNPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset); + renderBlocks.aoBrightnessXYZPNN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZPPN = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset); renderBlocks.aoLightValueScratchXZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchYZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXZPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZNPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPNN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + ratio); renderBlocks.aoLightValueScratchXYZPPN = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - ratio); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z - 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + ratio); int brightnessMixedXYZPPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPN, - renderBlocks.aoBrightnessXZPN, - renderBlocks.aoBrightnessXYZPPN, - mixedBrightness); + renderBlocks.aoBrightnessYZPN, + renderBlocks.aoBrightnessXZPN, + renderBlocks.aoBrightnessXYZPPN, + mixedBrightness); int brightnessMixedXYZPNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNN, - renderBlocks.aoBrightnessXYZPNN, - renderBlocks.aoBrightnessXZPN, - mixedBrightness); + renderBlocks.aoBrightnessYZNN, + renderBlocks.aoBrightnessXYZPNN, + renderBlocks.aoBrightnessXZPN, + mixedBrightness); int brightnessMixedXYZNNN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNN, - renderBlocks.aoBrightnessXZNN, - renderBlocks.aoBrightnessYZNN, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNN, + renderBlocks.aoBrightnessXZNN, + renderBlocks.aoBrightnessYZNN, + mixedBrightness); int brightnessMixedXYZNPN = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNN, - renderBlocks.aoBrightnessXYZNPN, - renderBlocks.aoBrightnessYZPN, - mixedBrightness); + renderBlocks.aoBrightnessXZNN, + renderBlocks.aoBrightnessXYZNPN, + renderBlocks.aoBrightnessYZPN, + mixedBrightness); float aoMixedXYZPPN = (aoLightValue + renderBlocks.aoLightValueScratchYZPN - + renderBlocks.aoLightValueScratchXZPN - + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; + + renderBlocks.aoLightValueScratchXZPN + + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F; float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchYZNN + aoLightValue - + renderBlocks.aoLightValueScratchXYZPNN - + renderBlocks.aoLightValueScratchXZPN) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPNN + + renderBlocks.aoLightValueScratchXZPN) / 4.0F; float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN + renderBlocks.aoLightValueScratchXZNN - + renderBlocks.aoLightValueScratchYZNN - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZNN + + aoLightValue) / 4.0F; float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN + renderBlocks.aoLightValueScratchXYZNPN - + aoLightValue - + renderBlocks.aoLightValueScratchYZPN) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZPN) / 4.0F; aoTopLeft = (float) (aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); aoBottomLeft = (float) (aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); aoBottomRight = (float) (aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMaxX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMaxX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); aoTopRight = (float) (aoMixedXYZNPN * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMinX - + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX - + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPN * renderBlocks.renderMinY * renderBlocks.renderMinX + + aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX + + aoMixedXYZNNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMaxY * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMaxY * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMaxY * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMaxY * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), - renderBlocks.renderMinY * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), + renderBlocks.renderMinY * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPN, - brightnessMixedXYZPPN, - brightnessMixedXYZPNN, - brightnessMixedXYZNNN, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), - renderBlocks.renderMinY * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); + brightnessMixedXYZNPN, + brightnessMixedXYZPPN, + brightnessMixedXYZPNN, + brightnessMixedXYZNNN, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), + renderBlocks.renderMinY * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); } return this; @@ -1392,184 +1272,160 @@ public class LightingHelper { brightness = mixedBrightness; float aoLightValue = renderBlocks.blockAccess.getBlock(x, y, z + 1) - .getAmbientOcclusionLightValue(); - - renderBlocks.aoBrightnessXZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y, - zOffset); - renderBlocks.aoBrightnessXZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y, - zOffset); - renderBlocks.aoBrightnessYZNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y - 1, - zOffset); - renderBlocks.aoBrightnessYZPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x, - y + 1, - zOffset); - renderBlocks.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x - 1, - y + 1, - zOffset); - renderBlocks.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y - 1, - zOffset); - renderBlocks.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock( - renderBlocks.blockAccess, - x + 1, - y + 1, - zOffset); + .getAmbientOcclusionLightValue(); + + renderBlocks.aoBrightnessXZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset); + renderBlocks.aoBrightnessXZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset); + renderBlocks.aoBrightnessYZNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset); + renderBlocks.aoBrightnessYZPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset); + renderBlocks.aoBrightnessXYZNNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZNPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset); + renderBlocks.aoBrightnessXYZPNP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset); + renderBlocks.aoBrightnessXYZPPP = block + .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset); renderBlocks.aoLightValueScratchXZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x - 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x + 1, y, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchYZNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchYZPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZNNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZNPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x - 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZPNP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y - 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); renderBlocks.aoLightValueScratchXYZPPP = getMixedAo( - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) - .getAmbientOcclusionLightValue(), - renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) - .getAmbientOcclusionLightValue(), - renderBlocks.renderMaxZ); + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z + 1) + .getAmbientOcclusionLightValue(), + renderBlocks.blockAccess.getBlock(x + 1, y + 1, z) + .getAmbientOcclusionLightValue(), + renderBlocks.renderMaxZ); int brightnessMixedXYZNPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXZNP, - renderBlocks.aoBrightnessXYZNPP, - renderBlocks.aoBrightnessYZPP, - mixedBrightness); + renderBlocks.aoBrightnessXZNP, + renderBlocks.aoBrightnessXYZNPP, + renderBlocks.aoBrightnessYZPP, + mixedBrightness); int brightnessMixedXYZNNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessXYZNNP, - renderBlocks.aoBrightnessXZNP, - renderBlocks.aoBrightnessYZNP, - mixedBrightness); + renderBlocks.aoBrightnessXYZNNP, + renderBlocks.aoBrightnessXZNP, + renderBlocks.aoBrightnessYZNP, + mixedBrightness); int brightnessMixedXYZPNP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZNP, - renderBlocks.aoBrightnessXYZPNP, - renderBlocks.aoBrightnessXZPP, - mixedBrightness); + renderBlocks.aoBrightnessYZNP, + renderBlocks.aoBrightnessXYZPNP, + renderBlocks.aoBrightnessXZPP, + mixedBrightness); int brightnessMixedXYZPPP = renderBlocks.getAoBrightness( - renderBlocks.aoBrightnessYZPP, - renderBlocks.aoBrightnessXZPP, - renderBlocks.aoBrightnessXYZPPP, - mixedBrightness); + renderBlocks.aoBrightnessYZPP, + renderBlocks.aoBrightnessXZPP, + renderBlocks.aoBrightnessXYZPPP, + mixedBrightness); float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXZNP + renderBlocks.aoLightValueScratchXYZNPP - + aoLightValue - + renderBlocks.aoLightValueScratchYZPP) / 4.0F; + + aoLightValue + + renderBlocks.aoLightValueScratchYZPP) / 4.0F; float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP + renderBlocks.aoLightValueScratchXZNP - + renderBlocks.aoLightValueScratchYZNP - + aoLightValue) / 4.0F; + + renderBlocks.aoLightValueScratchYZNP + + aoLightValue) / 4.0F; float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP + aoLightValue - + renderBlocks.aoLightValueScratchXYZPNP - + renderBlocks.aoLightValueScratchXZPP) / 4.0F; + + renderBlocks.aoLightValueScratchXYZPNP + + renderBlocks.aoLightValueScratchXZPP) / 4.0F; float aoMixedXYZPPP = (aoLightValue + renderBlocks.aoLightValueScratchYZPP - + renderBlocks.aoLightValueScratchXZPP - + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; + + renderBlocks.aoLightValueScratchXZPP + + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F; aoTopLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX)); aoBottomLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMinX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX)); aoBottomRight = (float) (aoMixedXYZNPP * renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMinY * renderBlocks.renderMaxX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX)); aoTopRight = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX) - + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxX - + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX - + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); + + aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMaxX + + aoMixedXYZPNP * (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX + + aoMixedXYZNNP * (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX)); renderBlocks.brightnessTopLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, - renderBlocks.renderMaxY * renderBlocks.renderMinX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMinX, + renderBlocks.renderMaxY * renderBlocks.renderMinX); renderBlocks.brightnessBottomLeft = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, - renderBlocks.renderMinY * renderBlocks.renderMinX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMinX), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMinX, + renderBlocks.renderMinY * renderBlocks.renderMinX); renderBlocks.brightnessBottomRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, - renderBlocks.renderMinY * renderBlocks.renderMaxX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMinY * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxX, + renderBlocks.renderMinY * renderBlocks.renderMaxX); renderBlocks.brightnessTopRight = renderBlocks.mixAoBrightness( - brightnessMixedXYZNPP, - brightnessMixedXYZNNP, - brightnessMixedXYZPNP, - brightnessMixedXYZPPP, - renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX), - (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, - renderBlocks.renderMaxY * renderBlocks.renderMaxX); + brightnessMixedXYZNPP, + brightnessMixedXYZNNP, + brightnessMixedXYZPNP, + brightnessMixedXYZPPP, + renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMaxY) * (1.0D - renderBlocks.renderMaxX), + (1.0D - renderBlocks.renderMaxY) * renderBlocks.renderMaxX, + renderBlocks.renderMaxY * renderBlocks.renderMaxX); } return this; diff --git a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java index 112fcd93cb..f2bcce2bf8 100644 --- a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java +++ b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java @@ -94,7 +94,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { /* Abstract Classes */ private abstract static class EntityWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder - implements IEntityWorldSpawnedEvent { + implements IEntityWorldSpawnedEvent { private Entity entity; @@ -111,7 +111,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class PositionedEntityWorldSpawnedEventBuilder extends EntityWorldSpawnedEventBuilder - implements IPositionedWorldSpawnedEvent { + implements IPositionedWorldSpawnedEvent { private Vec3 position; @@ -134,7 +134,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class PositionedWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder - implements IPositionedWorldSpawnedEvent { + implements IPositionedWorldSpawnedEvent { private Vec3 position; @@ -157,7 +157,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class StringIdentifierPositionedWorldSpawnedEventBuilder - extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent { + extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent { private String identifier; @@ -180,7 +180,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } private abstract static class SoundStringIdentifierPositionedWorldSpawnedEventBuilder - extends StringIdentifierPositionedWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent { + extends StringIdentifierPositionedWorldSpawnedEventBuilder implements ISoundWorldSpawnedEvent { private float pitch; private float volume; @@ -259,13 +259,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException("Position, identifier, motion and world must be set"); getWorld().spawnParticle( - getIdentifier(), - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - getMotion().xCoord, - getMotion().yCoord, - getMotion().zCoord); + getIdentifier(), + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + getMotion().xCoord, + getMotion().yCoord, + getMotion().zCoord); } } @@ -312,12 +312,12 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException(ILLEGAL_STATE_STR1); getWorld().playSoundEffect( - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - getIdentifier(), - getPitch(), - getVolume()); + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + getIdentifier(), + getPitch(), + getVolume()); } } @@ -370,13 +370,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException(ILLEGAL_STATE_STR1); getWorld().playSound( - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - getIdentifier(), - getPitch(), - getVolume(), - isProximity()); + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + getIdentifier(), + getPitch(), + getVolume(), + isProximity()); } } @@ -411,10 +411,10 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException(ILLEGAL_STATE_STR1); getWorld().playRecord( - getIdentifier(), - (int) getPosition().xCoord, - (int) getPosition().yCoord, - (int) getPosition().zCoord); + getIdentifier(), + (int) getPosition().xCoord, + (int) getPosition().yCoord, + (int) getPosition().zCoord); } } @@ -471,13 +471,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException("Position and world must be set"); getWorld().newExplosion( - getEntity(), - getPosition().xCoord, - getPosition().yCoord, - getPosition().zCoord, - strength, - isFlaming, - isSmoking); + getEntity(), + getPosition().xCoord, + getPosition().yCoord, + getPosition().zCoord, + strength, + isFlaming, + isSmoking); } } @@ -485,7 +485,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { * Positional Data is rounded down due to this targeting a block. */ public static final class ExtinguishFireEffectEventBuilder extends PositionedWorldSpawnedEventBuilder - implements IEntityPlayerWorldSpawnedEvent { + implements IEntityPlayerWorldSpawnedEvent { private int side; private EntityPlayer entityPlayer; @@ -531,16 +531,16 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { throw new IllegalStateException("EntityPlayer, position and world must be set"); getWorld().extinguishFire( - getEntityPlayer(), - (int) getPosition().xCoord, - (int) getPosition().yCoord, - (int) getPosition().zCoord, - side); + getEntityPlayer(), + (int) getPosition().xCoord, + (int) getPosition().yCoord, + (int) getPosition().zCoord, + side); } } public static final class SoundAtEntityEventBuilder extends EntityWorldSpawnedEventBuilder - implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent { + implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent { private float pitch; private float volume; @@ -605,7 +605,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable { } public static final class SoundToNearExceptEventBuilder extends WorldSpawnedEventBuilder - implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent, IEntityPlayerWorldSpawnedEvent { + implements ISoundWorldSpawnedEvent, IStringIdentifierWorldSpawnedEvent, IEntityPlayerWorldSpawnedEvent { private float pitch; private float volume; diff --git a/src/main/java/gregtech/api/world/GT_Worldgen.java b/src/main/java/gregtech/api/world/GT_Worldgen.java index ae6fc930a4..4e1d5c7a73 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen.java +++ b/src/main/java/gregtech/api/world/GT_Worldgen.java @@ -33,12 +33,12 @@ public abstract class GT_Worldgen { * @return if the Worldgeneration has been successfully completed */ public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return false; } public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, int seedX, int seedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, int seedX, int seedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return 4; // This is for the empty Orevein } @@ -52,7 +52,7 @@ public abstract class GT_Worldgen { * @return if the Worldgeneration has been successfully completed */ public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return false; } @@ -67,24 +67,22 @@ public abstract class GT_Worldgen { public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { if (!((aWorld.provider.getDimensionName() - .equalsIgnoreCase("Overworld")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("Nether")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("The End")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("Twilight Forest")) - || (aWorld.provider.getDimensionName() - .equalsIgnoreCase("Underdark")))) + .equalsIgnoreCase("Overworld")) + || (aWorld.provider.getDimensionName() + .equalsIgnoreCase("Nether")) + || (aWorld.provider.getDimensionName() + .equalsIgnoreCase("The End")) + || (aWorld.provider.getDimensionName() + .equalsIgnoreCase("Twilight Forest")) + || (aWorld.provider.getDimensionName() + .equalsIgnoreCase("Underdark")))) return false; String aDimName = aWorld.provider.getDimensionName(); Boolean tAllowed = mDimensionMap.get(aDimName); if (tAllowed == null) { - boolean tValue = GregTech_API.sWorldgenFile.get( - "worldgen." + mWorldGenName, - aDimName, - aDimensionType == aAllowedDimensionType); + boolean tValue = GregTech_API.sWorldgenFile + .get("worldgen." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); mDimensionMap.put(aDimName, tValue); return tValue; } diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java index c40b3dfe13..958adfad54 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore.java @@ -16,8 +16,8 @@ public abstract class GT_Worldgen_Ore extends GT_Worldgen { private final String aTextWorldgen = "worldgen."; public GT_Worldgen_Ore(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, - boolean aAllowToGenerateinVoid) { + int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, + boolean aAllowToGenerateinVoid) { super(aName, GregTech_API.sWorldgenList, aDefault); mDimensionType = aDimensionType; mBlock = aBlock; diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java index 79b9e1711f..900f7808b1 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock.java @@ -11,38 +11,38 @@ import net.minecraft.world.chunk.IChunkProvider; public class GT_Worldgen_Ore_SingleBlock extends GT_Worldgen_Ore { public GT_Worldgen_Ore_SingleBlock(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, - boolean aAllowToGenerateinVoid) { + int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection aBiomeList, + boolean aAllowToGenerateinVoid) { super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); + aName, + aDefault, + aBlock, + aBlockMeta, + aDimensionType, + aAmount, + aSize, + aProbability, + aMinY, + aMaxY, + aBiomeList, + aAllowToGenerateinVoid); } @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) - && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) - && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { + && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) + && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { for (int i = 0; i < mAmount; i++) { int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), - tZ = aChunkZ + aRandom.nextInt(16); + tZ = aChunkZ + aRandom.nextInt(16); Block tBlock = aWorld.getBlock(tX, tY, tZ); if (((mAllowToGenerateinVoid && aWorld.getBlock(tX, tY, tZ) - .isAir(aWorld, tX, tY, tZ)) - || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { + .isAir(aWorld, tX, tY, tZ)) + || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) + || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) + || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { aWorld.setBlock(tX, tY, tZ, mBlock, mBlockMeta, 0); } } diff --git a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java index 2c35dbf27e..956cd0eb4c 100644 --- a/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java +++ b/src/main/java/gregtech/api/world/GT_Worldgen_Ore_SingleBlock_UnderLava.java @@ -11,40 +11,40 @@ import net.minecraft.world.chunk.IChunkProvider; public class GT_Worldgen_Ore_SingleBlock_UnderLava extends GT_Worldgen_Ore { public GT_Worldgen_Ore_SingleBlock_UnderLava(String aName, boolean aDefault, Block aBlock, int aBlockMeta, - int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, - Collection aBiomeList, boolean aAllowToGenerateinVoid) { + int aDimensionType, int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, + Collection aBiomeList, boolean aAllowToGenerateinVoid) { super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); + aName, + aDefault, + aBlock, + aBlockMeta, + aDimensionType, + aAmount, + aSize, + aProbability, + aMinY, + aMaxY, + aBiomeList, + aAllowToGenerateinVoid); } @Override public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) - && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) - && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { + && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) + && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { for (int i = 0; i < mAmount; i++) { int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), - tZ = aChunkZ + aRandom.nextInt(16); + tZ = aChunkZ + aRandom.nextInt(16); Block tBlock = aWorld.getBlock(tX, tY, tZ); if (((mAllowToGenerateinVoid && aWorld.getBlock(tX, tY, tZ) - .isAir(aWorld, tX, tY, tZ)) - || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) - || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { + .isAir(aWorld, tX, tY, tZ)) + || (tBlock != null && (tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.stone) + || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.end_stone) + || tBlock.isReplaceableOreGen(aWorld, tX, tY, tZ, Blocks.netherrack))))) { if (aWorld.getBlock(tX, tY + 1, tZ) == Blocks.lava - || aWorld.getBlock(tX, tY, tZ) == Blocks.flowing_lava) + || aWorld.getBlock(tX, tY, tZ) == Blocks.flowing_lava) aWorld.setBlock(tX, tY, tZ, mBlock, mBlockMeta, 0); } } -- cgit