From 6f31720697bcc351421a4d86ba3bf749375dd12c Mon Sep 17 00:00:00 2001
From: Raven Szewczyk
Date: Sat, 27 Aug 2022 10:19:57 +0100
Subject: Update buildscript & apply spotless (#1306)
* Update dependencies
* Update buildscript, apply spotless
---
src/main/java/gregtech/GT_Mod.java | 385 +-
src/main/java/gregtech/api/GregTech_API.java | 444 +-
.../api/damagesources/GT_DamageSources.java | 12 +-
.../api/enchants/Enchantment_EnderDamage.java | 15 +-
.../java/gregtech/api/enums/ConfigCategories.java | 7 +-
src/main/java/gregtech/api/enums/Dyes.java | 24 +-
src/main/java/gregtech/api/enums/Element.java | 9 +-
.../gregtech/api/enums/GTNH_ExtraMaterials.java | 637 +-
.../java/gregtech/api/enums/GT_HatchElement.java | 8 +-
src/main/java/gregtech/api/enums/GT_Values.java | 352 +-
.../java/gregtech/api/enums/HeatingCoilLevel.java | 112 +-
src/main/java/gregtech/api/enums/ItemList.java | 370 +-
.../java/gregtech/api/enums/MaterialBuilder.java | 518 +-
src/main/java/gregtech/api/enums/Materials.java | 18509 ++++++++++++-
.../java/gregtech/api/enums/MaterialsBotania.java | 194 +-
.../java/gregtech/api/enums/MaterialsKevlar.java | 597 +-
src/main/java/gregtech/api/enums/OreDictNames.java | 1 -
src/main/java/gregtech/api/enums/OrePrefixes.java | 4026 ++-
src/main/java/gregtech/api/enums/ParticleFX.java | 1 -
.../java/gregtech/api/enums/SoundResource.java | 12 +-
src/main/java/gregtech/api/enums/SubTag.java | 23 +-
src/main/java/gregtech/api/enums/TC_Aspects.java | 2 +-
src/main/java/gregtech/api/enums/TextureSet.java | 7 +-
src/main/java/gregtech/api/enums/Textures.java | 1387 +-
src/main/java/gregtech/api/enums/Tier.java | 506 +-
.../java/gregtech/api/enums/ToolDictNames.java | 2 +-
.../gregtech/api/events/BlockScanningEvent.java | 18 +-
src/main/java/gregtech/api/fluid/FluidTankGT.java | 37 +-
.../java/gregtech/api/graphs/GenerateNodeMap.java | 56 +-
.../gregtech/api/graphs/GenerateNodeMapPower.java | 22 +-
src/main/java/gregtech/api/graphs/Lock.java | 5 +-
src/main/java/gregtech/api/graphs/Node.java | 4 +-
src/main/java/gregtech/api/graphs/NodeList.java | 13 +-
src/main/java/gregtech/api/graphs/PowerNode.java | 6 +-
src/main/java/gregtech/api/graphs/PowerNodes.java | 33 +-
.../api/graphs/consumers/ConsumerNode.java | 6 +-
.../api/graphs/consumers/EmptyPowerConsumer.java | 11 +-
.../api/graphs/consumers/NodeEnergyConnected.java | 10 +-
.../api/graphs/consumers/NodeEnergyReceiver.java | 99 +-
.../api/graphs/consumers/NodeEnergySink.java | 10 +-
.../api/graphs/consumers/NodeGTBaseMetaTile.java | 5 +-
.../java/gregtech/api/graphs/paths/NodePath.java | 2 +-
.../gregtech/api/graphs/paths/PowerNodePath.java | 1 -
src/main/java/gregtech/api/gui/GT_Container.java | 84 +-
.../api/gui/GT_ContainerMetaTile_Machine.java | 38 +-
.../gregtech/api/gui/GT_Container_2by2_Fluid.java | 9 +-
.../api/gui/GT_Container_BasicMachine.java | 36 +-
.../gregtech/api/gui/GT_Container_BasicTank.java | 12 +-
.../api/gui/GT_Container_MaintenanceHatch.java | 6 +-
.../api/gui/GT_Container_MultiMachine.java | 3 +-
.../api/gui/GT_Container_SpecialFilter.java | 39 +-
.../java/gregtech/api/gui/GT_GUIColorOverride.java | 11 +-
.../java/gregtech/api/gui/GT_GUIContainer.java | 13 +-
.../api/gui/GT_GUIContainerMetaTile_Machine.java | 104 +-
.../gregtech/api/gui/GT_GUIContainer_1by1.java | 9 +-
.../gregtech/api/gui/GT_GUIContainer_2by2.java | 7 +-
.../api/gui/GT_GUIContainer_2by2_Fluid.java | 5 +-
.../gregtech/api/gui/GT_GUIContainer_3by3.java | 7 +-
.../gregtech/api/gui/GT_GUIContainer_4by4.java | 7 +-
.../api/gui/GT_GUIContainer_BasicMachine.java | 167 +-
.../api/gui/GT_GUIContainer_BasicTank.java | 20 +-
.../api/gui/GT_GUIContainer_MaintenanceHatch.java | 10 +-
.../api/gui/GT_GUIContainer_MultiMachine.java | 62 +-
src/main/java/gregtech/api/gui/GT_GUICover.java | 13 +-
.../gregtech/api/gui/GT_GUIDialogSelectItem.java | 422 +-
src/main/java/gregtech/api/gui/GT_GUIScreen.java | 568 +-
src/main/java/gregtech/api/gui/GT_Slot_Holo.java | 19 +-
.../java/gregtech/api/gui/GT_Slot_Holo_ME.java | 3 +-
.../api/gui/widgets/GT_GuiCoverTabLine.java | 70 +-
.../api/gui/widgets/GT_GuiFakeItemButton.java | 32 +-
.../java/gregtech/api/gui/widgets/GT_GuiIcon.java | 123 +-
.../gregtech/api/gui/widgets/GT_GuiIconButton.java | 39 +-
.../api/gui/widgets/GT_GuiIconCheckButton.java | 13 +-
.../api/gui/widgets/GT_GuiIntegerTextBox.java | 15 +-
.../api/gui/widgets/GT_GuiSlotTooltip.java | 3 +-
.../api/gui/widgets/GT_GuiSmartTooltip.java | 11 +-
.../java/gregtech/api/gui/widgets/GT_GuiTab.java | 74 +-
.../gregtech/api/gui/widgets/GT_GuiTabLine.java | 108 +-
.../gregtech/api/gui/widgets/GT_GuiTooltip.java | 32 +-
.../api/gui/widgets/GT_GuiTooltipManager.java | 21 +-
.../gregtech/api/interfaces/IBlockContainer.java | 1 +
.../gregtech/api/interfaces/IDebugableBlock.java | 3 +-
.../api/interfaces/IGlobalWirelessEnergy.java | 68 +-
.../java/gregtech/api/interfaces/IGuiIcon.java | 5 +
.../java/gregtech/api/interfaces/IGuiScreen.java | 9 +-
.../gregtech/api/interfaces/IHatchElement.java | 42 +-
.../java/gregtech/api/interfaces/IHeatingCoil.java | 6 +-
.../gregtech/api/interfaces/IIconContainer.java | 12 +-
.../gregtech/api/interfaces/IItemBehaviour.java | 37 +-
.../api/interfaces/INetworkUpdatableItem.java | 18 +-
.../gregtech/api/interfaces/IProjectileItem.java | 3 +-
.../java/gregtech/api/interfaces/ITexture.java | 2 +-
.../java/gregtech/api/interfaces/IToolStats.java | 19 +-
.../gregtech/api/interfaces/internal/IGT_Mod.java | 2 +-
.../api/interfaces/internal/IGT_RecipeAdder.java | 724 +-
.../api/interfaces/internal/IThaumcraftCompat.java | 32 +-
.../api/interfaces/internal/IUETileEntity.java | 1 -
.../IConfigurationCircuitSupport.java | 7 +-
.../interfaces/metatileentity/IConnectable.java | 20 +-
.../metatileentity/IMachineCallback.java | 2 +
.../interfaces/metatileentity/IMetaTileEntity.java | 46 +-
.../metatileentity/IMetaTileEntityCable.java | 6 +-
.../metatileentity/IMetaTileEntityItemPipe.java | 64 +-
.../tileentity/IBasicEnergyContainer.java | 12 +-
.../api/interfaces/tileentity/ICoverable.java | 6 +-
.../tileentity/IDebugableTileEntity.java | 3 +-
.../interfaces/tileentity/IEnergyConnected.java | 16 +-
.../tileentity/IExperimentalEnergyTileEntity.java | 36 +-
.../api/interfaces/tileentity/IGTEnet.java | 11 +-
.../interfaces/tileentity/IGregTechTileEntity.java | 44 +-
.../tileentity/IGregtechWailaProvider.java | 15 +-
.../api/interfaces/tileentity/IIC2Enet.java | 1 -
.../tileentity/IMachineBlockUpdateable.java | 2 +-
.../interfaces/tileentity/IMachineProgress.java | 5 +-
.../api/interfaces/tileentity/ITurnable.java | 3 +-
.../interfaces/tileentity/IUpgradableMachine.java | 1 -
.../api/items/GT_Block_LongDistancePipe.java | 19 +-
.../gregtech/api/items/GT_BreederCell_Item.java | 41 +-
.../gregtech/api/items/GT_CoolantCellIC_Item.java | 18 +-
.../gregtech/api/items/GT_CoolantCell_Item.java | 41 +-
.../gregtech/api/items/GT_EnergyArmor_Item.java | 85 +-
.../java/gregtech/api/items/GT_Generic_Block.java | 4 +-
.../java/gregtech/api/items/GT_Generic_Item.java | 29 +-
.../java/gregtech/api/items/GT_MetaBase_Item.java | 239 +-
.../gregtech/api/items/GT_MetaGenerated_Item.java | 69 +-
.../api/items/GT_MetaGenerated_Item_X01.java | 55 +-
.../api/items/GT_MetaGenerated_Item_X32.java | 57 +-
.../gregtech/api/items/GT_MetaGenerated_Tool.java | 523 +-
.../api/items/GT_RadioactiveCellIC_Item.java | 100 +-
.../api/items/GT_RadioactiveCell_Item.java | 56 +-
.../gregtech/api/items/GT_SolderingTool_Item.java | 46 +-
.../java/gregtech/api/items/GT_Spray_Bug_Item.java | 20 +-
.../gregtech/api/items/GT_Spray_Foam_Item.java | 49 +-
.../gregtech/api/items/GT_Spray_Hardener_Item.java | 34 +-
.../api/items/GT_Spray_Hydration_Item.java | 23 +-
.../java/gregtech/api/items/GT_Spray_Ice_Item.java | 49 +-
.../gregtech/api/items/GT_Spray_Pepper_Item.java | 52 +-
src/main/java/gregtech/api/items/GT_Tool_Item.java | 48 +-
.../api/metatileentity/BaseMetaPipeEntity.java | 450 +-
.../api/metatileentity/BaseMetaTileEntity.java | 879 +-
.../api/metatileentity/BaseTileEntity.java | 57 +-
.../api/metatileentity/CommonMetaTileEntity.java | 7 +-
.../api/metatileentity/CoverableTileEntity.java | 211 +-
.../api/metatileentity/MetaPipeEntity.java | 409 +-
.../api/metatileentity/MetaTileEntity.java | 370 +-
.../api/metatileentity/TileIC2EnergySink.java | 51 +-
.../examples/GT_MetaTileEntity_E_Furnace.java | 76 +-
.../implementations/GT_MetaPipeEntity_Cable.java | 421 +-
.../implementations/GT_MetaPipeEntity_Fluid.java | 325 +-
.../implementations/GT_MetaPipeEntity_Frame.java | 55 +-
.../implementations/GT_MetaPipeEntity_Item.java | 275 +-
.../GT_MetaTileEntity_BasicBatteryBuffer.java | 101 +-
.../GT_MetaTileEntity_BasicGenerator.java | 98 +-
.../GT_MetaTileEntity_BasicHull.java | 50 +-
.../GT_MetaTileEntity_BasicHull_NonElectric.java | 17 +-
.../GT_MetaTileEntity_BasicMachine.java | 460 +-
.../GT_MetaTileEntity_BasicMachine_Bronze.java | 235 +-
.../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 441 +-
.../GT_MetaTileEntity_BasicMachine_Steel.java | 128 +-
.../GT_MetaTileEntity_BasicTank.java | 82 +-
.../implementations/GT_MetaTileEntity_Buffer.java | 156 +-
.../GT_MetaTileEntity_CubicMultiBlockBase.java | 171 +-
.../GT_MetaTileEntity_EnhancedMultiBlockBase.java | 347 +-
.../implementations/GT_MetaTileEntity_Hatch.java | 111 +-
.../GT_MetaTileEntity_Hatch_DataAccess.java | 35 +-
.../GT_MetaTileEntity_Hatch_Dynamo.java | 15 +-
.../GT_MetaTileEntity_Hatch_Energy.java | 18 +-
.../GT_MetaTileEntity_Hatch_Input.java | 47 +-
.../GT_MetaTileEntity_Hatch_InputBus.java | 118 +-
.../GT_MetaTileEntity_Hatch_Maintenance.java | 134 +-
.../GT_MetaTileEntity_Hatch_Muffler.java | 43 +-
.../GT_MetaTileEntity_Hatch_MultiInput.java | 40 +-
.../GT_MetaTileEntity_Hatch_Output.java | 183 +-
.../GT_MetaTileEntity_Hatch_OutputBus.java | 80 +-
.../GT_MetaTileEntity_MultiBlockBase.java | 432 +-
.../GT_MetaTileEntity_SpecialFilter.java | 13 +-
.../GT_MetaTileEntity_TieredMachineBlock.java | 32 +-
.../GT_MetaTileEntity_TooltipMultiBlockBase.java | 9 +-
.../GT_MetaTileEntity_Transformer.java | 192 +-
.../GT_MetaTileEntity_Wireless_Dynamo.java | 21 +-
.../GT_MetaTileEntity_Wireless_Hatch.java | 25 +-
.../api/multitileentity/MultiTileEntityBlock.java | 317 +-
.../MultiTileEntityBlockInternal.java | 75 +-
.../MultiTileEntityClassContainer.java | 29 +-
.../multitileentity/MultiTileEntityContainer.java | 9 +-
.../MultiTileEntityItemInternal.java | 148 +-
.../multitileentity/MultiTileEntityRegistry.java | 109 +-
.../multitileentity/base/BaseMultiTileEntity.java | 720 +-
.../base/BaseNontickableMultiTileEntity.java | 22 +-
.../base/BaseTickableMultiTileEntity.java | 24 +-
.../interfaces/IMultiBlockController.java | 8 +-
.../interfaces/IMultiBlockEnergy.java | 50 +-
.../interfaces/IMultiBlockFluidHandler.java | 17 +-
.../interfaces/IMultiBlockInventory.java | 59 +-
.../interfaces/IMultiTileEntity.java | 98 +-
.../machine/MultiTileBasicMachine.java | 109 +-
.../multiblock/base/MultiBlockController.java | 217 +-
.../multiblock/base/MultiBlockPart.java | 277 +-
.../multiblock/base/MultiBlock_Stackable.java | 10 +-
.../multiblock/casing/CasingBehaviorBase.java | 3 +-
.../gregtech/api/net/GT_Packet_Block_Event.java | 3 +-
.../api/net/GT_Packet_ClientPreference.java | 6 +-
.../api/net/GT_Packet_GtTileEntityGuiRequest.java | 29 +-
src/main/java/gregtech/api/net/GT_Packet_New.java | 33 +-
.../java/gregtech/api/net/GT_Packet_Pollution.java | 5 +-
.../api/net/GT_Packet_RequestCoverData.java | 14 +-
.../gregtech/api/net/GT_Packet_SendCoverData.java | 8 +-
.../api/net/GT_Packet_SetConfigurationCircuit.java | 5 +-
.../gregtech/api/net/GT_Packet_SetLockedFluid.java | 138 +-
.../java/gregtech/api/net/GT_Packet_Sound.java | 11 +-
.../gregtech/api/net/GT_Packet_TileEntity.java | 128 +-
.../api/net/GT_Packet_TileEntityCover.java | 3 +-
.../api/net/GT_Packet_TileEntityCoverGUI.java | 51 +-
.../api/net/GT_Packet_TileEntityCoverNew.java | 9 +-
.../gregtech/api/net/GT_Packet_UpdateItem.java | 84 +-
.../api/net/GT_Packet_WirelessRedstoneCover.java | 12 +-
.../api/objects/AE2DigitalChestHandler.java | 21 +-
.../java/gregtech/api/objects/CollectorUtils.java | 7 +-
.../java/gregtech/api/objects/ElementStack.java | 11 +-
.../java/gregtech/api/objects/GT_ArrayList.java | 19 +-
.../java/gregtech/api/objects/GT_ChunkManager.java | 83 +-
.../api/objects/GT_CopiedBlockTexture.java | 4 +-
.../gregtech/api/objects/GT_Cover_Default.java | 17 +-
.../java/gregtech/api/objects/GT_Cover_None.java | 160 +-
src/main/java/gregtech/api/objects/GT_Fluid.java | 8 +-
.../java/gregtech/api/objects/GT_FluidStack.java | 28 +-
src/main/java/gregtech/api/objects/GT_HashSet.java | 3 +-
.../java/gregtech/api/objects/GT_ItemStack.java | 5 +-
.../java/gregtech/api/objects/GT_MultiTexture.java | 2 +-
.../gregtech/api/objects/GT_RenderedTexture.java | 6 +-
.../java/gregtech/api/objects/GT_SidedTexture.java | 33 +-
.../api/objects/GT_StdRenderedTexture.java | 5 +-
.../java/gregtech/api/objects/GT_UO_Dimension.java | 73 +-
.../gregtech/api/objects/GT_UO_DimensionList.java | 143 +-
.../java/gregtech/api/objects/GT_UO_Fluid.java | 102 +-
src/main/java/gregtech/api/objects/ItemData.java | 10 +-
.../java/gregtech/api/objects/MaterialStack.java | 46 +-
src/main/java/gregtech/api/objects/ObjMap.java | 274 +-
.../gregtech/api/objects/ReverseShapedRecipe.java | 13 +-
.../api/objects/ReverseShapelessRecipe.java | 13 +-
src/main/java/gregtech/api/objects/XSTR.java | 42 +-
.../java/gregtech/api/render/TextureFactory.java | 39 +-
.../api/threads/GT_Runnable_Cable_Update.java | 26 +-
.../threads/GT_Runnable_MachineBlockUpdate.java | 66 +-
.../gregtech/api/threads/GT_Runnable_Sound.java | 34 +-
.../gregtech/api/util/ColorsMetadataSection.java | 16 +-
.../api/util/ColorsMetadataSectionSerializer.java | 32 +-
.../java/gregtech/api/util/GT_ApiaryUpgrade.java | 53 +-
.../gregtech/api/util/GT_AssemblyLineUtils.java | 1023 +-
.../gregtech/api/util/GT_Assemblyline_Server.java | 722 +-
src/main/java/gregtech/api/util/GT_BaseCrop.java | 145 +-
src/main/java/gregtech/api/util/GT_BlockMap.java | 221 +-
src/main/java/gregtech/api/util/GT_BlockSet.java | 48 +-
src/main/java/gregtech/api/util/GT_CLS_Compat.java | 56 +-
.../gregtech/api/util/GT_ChunkAssociatedData.java | 820 +-
.../gregtech/api/util/GT_CircuitryBehavior.java | 58 +-
.../gregtech/api/util/GT_ClientPreference.java | 6 +-
src/main/java/gregtech/api/util/GT_Config.java | 30 +-
.../java/gregtech/api/util/GT_CoverBehavior.java | 192 +-
.../gregtech/api/util/GT_CoverBehaviorBase.java | 196 +-
.../api/util/GT_ExoticEnergyInputHelper.java | 110 +-
src/main/java/gregtech/api/util/GT_FoodStat.java | 13 +-
.../java/gregtech/api/util/GT_Forestry_Compat.java | 129 +-
src/main/java/gregtech/api/util/GT_GC_Compat.java | 23 +-
.../gregtech/api/util/GT_HatchElementBuilder.java | 158 +-
.../api/util/GT_ItsNotMyFaultException.java | 3 +-
.../java/gregtech/api/util/GT_LanguageManager.java | 529 +-
src/main/java/gregtech/api/util/GT_Log.java | 4 +-
src/main/java/gregtech/api/util/GT_ModHandler.java | 1167 +-
.../api/util/GT_Multiblock_Tooltip_Builder.java | 975 +-
.../gregtech/api/util/GT_OreDictUnificator.java | 164 +-
.../java/gregtech/api/util/GT_PlayedSound.java | 9 +-
.../api/util/GT_ProcessingArray_Manager.java | 7 +-
src/main/java/gregtech/api/util/GT_Recipe.java | 4076 ++-
.../gregtech/api/util/GT_RecipeRegistrator.java | 513 +-
.../java/gregtech/api/util/GT_RenderingWorld.java | 328 +-
.../java/gregtech/api/util/GT_Shaped_Recipe.java | 37 +-
.../gregtech/api/util/GT_Shapeless_Recipe.java | 69 +-
.../gregtech/api/util/GT_Single_Recipe_Check.java | 28 +-
.../GT_Single_Recipe_Check_Processing_Array.java | 31 +-
.../gregtech/api/util/GT_SpawnEventHandler.java | 20 +-
.../gregtech/api/util/GT_StructureUtility.java | 202 +-
.../gregtech/api/util/GT_ToolHarvestHelper.java | 118 +-
.../gregtech/api/util/GT_TooltipDataCache.java | 14 +-
src/main/java/gregtech/api/util/GT_Util.java | 96 +-
src/main/java/gregtech/api/util/GT_Utility.java | 2285 +-
.../java/gregtech/api/util/GT_UtilityClient.java | 68 +-
.../java/gregtech/api/util/IGT_HatchAdder.java | 4 +-
.../gregtech/api/util/ISerializableObject.java | 15 +-
.../java/gregtech/api/util/LightingHelper.java | 1108 +-
.../api/util/WorldSpawnedEventBuilder.java | 119 +-
.../gregtech/api/util/extensions/IteratorExt.java | 1 -
src/main/java/gregtech/api/world/GT_Worldgen.java | 57 +-
.../java/gregtech/api/world/GT_Worldgen_Ore.java | 17 +-
.../api/world/GT_Worldgen_Ore_SingleBlock.java | 57 +-
.../GT_Worldgen_Ore_SingleBlock_UnderLava.java | 60 +-
.../java/gregtech/client/GT_GUI_ClientConfig.java | 64 +-
src/main/java/gregtech/client/GT_GuiFactory.java | 33 +-
.../gregtech/client/GT_TooltipEventHandler.java | 396 +-
src/main/java/gregtech/common/GT_Client.java | 413 +-
src/main/java/gregtech/common/GT_DummyWorld.java | 107 +-
src/main/java/gregtech/common/GT_Network.java | 94 +-
.../gregtech/common/GT_PlayerActivityLogger.java | 1 -
src/main/java/gregtech/common/GT_Pollution.java | 887 +-
src/main/java/gregtech/common/GT_Proxy.java | 1798 +-
src/main/java/gregtech/common/GT_RecipeAdder.java | 2296 +-
src/main/java/gregtech/common/GT_Server.java | 3 +-
.../java/gregtech/common/GT_ThaumcraftCompat.java | 144 +-
.../java/gregtech/common/GT_UndergroundOil.java | 107 +-
.../gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 567 +-
.../common/GT_Worldgen_GT_Ore_SmallPieces.java | 128 +-
.../java/gregtech/common/GT_Worldgen_Stone.java | 293 +-
.../java/gregtech/common/GT_Worldgenerator.java | 436 +-
.../gregtech/common/bees/GT_AlleleBeeSpecies.java | 40 +-
.../java/gregtech/common/bees/GT_AlleleHelper.java | 115 +-
.../java/gregtech/common/bees/GT_Bee_Mutation.java | 36 +-
.../gregtech/common/blocks/GT_Block_Casings1.java | 37 +-
.../gregtech/common/blocks/GT_Block_Casings2.java | 15 +-
.../gregtech/common/blocks/GT_Block_Casings3.java | 12 +-
.../gregtech/common/blocks/GT_Block_Casings4.java | 118 +-
.../gregtech/common/blocks/GT_Block_Casings5.java | 12 +-
.../gregtech/common/blocks/GT_Block_Casings6.java | 4 +-
.../gregtech/common/blocks/GT_Block_Casings8.java | 96 +-
.../common/blocks/GT_Block_Casings_Abstract.java | 12 +-
.../gregtech/common/blocks/GT_Block_Concretes.java | 14 +-
.../gregtech/common/blocks/GT_Block_Machines.java | 155 +-
.../gregtech/common/blocks/GT_Block_Metal.java | 6 +-
.../java/gregtech/common/blocks/GT_Block_Ores.java | 67 +-
.../common/blocks/GT_Block_Ores_Abstract.java | 77 +-
.../gregtech/common/blocks/GT_Block_Ores_UB1.java | 51 +-
.../gregtech/common/blocks/GT_Block_Ores_UB2.java | 52 +-
.../gregtech/common/blocks/GT_Block_Ores_UB3.java | 52 +-
.../common/blocks/GT_Block_Reinforced.java | 149 +-
.../gregtech/common/blocks/GT_Block_Stones.java | 12 +-
.../common/blocks/GT_Block_Stones_Abstract.java | 97 +-
.../gregtech/common/blocks/GT_Block_Storage.java | 6 +-
.../gregtech/common/blocks/GT_Item_Casings1.java | 7 -
.../gregtech/common/blocks/GT_Item_Casings2.java | 3 +-
.../gregtech/common/blocks/GT_Item_Casings5.java | 9 +-
.../common/blocks/GT_Item_Casings_Abstract.java | 41 +-
.../gregtech/common/blocks/GT_Item_Concretes.java | 6 +-
.../common/blocks/GT_Item_LongDistancePipe.java | 9 +-
.../gregtech/common/blocks/GT_Item_Machines.java | 204 +-
.../java/gregtech/common/blocks/GT_Item_Ores.java | 45 +-
.../common/blocks/GT_Item_Stones_Abstract.java | 6 +-
.../gregtech/common/blocks/GT_Item_Storage.java | 19 +-
.../gregtech/common/blocks/GT_TileEntity_Ores.java | 157 +-
.../java/gregtech/common/covers/GT_Cover_Arm.java | 244 +-
.../common/covers/GT_Cover_ControlsWork.java | 66 +-
.../gregtech/common/covers/GT_Cover_Conveyor.java | 143 +-
.../gregtech/common/covers/GT_Cover_Crafting.java | 35 +-
.../gregtech/common/covers/GT_Cover_DoesWork.java | 91 +-
.../gregtech/common/covers/GT_Cover_Drain.java | 110 +-
.../gregtech/common/covers/GT_Cover_EUMeter.java | 184 +-
.../common/covers/GT_Cover_EnergyOnly.java | 40 +-
.../gregtech/common/covers/GT_Cover_FacadeAE.java | 36 +-
.../common/covers/GT_Cover_FacadeBase.java | 145 +-
.../common/covers/GT_Cover_FluidLimiter.java | 56 +-
.../common/covers/GT_Cover_FluidRegulator.java | 1010 +-
.../covers/GT_Cover_FluidStorageMonitor.java | 182 +-
.../common/covers/GT_Cover_Fluidfilter.java | 168 +-
.../common/covers/GT_Cover_ItemFilter.java | 132 +-
.../gregtech/common/covers/GT_Cover_ItemMeter.java | 161 +-
.../java/gregtech/common/covers/GT_Cover_Lens.java | 3 +-
.../common/covers/GT_Cover_LiquidMeter.java | 88 +-
.../common/covers/GT_Cover_NeedMaintainance.java | 145 +-
.../common/covers/GT_Cover_PlayerDetector.java | 69 +-
.../java/gregtech/common/covers/GT_Cover_Pump.java | 165 +-
.../common/covers/GT_Cover_RedstoneConductor.java | 49 +-
.../covers/GT_Cover_RedstoneReceiverExternal.java | 15 +-
.../covers/GT_Cover_RedstoneReceiverInternal.java | 15 +-
.../common/covers/GT_Cover_RedstoneSignalizer.java | 29 +-
.../GT_Cover_RedstoneTransmitterExternal.java | 3 +-
.../GT_Cover_RedstoneTransmitterInternal.java | 12 +-
.../covers/GT_Cover_RedstoneWirelessBase.java | 107 +-
.../gregtech/common/covers/GT_Cover_Screen.java | 22 +-
.../gregtech/common/covers/GT_Cover_Shutter.java | 101 +-
.../common/covers/GT_Cover_SolarPanel.java | 115 +-
.../common/covers/GT_Cover_SteamValve.java | 3 +-
.../java/gregtech/common/covers/GT_Cover_Vent.java | 18 +-
.../common/entities/GT_EntityFXPollution.java | 7 +-
.../gregtech/common/entities/GT_Entity_Arrow.java | 185 +-
.../common/entities/GT_Entity_Arrow_Potion.java | 17 +-
.../gregtech/common/gui/GT_Container_Boiler.java | 21 +-
.../common/gui/GT_Container_ChestBuffer.java | 36 +-
.../gregtech/common/gui/GT_Container_Filter.java | 44 +-
.../common/gui/GT_Container_IndustrialApiary.java | 116 +-
.../common/gui/GT_Container_InputBus_ME.java | 58 +-
.../common/gui/GT_Container_ItemDistributor.java | 21 +-
.../GT_Container_MicrowaveEnergyTransmitter.java | 54 +-
.../common/gui/GT_Container_OutputHatch.java | 14 +-
.../gui/GT_Container_PrimitiveBlastFurnace.java | 3 +-
.../common/gui/GT_Container_Regulator.java | 14 +-
.../common/gui/GT_Container_SuperBuffer.java | 36 +-
.../common/gui/GT_Container_Teleporter.java | 57 +-
.../common/gui/GT_GUIContainerVolumetricFlask.java | 36 +-
.../common/gui/GT_GUIContainer_Boiler.java | 3 +-
.../gui/GT_GUIContainer_BronzeBlastFurnace.java | 24 +-
.../common/gui/GT_GUIContainer_FusionReactor.java | 39 +-
.../gui/GT_GUIContainer_IndustrialApiary.java | 157 +-
.../common/gui/GT_GUIContainer_InputBus_ME.java | 48 +-
.../gui/GT_GUIContainer_ItemDistributor.java | 4 +-
...GT_GUIContainer_MicrowaveEnergyTransmitter.java | 60 +-
.../common/gui/GT_GUIContainer_OutputHatch.java | 37 +-
.../gui/GT_GUIContainer_PrimitiveBlastFurnace.java | 31 +-
.../common/gui/GT_GUIContainer_QuantumChest.java | 24 +-
.../common/gui/GT_GUIContainer_RecipeFilter.java | 18 +-
.../common/gui/GT_GUIContainer_Regulator.java | 27 +-
.../common/gui/GT_GUIContainer_Teleporter.java | 44 +-
src/main/java/gregtech/common/items/CombType.java | 61 +-
src/main/java/gregtech/common/items/DropType.java | 45 +-
.../common/items/GT_DepletetCell_Item.java | 17 +-
.../gregtech/common/items/GT_FluidDisplayItem.java | 83 +-
.../common/items/GT_IntegratedCircuit_Item.java | 207 +-
.../common/items/GT_MetaGenerated_Item_01.java | 5306 +++-
.../common/items/GT_MetaGenerated_Item_02.java | 2530 +-
.../common/items/GT_MetaGenerated_Item_03.java | 598 +-
.../common/items/GT_MetaGenerated_Item_98.java | 28 +-
.../common/items/GT_MetaGenerated_Item_99.java | 48 +-
.../common/items/GT_MetaGenerated_Tool_01.java | 788 +-
.../common/items/GT_NeutronReflector_Item.java | 16 +-
.../gregtech/common/items/GT_SensorCard_Item.java | 22 +-
.../gregtech/common/items/GT_VolumetricFlask.java | 61 +-
src/main/java/gregtech/common/items/ItemComb.java | 2544 +-
src/main/java/gregtech/common/items/ItemDrop.java | 288 +-
.../java/gregtech/common/items/ItemPollen.java | 123 +-
.../java/gregtech/common/items/ItemPropolis.java | 182 +-
.../java/gregtech/common/items/PollenType.java | 11 +-
.../java/gregtech/common/items/PropolisType.java | 39 +-
.../common/items/behaviors/Behaviour_Arrow.java | 44 +-
.../items/behaviors/Behaviour_Arrow_Potion.java | 24 +-
.../items/behaviors/Behaviour_Cover_Tool.java | 105 +-
.../common/items/behaviors/Behaviour_Crowbar.java | 13 +-
.../common/items/behaviors/Behaviour_DataOrb.java | 3 +-
.../items/behaviors/Behaviour_DataStick.java | 47 +-
.../common/items/behaviors/Behaviour_Hoe.java | 20 +-
.../common/items/behaviors/Behaviour_Lighter.java | 56 +-
.../common/items/behaviors/Behaviour_None.java | 56 +-
.../behaviors/Behaviour_Plunger_Essentia.java | 30 +-
.../items/behaviors/Behaviour_Plunger_Fluid.java | 29 +-
.../items/behaviors/Behaviour_Plunger_Item.java | 41 +-
.../items/behaviors/Behaviour_PrintedPages.java | 3 +-
.../items/behaviors/Behaviour_Prospecting.java | 85 +-
.../common/items/behaviors/Behaviour_Scanner.java | 43 +-
.../common/items/behaviors/Behaviour_Scoop.java | 28 +-
.../items/behaviors/Behaviour_Screwdriver.java | 13 +-
.../common/items/behaviors/Behaviour_Sense.java | 26 +-
.../items/behaviors/Behaviour_SensorKit.java | 22 +-
.../items/behaviors/Behaviour_SoftHammer.java | 76 +-
.../items/behaviors/Behaviour_Sonictron.java | 19 +-
.../items/behaviors/Behaviour_Spray_Color.java | 46 +-
.../common/items/behaviors/Behaviour_Wrench.java | 101 +-
.../items/behaviors/Behaviour_WrittenBook.java | 19 +-
.../common/misc/GT_ClientPollutionMap.java | 94 +-
src/main/java/gregtech/common/misc/GT_Command.java | 171 +-
.../common/misc/GT_DrillingLogicDelegate.java | 33 +-
.../common/net/MessageSetFlaskCapacity.java | 3 +-
.../gregtech/common/power/BasicMachineEUPower.java | 24 +-
.../redstonecircuits/GT_Circuit_BasicLogic.java | 36 +-
.../common/redstonecircuits/GT_Circuit_BitAnd.java | 12 +-
.../common/redstonecircuits/GT_Circuit_Equals.java | 7 +-
.../common/redstonecircuits/GT_Circuit_Pulser.java | 14 +-
.../redstonecircuits/GT_Circuit_Randomizer.java | 3 +-
.../redstonecircuits/GT_Circuit_RedstoneMeter.java | 8 +-
.../common/redstonecircuits/GT_Circuit_Timer.java | 4 +-
.../common/render/CosmicItemRendererGT.java | 112 +-
.../gregtech/common/render/GT_CapeRenderer.java | 49 +-
.../common/render/GT_CopiedBlockTexture.java | 6 +-
.../common/render/GT_CopiedCTMBlockTexture.java | 18 +-
.../gregtech/common/render/GT_FlaskRenderer.java | 11 +-
.../render/GT_FluidDisplayStackRenderer.java | 36 +-
.../render/GT_MetaGenerated_Tool_Renderer.java | 100 +-
.../gregtech/common/render/GT_MultiTexture.java | 2 -
.../common/render/GT_PollutionRenderer.java | 123 +-
.../java/gregtech/common/render/GT_RenderUtil.java | 11 +-
.../gregtech/common/render/GT_RenderedTexture.java | 90 +-
.../gregtech/common/render/GT_Renderer_Block.java | 526 +-
.../gregtech/common/render/GT_SidedTexture.java | 26 +-
.../gregtech/common/render/GT_TextureBase.java | 2 +-
.../gregtech/common/render/GT_TextureBuilder.java | 14 +-
.../gregtech/common/render/IRenderedBlock.java | 57 +-
.../render/items/GT_GeneratedItem_Renderer.java | 54 +-
.../items/GT_GeneratedMaterial_Renderer.java | 38 +-
.../items/GT_MetaGenerated_Item_Renderer.java | 4 +-
.../automation/GT_MetaTileEntity_ChestBuffer.java | 59 +-
.../automation/GT_MetaTileEntity_Filter.java | 40 +-
.../GT_MetaTileEntity_ItemDistributor.java | 64 +-
.../automation/GT_MetaTileEntity_RecipeFilter.java | 32 +-
.../automation/GT_MetaTileEntity_Regulator.java | 61 +-
.../automation/GT_MetaTileEntity_SuperBuffer.java | 54 +-
.../automation/GT_MetaTileEntity_TypeFilter.java | 65 +-
.../boilers/GT_MetaTileEntity_Boiler.java | 49 +-
.../boilers/GT_MetaTileEntity_Boiler_Bronze.java | 230 +-
.../boilers/GT_MetaTileEntity_Boiler_Lava.java | 60 +-
.../boilers/GT_MetaTileEntity_Boiler_Solar.java | 138 +-
.../GT_MetaTileEntity_Boiler_Solar_Steel.java | 37 +-
.../boilers/GT_MetaTileEntity_Boiler_Steel.java | 57 +-
.../GT_MetaTileEntity_DieselGenerator.java | 175 +-
.../generators/GT_MetaTileEntity_GasTurbine.java | 146 +-
.../generators/GT_MetaTileEntity_LightningRod.java | 62 +-
.../GT_MetaTileEntity_MagicEnergyConverter.java | 153 +-
.../GT_MetaTileEntity_MagicalEnergyAbsorber.java | 205 +-
.../GT_MetaTileEntity_NaquadahReactor.java | 135 +-
.../GT_MetaTileEntity_PlasmaGenerator.java | 98 +-
.../generators/GT_MetaTileEntity_SteamTurbine.java | 139 +-
.../GT_MetaTileEntity_BasicHull_Bronze.java | 18 +-
.../GT_MetaTileEntity_BasicHull_BronzeBricks.java | 26 +-
.../GT_MetaTileEntity_BasicHull_Steel.java | 16 +-
.../GT_MetaTileEntity_BasicHull_SteelBricks.java | 25 +-
.../GT_MetaTileEntity_Hatch_InputBus_ME.java | 105 +-
.../GT_MetaTileEntity_Hatch_OutputBus_ME.java | 118 +-
.../GT_MetaTileEntity_AdvSeismicProspector.java | 219 +-
.../basic/GT_MetaTileEntity_Boxinator.java | 144 +-
.../machines/basic/GT_MetaTileEntity_Charger.java | 70 +-
.../basic/GT_MetaTileEntity_CuringOven.java | 86 +-
.../basic/GT_MetaTileEntity_Disassembler.java | 395 +-
.../basic/GT_MetaTileEntity_IndustrialApiary.java | 596 +-
.../basic/GT_MetaTileEntity_Massfabricator.java | 115 +-
..._MetaTileEntity_MicrowaveEnergyTransmitter.java | 142 +-
.../machines/basic/GT_MetaTileEntity_Miner.java | 210 +-
.../basic/GT_MetaTileEntity_MonsterRepellent.java | 97 +-
.../basic/GT_MetaTileEntity_PotionBrewer.java | 98 +-
.../machines/basic/GT_MetaTileEntity_Printer.java | 32 +-
.../machines/basic/GT_MetaTileEntity_Pump.java | 287 +-
.../basic/GT_MetaTileEntity_Replicator.java | 121 +-
.../basic/GT_MetaTileEntity_RockBreaker.java | 97 +-
.../machines/basic/GT_MetaTileEntity_Scanner.java | 224 +-
.../basic/GT_MetaTileEntity_SeismicProspector.java | 207 +-
.../basic/GT_MetaTileEntity_Teleporter.java | 265 +-
...GT_MetaTileEntity_LongDistancePipelineBase.java | 191 +-
...T_MetaTileEntity_LongDistancePipelineFluid.java | 58 +-
...GT_MetaTileEntity_LongDistancePipelineItem.java | 69 +-
.../GT_MetaTileEntity_AbstractMultiFurnace.java | 11 +-
.../multi/GT_MetaTileEntity_AssemblyLine.java | 275 +-
.../GT_MetaTileEntity_BrickedBlastFurnace.java | 23 +-
.../GT_MetaTileEntity_BronzeBlastFurnace.java | 27 +-
.../multi/GT_MetaTileEntity_Charcoal_Pit.java | 112 +-
.../multi/GT_MetaTileEntity_Cleanroom.java | 268 +-
.../GT_MetaTileEntity_ConcreteBackfillerBase.java | 70 +-
.../multi/GT_MetaTileEntity_DieselEngine.java | 224 +-
.../multi/GT_MetaTileEntity_DistillationTower.java | 245 +-
.../multi/GT_MetaTileEntity_DrillerBase.java | 284 +-
.../GT_MetaTileEntity_ElectricBlastFurnace.java | 286 +-
.../GT_MetaTileEntity_ExtremeDieselEngine.java | 123 +-
.../multi/GT_MetaTileEntity_FusionComputer.java | 244 +-
.../multi/GT_MetaTileEntity_FusionComputer1.java | 13 +-
.../multi/GT_MetaTileEntity_FusionComputer2.java | 12 +-
.../multi/GT_MetaTileEntity_FusionComputer3.java | 13 +-
.../multi/GT_MetaTileEntity_HeatExchanger.java | 179 +-
.../GT_MetaTileEntity_ImplosionCompressor.java | 101 +-
.../GT_MetaTileEntity_IntegratedOreFactory.java | 272 +-
.../multi/GT_MetaTileEntity_LargeBoiler.java | 262 +-
.../GT_MetaTileEntity_LargeBoiler_Bronze.java | 9 +-
.../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 13 +-
.../GT_MetaTileEntity_LargeBoiler_Titanium.java | 18 +-
...T_MetaTileEntity_LargeBoiler_TungstenSteel.java | 14 +-
.../GT_MetaTileEntity_LargeChemicalReactor.java | 175 +-
.../multi/GT_MetaTileEntity_LargeTurbine.java | 242 +-
.../multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 77 +-
...GT_MetaTileEntity_LargeTurbine_GasAdvanced.java | 106 +-
.../GT_MetaTileEntity_LargeTurbine_HPSteam.java | 90 +-
.../GT_MetaTileEntity_LargeTurbine_Plasma.java | 207 +-
.../GT_MetaTileEntity_LargeTurbine_Steam.java | 108 +-
.../multi/GT_MetaTileEntity_MultiFurnace.java | 219 +-
.../multi/GT_MetaTileEntity_OilCracker.java | 229 +-
.../multi/GT_MetaTileEntity_OilDrillBase.java | 219 +-
.../multi/GT_MetaTileEntity_OilDrillInfinite.java | 12 +-
.../multi/GT_MetaTileEntity_OreDrillingPlant1.java | 4 +-
.../multi/GT_MetaTileEntity_OreDrillingPlant2.java | 4 +-
.../multi/GT_MetaTileEntity_OreDrillingPlant3.java | 4 +-
.../multi/GT_MetaTileEntity_OreDrillingPlant4.java | 4 +-
.../GT_MetaTileEntity_OreDrillingPlantBase.java | 200 +-
.../multi/GT_MetaTileEntity_PlasmaForge.java | 1192 +-
.../GT_MetaTileEntity_PrimitiveBlastFurnace.java | 143 +-
.../multi/GT_MetaTileEntity_ProcessingArray.java | 233 +-
.../multi/GT_MetaTileEntity_PyrolyseOven.java | 169 +-
.../multi/GT_MetaTileEntity_VacuumFreezer.java | 73 +-
.../machines/multiblock/MultiBlock_Macerator.java | 108 +-
.../GT_MetaTileEntity_AlloySmelter_Bronze.java | 75 +-
.../GT_MetaTileEntity_AlloySmelter_Steel.java | 75 +-
.../steam/GT_MetaTileEntity_Compressor_Bronze.java | 75 +-
.../steam/GT_MetaTileEntity_Compressor_Steel.java | 75 +-
.../steam/GT_MetaTileEntity_Extractor_Bronze.java | 75 +-
.../steam/GT_MetaTileEntity_Extractor_Steel.java | 75 +-
.../GT_MetaTileEntity_ForgeHammer_Bronze.java | 86 +-
.../steam/GT_MetaTileEntity_ForgeHammer_Steel.java | 86 +-
.../steam/GT_MetaTileEntity_Furnace_Bronze.java | 79 +-
.../steam/GT_MetaTileEntity_Furnace_Steel.java | 77 +-
.../steam/GT_MetaTileEntity_Macerator_Bronze.java | 111 +-
.../steam/GT_MetaTileEntity_Macerator_Steel.java | 116 +-
.../GT_MetaTileEntity_DigitalChestBase.java | 200 +-
.../storage/GT_MetaTileEntity_DigitalTankBase.java | 64 +-
.../storage/GT_MetaTileEntity_Locker.java | 27 +-
.../storage/GT_MetaTileEntity_QuantumChest.java | 7 +-
.../storage/GT_MetaTileEntity_QuantumTank.java | 27 +-
.../storage/GT_MetaTileEntity_SuperChest.java | 3 +-
.../storage/GT_MetaTileEntity_SuperTank.java | 26 +-
src/main/java/gregtech/common/tools/GT_Tool.java | 59 +-
.../java/gregtech/common/tools/GT_Tool_Axe.java | 86 +-
.../common/tools/GT_Tool_BranchCutter.java | 31 +-
.../common/tools/GT_Tool_ButcheryKnife.java | 10 +-
.../gregtech/common/tools/GT_Tool_BuzzSaw.java | 14 +-
.../gregtech/common/tools/GT_Tool_Chainsaw_HV.java | 6 +-
.../gregtech/common/tools/GT_Tool_Chainsaw_LV.java | 86 +-
.../gregtech/common/tools/GT_Tool_Chainsaw_MV.java | 6 +-
.../gregtech/common/tools/GT_Tool_Crowbar.java | 14 +-
.../gregtech/common/tools/GT_Tool_Drill_HV.java | 6 +-
.../gregtech/common/tools/GT_Tool_Drill_LV.java | 40 +-
.../gregtech/common/tools/GT_Tool_Drill_MV.java | 9 +-
.../java/gregtech/common/tools/GT_Tool_File.java | 22 +-
.../gregtech/common/tools/GT_Tool_HardHammer.java | 57 +-
.../java/gregtech/common/tools/GT_Tool_Hoe.java | 20 +-
.../gregtech/common/tools/GT_Tool_JackHammer.java | 43 +-
.../java/gregtech/common/tools/GT_Tool_Knife.java | 5 +-
.../java/gregtech/common/tools/GT_Tool_Mortar.java | 7 +-
.../gregtech/common/tools/GT_Tool_Pickaxe.java | 33 +-
.../java/gregtech/common/tools/GT_Tool_Plow.java | 53 +-
.../gregtech/common/tools/GT_Tool_Plunger.java | 17 +-
.../gregtech/common/tools/GT_Tool_RollingPin.java | 7 +-
.../java/gregtech/common/tools/GT_Tool_Saw.java | 60 +-
.../java/gregtech/common/tools/GT_Tool_Scoop.java | 18 +-
.../gregtech/common/tools/GT_Tool_Screwdriver.java | 34 +-
.../common/tools/GT_Tool_Screwdriver_LV.java | 10 +-
.../java/gregtech/common/tools/GT_Tool_Sense.java | 51 +-
.../java/gregtech/common/tools/GT_Tool_Shovel.java | 28 +-
.../gregtech/common/tools/GT_Tool_SoftHammer.java | 18 +-
.../common/tools/GT_Tool_Soldering_Iron.java | 29 +-
.../java/gregtech/common/tools/GT_Tool_Sword.java | 36 +-
.../gregtech/common/tools/GT_Tool_Turbine.java | 5 +-
.../common/tools/GT_Tool_UniversalSpade.java | 56 +-
.../gregtech/common/tools/GT_Tool_WireCutter.java | 13 +-
.../java/gregtech/common/tools/GT_Tool_Wrench.java | 19 +-
.../gregtech/common/tools/GT_Tool_Wrench_HV.java | 10 +-
.../gregtech/common/tools/GT_Tool_Wrench_LV.java | 13 +-
.../gregtech/common/tools/GT_Tool_Wrench_MV.java | 10 +-
.../crossmod/GregtechWailaDataProvider.java | 31 +-
src/main/java/gregtech/crossmod/Harvestcraft.java | 3 +-
src/main/java/gregtech/crossmod/Waila.java | 8 +-
src/main/java/gregtech/loaders/ExtraIcons.java | 12 +-
.../java/gregtech/loaders/load/GT_FuelLoader.java | 140 +-
.../gregtech/loaders/load/GT_ItemIterator.java | 329 +-
.../gregtech/loaders/load/GT_SonictronLoader.java | 3 +-
.../materialprocessing/ProcessingConfig.java | 33 +-
.../materialprocessing/ProcessingModSupport.java | 14 +-
.../gregtech/loaders/misc/GT_Achievements.java | 302 +-
.../gregtech/loaders/misc/GT_BeeDefinition.java | 2815 +-
src/main/java/gregtech/loaders/misc/GT_Bees.java | 60 +-
.../gregtech/loaders/misc/GT_BranchDefinition.java | 61 +-
.../java/gregtech/loaders/misc/GT_CoverLoader.java | 32 +-
.../loaders/oreprocessing/ProcessingAll.java | 9 +-
.../loaders/oreprocessing/ProcessingArrows.java | 101 +-
.../loaders/oreprocessing/ProcessingBeans.java | 6 +-
.../loaders/oreprocessing/ProcessingBlock.java | 77 +-
.../loaders/oreprocessing/ProcessingBolt.java | 11 +-
.../loaders/oreprocessing/ProcessingCell.java | 129 +-
.../loaders/oreprocessing/ProcessingCircuit.java | 31 +-
.../oreprocessing/ProcessingCompressed.java | 8 +-
.../loaders/oreprocessing/ProcessingCrafting.java | 408 +-
.../loaders/oreprocessing/ProcessingCrate.java | 91 +-
.../loaders/oreprocessing/ProcessingCrop.java | 73 +-
.../oreprocessing/ProcessingCrushedOre.java | 112 +-
.../oreprocessing/ProcessingCrystallized.java | 16 +-
.../loaders/oreprocessing/ProcessingDirty.java | 134 +-
.../loaders/oreprocessing/ProcessingDust.java | 431 +-
.../loaders/oreprocessing/ProcessingDye.java | 56 +-
.../loaders/oreprocessing/ProcessingFineWire.java | 27 +-
.../loaders/oreprocessing/ProcessingFoil.java | 12 +-
.../loaders/oreprocessing/ProcessingFood.java | 63 +-
.../loaders/oreprocessing/ProcessingGear.java | 91 +-
.../loaders/oreprocessing/ProcessingGem.java | 267 +-
.../loaders/oreprocessing/ProcessingIngot.java | 186 +-
.../loaders/oreprocessing/ProcessingItem.java | 14 +-
.../loaders/oreprocessing/ProcessingLens.java | 38 +-
.../loaders/oreprocessing/ProcessingLog.java | 293 +-
.../loaders/oreprocessing/ProcessingNugget.java | 41 +-
.../loaders/oreprocessing/ProcessingOre.java | 197 +-
.../loaders/oreprocessing/ProcessingOrePoor.java | 29 +-
.../oreprocessing/ProcessingOreSmelting.java | 132 +-
.../loaders/oreprocessing/ProcessingPipe.java | 133 +-
.../loaders/oreprocessing/ProcessingPlank.java | 130 +-
.../loaders/oreprocessing/ProcessingPlate.java | 382 +-
.../loaders/oreprocessing/ProcessingPure.java | 23 +-
.../loaders/oreprocessing/ProcessingRecycling.java | 15 +-
.../loaders/oreprocessing/ProcessingRotor.java | 59 +-
.../loaders/oreprocessing/ProcessingRound.java | 25 +-
.../loaders/oreprocessing/ProcessingSand.java | 25 +-
.../loaders/oreprocessing/ProcessingSaplings.java | 17 +-
.../loaders/oreprocessing/ProcessingScrew.java | 15 +-
.../loaders/oreprocessing/ProcessingShaping.java | 448 +-
.../loaders/oreprocessing/ProcessingSlab.java | 18 +-
.../loaders/oreprocessing/ProcessingStick.java | 54 +-
.../loaders/oreprocessing/ProcessingStickLong.java | 36 +-
.../loaders/oreprocessing/ProcessingStone.java | 178 +-
.../oreprocessing/ProcessingStoneCobble.java | 32 +-
.../oreprocessing/ProcessingStoneVarious.java | 21 +-
.../loaders/oreprocessing/ProcessingToolHead.java | 1845 +-
.../loaders/oreprocessing/ProcessingToolOther.java | 177 +-
.../oreprocessing/ProcessingTransforming.java | 103 +-
.../loaders/oreprocessing/ProcessingWax.java | 6 +-
.../loaders/oreprocessing/ProcessingWire.java | 424 +-
.../loaders/postload/GT_BlockResistanceLoader.java | 4 +-
.../loaders/postload/GT_BookAndLootLoader.java | 336 +-
.../loaders/postload/GT_CraftingRecipeLoader.java | 3840 ++-
.../gregtech/loaders/postload/GT_CropLoader.java | 1424 +-
.../loaders/postload/GT_MachineRecipeLoader.java | 26888 ++++++++++++++++---
.../gregtech/loaders/postload/GT_PostLoad.java | 392 +-
.../postload/GT_ProcessingArrayRecipeLoader.java | 180 +-
.../postload/GT_RecyclerBlacklistLoader.java | 59 +-
.../loaders/postload/GT_UUMRecipeLoader.java | 3 +-
.../loaders/postload/GT_Worldgenloader.java | 1756 +-
.../gregtech/loaders/postload/PartP2PGTPower.java | 26 +-
.../loaders/preload/GT_Loader_ItemData.java | 452 +-
.../preload/GT_Loader_Item_Block_And_Fluid.java | 3195 ++-
.../preload/GT_Loader_MetaTileEntities.java | 15834 ++++++++++-
.../preload/GT_Loader_MultiTileEntities.java | 47 +-
.../loaders/preload/GT_Loader_OreDictionary.java | 353 +-
.../loaders/preload/GT_Loader_OreProcessing.java | 3 +-
.../java/gregtech/loaders/preload/GT_PreLoad.java | 884 +-
.../java/gregtech/nei/GT_NEI_AssLineHandler.java | 239 +-
.../java/gregtech/nei/GT_NEI_DefaultHandler.java | 513 +-
.../gregtech/nei/NEIHandlerAbsoluteTooltip.java | 8 +-
src/main/java/gregtech/nei/NEI_GT_Config.java | 8 +-
.../java/gregtech/nei/NEI_TransferRectHost.java | 3 +
src/main/java/gregtech/nei/RecipeMapHandler.java | 4 +-
724 files changed, 135432 insertions(+), 39095 deletions(-)
(limited to 'src/main/java/gregtech')
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index f59c7c18df..7025c16416 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -1,5 +1,8 @@
package gregtech;
+import static gregtech.api.GregTech_API.registerCircuitProgrammer;
+import static gregtech.api.enums.GT_Values.MOD_ID_FR;
+
import appeng.api.AEApi;
import com.google.common.base.Stopwatch;
import cpw.mods.fml.common.FMLCommonHandler;
@@ -15,8 +18,6 @@ import cpw.mods.fml.common.event.FMLServerStartedEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.enchants.Enchantment_EnderDamage;
import gregtech.api.enchants.Enchantment_Radioactivity;
@@ -56,7 +57,6 @@ import gregtech.common.misc.GT_Command;
import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalChestBase;
import gregtech.crossmod.Harvestcraft;
import gregtech.crossmod.Waila;
-import gregtech.loaders.ExtraIcons;
import gregtech.loaders.load.GT_CoverBehaviorLoader;
import gregtech.loaders.load.GT_FuelLoader;
import gregtech.loaders.load.GT_ItemIterator;
@@ -69,6 +69,13 @@ import gregtech.loaders.preload.*;
import gregtech.nei.IMCForNEI;
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeOutput;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.Map;
+import java.util.function.Predicate;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -85,71 +92,67 @@ import net.minecraftforge.oredict.OreDictionary;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Locale;
-import java.util.Map;
-import java.util.function.Predicate;
-
-import static gregtech.api.GregTech_API.registerCircuitProgrammer;
-import static gregtech.api.enums.GT_Values.MOD_ID_FR;
-
-@Mod(modid = "gregtech", name = "GregTech", version = "MC1710",
+@Mod(
+ modid = "gregtech",
+ name = "GregTech",
+ version = "MC1710",
guiFactory = "gregtech.client.GT_GuiFactory",
- dependencies = " required-after:IC2;" +
- " required-after:structurelib;" +
- " required-after:gtnhlib;" +
- " after:dreamcraft;" +
- " after:Forestry;" +
- " after:PFAAGeologica;" +
- " after:Thaumcraft;" +
- " after:Railcraft;" +
- " after:appliedenergistics2;" +
- " after:ThermalExpansion;" +
- " after:TwilightForest;" +
- " after:harvestcraft;" +
- " after:magicalcrops;" +
- " after:Botania;" +
- " after:BuildCraft|Transport;" +
- " after:BuildCraft|Silicon;" +
- " after:BuildCraft|Factory;" +
- " after:BuildCraft|Energy;" +
- " after:BuildCraft|Core;" +
- " after:BuildCraft|Builders;" +
- " after:GalacticraftCore;" +
- " after:GalacticraftMars;" +
- " after:GalacticraftPlanets;" +
- " after:ThermalExpansion|Transport;" +
- " after:ThermalExpansion|Energy;" +
- " after:ThermalExpansion|Factory;" +
- " after:RedPowerCore;" +
- " after:RedPowerBase;" +
- " after:RedPowerMachine;" +
- " after:RedPowerCompat;" +
- " after:RedPowerWiring;" +
- " after:RedPowerLogic;" +
- " after:RedPowerLighting;" +
- " after:RedPowerWorld;" +
- " after:RedPowerControl;" +
- " after:UndergroundBiomes;" +
- " after:TConstruct;" +
- " after:Translocator;" +
- " after:gendustry;")
+ dependencies = " required-after:IC2;" + " required-after:structurelib;"
+ + " required-after:gtnhlib;"
+ + " after:dreamcraft;"
+ + " after:Forestry;"
+ + " after:PFAAGeologica;"
+ + " after:Thaumcraft;"
+ + " after:Railcraft;"
+ + " after:appliedenergistics2;"
+ + " after:ThermalExpansion;"
+ + " after:TwilightForest;"
+ + " after:harvestcraft;"
+ + " after:magicalcrops;"
+ + " after:Botania;"
+ + " after:BuildCraft|Transport;"
+ + " after:BuildCraft|Silicon;"
+ + " after:BuildCraft|Factory;"
+ + " after:BuildCraft|Energy;"
+ + " after:BuildCraft|Core;"
+ + " after:BuildCraft|Builders;"
+ + " after:GalacticraftCore;"
+ + " after:GalacticraftMars;"
+ + " after:GalacticraftPlanets;"
+ + " after:ThermalExpansion|Transport;"
+ + " after:ThermalExpansion|Energy;"
+ + " after:ThermalExpansion|Factory;"
+ + " after:RedPowerCore;"
+ + " after:RedPowerBase;"
+ + " after:RedPowerMachine;"
+ + " after:RedPowerCompat;"
+ + " after:RedPowerWiring;"
+ + " after:RedPowerLogic;"
+ + " after:RedPowerLighting;"
+ + " after:RedPowerWorld;"
+ + " after:RedPowerControl;"
+ + " after:UndergroundBiomes;"
+ + " after:TConstruct;"
+ + " after:Translocator;"
+ + " after:gendustry;")
public class GT_Mod implements IGT_Mod {
@Deprecated // Keep for use in BaseMetaTileEntity
public static final int VERSION = 509, SUBVERSION = 40;
+
@SuppressWarnings("DeprecatedIsStillUsed") // Need initialization until it is deleted
@Deprecated
public static final int TOTAL_VERSION = calculateTotalGTVersion(VERSION, SUBVERSION);
+
@Deprecated
public static final int REQUIRED_IC2 = 624;
+
@Mod.Instance("gregtech")
public static GT_Mod instance;
+
@SidedProxy(modId = "gregtech", clientSide = "gregtech.common.GT_Client", serverSide = "gregtech.common.GT_Server")
public static GT_Proxy gregtechproxy;
+
public static int MAX_IC2 = 2147483647;
public static GT_Achievements achievements;
public static final String aTextGeneral = "general";
@@ -157,8 +160,17 @@ public class GT_Mod implements IGT_Mod {
public static final Logger GT_FML_LOGGER = LogManager.getLogger("GregTech GTNH");
static {
- if ((509 != GregTech_API.VERSION) || (509 != GT_ModHandler.VERSION) || (509 != GT_OreDictUnificator.VERSION) || (509 != GT_Recipe.VERSION) || (509 != GT_Utility.VERSION) || (509 != GT_RecipeRegistrator.VERSION) || (509 != Element.VERSION) || (509 != Materials.VERSION) || (509 != OrePrefixes.VERSION)) {
- throw new GT_ItsNotMyFaultException("One of your Mods included GregTech-API Files inside it's download, mention this to the Mod Author, who does this bad thing, and tell him/her to use reflection. I have added a Version check, to prevent Authors from breaking my Mod that way.");
+ if ((509 != GregTech_API.VERSION)
+ || (509 != GT_ModHandler.VERSION)
+ || (509 != GT_OreDictUnificator.VERSION)
+ || (509 != GT_Recipe.VERSION)
+ || (509 != GT_Utility.VERSION)
+ || (509 != GT_RecipeRegistrator.VERSION)
+ || (509 != Element.VERSION)
+ || (509 != Materials.VERSION)
+ || (509 != OrePrefixes.VERSION)) {
+ throw new GT_ItsNotMyFaultException(
+ "One of your Mods included GregTech-API Files inside it's download, mention this to the Mod Author, who does this bad thing, and tell him/her to use reflection. I have added a Version check, to prevent Authors from breaking my Mod that way.");
}
}
@@ -222,7 +234,8 @@ public class GT_Mod implements IGT_Mod {
GT_PreLoad.adjustScrap();
EntityRegistry.registerModEntity(GT_Entity_Arrow.class, "GT_Entity_Arrow", 1, GT_Values.GT, 160, 1, true);
- EntityRegistry.registerModEntity(GT_Entity_Arrow_Potion.class, "GT_Entity_Arrow_Potion", 2, GT_Values.GT, 160, 1, true);
+ EntityRegistry.registerModEntity(
+ GT_Entity_Arrow_Potion.class, "GT_Entity_Arrow_Potion", 2, GT_Values.GT, 160, 1, true);
GT_PreLoad.runMineTweakerCompat();
@@ -251,8 +264,7 @@ public class GT_Mod implements IGT_Mod {
}
}
- if (FMLCommonHandler.instance().getEffectiveSide().isServer())
- GT_Assemblyline_Server.fillMap(aEvent);
+ if (FMLCommonHandler.instance().getEffectiveSide().isServer()) GT_Assemblyline_Server.fillMap(aEvent);
}
@Mod.EventHandler
@@ -280,16 +292,17 @@ public class GT_Mod implements IGT_Mod {
gregtechproxy.onLoad();
- registerCircuitProgrammer(new Predicate() {
- private final int screwdriverOreId = OreDictionary.getOreID("craftingToolScrewdriver");
- @Override
- public boolean test(ItemStack stack) {
- for (int i : OreDictionary.getOreIDs(stack))
- if (i == screwdriverOreId)
- return true;
- return false;
- }
- }, true);
+ registerCircuitProgrammer(
+ new Predicate() {
+ private final int screwdriverOreId = OreDictionary.getOreID("craftingToolScrewdriver");
+
+ @Override
+ public boolean test(ItemStack stack) {
+ for (int i : OreDictionary.getOreIDs(stack)) if (i == screwdriverOreId) return true;
+ return false;
+ }
+ },
+ true);
if (gregtechproxy.mSortToTheEnd) {
new GT_ItemIterator().run();
@@ -310,7 +323,6 @@ public class GT_Mod implements IGT_Mod {
e.printStackTrace(GT_Log.err);
}
}
-
}
@Mod.EventHandler
@@ -354,14 +366,42 @@ public class GT_Mod implements IGT_Mod {
new GT_Worldgenloader().run();
new GT_CoverLoader().run();
- GT_RecipeRegistrator.registerUsagesForMaterials(null, false, new ItemStack(Blocks.planks, 1), new ItemStack(Blocks.cobblestone, 1), new ItemStack(Blocks.stone, 1), new ItemStack(Items.leather, 1));
-
- GT_OreDictUnificator.addItemData(GT_ModHandler.getRecipeOutput(null, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Tin, 1L), null, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Tin, 1L), null, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Tin, 1L), null, null, null), new ItemData(Materials.Tin, 10886400L));
+ GT_RecipeRegistrator.registerUsagesForMaterials(
+ null,
+ false,
+ new ItemStack(Blocks.planks, 1),
+ new ItemStack(Blocks.cobblestone, 1),
+ new ItemStack(Blocks.stone, 1),
+ new ItemStack(Items.leather, 1));
+
+ GT_OreDictUnificator.addItemData(
+ GT_ModHandler.getRecipeOutput(
+ null,
+ GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Tin, 1L),
+ null,
+ GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Tin, 1L),
+ null,
+ GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Tin, 1L),
+ null,
+ null,
+ null),
+ new ItemData(Materials.Tin, 10886400L));
if (!GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.storageblockcrafting, "tile.glowstone", false)) {
- GT_ModHandler.removeRecipe(new ItemStack(Items.glowstone_dust, 1), new ItemStack(Items.glowstone_dust, 1), null, new ItemStack(Items.glowstone_dust, 1), new ItemStack(Items.glowstone_dust, 1));
- }
- GT_ModHandler.removeRecipeDelayed(new ItemStack(Blocks.wooden_slab, 1, 0), new ItemStack(Blocks.wooden_slab, 1, 1), new ItemStack(Blocks.wooden_slab, 1, 2));
- GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.wooden_slab, 6, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"WWW", 'W', new ItemStack(Blocks.planks, 1, 0)});
+ GT_ModHandler.removeRecipe(
+ new ItemStack(Items.glowstone_dust, 1),
+ new ItemStack(Items.glowstone_dust, 1),
+ null,
+ new ItemStack(Items.glowstone_dust, 1),
+ new ItemStack(Items.glowstone_dust, 1));
+ }
+ GT_ModHandler.removeRecipeDelayed(
+ new ItemStack(Blocks.wooden_slab, 1, 0),
+ new ItemStack(Blocks.wooden_slab, 1, 1),
+ new ItemStack(Blocks.wooden_slab, 1, 2));
+ GT_ModHandler.addCraftingRecipe(
+ new ItemStack(Blocks.wooden_slab, 6, 0),
+ GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {"WWW", 'W', new ItemStack(Blocks.planks, 1, 0)});
// Save a copy of these list before activateOreDictHandler(), then loop over them.
Map aMaceratorRecipeList = GT_ModHandler.getMaceratorRecipeList();
@@ -370,22 +410,35 @@ public class GT_Mod implements IGT_Mod {
Map aOreWashingRecipeList = GT_ModHandler.getOreWashingRecipeList();
Map aThermalCentrifugeRecipeList = GT_ModHandler.getThermalCentrifugeRecipeList();
- GT_Log.out.println("GT_Mod: Activating OreDictionary Handler, this can take some time, as it scans the whole OreDictionary");
- GT_FML_LOGGER.info("If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager.");
+ GT_Log.out.println(
+ "GT_Mod: Activating OreDictionary Handler, this can take some time, as it scans the whole OreDictionary");
+ GT_FML_LOGGER.info(
+ "If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager.");
GT_PostLoad.activateOreDictHandler();
GT_PostLoad.replaceVanillaMaterials();
- GT_PostLoad.removeIc2Recipes(aMaceratorRecipeList, aCompressorRecipeList, aExtractorRecipeList, aOreWashingRecipeList, aThermalCentrifugeRecipeList);
+ GT_PostLoad.removeIc2Recipes(
+ aMaceratorRecipeList,
+ aCompressorRecipeList,
+ aExtractorRecipeList,
+ aOreWashingRecipeList,
+ aThermalCentrifugeRecipeList);
if (GT_Values.D1) {
- GT_ModHandler.sSingleNonBlockDamagableRecipeList.forEach(iRecipe -> GT_Log.out.println("=> " + iRecipe.getRecipeOutput().getDisplayName()));
+ GT_ModHandler.sSingleNonBlockDamagableRecipeList.forEach(iRecipe ->
+ GT_Log.out.println("=> " + iRecipe.getRecipeOutput().getDisplayName()));
}
new GT_CraftingRecipeLoader().run();
if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, "ic2forgehammer", true)) {
GT_ModHandler.removeRecipeByOutput(ItemList.IC2_ForgeHammer.getWildcard(1L));
}
GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item("machine", 1L));
- GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("machine", 1L), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "RwR", "RRR", 'R', OrePrefixes.plate.get(Materials.Iron)});
+ GT_ModHandler.addCraftingRecipe(
+ GT_ModHandler.getIC2Item("machine", 1L),
+ GT_ModHandler.RecipeBits.BUFFERED
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE,
+ new Object[] {"RRR", "RwR", "RRR", 'R', OrePrefixes.plate.get(Materials.Iron)});
GT_PostLoad.registerFluidCannerRecipes();
@@ -395,7 +448,11 @@ public class GT_Mod implements IGT_Mod {
}
if (GregTech_API.mAE2) {
GT_MetaTileEntity_DigitalChestBase.registerAEIntegration();
- ItemStack facade = AEApi.instance().definitions().items().facade().maybeItem()
+ ItemStack facade = AEApi.instance()
+ .definitions()
+ .items()
+ .facade()
+ .maybeItem()
.transform(i -> new ItemStack(i, 1, GT_Values.W))
.orNull();
if (facade != null) {
@@ -403,14 +460,30 @@ public class GT_Mod implements IGT_Mod {
}
}
-
- Arrays.stream(new String[]{
- "blastfurnace", "blockcutter", "inductionFurnace", "generator", "windMill", "waterMill", "solarPanel", "centrifuge", "electrolyzer", "compressor",
- "electroFurnace", "extractor", "macerator", "recycler", "metalformer", "orewashingplant", "massFabricator", "replicator",
- })
- .filter(tName -> GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + tName, true))
- .map(tName -> GT_ModHandler.getIC2Item(tName, 1L)).forEach(GT_ModHandler::removeRecipeByOutputDelayed);
-
+ Arrays.stream(new String[] {
+ "blastfurnace",
+ "blockcutter",
+ "inductionFurnace",
+ "generator",
+ "windMill",
+ "waterMill",
+ "solarPanel",
+ "centrifuge",
+ "electrolyzer",
+ "compressor",
+ "electroFurnace",
+ "extractor",
+ "macerator",
+ "recycler",
+ "metalformer",
+ "orewashingplant",
+ "massFabricator",
+ "replicator",
+ })
+ .filter(tName ->
+ GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.disabledrecipes, aTextIC2 + tName, true))
+ .map(tName -> GT_ModHandler.getIC2Item(tName, 1L))
+ .forEach(GT_ModHandler::removeRecipeByOutputDelayed);
GT_PostLoad.nerfVanillaTools();
new GT_ExtremeDieselFuelLoader().run();
@@ -494,56 +567,95 @@ public class GT_Mod implements IGT_Mod {
}
gregtechproxy.onServerStarting();
- //Check for more IC2 recipes on ServerStart to also catch MineTweaker additions
- GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getMaceratorRecipeList(), GT_Recipe.GT_Recipe_Map.sMaceratorRecipes, true, true, true);
- GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getCompressorRecipeList(), GT_Recipe.GT_Recipe_Map.sCompressorRecipes, true, true, true);
- GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getExtractorRecipeList(), GT_Recipe.GT_Recipe_Map.sExtractorRecipes, true, true, true);
- GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getOreWashingRecipeList(), GT_Recipe.GT_Recipe_Map.sOreWasherRecipes, false, true, true);
- GT_ModHandler.addIC2RecipesToGT(GT_ModHandler.getThermalCentrifugeRecipeList(), GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes, true, true, true);
+ // Check for more IC2 recipes on ServerStart to also catch MineTweaker additions
+ GT_ModHandler.addIC2RecipesToGT(
+ GT_ModHandler.getMaceratorRecipeList(), GT_Recipe.GT_Recipe_Map.sMaceratorRecipes, true, true, true);
+ GT_ModHandler.addIC2RecipesToGT(
+ GT_ModHandler.getCompressorRecipeList(), GT_Recipe.GT_Recipe_Map.sCompressorRecipes, true, true, true);
+ GT_ModHandler.addIC2RecipesToGT(
+ GT_ModHandler.getExtractorRecipeList(), GT_Recipe.GT_Recipe_Map.sExtractorRecipes, true, true, true);
+ GT_ModHandler.addIC2RecipesToGT(
+ GT_ModHandler.getOreWashingRecipeList(), GT_Recipe.GT_Recipe_Map.sOreWasherRecipes, false, true, true);
+ GT_ModHandler.addIC2RecipesToGT(
+ GT_ModHandler.getThermalCentrifugeRecipeList(),
+ GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes,
+ true,
+ true,
+ true);
GT_Log.out.println("GT_Mod: Unificating outputs of all known Recipe Types.");
ArrayList tStacks = new ArrayList<>(10000);
GT_Log.out.println("GT_Mod: IC2 Machines");
- ic2.api.recipe.Recipes.cannerBottle.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.centrifuge.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.compressor.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.extractor.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.macerator.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.metalformerCutting.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.metalformerExtruding.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.metalformerRolling.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.matterAmplifier.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
- ic2.api.recipe.Recipes.oreWashing.getRecipes().values().stream().map(t -> t.items).forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.cannerBottle.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.centrifuge.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.compressor.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.extractor.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.macerator.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.metalformerCutting.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.metalformerExtruding.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.metalformerRolling.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.matterAmplifier.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
+ ic2.api.recipe.Recipes.oreWashing.getRecipes().values().stream()
+ .map(t -> t.items)
+ .forEach(tStacks::addAll);
GT_Log.out.println("GT_Mod: Dungeon Loot");
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("dungeonChest").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("dungeonChest").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("bonusChest").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("bonusChest").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("villageBlacksmith").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("villageBlacksmith").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdCrossing").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("strongholdCrossing").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdLibrary").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("strongholdLibrary").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("strongholdCorridor").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("strongholdCorridor").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidJungleDispenser").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("pyramidJungleDispenser").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidJungleChest").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("pyramidJungleChest").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("pyramidDesertyChest").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("pyramidDesertyChest").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
- for (WeightedRandomChestContent tContent : ChestGenHooks.getInfo("mineshaftCorridor").getItems(new XSTR())) {
+ for (WeightedRandomChestContent tContent :
+ ChestGenHooks.getInfo("mineshaftCorridor").getItems(new XSTR())) {
tStacks.add(tContent.theItemId);
}
GT_Log.out.println("GT_Mod: Smelting");
@@ -562,19 +674,31 @@ public class GT_Mod implements IGT_Mod {
for (ItemStack tOutput : tStacks) {
if (gregtechproxy.mRegisteredOres.contains(tOutput)) {
GT_FML_LOGGER.error("GT-ERR-01: @ " + tOutput.getUnlocalizedName() + " " + tOutput.getDisplayName());
- GT_FML_LOGGER.error("A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error");
- GT_FML_LOGGER.error("Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly.");
- GT_FML_LOGGER.error("Please check all Recipes outputting this Item, and report the Recipes to their Owner.");
- GT_FML_LOGGER.error("The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!");
- GT_FML_LOGGER.error("And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don't want failed Bug Reports.");
- GT_FML_LOGGER.error("GregTech just reports this Error to you, so you can report it to the Mod causing the Problem.");
- GT_FML_LOGGER.error("Even though I make that Bug visible, I can not and will not fix that for you, that's for the causing Mod to fix.");
+ GT_FML_LOGGER.error(
+ "A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error");
+ GT_FML_LOGGER.error(
+ "Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly.");
+ GT_FML_LOGGER.error(
+ "Please check all Recipes outputting this Item, and report the Recipes to their Owner.");
+ GT_FML_LOGGER.error(
+ "The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!");
+ GT_FML_LOGGER.error(
+ "And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don't want failed Bug Reports.");
+ GT_FML_LOGGER.error(
+ "GregTech just reports this Error to you, so you can report it to the Mod causing the Problem.");
+ GT_FML_LOGGER.error(
+ "Even though I make that Bug visible, I can not and will not fix that for you, that's for the causing Mod to fix.");
GT_FML_LOGGER.error("And speaking of failed Reports:");
- GT_FML_LOGGER.error("Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don't report it to either of them.");
- GT_FML_LOGGER.error("I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT.");
- GT_FML_LOGGER.error("Asking in the IC2 Forums, which Mod is causing that, won't help anyone, since it is not possible to determine, which Mod it is.");
- GT_FML_LOGGER.error("If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible.");
- GT_FML_LOGGER.error("Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially allcapsed Language.");
+ GT_FML_LOGGER.error(
+ "Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don't report it to either of them.");
+ GT_FML_LOGGER.error(
+ "I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT.");
+ GT_FML_LOGGER.error(
+ "Asking in the IC2 Forums, which Mod is causing that, won't help anyone, since it is not possible to determine, which Mod it is.");
+ GT_FML_LOGGER.error(
+ "If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible.");
+ GT_FML_LOGGER.error(
+ "Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially allcapsed Language.");
GT_FML_LOGGER.error("Also it is a Ban Reason on the IC2-Forums to post this seriously.");
tOutput.setStackDisplayName("ERROR! PLEASE CHECK YOUR LOG FOR 'GT-ERR-01'!");
} else {
@@ -634,7 +758,6 @@ public class GT_Mod implements IGT_Mod {
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
-
}
@Mod.EventHandler
@@ -656,7 +779,7 @@ public class GT_Mod implements IGT_Mod {
e.printStackTrace(GT_Log.err);
}
}
- //Interrupt IDLE Threads to close down cleanly
+ // Interrupt IDLE Threads to close down cleanly
GT_Runnable_MachineBlockUpdate.shutdownExecutorService();
}
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java
index 2400f1eef9..56e80d4971 100644
--- a/src/main/java/gregtech/api/GregTech_API.java
+++ b/src/main/java/gregtech/api/GregTech_API.java
@@ -1,5 +1,10 @@
package gregtech.api;
+import static gregtech.api.enums.GT_Values.B;
+import static gregtech.api.enums.GT_Values.L;
+import static gregtech.api.enums.GT_Values.M;
+import static gregtech.api.enums.GT_Values.MOD_ID_IC2;
+
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -37,16 +42,6 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.api.world.GT_Worldgen;
import gregtech.common.items.GT_IntegratedCircuit_Item;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.Fluid;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -62,11 +57,15 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.function.Predicate;
import java.util.stream.Collectors;
-
-import static gregtech.api.enums.GT_Values.B;
-import static gregtech.api.enums.GT_Values.L;
-import static gregtech.api.enums.GT_Values.M;
-import static gregtech.api.enums.GT_Values.MOD_ID_IC2;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.Fluid;
/**
* Please do not include this File in your Mod-download as it ruins compatibility, like with the IC2-API
@@ -84,7 +83,6 @@ import static gregtech.api.enums.GT_Values.MOD_ID_IC2;
*
* @author Gregorius Techneticies
*/
-
@SuppressWarnings("unused") // API class has legitimately unused methods and members
public class GregTech_API {
@@ -102,6 +100,7 @@ public class GregTech_API {
* Fixes the HashMap Mappings for ItemStacks once the Server started
*/
public static final Collection
*/
public enum SoundResource {
-
RANDOM_BREAK(0, "random.break"),
RANDOM_ANVIL_USE(1, "random.anvil_use"),
RANDOM_ANVIL_BREAK(2, "random.anvil_break"),
@@ -296,8 +294,8 @@ public enum SoundResource {
EnumSet.allOf(SoundResource.class).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));
+ EnumSet.allOf(SoundResource.class)
+ .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 681358f8f1..b1999de89b 100644
--- a/src/main/java/gregtech/api/enums/SubTag.java
+++ b/src/main/java/gregtech/api/enums/SubTag.java
@@ -2,7 +2,6 @@ package gregtech.api.enums;
import gregtech.api.interfaces.ICondition;
import gregtech.api.interfaces.ISubTagContainer;
-
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -29,13 +28,13 @@ public final class SubTag implements ICondition {
* Add this to your Material if you want to have its Ore Calcite heated in a Blast Furnace for more output. Already 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");
+ public static final SubTag BLASTFURNACE_CALCITE_DOUBLE = getNewSubTag("BLASTFURNACE_CALCITE_DOUBLE"),
+ 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 recipe. Already listed are:
* Chalcopyrite, Tetrahedrite
*/
-
public static final SubTag DONT_ADD_DEFAULT_BBF_RECIPE = getNewSubTag("DONT_ADD_DEFAULT_BBF_RECIPE");
/**
@@ -54,9 +53,9 @@ public final class SubTag implements ICondition {
*/
public static final SubTag WASHING_MERCURY = getNewSubTag("WASHING_MERCURY");
/**
- * Add this to your Material if you want to have its Ore Mercury washed with 99% output chance. Already listed are:
- * Silver
- */
+ * Add this to your Material if you want to have its Ore Mercury washed with 99% output chance. Already listed are:
+ * Silver
+ */
public static final SubTag WASHING_MERCURY_99_PERCENT = getNewSubTag("WASHING_MERCURY_99_PERCENT");
/**
* Add this to your Material if you want to have its Ore electromagnetically separated to give Gold.
@@ -69,7 +68,8 @@ 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");
+ public static final SubTag ELECTROMAGNETIC_SEPERATION_NEODYMIUM =
+ getNewSubTag("ELECTROMAGNETIC_SEPERATION_NEODYMIUM");
/**
* Add this to your Material if you want to have its Ore giving Cinnabar Crystals on Pulverization. Already listed are:
* Redstone
@@ -239,6 +239,7 @@ public final class SubTag implements ICondition {
* Projectile Tag for Arrows
*/
public static final SubTag PROJECTILE_ARROW = getNewSubTag("PROJECTILE_ARROW");
+
public final Collection mRelevantTaggedItems = new HashSet<>(1);
private SubTag(String aName) {
@@ -248,9 +249,7 @@ public final class SubTag implements ICondition {
}
public static SubTag getNewSubTag(String aName) {
- for (SubTag tSubTag : sSubTags.values())
- if (tSubTag.mName.equals(aName))
- return tSubTag;
+ for (SubTag tSubTag : sSubTags.values()) if (tSubTag.mName.equals(aName)) return tSubTag;
return new SubTag(aName);
}
@@ -269,9 +268,7 @@ public final class SubTag implements ICondition {
public SubTag addTo(ISubTagContainer... aContainers) {
if (aContainers != null)
- for (ISubTagContainer aContainer : aContainers)
- if (aContainer != null)
- aContainer.add(this);
+ for (ISubTagContainer aContainer : aContainers) if (aContainer != null) aContainer.add(this);
return this;
}
diff --git a/src/main/java/gregtech/api/enums/TC_Aspects.java b/src/main/java/gregtech/api/enums/TC_Aspects.java
index 582ffb86f6..cb578cf870 100644
--- a/src/main/java/gregtech/api/enums/TC_Aspects.java
+++ b/src/main/java/gregtech/api/enums/TC_Aspects.java
@@ -62,6 +62,7 @@ public enum TC_Aspects {
* The Thaumcraft Aspect Object of the Mod itself.
*/
public Object mAspect;
+
public int mValue;
TC_Aspects(int aValue) {
@@ -72,7 +73,6 @@ public enum TC_Aspects {
public TC_Aspects mAspect;
public long mAmount;
-
public TC_AspectStack(TC_Aspects aAspect, long aAmount) {
mAspect = aAspect;
mAmount = aAmount;
diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java
index c9ae82ca61..78864e1ca5 100644
--- a/src/main/java/gregtech/api/enums/TextureSet.java
+++ b/src/main/java/gregtech/api/enums/TextureSet.java
@@ -1,12 +1,12 @@
package gregtech.api.enums;
+
import gregtech.api.interfaces.IIconContainer;
public class TextureSet {
public boolean is_custom = false;
- public static final TextureSet
- SET_NONE = new TextureSet("NONE"),
+ public static final TextureSet SET_NONE = new TextureSet("NONE"),
SET_DULL = new TextureSet("DULL"),
SET_RUBY = new TextureSet("RUBY"),
SET_OPAL = new TextureSet("OPAL"),
@@ -37,8 +37,7 @@ public class TextureSet {
/**
* For the Indices of OrePrefixes you need to look into the OrePrefix Enum.
*/
- public static final short
- INDEX_wire = 69,
+ public static final short INDEX_wire = 69,
INDEX_foil = 70,
INDEX_block1 = 71,
INDEX_block2 = 72,
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index 666098b079..238ab4bf58 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -1,23 +1,22 @@
package gregtech.api.enums;
+import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
+import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
+import java.util.HashMap;
+import java.util.Map;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
-import java.util.HashMap;
-import java.util.Map;
-
-import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
-import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
-
public class Textures {
public enum BlockIcons implements IIconContainer, Runnable {
- //ADDED
+ // ADDED
MACHINE_UEV_SIDE,
MACHINE_UIV_SIDE,
@@ -310,7 +309,7 @@ public class Textures {
MACHINE_CASING_FIREBOX_STEEL,
MACHINE_CASING_FIREBOX_TUNGSTENSTEEL,
MACHINE_CASING_ENGINE_INTAKE,
- MACHINE_CASING_EXTREME_ENGINE_INTAKE, //changed color in a terrible way
+ MACHINE_CASING_EXTREME_ENGINE_INTAKE, // changed color in a terrible way
MACHINE_CASING_CHEMICALLY_INERT,
MACHINE_COIL_CUPRONICKEL,
@@ -1267,8 +1266,7 @@ public class Textures {
OVERLAY_ME_INPUT_HATCH,
OVERLAY_ME_INPUT_HATCH_ACTIVE,
OVERLAY_ME_CRAFTING_HATCH,
- OVERLAY_ME_CRAFTING_HATCH_ACTIVE
- ;
+ OVERLAY_ME_CRAFTING_HATCH_ACTIVE;
/**
* Icon for Fresh CFoam
@@ -1280,674 +1278,699 @@ public class Textures {
* 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
- },
- 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
- };
+ 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
+ },
+ 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};
public static final ITexture[] HIDDEN_TEXTURE = {
TextureFactory.builder().addIcon(HIDDEN_FACE).stdOrient().build()
};
- public static final ITexture[] ERROR_RENDERING = {
- TextureFactory.of(RENDERING_ERROR)
- };
+ 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),
@@ -1969,7 +1992,8 @@ public class Textures {
* USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0]
*/
@Deprecated
- public static ITexture[] CASING_BLOCKS = new ITexture[128];//original variable still limited to 128
+ public static ITexture[] CASING_BLOCKS = new ITexture[128]; // original variable still limited to 128
+
public static ITexture[][] MACHINE_CASINGS = new ITexture[15][17];
/**
* by Default pages are null
@@ -1980,7 +2004,9 @@ public class Textures {
* page 12: 0-127 GlodBlock
* page 42: 0-126 glee8e, 127 KekzTech LSC base
*/
- public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
+ public static ITexture[][] casingTexturePages =
+ new ITexture[128][]; // page holder so we don't make an short long array
+
public static final int ERROR_TEXTURE_INDEX = (1 << 7) + 97;
private static final Map reverseMap = new HashMap<>();
@@ -1988,11 +2014,12 @@ public class Textures {
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...
+ // adds some known pages, modders also can do it...
GT_Utility.addTexturePage((byte) 1);
GT_Utility.addTexturePage((byte) 8);
setCasingTextureForId(ERROR_TEXTURE_INDEX, ERROR_RENDERING[0]);
@@ -2071,7 +2098,6 @@ public class Textures {
public ResourceLocation getTextureFile() {
return TextureMap.locationBlocksTexture;
}
-
}
}
@@ -2122,30 +2148,31 @@ public class Textures {
TURBINE_SMALL,
TURBINE_LARGE,
TURBINE_HUGE;
-
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 =
+ {
+ 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,
+ };
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 c812fd6c08..bef43f92ae 100644
--- a/src/main/java/gregtech/api/enums/Tier.java
+++ b/src/main/java/gregtech/api/enums/Tier.java
@@ -7,64 +7,470 @@ 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)),
+ 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)),
- //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_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)),
- };
+ // 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_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)),
+ };
/**
* Used for Crafting Recipes
*/
- public final Object
- mHullObject,
- mConductingObject,
- mLargerConductingObject,
- mManagingObject,
- mBetterManagingObject;
+ public final Object mHullObject, mConductingObject, mLargerConductingObject, mManagingObject, mBetterManagingObject;
+
private final SubTag mType;
private final byte mRank;
- private final long
- mPrimaryValue,
- mSecondaryValue,
- mSpeedMultiplier,
- mEnergyCostMultiplier;
+ private final long mPrimaryValue, mSecondaryValue, mSpeedMultiplier, mEnergyCostMultiplier;
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) {
+ 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) {
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 d41c63c717..27e297de5e 100644
--- a/src/main/java/gregtech/api/enums/ToolDictNames.java
+++ b/src/main/java/gregtech/api/enums/ToolDictNames.java
@@ -32,7 +32,7 @@ public enum ToolDictNames {
public static boolean contains(String aName) {
if (!aName.startsWith("craftingTool")) return false;
- for (ToolDictNames tool: ToolDictNames.values()) {
+ for (ToolDictNames tool : ToolDictNames.values()) {
if (tool.toString().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 93c4f6881c..85d2e3e07a 100644
--- a/src/main/java/gregtech/api/events/BlockScanningEvent.java
+++ b/src/main/java/gregtech/api/events/BlockScanningEvent.java
@@ -1,14 +1,13 @@
package gregtech.api.events;
import cpw.mods.fml.common.eventhandler.Cancelable;
+import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.event.world.WorldEvent;
-import java.util.ArrayList;
-
@Cancelable
public class BlockScanningEvent extends WorldEvent {
@@ -25,7 +24,20 @@ 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) {
+ 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) {
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 5df9e2638a..93b3c87575 100644
--- a/src/main/java/gregtech/api/fluid/FluidTankGT.java
+++ b/src/main/java/gregtech/api/fluid/FluidTankGT.java
@@ -1,16 +1,15 @@
package gregtech.api.fluid;
+import static com.google.common.primitives.Ints.saturatedCast;
+
import gregtech.api.util.GT_Utility;
+import java.util.Map;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidTank;
-import java.util.Map;
-
-import static com.google.common.primitives.Ints.saturatedCast;
-
public class FluidTankGT implements IFluidTank {
public final FluidTankGT[] AS_ARRAY = new FluidTankGT[] {this};
private FluidStack mFluid;
@@ -18,6 +17,7 @@ public class FluidTankGT implements IFluidTank {
private boolean mPreventDraining = false, mVoidExcess = false, mChangedFluids = false;
/** HashMap of adjustable Tank Sizes based on Fluids if needed. */
private Map mAdjustableCapacity = null;
+
private long mAdjustableMultiplier = 1;
/** Gives you a Tank Index in case there is multiple Tanks on a TileEntity that cares. */
public int mIndex = 0;
@@ -102,7 +102,7 @@ public class FluidTankGT implements IFluidTank {
@Override
public FluidStack drain(int aDrained, boolean aDoDrain) {
if (isEmpty() || aDrained <= 0) return null;
- if (mAmount < aDrained) aDrained = (int)mAmount;
+ if (mAmount < aDrained) aDrained = (int) mAmount;
final FluidStack rFluid = new FluidStack(mFluid, aDrained);
if (aDoDrain) {
mAmount -= aDrained;
@@ -190,11 +190,20 @@ public class FluidTankGT implements IFluidTank {
} else mAmount = tCapacity;
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);
+ 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);
}
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)));
+ return aFluid == null
+ || aFluid.amount <= 0
+ || (isEmpty()
+ ? mVoidExcess || aFluid.amount <= capacity(aFluid)
+ : contains(aFluid) && (mVoidExcess || mAmount + aFluid.amount <= capacity(aFluid)));
}
public boolean canFillAll(long aAmount) {
@@ -341,23 +350,22 @@ public class FluidTankGT implements IFluidTank {
}
public long capacity(FluidStack aFluid) {
- if(mAdjustableCapacity == null || aFluid == null)
- return mCapacity;
+ if (mAdjustableCapacity == null || aFluid == null) return mCapacity;
return capacity(aFluid.getFluid());
}
public long capacity(Fluid aFluid) {
- if(mAdjustableCapacity == null || aFluid == null)
- return mCapacity;
+ if (mAdjustableCapacity == null || aFluid == null) return mCapacity;
return capacity(aFluid.getName());
}
public long capacity(String aFluid) {
- if( mAdjustableCapacity == null || aFluid == null)
- return mCapacity;
+ if (mAdjustableCapacity == null || aFluid == null) return mCapacity;
final Long tSize = mAdjustableCapacity.get(aFluid);
- return tSize == null ? Math.max(mAmount, mCapacity) : Math.max(tSize * mAdjustableMultiplier, Math.max(mAmount, mCapacity));
+ return tSize == null
+ ? Math.max(mAmount, mCapacity)
+ : Math.max(tSize * mAdjustableMultiplier, Math.max(mAmount, mCapacity));
}
public boolean isHalf() {
@@ -440,5 +448,4 @@ public class FluidTankGT implements IFluidTank {
public FluidTankInfo getInfo() {
return new FluidTankInfo(isEmpty() ? null : mFluid.copy(), saturatedCast(capacity()));
}
-
}
diff --git a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java
index 4d1b7a7461..c0ee8b9490 100644
--- a/src/main/java/gregtech/api/graphs/GenerateNodeMap.java
+++ b/src/main/java/gregtech/api/graphs/GenerateNodeMap.java
@@ -1,19 +1,17 @@
package gregtech.api.graphs;
+import static gregtech.api.util.GT_Utility.getOppositeSide;
+
import gregtech.api.graphs.consumers.ConsumerNode;
import gregtech.api.graphs.paths.NodePath;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
import java.util.HashSet;
-
-import static gregtech.api.util.GT_Utility.getOppositeSide;
-
+import net.minecraft.tileentity.TileEntity;
// generates the node map
-abstract public class GenerateNodeMap {
+public abstract class GenerateNodeMap {
// clearing the node map to make sure it is gone on reset
public static void clearNodeMap(Node aNode, int aReturnNodeValue) {
if (aNode.mTileEntity instanceof BaseMetaPipeEntity) {
@@ -33,8 +31,7 @@ abstract public class GenerateNodeMap {
}
Node tNextNode = aNode.mNeighbourNodes[i];
if (tNextNode == null) continue;
- if (tNextNode.mNodeValue != aReturnNodeValue)
- clearNodeMap(tNextNode, aNode.mNodeValue);
+ if (tNextNode.mNodeValue != aReturnNodeValue) clearNodeMap(tNextNode, aNode.mNodeValue);
aNode.mNeighbourNodes[i] = null;
}
}
@@ -49,8 +46,13 @@ abstract public class GenerateNodeMap {
}
// gets the next node
- protected void generateNextNode(BaseMetaPipeEntity aPipe, Node aPipeNode, byte aInvalidSide, int aNextNodeValue,
- ArrayList tConsumers, HashSet tNodeMap) {
+ protected void generateNextNode(
+ BaseMetaPipeEntity aPipe,
+ Node aPipeNode,
+ byte aInvalidSide,
+ int aNextNodeValue,
+ ArrayList tConsumers,
+ HashSet tNodeMap) {
MetaPipeEntity tMetaPipe = (MetaPipeEntity) aPipe.getMetaTileEntity();
for (byte i = 0; i < 6; i++) {
if (i == aInvalidSide) {
@@ -61,8 +63,14 @@ abstract public class GenerateNodeMap {
ArrayList tNewPipes = new ArrayList<>();
Pair nextTileEntity = getNextValidTileEntity(tNextTileEntity, tNewPipes, i, tNodeMap);
if (nextTileEntity != null) {
- Node tNextNode = generateNode(nextTileEntity.mTileEntity, aPipeNode, aNextNodeValue + 1, tNewPipes,
- nextTileEntity.mSide, tConsumers, tNodeMap);
+ Node tNextNode = generateNode(
+ nextTileEntity.mTileEntity,
+ aPipeNode,
+ aNextNodeValue + 1,
+ tNewPipes,
+ nextTileEntity.mSide,
+ tConsumers,
+ tNodeMap);
if (tNextNode != null) {
aNextNodeValue = tNextNode.mHighestNodeValue;
aPipeNode.mHighestNodeValue = tNextNode.mHighestNodeValue;
@@ -77,8 +85,14 @@ abstract public 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) {
+ protected Node generateNode(
+ TileEntity aTileEntity,
+ Node aPreviousNode,
+ int aNextNodeValue,
+ ArrayList aPipes,
+ int aSide,
+ ArrayList aConsumers,
+ HashSet aNodeMap) {
if (aTileEntity.isInvalid()) return null;
byte tSideOp = getOppositeSide(aSide);
byte tInvalidSide = aPreviousNode == null ? -1 : tSideOp;
@@ -96,7 +110,7 @@ abstract public class GenerateNodeMap {
}
tPipe.setNode(tPipeNode);
aNodeMap.add(tPipeNode);
- tPipeNode.mSelfPath = getNewPath(new MetaPipeEntity[]{tMetaPipe});
+ tPipeNode.mSelfPath = getNewPath(new MetaPipeEntity[] {tMetaPipe});
tThisNode = tPipeNode;
if (tInvalidSide > -1) {
tPipeNode.mNeighbourNodes[tInvalidSide] = aPreviousNode;
@@ -123,14 +137,14 @@ abstract public 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) {
+ protected Pair getNextValidTileEntity(
+ TileEntity aTileEntity, ArrayList aPipes, byte aSide, HashSet aNodeMap) {
if (isPipe(aTileEntity)) {
BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) aTileEntity;
MetaPipeEntity tMetaPipe = (MetaPipeEntity) tPipe.getMetaTileEntity();
Node tNode = tPipe.getNode();
if (tNode != null) {
- if (aNodeMap.contains(tNode))
- return null;
+ if (aNodeMap.contains(tNode)) return null;
}
int tConnections = getNumberOfConnections(tMetaPipe);
if (tConnections == 2) {
@@ -161,13 +175,15 @@ abstract public class GenerateNodeMap {
}
// checks if the tile entity is a consumer and add to the list
- abstract protected boolean addConsumer(TileEntity aTileEntity, byte aSide, int aNodeValue, ArrayList aConsumers);
+ protected abstract boolean addConsumer(
+ TileEntity aTileEntity, byte aSide, int aNodeValue, 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) {
+ protected Node getEmptyNode(
+ int aNodeValue, byte aSide, TileEntity aTileEntity, 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 bb7a1f58e1..293a46502a 100644
--- a/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java
+++ b/src/main/java/gregtech/api/graphs/GenerateNodeMapPower.java
@@ -16,11 +16,10 @@ import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
import ic2.api.energy.tile.IEnergySink;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-
import java.util.ArrayList;
import java.util.HashSet;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
// node map generator for power distribution
public class GenerateNodeMapPower extends GenerateNodeMap {
@@ -30,11 +29,13 @@ public class GenerateNodeMapPower extends GenerateNodeMap {
@Override
protected boolean isPipe(TileEntity aTileEntity) {
- return super.isPipe(aTileEntity) && ((BaseMetaPipeEntity) aTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable;
+ return super.isPipe(aTileEntity)
+ && ((BaseMetaPipeEntity) aTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable;
}
@Override
- protected boolean addConsumer(TileEntity aTileEntity, byte aSide, int aNodeValue, ArrayList aConsumers) {
+ protected boolean addConsumer(
+ TileEntity aTileEntity, byte aSide, int aNodeValue, ArrayList aConsumers) {
if (aTileEntity instanceof BaseMetaTileEntity) {
BaseMetaTileEntity tBaseTileEntity = (BaseMetaTileEntity) aTileEntity;
if (tBaseTileEntity.inputEnergyFrom(aSide, false)) {
@@ -62,12 +63,14 @@ public class GenerateNodeMapPower extends GenerateNodeMap {
tNextTo = aTileEntity.getWorldObj().getTileEntity(dX, dY, dZ);
if (((IEnergySink) aTileEntity).acceptsEnergyFrom(tNextTo, ForgeDirection.getOrientation(aSide))) {
- ConsumerNode tConsumerNode = new NodeEnergySink(aNodeValue, (IEnergySink) aTileEntity, aSide, aConsumers);
+ ConsumerNode tConsumerNode =
+ new NodeEnergySink(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);
+ ConsumerNode tConsumerNode =
+ new NodeEnergyReceiver(aNodeValue, (IEnergyReceiver) aTileEntity, aSide, aConsumers);
aConsumers.add(tConsumerNode);
return true;
}
@@ -79,9 +82,10 @@ public class GenerateNodeMapPower extends GenerateNodeMap {
return new PowerNodePath(aPipes);
}
- //used to apply voltage on dead ends
+ // used to apply voltage on dead ends
@Override
- protected Node getEmptyNode(int aNodeValue, byte aSide, TileEntity aTileEntity, ArrayList aConsumers) {
+ protected Node getEmptyNode(
+ int aNodeValue, byte aSide, TileEntity aTileEntity, ArrayList aConsumers) {
Node tNode = new EmptyPowerConsumer(aNodeValue, aTileEntity, aSide, aConsumers);
aConsumers.add((ConsumerNode) tNode);
return tNode;
diff --git a/src/main/java/gregtech/api/graphs/Lock.java b/src/main/java/gregtech/api/graphs/Lock.java
index 0ba43b83de..e89cc8b25c 100644
--- a/src/main/java/gregtech/api/graphs/Lock.java
+++ b/src/main/java/gregtech/api/graphs/Lock.java
@@ -1,8 +1,7 @@
package gregtech.api.graphs;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
+import net.minecraft.tileentity.TileEntity;
public class Lock {
protected ArrayList tiles = new ArrayList<>();
@@ -25,7 +24,7 @@ public class Lock {
return !tiles.isEmpty();
}
- //i want to check for the exact object not equals
+ // i want to check for the exact object not equals
protected int contains(TileEntity tileEntity) {
for (int i = 0; i < tiles.size(); i++) {
if (tiles.get(i) == tileEntity) {
diff --git a/src/main/java/gregtech/api/graphs/Node.java b/src/main/java/gregtech/api/graphs/Node.java
index be499dea0d..f6a3ebe2d2 100644
--- a/src/main/java/gregtech/api/graphs/Node.java
+++ b/src/main/java/gregtech/api/graphs/Node.java
@@ -2,11 +2,10 @@ package gregtech.api.graphs;
import gregtech.api.graphs.consumers.ConsumerNode;
import gregtech.api.graphs.paths.NodePath;
+import java.util.ArrayList;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
-import java.util.ArrayList;
-
// base Node class
public class Node {
public Node(int aNodeValue, TileEntity aTileEntity, ArrayList aConsumers) {
@@ -18,7 +17,6 @@ public class Node {
mCreationTime = MinecraftServer.getServer().getTickCounter();
}
-
public final TileEntity mTileEntity;
public Node[] mNeighbourNodes = new Node[6];
public NodePath[] mNodePaths = new NodePath[6];
diff --git a/src/main/java/gregtech/api/graphs/NodeList.java b/src/main/java/gregtech/api/graphs/NodeList.java
index fb8afe68fa..8a018e2123 100644
--- a/src/main/java/gregtech/api/graphs/NodeList.java
+++ b/src/main/java/gregtech/api/graphs/NodeList.java
@@ -4,21 +4,18 @@ package gregtech.api.graphs;
public class NodeList {
Node[] mNodes;
int mCounter = 0;
+
public NodeList(Node[] mNodes) {
this.mNodes = mNodes;
}
Node getNextNode() {
- if (++mCounter < mNodes.length)
- return mNodes[mCounter];
- else
- return null;
+ if (++mCounter < mNodes.length) return mNodes[mCounter];
+ else return null;
}
Node getNode() {
- if (mCounter < mNodes.length)
- return mNodes[mCounter];
- else
- return null;
+ if (mCounter < mNodes.length) return mNodes[mCounter];
+ else return null;
}
}
diff --git a/src/main/java/gregtech/api/graphs/PowerNode.java b/src/main/java/gregtech/api/graphs/PowerNode.java
index 82c97d3901..c81d436861 100644
--- a/src/main/java/gregtech/api/graphs/PowerNode.java
+++ b/src/main/java/gregtech/api/graphs/PowerNode.java
@@ -1,13 +1,13 @@
package gregtech.api.graphs;
import gregtech.api.graphs.consumers.ConsumerNode;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
+import net.minecraft.tileentity.TileEntity;
// base node for power networks
-public class PowerNode extends Node{
+public class PowerNode extends Node {
public boolean mHadVoltage = false;
+
public PowerNode(int aNodeValue, TileEntity aTileEntity, ArrayList aConsumers) {
super(aNodeValue, aTileEntity, aConsumers);
}
diff --git a/src/main/java/gregtech/api/graphs/PowerNodes.java b/src/main/java/gregtech/api/graphs/PowerNodes.java
index e5d0e56699..759002dbdb 100644
--- a/src/main/java/gregtech/api/graphs/PowerNodes.java
+++ b/src/main/java/gregtech/api/graphs/PowerNodes.java
@@ -22,7 +22,8 @@ import gregtech.api.graphs.paths.PowerNodePath;
*/
public class PowerNodes {
// check if the looked for node is next to or get the next node that is closer to it
- static public long powerNode(Node aCurrentNode, Node aPreviousNode, NodeList aConsumers, long aVoltage, long aMaxAmps) {
+ public static long powerNode(
+ Node aCurrentNode, Node aPreviousNode, NodeList aConsumers, long aVoltage, long aMaxAmps) {
long tAmpsUsed = 0;
ConsumerNode tConsumer = (ConsumerNode) aConsumers.getNode();
int tLoopProtection = 0;
@@ -39,7 +40,8 @@ public class PowerNodes {
break;
} else {
if (aPreviousNode == tNextNode) return tAmpsUsed;
- tAmpsUsed += processNextNode(aCurrentNode, tNextNode, aConsumers, j, aMaxAmps - tAmpsUsed, aVoltage);
+ tAmpsUsed += processNextNode(
+ aCurrentNode, tNextNode, aConsumers, j, aMaxAmps - tAmpsUsed, aVoltage);
tConsumer = (ConsumerNode) aConsumers.getNode();
break;
}
@@ -52,7 +54,8 @@ public class PowerNodes {
if (tNextNode == null) continue;
if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTargetNodeValue) {
if (tNextNode == aPreviousNode) return tAmpsUsed;
- tAmpsUsed += processNextNodeAbove(aCurrentNode, tNextNode, aConsumers, side, aMaxAmps - tAmpsUsed, aVoltage);
+ tAmpsUsed += processNextNodeAbove(
+ aCurrentNode, tNextNode, aConsumers, side, aMaxAmps - tAmpsUsed, aVoltage);
tConsumer = (ConsumerNode) aConsumers.getNode();
break;
} else if (tNextNode.mNodeValue == tTargetNodeValue) {
@@ -74,7 +77,8 @@ 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) {
+ protected static long powerNodeAbove(
+ Node aCurrentNode, Node aPreviousNode, NodeList aConsumers, long aVoltage, long aMaxAmps) {
long tAmpsUsed = 0;
int tLoopProtection = 0;
ConsumerNode tConsumer = (ConsumerNode) aConsumers.getNode();
@@ -88,7 +92,8 @@ public class PowerNodes {
if (tNextNode == null) continue;
if (tNextNode.mNodeValue > aCurrentNode.mNodeValue && tNextNode.mNodeValue < tTargetNodeValue) {
if (tNextNode == aPreviousNode) return tAmpsUsed;
- tAmpsUsed += processNextNodeAbove(aCurrentNode, tNextNode, aConsumers, side, aMaxAmps - tAmpsUsed, aVoltage);
+ tAmpsUsed += processNextNodeAbove(
+ aCurrentNode, tNextNode, aConsumers, side, aMaxAmps - tAmpsUsed, aVoltage);
tConsumer = (ConsumerNode) aConsumers.getNode();
break;
} else if (tNextNode.mNodeValue == tTargetNodeValue) {
@@ -108,7 +113,8 @@ public class PowerNodes {
return tAmpsUsed;
}
- protected static long processNextNode(Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, long aMaxAmps, long aVoltage) {
+ protected static long processNextNode(
+ Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, long aMaxAmps, long aVoltage) {
if (aCurrentNode.locks[aSide].isLocked()) {
aConsumers.getNextNode();
return 0;
@@ -124,12 +130,12 @@ public class PowerNodes {
tVoltLoss += tPath.getLoss();
long tAmps = powerNode(aNextNode, aCurrentNode, aConsumers, aVoltage - tVoltLoss, aMaxAmps);
tPath.addAmps(tAmps);
- if (tSelfPath != null)
- tSelfPath.addAmps(tAmps);
+ if (tSelfPath != null) tSelfPath.addAmps(tAmps);
return tAmps;
}
- protected static long processNextNodeAbove(Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, long aMaxAmps, long aVoltage) {
+ protected static long processNextNodeAbove(
+ Node aCurrentNode, Node aNextNode, NodeList aConsumers, int aSide, long aMaxAmps, long aVoltage) {
if (aCurrentNode.locks[aSide].isLocked()) {
aConsumers.getNextNode();
return 0;
@@ -145,12 +151,12 @@ public class PowerNodes {
tVoltLoss += tPath.getLoss();
long tAmps = powerNodeAbove(aNextNode, aCurrentNode, aConsumers, aVoltage - tVoltLoss, aMaxAmps);
tPath.addAmps(tAmps);
- if (tSelfPath != null)
- tSelfPath.addAmps(tAmps);
+ if (tSelfPath != null) tSelfPath.addAmps(tAmps);
return tAmps;
}
- protected static long processNodeInject(Node aCurrentNode, ConsumerNode aConsumer, int aSide, long aMaxAmps, long aVoltage) {
+ protected static long processNodeInject(
+ Node aCurrentNode, ConsumerNode aConsumer, int aSide, long aMaxAmps, long aVoltage) {
if (aCurrentNode.locks[aSide].isLocked()) return 0;
final PowerNodePath tPath = (PowerNodePath) aCurrentNode.mNodePaths[aSide];
final PowerNodePath tSelfPath = (PowerNodePath) aCurrentNode.mSelfPath;
@@ -163,8 +169,7 @@ public class PowerNodes {
tVoltLoss += tPath.getLoss();
long tAmps = aConsumer.injectEnergy(aVoltage - tVoltLoss, aMaxAmps);
tPath.addAmps(tAmps);
- if (tSelfPath != null)
- tSelfPath.addAmps(tAmps);
+ if (tSelfPath != null) tSelfPath.addAmps(tAmps);
return tAmps;
}
}
diff --git a/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java b/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java
index e060c5c094..78b3c51928 100644
--- a/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java
+++ b/src/main/java/gregtech/api/graphs/consumers/ConsumerNode.java
@@ -1,15 +1,15 @@
package gregtech.api.graphs.consumers;
import gregtech.api.graphs.Node;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
+import net.minecraft.tileentity.TileEntity;
// node attached to a tile entity that can consume stuff from the network
public class ConsumerNode extends Node {
public byte mSide;
+
public ConsumerNode(int aNodeValue, TileEntity aTileEntity, byte aSide, ArrayList aConsumers) {
- super(aNodeValue,aTileEntity,aConsumers);
+ super(aNodeValue, aTileEntity, aConsumers);
this.mSide = aSide;
}
diff --git a/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java b/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java
index 29f4fe8893..d5ff76c12b 100644
--- a/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java
+++ b/src/main/java/gregtech/api/graphs/consumers/EmptyPowerConsumer.java
@@ -2,12 +2,11 @@ package gregtech.api.graphs.consumers;
import gregtech.api.graphs.paths.PowerNodePath;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
+import net.minecraft.tileentity.TileEntity;
-//this is here to apply voltage to dead ends
-public class EmptyPowerConsumer extends ConsumerNode{
+// this is here to apply voltage to dead ends
+public class EmptyPowerConsumer extends ConsumerNode {
public EmptyPowerConsumer(int aNodeValue, TileEntity aTileEntity, byte aSide, ArrayList aConsumers) {
super(aNodeValue, aTileEntity, aSide, aConsumers);
}
@@ -20,8 +19,8 @@ public class EmptyPowerConsumer extends ConsumerNode{
@Override
public int injectEnergy(long aVoltage, long aMaxAmps) {
BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) mTileEntity;
- PowerNodePath tPath =(PowerNodePath) tPipe.getNodePath();
- tPath.applyVoltage(aVoltage,true);
+ PowerNodePath tPath = (PowerNodePath) tPipe.getNodePath();
+ tPath.applyVoltage(aVoltage, true);
return 0;
}
}
diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java
index 0b3c8e31fa..30582332e7 100644
--- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java
+++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyConnected.java
@@ -1,13 +1,13 @@
package gregtech.api.graphs.consumers;
import gregtech.api.interfaces.tileentity.IEnergyConnected;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
+import net.minecraft.tileentity.TileEntity;
public class NodeEnergyConnected extends ConsumerNode {
- public NodeEnergyConnected(int aNodeValue, IEnergyConnected aTileEntity, byte aSide, ArrayList aConsumers) {
- super(aNodeValue,(TileEntity) aTileEntity, aSide, aConsumers);
+ public NodeEnergyConnected(
+ int aNodeValue, IEnergyConnected aTileEntity, byte aSide, ArrayList aConsumers) {
+ super(aNodeValue, (TileEntity) aTileEntity, aSide, aConsumers);
}
@Override
@@ -17,6 +17,6 @@ public class NodeEnergyConnected extends ConsumerNode {
@Override
public int injectEnergy(long aVoltage, long aMaxAmps) {
- return (int) ((IEnergyConnected)mTileEntity).injectEnergyUnits(mSide,aVoltage,aMaxAmps);
+ return (int) ((IEnergyConnected) mTileEntity).injectEnergyUnits(mSide, aVoltage, aMaxAmps);
}
}
diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java
index bd9e75945b..9c5e3f8aab 100644
--- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java
+++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java
@@ -1,5 +1,7 @@
package gregtech.api.graphs.consumers;
+import static gregtech.api.enums.GT_Values.V;
+
import cofh.api.energy.IEnergyReceiver;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
@@ -7,19 +9,18 @@ import gregtech.api.enums.SoundResource;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.common.GT_Pollution;
+import java.util.ArrayList;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.ArrayList;
-
-import static gregtech.api.enums.GT_Values.V;
-
-//consumer for RF machines
+// consumer for RF machines
public class NodeEnergyReceiver extends ConsumerNode {
int mRestRF = 0;
- public NodeEnergyReceiver(int aNodeValue, IEnergyReceiver aTileEntity, byte aSide, ArrayList aConsumers) {
+
+ public NodeEnergyReceiver(
+ int aNodeValue, IEnergyReceiver aTileEntity, byte aSide, ArrayList aConsumers) {
super(aNodeValue, (TileEntity) aTileEntity, aSide, aConsumers);
}
@@ -37,44 +38,82 @@ public class NodeEnergyReceiver extends ConsumerNode {
mRestRF -= consumed;
return ampsUsed;
}
- if (GregTech_API.mRFExplosions && GregTech_API.sMachineExplosions &&
- ((IEnergyReceiver) mTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600L) {
+ if (GregTech_API.mRFExplosions
+ && GregTech_API.sMachineExplosions
+ && ((IEnergyReceiver) mTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600L) {
explode(rfOut);
}
return 0;
}
- //copied from IEnergyConnected
+ // copied from IEnergyConnected
private void explode(int aRfOut) {
if (aRfOut > 32L * GregTech_API.mEUtoRF / 100L) {
int aExplosionPower = aRfOut;
- float tStrength =
- aExplosionPower < V[0] ? 1.0F :
- aExplosionPower < V[1] ? 2.0F :
- aExplosionPower < V[2] ? 3.0F :
- aExplosionPower < V[3] ? 4.0F :
- aExplosionPower < V[4] ? 5.0F :
- aExplosionPower < V[4] * 2 ? 6.0F :
- aExplosionPower < V[5] ? 7.0F :
- aExplosionPower < V[6] ? 8.0F :
- aExplosionPower < V[7] ? 9.0F :
- aExplosionPower < V[8] ? 10.0F :
- aExplosionPower < V[8] * 2 ? 11.0F :
- aExplosionPower < V[9] ? 12.0F :
- aExplosionPower < V[10] ? 13.0F :
- aExplosionPower < V[11] ? 14.0F :
- aExplosionPower < V[12] ? 15.0F :
- aExplosionPower < V[12] * 2 ? 16.0F :
- aExplosionPower < V[13] ? 17.0F :
- aExplosionPower < V[14] ? 18.0F :
- aExplosionPower < V[15] ? 19.0F : 20.0F;
+ float tStrength = aExplosionPower < V[0]
+ ? 1.0F
+ : aExplosionPower < V[1]
+ ? 2.0F
+ : aExplosionPower < V[2]
+ ? 3.0F
+ : aExplosionPower < V[3]
+ ? 4.0F
+ : aExplosionPower < V[4]
+ ? 5.0F
+ : aExplosionPower < V[4] * 2
+ ? 6.0F
+ : aExplosionPower < V[5]
+ ? 7.0F
+ : aExplosionPower < V[6]
+ ? 8.0F
+ : aExplosionPower < V[7]
+ ? 9.0F
+ : aExplosionPower < V[8]
+ ? 10.0F
+ : aExplosionPower < V[8] * 2
+ ? 11.0F
+ : aExplosionPower
+ < V[
+ 9]
+ ? 12.0F
+ : aExplosionPower
+ < V[
+ 10]
+ ? 13.0F
+ : aExplosionPower
+ < V[
+ 11]
+ ? 14.0F
+ : aExplosionPower
+ < V[
+ 12]
+ ? 15.0F
+ : aExplosionPower
+ < V[
+ 12]
+ * 2
+ ? 16.0F
+ : aExplosionPower
+ < V[
+ 13]
+ ? 17.0F
+ : aExplosionPower
+ < V[
+ 14]
+ ? 18.0F
+ : aExplosionPower
+ < V[
+ 15]
+ ? 19.0F
+ : 20.0F;
int tX = mTileEntity.xCoord, tY = mTileEntity.yCoord, tZ = mTileEntity.zCoord;
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);
+ GT_Pollution.addPollution(
+ tWorld.getChunkFromBlockCoords(tX, tZ), GT_Mod.gregtechproxy.mPollutionOnExplosion);
new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder()
.setStrength(tStrength)
diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java
index d2c54e284f..95b16883af 100644
--- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java
+++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergySink.java
@@ -1,11 +1,10 @@
package gregtech.api.graphs.consumers;
import ic2.api.energy.tile.IEnergySink;
+import java.util.ArrayList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.ArrayList;
-
// consumer for IC2 machines
public class NodeEnergySink extends ConsumerNode {
public NodeEnergySink(int nodeValue, IEnergySink tileEntity, byte side, ArrayList consumers) {
@@ -20,9 +19,10 @@ public class NodeEnergySink extends ConsumerNode {
@Override
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)
- tUsedAmps++;
+ while (aMaxAmps > tUsedAmps
+ && ((IEnergySink) mTileEntity).getDemandedEnergy() > 0
+ && ((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 e9736df7f4..e367a5294e 100644
--- a/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java
+++ b/src/main/java/gregtech/api/graphs/consumers/NodeGTBaseMetaTile.java
@@ -6,13 +6,14 @@ import java.util.ArrayList;
// consumer for gt machines
public class NodeGTBaseMetaTile extends ConsumerNode {
- public NodeGTBaseMetaTile(int aNodeValue, BaseMetaTileEntity aTileEntity, byte aSide, ArrayList aConsumers) {
+ public NodeGTBaseMetaTile(
+ int aNodeValue, BaseMetaTileEntity aTileEntity, byte aSide, ArrayList aConsumers) {
super(aNodeValue, aTileEntity, aSide, aConsumers);
}
@Override
public int injectEnergy(long aVoltage, long aMaxAmps) {
- return (int)((IEnergyConnected) mTileEntity).injectEnergyUnits(mSide,aVoltage, aMaxAmps);
+ return (int) ((IEnergyConnected) mTileEntity).injectEnergyUnits(mSide, aVoltage, aMaxAmps);
}
@Override
diff --git a/src/main/java/gregtech/api/graphs/paths/NodePath.java b/src/main/java/gregtech/api/graphs/paths/NodePath.java
index 3a4bbed8c6..d5a179b24b 100644
--- a/src/main/java/gregtech/api/graphs/paths/NodePath.java
+++ b/src/main/java/gregtech/api/graphs/paths/NodePath.java
@@ -4,7 +4,7 @@ import gregtech.api.graphs.Lock;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
-//to contain all info about the path between nodes
+// to contain all info about the path between nodes
public class NodePath {
protected MetaPipeEntity[] mPipes;
public Lock lock = new Lock();
diff --git a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java
index d18d6bcdd3..3ab8c7fe03 100644
--- a/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java
+++ b/src/main/java/gregtech/api/graphs/paths/PowerNodePath.java
@@ -16,7 +16,6 @@ public class PowerNodePath extends NodePath {
int mTick = 0;
boolean mCountUp = true;
-
public PowerNodePath(MetaPipeEntity[] aCables) {
super(aCables);
}
diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java
index 843d34c1f3..b5aebf87f2 100644
--- a/src/main/java/gregtech/api/gui/GT_Container.java
+++ b/src/main/java/gregtech/api/gui/GT_Container.java
@@ -4,6 +4,7 @@ import gregtech.api.interfaces.IFluidAccess;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -14,8 +15,6 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
-import java.util.List;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -109,8 +108,10 @@ public class GT_Container extends Container {
if (aSlotIndex >= 0) {
if (inventorySlots.get(aSlotIndex) == null || inventorySlots.get(aSlotIndex) instanceof GT_Slot_Holo)
return null;
- if (!(inventorySlots.get(aSlotIndex) instanceof GT_Slot_Armor)) if (aSlotIndex < getAllSlotCount())
- if (aSlotIndex < getSlotStartIndex() || aSlotIndex >= getSlotStartIndex() + getSlotCount()) return null;
+ if (!(inventorySlots.get(aSlotIndex) instanceof GT_Slot_Armor))
+ if (aSlotIndex < getAllSlotCount())
+ if (aSlotIndex < getSlotStartIndex() || aSlotIndex >= getSlotStartIndex() + getSlotCount())
+ return null;
}
try {
@@ -137,7 +138,8 @@ public class GT_Container extends Container {
aPlayerInventory.setItemStack(null);
}
if (aMouseclick == 1) {
- aPlayer.dropPlayerItemWithRandomChoice(aPlayerInventory.getItemStack().splitStack(1), true);
+ aPlayer.dropPlayerItemWithRandomChoice(
+ aPlayerInventory.getItemStack().splitStack(1), true);
if (aPlayerInventory.getItemStack().stackSize == 0) {
aPlayerInventory.setItemStack(null);
}
@@ -187,7 +189,9 @@ 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)) {
+ if (tTempStack.getItem() == mouseStack.getItem()
+ && 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;
@@ -204,10 +208,15 @@ public class GT_Container extends Container {
aSlot.putStack(mouseStack);
aPlayerInventory.setItemStack(tTempStack);
}
- } else if (tTempStack.getItem() == mouseStack.getItem() && mouseStack.getMaxStackSize() > 1 && (!tTempStack.getHasSubtypes() || tTempStack.getItemDamage() == mouseStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) {
+ } 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()) {
+ if (tTempStackSize > 0
+ && tTempStackSize + mouseStack.stackSize <= mouseStack.getMaxStackSize()) {
mouseStack.stackSize += tTempStackSize;
tTempStack = aSlot.decrStackSize(tTempStackSize);
@@ -231,7 +240,8 @@ public class GT_Container extends Container {
if (aSlot.canTakeStack(aPlayer)) {
// get the stack at the specified hotbar slot.
tTempStack = aPlayerInventory.getStackInSlot(aMouseclick);
- boolean canSwap = tTempStack == null || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack);
+ boolean canSwap =
+ tTempStack == null || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack);
tTempStackSize = -1;
if (!canSwap) {
@@ -260,7 +270,10 @@ public class GT_Container extends Container {
aSlot.putStack(tTempStack);
}
}
- } else if (aShifthold == 3 && aPlayer.capabilities.isCreativeMode && aPlayerInventory.getItemStack() == null && aSlotIndex >= 0) {
+ } else if (aShifthold == 3
+ && aPlayer.capabilities.isCreativeMode
+ && aPlayerInventory.getItemStack() == null
+ && aSlotIndex >= 0) {
aSlot = (Slot) this.inventorySlots.get(aSlotIndex);
if (aSlot != null && aSlot.getHasStack()) {
tTempStack = GT_Utility.copyOrNull(aSlot.getStack());
@@ -278,19 +291,26 @@ public class GT_Container extends Container {
mTileEntity.markDirty();
- //null checks and checks if the item can be stacked (maxStackSize > 1)
- if (getSlotCount() > 0 && slotObject != null && slotObject.getHasStack() && !(slotObject instanceof GT_Slot_Holo)) {
+ // null checks and checks if the item can be stacked (maxStackSize > 1)
+ if (getSlotCount() > 0
+ && slotObject != null
+ && slotObject.getHasStack()
+ && !(slotObject instanceof GT_Slot_Holo)) {
ItemStack stackInSlot = slotObject.getStack();
stack = GT_Utility.copyOrNull(stackInSlot);
- //TileEntity -> Player
+ // TileEntity -> Player
if (aSlotIndex < getAllSlotCount()) {
if (doesBindPlayerInventory())
if (!mergeItemStack(stackInSlot, getAllSlotCount(), getAllSlotCount() + 36, true)) {
return null;
}
- //Player -> TileEntity
- } else if (!mergeItemStack(stackInSlot, getShiftClickStartIndex(), getShiftClickStartIndex() + getShiftClickSlotCount(), false)) {
+ // Player -> TileEntity
+ } else if (!mergeItemStack(
+ stackInSlot,
+ getShiftClickStartIndex(),
+ getShiftClickStartIndex() + getShiftClickSlotCount(),
+ false)) {
return null;
}
@@ -321,10 +341,17 @@ public class GT_Container extends Container {
ItemStack itemStack;
if (aStack.isStackable()) {
- while (aStack.stackSize > 0 && (!reverseOrder && slotIndex < aSlotCount || reverseOrder && slotIndex >= aStartIndex)) {
+ while (aStack.stackSize > 0
+ && (!reverseOrder && slotIndex < aSlotCount || reverseOrder && slotIndex >= aStartIndex)) {
slot = (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)) {
+ 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)) {
int combinedStackSize = itemStack.stackSize + aStack.stackSize;
if (itemStack.stackSize < mTileEntity.getInventoryStackLimit()) {
if (combinedStackSize <= aStack.getMaxStackSize()) {
@@ -569,14 +596,18 @@ public class GT_Container extends Container {
return true;
}
- protected static ItemStack handleFluidSlotClick(IFluidAccess aFluidAccess, EntityPlayer aPlayer, boolean aProcessFullStack, boolean aCanDrain, boolean aCanFill) {
+ protected static ItemStack handleFluidSlotClick(
+ IFluidAccess aFluidAccess,
+ EntityPlayer aPlayer,
+ 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;
FluidStack tInputFluid = aFluidAccess.get();
FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackSizedOne, true);
- if (tFluidHeld != null && tFluidHeld.amount <= 0)
- tFluidHeld = null;
+ if (tFluidHeld != null && tFluidHeld.amount <= 0) tFluidHeld = null;
if (tInputFluid == null) {
// tank empty, consider fill only from now on
if (!aCanFill)
@@ -639,19 +670,17 @@ public class GT_Container extends Container {
}
replaceCursorItemStack(aPlayer, tFilledContainer);
}
- if (tTankStack.amount <= 0)
- aFluidAccess.set(null);
+ if (tTankStack.amount <= 0) aFluidAccess.set(null);
return tFilledContainer;
}
- protected static ItemStack fillFluid(IFluidAccess aFluidAccess, EntityPlayer aPlayer, FluidStack aFluidHeld, boolean aProcessFullStack) {
+ protected static ItemStack fillFluid(
+ IFluidAccess aFluidAccess, EntityPlayer aPlayer, FluidStack aFluidHeld, 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;
+ if (aFluidAccess.get() != null && !aFluidAccess.get().isFluidEqual(aFluidHeld)) return null;
ItemStack tStackHeld = aPlayer.inventory.getItemStack();
ItemStack tStackSizedOne = GT_Utility.copyAmount(1, tStackHeld);
- if (tStackSizedOne == null)
- return null;
+ if (tStackSizedOne == null) return null;
int tFreeSpace = aFluidAccess.getCapacity() - (aFluidAccess.get() != null ? aFluidAccess.get().amount : 0);
if (tFreeSpace <= 0)
@@ -715,5 +744,4 @@ public class GT_Container extends Container {
GT_Utility.addItemToPlayerInventory(aPlayer, tStackResult);
}
}
-
}
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 97ee1d85a3..f2774bbd38 100644
--- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java
+++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java
@@ -1,13 +1,12 @@
package gregtech.api.gui;
-import java.util.List;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.metatileentity.IConfigurationCircuitSupport;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
@@ -31,8 +30,7 @@ public class GT_ContainerMetaTile_Machine extends GT_Container {
mInput = 0,
mID = 0,
mDisplayErrorCode = 0;
- public long mEnergyLong = 0,
- mStorageLong = 0;
+ public long mEnergyLong = 0, mStorageLong = 0;
private int oActive = 0,
oMaxProgressTime = 0,
oProgressTime = 0,
@@ -44,12 +42,10 @@ public class GT_ContainerMetaTile_Machine extends GT_Container {
oInput = 0,
oID = 0,
oDisplayErrorCode = 0;
- private long oEnergyLong = 0,
- oStorageLong = 0;
+ private long oEnergyLong = 0, oStorageLong = 0;
protected int mTimer = 0;
protected Runnable circuitSlotClickCallback;
-
public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
@@ -57,31 +53,32 @@ public class GT_ContainerMetaTile_Machine extends GT_Container {
if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) {
addSlots(aInventoryPlayer);
- if (doesBindPlayerInventory())
- bindPlayerInventory(aInventoryPlayer);
+ if (doesBindPlayerInventory()) bindPlayerInventory(aInventoryPlayer);
detectAndSendChanges();
} else {
aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
}
}
- public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean doesBindInventory) {
+ public GT_ContainerMetaTile_Machine(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean doesBindInventory) {
super(aInventoryPlayer, aTileEntity);
mTileEntity = aTileEntity;
if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) {
addSlots(aInventoryPlayer);
- if (doesBindPlayerInventory() && doesBindInventory)
- bindPlayerInventory(aInventoryPlayer);
+ if (doesBindPlayerInventory() && doesBindInventory) bindPlayerInventory(aInventoryPlayer);
detectAndSendChanges();
} else {
aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
}
}
+
protected void addCircuitSlot() {
if (mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport) {
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)mTileEntity.getMetaTileEntity();
- GT_Slot_Render slotCircuit = new GT_Slot_Render(mTileEntity, ccs.getCircuitSlot(), ccs.getCircuitSlotX(), ccs.getCircuitSlotY());
+ IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) mTileEntity.getMetaTileEntity();
+ GT_Slot_Render slotCircuit =
+ new GT_Slot_Render(mTileEntity, ccs.getCircuitSlot(), ccs.getCircuitSlotX(), ccs.getCircuitSlotY());
addSlotToContainer(slotCircuit);
slotCircuit.setEnabled(ccs.allowSelectCircuit());
}
@@ -95,8 +92,7 @@ public class GT_ContainerMetaTile_Machine extends GT_Container {
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null)
- return;
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
mStorage = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getEUCapacity());
mStorageLong = mTileEntity.getEUCapacity();
mEnergy = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getStoredEU());
@@ -261,17 +257,17 @@ public class GT_ContainerMetaTile_Machine extends GT_Container {
public void setCircuitSlotClickCallback(Runnable circuitSlotClickCallback) {
this.circuitSlotClickCallback = circuitSlotClickCallback;
}
+
@Override
public ItemStack slotClick(int aSlotNumber, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
if (mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport) {
IMetaTileEntity machine = mTileEntity.getMetaTileEntity();
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)machine;
+ IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) machine;
if (ccs.allowSelectCircuit() && aSlotNumber == ccs.getCircuitGUISlot() && aMouseclick < 2) {
ItemStack newCircuit;
if (aShifthold == 1) {
if (aMouseclick == 0) {
- if (circuitSlotClickCallback != null)
- circuitSlotClickCallback.run();
+ if (circuitSlotClickCallback != null) circuitSlotClickCallback.run();
return null;
} else {
// clear
@@ -282,7 +278,9 @@ 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_2by2_Fluid.java b/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java
index f8f4e3c886..35ed089c97 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java
@@ -38,15 +38,18 @@ public class GT_Container_2by2_Fluid extends GT_ContainerMetaTile_Machine {
* I'd imagine this lag to become only more severe when playing MP over ethernet, which would have much more latency
* than a memory connection
*/
- GT_MetaTileEntity_Hatch_MultiInput tTank = (GT_MetaTileEntity_Hatch_MultiInput) mTileEntity.getMetaTileEntity();
+ GT_MetaTileEntity_Hatch_MultiInput tTank =
+ (GT_MetaTileEntity_Hatch_MultiInput) mTileEntity.getMetaTileEntity();
tTank.setDrainableStack(GT_Utility.getFluidFromDisplayStack(tTank.getStackInSlot(2)));
}
- GT_MetaTileEntity_Hatch_MultiInput tTank = (GT_MetaTileEntity_Hatch_MultiInput) mTileEntity.getMetaTileEntity();
+ GT_MetaTileEntity_Hatch_MultiInput tTank =
+ (GT_MetaTileEntity_Hatch_MultiInput) mTileEntity.getMetaTileEntity();
MultiFluidAccess tDrainableAccess = MultiFluidAccess.from(tTank, aSlotIndex);
ItemStack tStackHeld = aPlayer.inventory.getItemStack();
FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackHeld, true);
if (tDrainableAccess.isMatch(tFluidHeld, aSlotIndex))
- return handleFluidSlotClick(tDrainableAccess, aPlayer, aMouseclick == 0, true, !tTank.isDrainableStackSeparate());
+ return handleFluidSlotClick(
+ 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_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java
index 6db6d45a89..fc0b3270d2 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java
@@ -1,23 +1,20 @@
package gregtech.api.gui;
+import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.interfaces.IFluidAccess;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
-import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import java.util.List;
-
-import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -25,10 +22,7 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Basi
*/
public class GT_Container_BasicMachine extends GT_Container_BasicTank {
- public boolean
- mFluidTransfer = false,
- mItemTransfer = false,
- mStuttering = false;
+ public boolean mFluidTransfer = false, mItemTransfer = false, mStuttering = false;
GT_Slot_Holo slotFluidTransferToggle;
GT_Slot_Holo slotItemTransferToggle;
@@ -198,9 +192,7 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank {
addSlotToContainer(slotBattery = new Slot(mTileEntity, 1, 80, 63));
addSlotToContainer(slotSpecial = new Slot(mTileEntity, 3, 125, 63));
addSlotToContainer(slotFluidInput = new GT_Slot_Render(mTileEntity, tStartIndex++, 53, 63));
- slotFluidInput.setEnabled(recipes != null
- ? (recipes.hasFluidInputs())
- : (machine.getCapacity() != 0));
+ slotFluidInput.setEnabled(recipes != null ? (recipes.hasFluidInputs()) : (machine.getCapacity() != 0));
}
@Override
@@ -220,19 +212,25 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank {
}
return null;
default:
- if (aSlotNumber == OTHER_SLOT_COUNT + 1 + machine.mInputSlotCount + machine.mOutputItems.length && aMouseclick < 2) {
+ if (aSlotNumber == OTHER_SLOT_COUNT + 1 + machine.mInputSlotCount + machine.mOutputItems.length
+ && aMouseclick < 2) {
if (mTileEntity.isClientSide()) {
// see parent class slotClick for an explanation on why doing this
- GT_MetaTileEntity_BasicTank tTank = (GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity();
+ GT_MetaTileEntity_BasicTank tTank =
+ (GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity();
tTank.setFillableStack(GT_Utility.getFluidFromDisplayStack(tTank.getStackInSlot(2)));
}
GT_MetaTileEntity_BasicTank tTank = (GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity();
BasicTankFluidAccess tFillableAccess = BasicTankFluidAccess.from(tTank, true);
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()));
- if (mTileEntity.isServerSide() && tToken != null)
- mTileEntity.markInventoryBeenModified();
+ // 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()));
+ if (mTileEntity.isServerSide() && tToken != null) mTileEntity.markInventoryBeenModified();
return tToken;
} else {
return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
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 d294b60ca9..23769ab0cc 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java
@@ -55,7 +55,8 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine {
}
GT_MetaTileEntity_BasicTank tTank = (GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity();
BasicTankFluidAccess tDrainableAccess = BasicTankFluidAccess.from(tTank, false);
- return handleFluidSlotClick(tDrainableAccess, aPlayer, aMouseclick == 0, true, !tTank.isDrainableStackSeparate());
+ return handleFluidSlotClick(
+ tDrainableAccess, aPlayer, aMouseclick == 0, true, !tTank.isDrainableStackSeparate());
}
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
@@ -66,8 +67,7 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine {
if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
if (((GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity()).mFluid != null)
mContent = ((GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity()).mFluid.amount;
- else
- mContent = 0;
+ else mContent = 0;
for (Object crafter : this.crafters) {
ICrafting player = (ICrafting) crafter;
if (mTimer % 500 == 0 || oContent != mContent) {
@@ -114,10 +114,8 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine {
@Override
public void set(FluidStack stack) {
- if (mIsFillableStack)
- mTank.setFillableStack(stack);
- else
- mTank.setDrainableStack(stack);
+ if (mIsFillableStack) mTank.setFillableStack(stack);
+ else mTank.setDrainableStack(stack);
}
@Override
diff --git a/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java b/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java
index c3758486ba..fcaf618b56 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java
@@ -19,13 +19,11 @@ public class GT_Container_MaintenanceHatch extends GT_ContainerMetaTile_Machine
@Override
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex != 0)
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ if (aSlotIndex != 0) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
ItemStack tStack = aPlayer.inventory.getItemStack();
if (tStack != null) {
((GT_MetaTileEntity_Hatch_Maintenance) mTileEntity.getMetaTileEntity()).onToolClick(tStack, aPlayer);
- if (tStack.stackSize <= 0)
- aPlayer.inventory.setItemStack(null);
+ if (tStack.stackSize <= 0) aPlayer.inventory.setItemStack(null);
}
return null;
}
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 f5e9a83d19..722057950b 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java
@@ -14,7 +14,8 @@ public class GT_Container_MultiMachine extends GT_ContainerMetaTile_Machine {
super(aInventoryPlayer, aTileEntity);
}
- public GT_Container_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) {
+ public GT_Container_MultiMachine(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) {
super(aInventoryPlayer, aTileEntity, bindInventory);
}
diff --git a/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java b/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java
index fef857a7ae..0622f52865 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java
@@ -48,51 +48,58 @@ public class GT_Container_SpecialFilter extends GT_ContainerMetaTile_Machine {
return null;
}
if (aSlotIndex == 9) {
- ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).clickTypeIcon(aMouseclick != 0, aPlayer.inventory.getItemStack());
+ ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity())
+ .clickTypeIcon(aMouseclick != 0, aPlayer.inventory.getItemStack());
return null;
}
if (aSlotIndex == 10) {
- ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput);
+ ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput =
+ (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 11) {
- ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull =
+ (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("122","Emit Redstone if slots contain something"));
+ GT_Utility.sendChatToPlayer(
+ aPlayer, GT_Utility.trans("122", "Emit Redstone if slots contain something"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123","Don't emit Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123", "Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 12) {
- ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert);
+ ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert =
+ (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone"));
}
return null;
}
if (aSlotIndex == 13) {
- ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter);
+ ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter =
+ (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter);
if (((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvertFilter) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("124","Invert Filter"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("124", "Invert Filter"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("125","Don't invert Filter"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("125", "Don't invert Filter"));
}
return null;
}
if (aSlotIndex == 14) {
- ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed = (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed);
+ ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed =
+ (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed);
if (((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bNBTAllowed) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("126","Ignore NBT"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("126", "Ignore NBT"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("127","NBT has to match"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("127", "NBT has to match"));
}
return null;
}
diff --git a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java b/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java
index c2a833503e..63c7b224b5 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java
@@ -1,24 +1,25 @@
package gregtech.api.gui;
-import gregtech.api.util.ColorsMetadataSection;
import gregtech.api.GregTech_API;
+import gregtech.api.util.ColorsMetadataSection;
+import java.io.IOException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.IResource;
import net.minecraft.util.ResourceLocation;
-import java.io.IOException;
-
public class GT_GUIColorOverride {
private ColorsMetadataSection cmSection;
public GT_GUIColorOverride(String guiTexturePath) {
try {
- IResource ir = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(guiTexturePath));
+ IResource ir =
+ Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(guiTexturePath));
if (ir.hasMetadata()) {
cmSection = (ColorsMetadataSection) ir.getMetadata("colors");
}
- } catch (IOException ignore) {}
+ } catch (IOException ignore) {
+ }
}
public int getTextColorOrDefault(String textType, int defaultColor) {
diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer.java b/src/main/java/gregtech/api/gui/GT_GUIContainer.java
index 5d3f0a59a1..281f910d8c 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer.java
@@ -1,6 +1,7 @@
package gregtech.api.gui;
-import gregtech.api.gui.GT_GUIColorOverride;
+import static gregtech.GT_Mod.GT_FML_LOGGER;
+
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.inventory.Container;
@@ -8,10 +9,6 @@ import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Mouse;
-import java.io.IOException;
-
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -79,11 +76,9 @@ public class GT_GUIContainer extends GuiContainer {
super.handleMouseInput();
}
- protected void onMouseWheel(int mx, int my, int delta) {
- }
+ protected void onMouseWheel(int mx, int my, int delta) {}
- public boolean isMouseOverSlot(int slotIndex, int mx, int my)
- {
+ public boolean isMouseOverSlot(int slotIndex, int mx, int my) {
int size = inventorySlots.inventorySlots.size();
if (slotIndex < 0 || slotIndex >= size) {
// slot does not exist somehow. log and carry on
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 8a744aee60..0752324678 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
@@ -17,16 +17,13 @@ import gregtech.api.net.GT_Packet_SetConfigurationCircuit;
import gregtech.api.util.GT_TooltipDataCache;
import gregtech.api.util.GT_Util;
import gregtech.api.util.GT_Utility;
-
+import java.util.List;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-
-import java.util.List;
-
import org.lwjgl.opengl.GL11;
/**
@@ -46,27 +43,22 @@ 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;
- 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);
+ private static final int COVER_TAB_LEFT = -16,
+ COVER_TAB_TOP = 1,
+ COVER_TAB_HEIGHT = 20,
+ COVER_TAB_WIDTH = 18,
+ 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);
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.
@@ -78,8 +70,8 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements
mContainer.setCircuitSlotClickCallback(this::openSelectCircuitDialog);
}
- public GT_GUIContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
- String aGUIbackground) {
+ public GT_GUIContainerMetaTile_Machine(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aGUIbackground) {
this(new GT_ContainerMetaTile_Machine(aInventoryPlayer, aTileEntity), aGUIbackground);
}
@@ -88,18 +80,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
@@ -152,15 +144,14 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements
/**
* @return This machine's MetaTileEntity
*/
- private MetaTileEntity getMachine() {
- return (MetaTileEntity ) mContainer.mTileEntity.getMetaTileEntity();
+ private MetaTileEntity getMachine() {
+ return (MetaTileEntity) mContainer.mTileEntity.getMetaTileEntity();
}
// Tabs support
@Override
- protected void mouseClicked(int mouseX, int mouseY, int mouseButton)
- {
+ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
// Check for clicked tabs
coverTabs.onMouseClicked(mouseX, mouseY, mouseButton);
@@ -188,11 +179,12 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements
*/
protected void setupTooltips() {
if (mContainer.mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport) {
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)mContainer.mTileEntity.getMetaTileEntity();
+ IConfigurationCircuitSupport ccs =
+ (IConfigurationCircuitSupport) mContainer.mTileEntity.getMetaTileEntity();
if (ccs.allowSelectCircuit())
- addToolTip(new GT_GuiSlotTooltip(mContainer.getSlot(ccs.getCircuitGUISlot()), mTooltipCache.getData(GHOST_CIRCUIT_TOOLTIP)));
+ addToolTip(new GT_GuiSlotTooltip(
+ mContainer.getSlot(ccs.getCircuitGUISlot()), mTooltipCache.getData(GHOST_CIRCUIT_TOOLTIP)));
}
-
}
// GT_IToolTipRenderer and GT_ITabRenderer implementations
@@ -200,30 +192,37 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements
public void drawHoveringText(List text, int mouseX, int mouseY, FontRenderer font) {
super.drawHoveringText(text, mouseX, mouseY, font);
}
+
@Override
public int getGuiTop() {
return guiTop;
}
+
@Override
public int getGuiLeft() {
return guiLeft;
}
+
@Override
public int getXSize() {
return xSize;
}
+
@Override
public FontRenderer getFontRenderer() {
return fontRendererObj;
}
+
@Override
public RenderItem getItemRenderer() {
return itemRender;
}
+
@Override
public void addToolTip(GT_GuiTooltip toolTip) {
mTooltipManager.addToolTip(toolTip);
}
+
@Override
public boolean removeToolTip(GT_GuiTooltip toolTip) {
return mTooltipManager.removeToolTip(toolTip);
@@ -232,11 +231,11 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements
@Override
protected void onMouseWheel(int mx, int my, int delta) {
if (mContainer.mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport) {
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)mContainer.mTileEntity.getMetaTileEntity();
+ IConfigurationCircuitSupport ccs =
+ (IConfigurationCircuitSupport) mContainer.mTileEntity.getMetaTileEntity();
Slot slotCircuit = mContainer.getSlot(ccs.getCircuitGUISlot());
- if (slotCircuit != null && func_146978_c(slotCircuit.xDisplayPosition,
- slotCircuit.yDisplayPosition, 16, 16, mx, my))
- {
+ if (slotCircuit != null
+ && func_146978_c(slotCircuit.xDisplayPosition, slotCircuit.yDisplayPosition, 16, 16, mx, my)) {
// emulate click
handleMouseClick(slotCircuit, -1, delta > 0 ? 1 : 0, 0);
return;
@@ -247,23 +246,22 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements
private void openSelectCircuitDialog() {
IMetaTileEntity machine = mContainer.mTileEntity.getMetaTileEntity();
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)machine;
+ 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()))));
+ 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) {
GT_Values.NW.sendToServer(new GT_Packet_SetConfigurationCircuit(mContainer.mTileEntity, selected));
// we will not do any validation on client side
// it doesn't get to actually decide what inventory contains anyway
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)mContainer.mTileEntity.getMetaTileEntity();
+ IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) mContainer.mTileEntity.getMetaTileEntity();
mContainer.mTileEntity.setInventorySlotContents(ccs.getCircuitSlot(), 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 7e85cb60f0..16ef27c941 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java
@@ -1,12 +1,12 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
public class GT_GUIContainer_1by1 extends GT_GUIContainerMetaTile_Machine {
-
+
private final String mName;
private final int textColor = this.getTextColorOrDefault("title", 0x404040);
@@ -15,7 +15,8 @@ public class GT_GUIContainer_1by1 extends GT_GUIContainerMetaTile_Machine {
mName = aName;
}
- public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ public GT_GUIContainer_1by1(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
super(new GT_Container_1by1(aInventoryPlayer, aTileEntity), RES_PATH_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 acefe12459..909a5b0d6a 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java
@@ -1,10 +1,10 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
public class GT_GUIContainer_2by2 extends GT_GUIContainerMetaTile_Machine {
private final String mName;
@@ -15,7 +15,8 @@ public class GT_GUIContainer_2by2 extends GT_GUIContainerMetaTile_Machine {
mName = aName;
}
- public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ public GT_GUIContainer_2by2(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
super(new GT_Container_2by2(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "2by2.png");
mName = aName;
}
diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2_Fluid.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2_Fluid.java
index afabaa0a80..d896349f0a 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2_Fluid.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2_Fluid.java
@@ -1,11 +1,11 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
public class GT_GUIContainer_2by2_Fluid extends GT_GUIContainerMetaTile_Machine {
private final String mName;
@@ -29,5 +29,4 @@ public class GT_GUIContainer_2by2_Fluid extends GT_GUIContainerMetaTile_Machine
int y = (height - ySize) / 2;
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
-
}
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 c2911fc67f..97caa08946 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java
@@ -1,10 +1,10 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
public class GT_GUIContainer_3by3 extends GT_GUIContainerMetaTile_Machine {
private final String mName;
@@ -15,7 +15,8 @@ public class GT_GUIContainer_3by3 extends GT_GUIContainerMetaTile_Machine {
mName = aName;
}
- public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ public GT_GUIContainer_3by3(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
super(new GT_Container_3by3(aInventoryPlayer, aTileEntity), RES_PATH_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 b28129eede..40441e3093 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java
@@ -1,10 +1,10 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
public class GT_GUIContainer_4by4 extends GT_GUIContainerMetaTile_Machine {
private final String mName;
@@ -15,7 +15,8 @@ public class GT_GUIContainer_4by4 extends GT_GUIContainerMetaTile_Machine {
mName = aName;
}
- public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ public GT_GUIContainer_4by4(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
super(new GT_Container_4by4(aInventoryPlayer, aTileEntity), RES_PATH_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 338d9e14a2..35dcf047a7 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java
@@ -1,27 +1,23 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.gui.widgets.GT_GuiIcon;
+import gregtech.api.gui.widgets.GT_GuiSlotTooltip;
+import gregtech.api.gui.widgets.GT_GuiSmartTooltip;
+import gregtech.api.gui.widgets.GT_GuiSmartTooltip.TooltipVisibilityProvider;
import gregtech.api.gui.widgets.GT_GuiTabLine.GT_GuiTabIconSet;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
-import gregtech.api.gui.widgets.GT_GuiSlotTooltip;
-import gregtech.api.gui.widgets.GT_GuiSmartTooltip;
-import gregtech.api.gui.widgets.GT_GuiSmartTooltip.TooltipVisibilityProvider;
-import gregtech.api.net.GT_Packet_SetConfigurationCircuit;
-import gregtech.common.power.Power;
-import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.common.power.Power;
import gregtech.nei.NEI_TransferRectHost;
+import java.awt.Rectangle;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-import java.awt.Rectangle;
-
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -32,45 +28,47 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
*/
public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machine implements NEI_TransferRectHost {
private static final int NEEDS_STEAM_VENTING = 64;
- private final static GT_GuiTabIconSet TAB_ICONSET_BRONZE = new GT_GuiTabIconSet(
- GT_GuiIcon.TAB_NORMAL_BRONZE,
- GT_GuiIcon.TAB_HIGHLIGHT_BRONZE,
- GT_GuiIcon.TAB_DISABLED_BRONZE);
- private final static GT_GuiTabIconSet TAB_ICONSET_STEEL = new GT_GuiTabIconSet(
- GT_GuiIcon.TAB_NORMAL_STEEL,
- GT_GuiIcon.TAB_HIGHLIGHT_STEEL,
- GT_GuiIcon.TAB_DISABLED_STEEL);
+ 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);
+ 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);
private final int textColor = this.getTextColorOrDefault("title", 0x404040);
- public final String
- mName,
- mNEI;
- public final byte
- mProgressBarDirection,
- mProgressBarAmount;
-
+ 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.";
-
- public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
- String aTextureFile, String aNEI) {
+ 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.";
+
+ public GT_GUIContainer_BasicMachine(
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName,
+ 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) {
- super(new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity),
- RES_PATH_GUI + "basicmachines/" + aTextureFile);
+ public GT_GUIContainer_BasicMachine(
+ InventoryPlayer aInventoryPlayer,
+ IGregTechTileEntity aTileEntity,
+ String aName,
+ String aTextureFile,
+ String aNEI,
+ byte aProgressBarDirection,
+ byte aProgressBarAmount) {
+ super(
+ new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity),
+ RES_PATH_GUI + "basicmachines/" + aTextureFile);
mProgressBarDirection = aProgressBarDirection;
mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
mName = aName;
@@ -92,11 +90,14 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin
if (machine.isSteampowered()) {
batterySlotTooltipKey = UNUSED_SLOT_TOOLTIP;
batterySlotTooltipArgs = new String[0];
- addToolTip(new GT_GuiSmartTooltip(tProblemArea, new TooltipVisibilityProvider() {
- public boolean shouldShowTooltip() {
- return hasErrorCode(NEEDS_STEAM_VENTING);
- }
- }, mTooltipCache.getData(STALLED_VENT_TOOLTIP)));
+ addToolTip(new GT_GuiSmartTooltip(
+ tProblemArea,
+ new TooltipVisibilityProvider() {
+ public boolean shouldShowTooltip() {
+ return hasErrorCode(NEEDS_STEAM_VENTING);
+ }
+ },
+ mTooltipCache.getData(STALLED_VENT_TOOLTIP)));
} else {
String pTier1 = powerTierName(machine.mTier);
if (machine.mTier == GT_Values.VN.length - 1) {
@@ -106,29 +107,36 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin
batterySlotTooltipKey = BATTERY_SLOT_TOOLTIP;
batterySlotTooltipArgs = new String[] {pTier1, powerTierName((byte) (machine.mTier + 1))};
}
- addToolTip(new GT_GuiSlotTooltip( container.slotFluidTransferToggle,
- mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP)));
- addToolTip(new GT_GuiSlotTooltip( container.slotItemTransferToggle,
- mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP)));
- }
+ addToolTip(new GT_GuiSlotTooltip(
+ container.slotFluidTransferToggle, mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP)));
+ addToolTip(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())));
+ addToolTip(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())));
+ addToolTip(new GT_GuiSlotTooltip(
+ container.slotFluidOutput, mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, machine.getCapacity())));
}
- addToolTip( 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)));
- addToolTip(new GT_GuiSmartTooltip(tProblemArea, new TooltipVisibilityProvider() {
+ addToolTip(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)));
+ addToolTip(new GT_GuiSmartTooltip(
+ tProblemArea,
+ new TooltipVisibilityProvider() {
public boolean shouldShowTooltip() {
return container.mStuttering && !hasErrorCode(NEEDS_STEAM_VENTING);
}
- }, mTooltipCache.getData(STALLED_STUTTERING_TOOLTIP, StatCollector.translateToLocal(
- POWER_SOURCE_KEY + (machine.isSteampowered() ? "steam" : "power")))));
+ },
+ mTooltipCache.getData(
+ STALLED_STUTTERING_TOOLTIP,
+ StatCollector.translateToLocal(
+ POWER_SOURCE_KEY + (machine.isSteampowered() ? "steam" : "power")))));
}
/**
@@ -158,19 +166,23 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
if (mContainer != null) {
if (!getMachine().isSteampowered()) {
- if (getContainer().mFluidTransfer)
- drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
- if (getContainer().mItemTransfer)
- drawTexturedModalRect(x + 25, y + 62, 176, 36, 18, 18);
+ if (getContainer().mFluidTransfer) drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
+ if (getContainer().mItemTransfer) drawTexturedModalRect(x + 25, y + 62, 176, 36, 18, 18);
}
- if (getContainer().mStuttering)
- drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18);
+ if (getContainer().mStuttering) drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18);
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);
+ int tProgress = Math.max(
+ 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:
@@ -210,7 +222,8 @@ 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_STEEL
+ : TAB_ICONSET_BRONZE;
}
return super.getTabBackground();
}
@@ -243,7 +256,7 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin
@Override
public Object[] getNeiTransferRectArgs() {
- return new Object[]{getMachine().getPower()};
+ return new Object[] {getMachine().getPower()};
}
@Override
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 a24060aaa4..034525c338 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java
@@ -1,19 +1,18 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
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);
+ private final int textColor = this.getTextColorOrDefault("text", 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), RES_PATH_GUI + "BasicTank.png");
@@ -22,11 +21,16 @@ public class GT_GUIContainer_BasicTank extends GT_GUIContainerMetaTile_Machine {
@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);
+ fontRendererObj.drawString(
+ GT_Utility.parseNumberToString(((GT_Container_BasicTank) mContainer).mContent),
+ 10,
+ 30,
+ textColorValue);
}
}
diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java
index fe3c47fa95..07ca031345 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java
@@ -1,15 +1,13 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
public class GT_GUIContainer_MaintenanceHatch extends GT_GUIContainerMetaTile_Machine {
- private final int
- textColor = this.getTextColorOrDefault("text", 0x404040),
- textColorTitle = this.getTextColorOrDefault("title", 0x404040);
-
+ private final int textColor = this.getTextColorOrDefault("text", 0x404040),
+ textColorTitle = this.getTextColorOrDefault("title", 0x404040);
public GT_GUIContainer_MaintenanceHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(new GT_Container_MaintenanceHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Maintenance.png");
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 69a3d26b2e..98268cd667 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java
@@ -1,5 +1,7 @@
package gregtech.api.gui;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
@@ -9,9 +11,6 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbin
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
-
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -22,12 +21,14 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machine {
String mName = "";
- private final int
- textColor = this.getTextColorOrDefault("text", 0xFAFAFF),
- textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF);
-
- public GT_GUIContainer_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
- super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF),
+ textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF);
+
+ public GT_GUIContainer_MultiMachine(
+ InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
+ super(
+ new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity),
+ RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
mName = aName;
}
@@ -74,8 +75,9 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin
line_counter += 8;
}
-
- if (mContainer != null) {//(mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
+ if (mContainer
+ != null) { // (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
+ // | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
if ((mContainer.mDisplayErrorCode & 1) != 0) {
fontRendererObj.drawString(GT_Utility.trans("132", "Pipe is loose."), 10, line_counter, textColor);
line_counter += 8;
@@ -92,46 +94,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);
line_counter += 8;
} 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);
- 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);
+ 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);
}
} else if (mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) {
ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity().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);
+ 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);
}
}
}
diff --git a/src/main/java/gregtech/api/gui/GT_GUICover.java b/src/main/java/gregtech/api/gui/GT_GUICover.java
index 4f61c95dd3..635a27d6ef 100644
--- a/src/main/java/gregtech/api/gui/GT_GUICover.java
+++ b/src/main/java/gregtech/api/gui/GT_GUICover.java
@@ -31,19 +31,18 @@ public abstract class GT_GUICover extends GT_GUIScreen {
public void setParentGuiId(int parentGuiId) {
this.parentGuiId = parentGuiId;
}
-
@Override
public void closeScreen() {
// 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()));
+ 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 0aec243967..c077b02bf7 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java
@@ -4,215 +4,227 @@ import gregtech.api.gui.widgets.GT_GuiFakeItemButton;
import gregtech.api.gui.widgets.GT_GuiIcon;
import gregtech.api.gui.widgets.GT_GuiIconButton;
import gregtech.api.util.GT_Utility;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.function.Consumer;
-
public class GT_GUIDialogSelectItem extends GT_GUIScreen {
- public static final int UNSELECTED = -1;
- private static final int cols = 9;
- private static final int rows = 3;
- private final int textColor = this.getTextColorOrDefault("text",0xff555555);
- private final GuiScreen parent;
- private final Consumer selectedCallback;
- // passed in stack
- private final List stacks;
- // 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 boolean noDeselect;
- private int selected;
- private int scroll = 0;
- private GT_GuiIconButton btnUp;
- private GT_GuiIconButton btnDown;
-
-
- public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, 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) {
- this(header, headerItem, parent, selectedCallback, stacks, selected, false);
- }
-
- /**
- * Open a dialog to select an item from given list. Given callback may be called zero or more times depending on user action.
- * @param header Header text
- * @param headerItem ItemStack to use as Dialog icon
- * @param parent open which GUIScreen when this dialog is closed. use null if it has no parent.
- * @param selectedCallback callback upon selected
- * @param stacks list to choose from
- * @param selected preselected item. Use {@link #UNSELECTED} for unselected. Invalid selected will be clamped to 0 or highest index
- * @param noDeselect true if player cannot deselect, false otherwise. If this is set to true, selectedCallback 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) {
- super(176, 107, header);
- this.noDeselect = noDeselect;
- if (headerItem != null)
- this.headerIcon.setItem(headerItem);
- this.parent = parent;
- this.selectedCallback = selectedCallback;
- this.stacks = stacks;
-
- if (stacks.size() > rows * cols) {
- btnUp = new GT_GuiIconButton(this, 0, 134, 25, GT_GuiIcon.GREEN_ARROW_UP);
- btnDown = new GT_GuiIconButton(this, 1, 152, 25, GT_GuiIcon.GREEN_ARROW_DOWN);
- }
-
- 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));
- }
- }
-
- setSelected(noDeselect ? Math.max(0, selected) : selected);
- ensureSelectedDisplayed();
- }
-
- @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")));
- }
-
- @Override
- public void closeScreen() {
- selectedCallback.accept(getCandidate(getSelected()));
- mc.displayGuiScreen(parent);
- if (parent == null)
- mc.setIngameFocus();
- }
-
- @Override
- public void buttonClicked(GuiButton button) {
- switch (button.id) {
- case 0:
- setScroll(scroll - 1);
- return;
- case 1:
- setScroll(scroll + 1);
- return;
- }
- super.buttonClicked(button);
- }
-
- @Override
- public void drawExtras(int mouseX, int mouseY, float parTicks) {
- int y = 25 + (18 - getFontRenderer().FONT_HEIGHT) / 2;
- getFontRenderer().drawString(StatCollector.translateToLocal("GT5U.gui.select.current"), 8, y, textColor);
- super.drawExtras(mouseX, mouseY, parTicks);
- }
-
- @Override
- public void mouseClicked(int x, int y, int button) {
- int mx = x - guiLeft, my = y - guiTop;
- if (button == 0) {
- if (btnCurrent.getBounds().contains(mx, my)) {
- ensureSelectedDisplayed();
- return;
- }
-
- for (int i = 0, slotsSize = slots.size(); i < slotsSize; i++) {
- GT_GuiFakeItemButton slot = slots.get(i);
- if (slot.getBounds().contains(mx, my)) {
- setSelected(slotIndexToListIndex(i));
- return;
- }
- }
- } else if (button == 1 && getSelected() >= 0) {
- if (btnCurrent.getBounds().contains(mx, my)) {
- setSelected(UNSELECTED);
- return;
- }
- GT_GuiFakeItemButton slot = getSlot(listIndexToSlotIndex(getSelected()));
- if (slot != null && slot.getBounds().contains(mx, my)) {
- setSelected(UNSELECTED);
- }
- }
- super.mouseClicked(x, y, button);
- }
-
- @Override
- public void onMouseWheel(int x, int y, int delta) {
- if (delta < 0)
- setScroll(scroll + 1);
- else if (delta > 0)
- setScroll(scroll - 1);
- }
-
- 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);
- }
- }
-
- private void ensureSelectedDisplayed() {
- if (getSelected() < scroll * cols) {
- setScroll(getSelected() / cols);
- } else if (getSelected() > (scroll + rows) * cols) {
- setScroll((getSelected() - (rows - 1) * cols) / cols);
- } else {
- // called nonetheless to update button enabled states
- setScroll(scroll);
- }
- }
-
- private int slotIndexToListIndex(int index) {
- int mapped = scroll * cols + index;
- return mapped >= stacks.size() ? UNSELECTED : mapped;
- }
-
- private int listIndexToSlotIndex(int index) {
- return index - scroll * cols;
- }
-
- public int getSelected() {
- return selected;
- }
-
- public void setSelected(int selected) {
- if (selected == this.selected) return;
- int newSelected = GT_Utility.clamp(selected, UNSELECTED, stacks.size() - 1);
-
- if (noDeselect && newSelected == UNSELECTED)
- return;
-
- GT_GuiFakeItemButton selectedSlot = getSlot(this.selected);
- if (selectedSlot != null)
- selectedSlot.setBgIcon(GT_GuiIcon.SLOT_GRAY);
-
- this.selected = newSelected;
-
- btnCurrent.setItem(getCandidate(this.selected));
-
- selectedSlot = getSlot(this.selected);
- if (selectedSlot != null)
- selectedSlot.setBgIcon(GT_GuiIcon.SLOT_DARKGRAY);
- }
-
- private void setScroll(int scroll) {
- if (stacks.size() > rows * cols) {
- int lo = 0;
- int hi = (stacks.size() - rows * cols) / cols + 1;
- this.scroll = GT_Utility.clamp(scroll, lo, hi);
- btnUp.enabled = this.scroll != lo;
- btnDown.enabled = this.scroll != hi;
- }
- fillSlots();
- }
-
- private ItemStack getCandidate(int listIndex) {
- return listIndex < 0 || listIndex >= stacks.size() ? null : stacks.get(listIndex);
- }
-
- private GT_GuiFakeItemButton getSlot(int slotIndex) {
- return slotIndex < 0 || slotIndex >= slots.size() ? null : slots.get(slotIndex);
- }
+ public static final int UNSELECTED = -1;
+ private static final int cols = 9;
+ private static final int rows = 3;
+ private final int textColor = this.getTextColorOrDefault("text", 0xff555555);
+ private final GuiScreen parent;
+ private final Consumer selectedCallback;
+ // passed in stack
+ private final List stacks;
+ // 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 boolean noDeselect;
+ private int selected;
+ private int scroll = 0;
+ private GT_GuiIconButton btnUp;
+ private GT_GuiIconButton btnDown;
+
+ public GT_GUIDialogSelectItem(
+ String header,
+ ItemStack headerItem,
+ GuiScreen parent,
+ 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) {
+ this(header, headerItem, parent, selectedCallback, stacks, selected, false);
+ }
+
+ /**
+ * Open a dialog to select an item from given list. Given callback may be called zero or more times depending on user action.
+ * @param header Header text
+ * @param headerItem ItemStack to use as Dialog icon
+ * @param parent open which GUIScreen when this dialog is closed. use null if it has no parent.
+ * @param selectedCallback callback upon selected
+ * @param stacks list to choose from
+ * @param selected preselected item. Use {@link #UNSELECTED} for unselected. Invalid selected will be clamped to 0 or highest index
+ * @param noDeselect true if player cannot deselect, false otherwise. If this is set to true, selectedCallback 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) {
+ super(176, 107, header);
+ this.noDeselect = noDeselect;
+ if (headerItem != null) this.headerIcon.setItem(headerItem);
+ this.parent = parent;
+ this.selectedCallback = selectedCallback;
+ this.stacks = stacks;
+
+ if (stacks.size() > rows * cols) {
+ btnUp = new GT_GuiIconButton(this, 0, 134, 25, GT_GuiIcon.GREEN_ARROW_UP);
+ btnDown = new GT_GuiIconButton(this, 1, 152, 25, GT_GuiIcon.GREEN_ARROW_DOWN);
+ }
+
+ 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));
+ }
+ }
+
+ setSelected(noDeselect ? Math.max(0, selected) : selected);
+ ensureSelectedDisplayed();
+ }
+
+ @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")));
+ }
+
+ @Override
+ public void closeScreen() {
+ selectedCallback.accept(getCandidate(getSelected()));
+ mc.displayGuiScreen(parent);
+ if (parent == null) mc.setIngameFocus();
+ }
+
+ @Override
+ public void buttonClicked(GuiButton button) {
+ switch (button.id) {
+ case 0:
+ setScroll(scroll - 1);
+ return;
+ case 1:
+ setScroll(scroll + 1);
+ return;
+ }
+ super.buttonClicked(button);
+ }
+
+ @Override
+ public void drawExtras(int mouseX, int mouseY, float parTicks) {
+ int y = 25 + (18 - getFontRenderer().FONT_HEIGHT) / 2;
+ getFontRenderer().drawString(StatCollector.translateToLocal("GT5U.gui.select.current"), 8, y, textColor);
+ super.drawExtras(mouseX, mouseY, parTicks);
+ }
+
+ @Override
+ public void mouseClicked(int x, int y, int button) {
+ int mx = x - guiLeft, my = y - guiTop;
+ if (button == 0) {
+ if (btnCurrent.getBounds().contains(mx, my)) {
+ ensureSelectedDisplayed();
+ return;
+ }
+
+ for (int i = 0, slotsSize = slots.size(); i < slotsSize; i++) {
+ GT_GuiFakeItemButton slot = slots.get(i);
+ if (slot.getBounds().contains(mx, my)) {
+ setSelected(slotIndexToListIndex(i));
+ return;
+ }
+ }
+ } else if (button == 1 && getSelected() >= 0) {
+ if (btnCurrent.getBounds().contains(mx, my)) {
+ setSelected(UNSELECTED);
+ return;
+ }
+ GT_GuiFakeItemButton slot = getSlot(listIndexToSlotIndex(getSelected()));
+ if (slot != null && slot.getBounds().contains(mx, my)) {
+ setSelected(UNSELECTED);
+ }
+ }
+ super.mouseClicked(x, y, button);
+ }
+
+ @Override
+ public void onMouseWheel(int x, int y, int delta) {
+ if (delta < 0) setScroll(scroll + 1);
+ else if (delta > 0) setScroll(scroll - 1);
+ }
+
+ 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);
+ }
+ }
+
+ private void ensureSelectedDisplayed() {
+ if (getSelected() < scroll * cols) {
+ setScroll(getSelected() / cols);
+ } else if (getSelected() > (scroll + rows) * cols) {
+ setScroll((getSelected() - (rows - 1) * cols) / cols);
+ } else {
+ // called nonetheless to update button enabled states
+ setScroll(scroll);
+ }
+ }
+
+ private int slotIndexToListIndex(int index) {
+ int mapped = scroll * cols + index;
+ return mapped >= stacks.size() ? UNSELECTED : mapped;
+ }
+
+ private int listIndexToSlotIndex(int index) {
+ return index - scroll * cols;
+ }
+
+ public int getSelected() {
+ return selected;
+ }
+
+ public void setSelected(int selected) {
+ if (selected == this.selected) return;
+ int newSelected = GT_Utility.clamp(selected, UNSELECTED, stacks.size() - 1);
+
+ if (noDeselect && newSelected == UNSELECTED) return;
+
+ GT_GuiFakeItemButton selectedSlot = getSlot(this.selected);
+ if (selectedSlot != null) selectedSlot.setBgIcon(GT_GuiIcon.SLOT_GRAY);
+
+ this.selected = newSelected;
+
+ btnCurrent.setItem(getCandidate(this.selected));
+
+ selectedSlot = getSlot(this.selected);
+ if (selectedSlot != null) selectedSlot.setBgIcon(GT_GuiIcon.SLOT_DARKGRAY);
+ }
+
+ private void setScroll(int scroll) {
+ if (stacks.size() > rows * cols) {
+ int lo = 0;
+ int hi = (stacks.size() - rows * cols) / cols + 1;
+ this.scroll = GT_Utility.clamp(scroll, lo, hi);
+ btnUp.enabled = this.scroll != lo;
+ btnDown.enabled = this.scroll != hi;
+ }
+ fillSlots();
+ }
+
+ private ItemStack getCandidate(int listIndex) {
+ return listIndex < 0 || listIndex >= stacks.size() ? null : stacks.get(listIndex);
+ }
+
+ private GT_GuiFakeItemButton getSlot(int slotIndex) {
+ return slotIndex < 0 || slotIndex >= slots.size() ? null : slots.get(slotIndex);
+ }
}
diff --git a/src/main/java/gregtech/api/gui/GT_GUIScreen.java b/src/main/java/gregtech/api/gui/GT_GUIScreen.java
index 1efaddea35..281be1e55d 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIScreen.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIScreen.java
@@ -1,13 +1,14 @@
package gregtech.api.gui;
import gregtech.api.enums.Dyes;
-import gregtech.api.gui.GT_GUIColorOverride;
import gregtech.api.gui.widgets.GT_GuiFakeItemButton;
import gregtech.api.gui.widgets.GT_GuiIntegerTextBox;
import gregtech.api.gui.widgets.GT_GuiTooltip;
import gregtech.api.gui.widgets.GT_GuiTooltipManager;
import gregtech.api.gui.widgets.GT_GuiTooltipManager.GT_IToolTipRenderer;
import gregtech.api.interfaces.IGuiScreen;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -19,316 +20,305 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
public abstract class GT_GUIScreen extends GuiScreen implements GT_IToolTipRenderer, IGuiScreen {
- protected GT_GuiTooltipManager ttManager = new GT_GuiTooltipManager();
+ protected GT_GuiTooltipManager ttManager = new GT_GuiTooltipManager();
- protected int gui_width = 176;
- protected int gui_height = 107;
- protected int guiTop, guiLeft;
- protected boolean drawButtons = true;
+ protected int gui_width = 176;
+ protected int gui_height = 107;
+ protected int guiTop, guiLeft;
+ protected boolean drawButtons = true;
private ResourceLocation mGUIbackgroundLocation;
- private GuiButton selectedButton;
+ private GuiButton selectedButton;
private GT_GUIColorOverride colorOverride;
private final int textColor;
- private final static String guiTexturePath = "gregtech:textures/gui/GuiCover.png";
+ private static final String guiTexturePath = "gregtech:textures/gui/GuiCover.png";
- public String header;
- public GT_GuiFakeItemButton headerIcon;
+ public String header;
+ public GT_GuiFakeItemButton headerIcon;
- protected List elements = new ArrayList<>();
- protected List textBoxes = new ArrayList<>();
+ protected List elements = new ArrayList<>();
+ protected List textBoxes = new ArrayList<>();
- public GT_GUIScreen(int width, int height, String header) {
+ public GT_GUIScreen(int width, int height, String header) {
this.gui_width = width;
- this.gui_height = height;
- this.header = header;
- this.headerIcon = new GT_GuiFakeItemButton(this, 5, 5, null);
+ this.gui_height = height;
+ this.header = header;
+ this.headerIcon = new GT_GuiFakeItemButton(this, 5, 5, null);
this.mGUIbackgroundLocation = new ResourceLocation(guiTexturePath);
this.colorOverride = new GT_GUIColorOverride(guiTexturePath);
this.textColor = getTextColorOrDefault("title", 0xFF222222);
- }
+ }
- @Override
- public void initGui() {
- guiLeft = (this.width - this.gui_width) / 2;
- guiTop = (this.height - this.gui_height) / 2;
+ @Override
+ public void initGui() {
+ guiLeft = (this.width - this.gui_width) / 2;
+ guiTop = (this.height - this.gui_height) / 2;
- for (IGuiElement element : elements) {
- if (element instanceof GuiButton)
- buttonList.add(element);
- if (element instanceof GT_GuiIntegerTextBox)
- textBoxes.add((GT_GuiIntegerTextBox) element);
- }
+ for (IGuiElement element : elements) {
+ if (element instanceof GuiButton) buttonList.add(element);
+ if (element instanceof GT_GuiIntegerTextBox) textBoxes.add((GT_GuiIntegerTextBox) element);
+ }
- onInitGui(guiLeft, guiTop, gui_width, gui_height);
+ onInitGui(guiLeft, guiTop, gui_width, gui_height);
- for (IGuiElement element : elements) {
- element.onInit();
- }
- super.initGui();
- }
+ for (IGuiElement element : elements) {
+ element.onInit();
+ }
+ super.initGui();
+ }
- protected abstract void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height);
+ protected abstract void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height);
protected int getTextColorOrDefault(String textType, int defaultColor) {
return colorOverride.getTextColorOrDefault(textType, defaultColor);
}
- public void onMouseWheel(int x, int y, int delta) {
- }
-
- @Override
- public void handleMouseInput() {
- int delta = Mouse.getEventDWheel();
- if (delta != 0) {
- int i = Mouse.getEventX() * this.width / this.mc.displayWidth;
- int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
- onMouseWheel(i, j, delta);
- }
- super.handleMouseInput();
- }
-
- @Override
- public void drawScreen(int mouseX, int mouseY, float parTicks) {
- drawDefaultBackground();
-
- drawBackground(mouseX, mouseY, parTicks);
-
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glDisable(GL11.GL_DEPTH_TEST);
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- if (drawButtons) {
- RenderHelper.enableGUIStandardItemLighting();
- for (IGuiElement e : elements)
- e.draw(mouseX, mouseY, parTicks);
- }
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
-
- GL11.glPushMatrix();
- GL11.glTranslatef(guiLeft, guiTop, 0.0F);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- GL11.glDisable(GL11.GL_LIGHTING);
- drawForegroundLayer(mouseX, mouseY, parTicks);
- GL11.glEnable(GL11.GL_LIGHTING);
-
- GL11.glPopMatrix();
-
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
- RenderHelper.enableStandardItemLighting();
- }
-
- public void drawForegroundLayer(int mouseX, int mouseY, float parTicks) {
- drawExtras(mouseX, mouseY, parTicks);
- ttManager.onTick(this, mouseX, mouseY);
- }
-
- public void drawBackground(int mouseX, int mouseY, float parTicks) {
- short[] color = Dyes.MACHINE_METAL.getRGBA();
- GL11.glColor3ub((byte) color[0], (byte) color[1], (byte) color[2]);
- this.mc.renderEngine.bindTexture(mGUIbackgroundLocation);
- drawTexturedModalRect(guiLeft, guiTop, 0,0, gui_width, gui_height);
- }
-
- public void drawExtras(int mouseX, int mouseY, float parTicks) {
- this.fontRendererObj.drawString(header, 25, 9, textColor);
- }
-
- @Override
- public boolean doesGuiPauseGame()
- {
- return false;
- }
-
- public void closeScreen() {
- this.mc.displayGuiScreen(null);
- this.mc.setIngameFocus();
- }
-
- @Override
- public void updateScreen() {
- super.updateScreen();
- for (GuiTextField f : textBoxes) {
- f.updateCursorCounter();
- }
- }
-
- @Override
- public void mouseClicked(int x, int y, int button) {
- for (GT_GuiIntegerTextBox tBox : textBoxes) {
- boolean hadFocus = tBox.isFocused();
- if (tBox.isEnabled() || hadFocus)
- tBox.mouseClicked(x,y,button);
-
- if (tBox.isFocused() && button == 1 && tBox.isEnabled()) //rightclick -> lcear it
- tBox.setText("0");
- else if (hadFocus && !tBox.isFocused())
- applyTextBox(tBox);
- }
- super.mouseClicked(x, y, button);
- }
-
- @Override
- public void keyTyped(char c, int key) {
- GT_GuiIntegerTextBox focusedTextBox = null;
- for (GT_GuiIntegerTextBox textBox : textBoxes) {
- if (textBox.isFocused())
- focusedTextBox = textBox;
- }
-
- if (key == 1) { //esc
- if(focusedTextBox != null) {
- resetTextBox(focusedTextBox);
- setFocusedTextBox(null);
- return;
- } else {
- closeScreen();
- // don't fall through to parent
- return;
- }
- }
-
- if (c == '\t') { //tab
- for (int i = 0; i < textBoxes.size(); i++) {
- GT_GuiIntegerTextBox box = textBoxes.get(i);
- if (box.isFocused()) {
- applyTextBox(box);
- setFocusedTextBox(((i+1) < textBoxes.size()) ? textBoxes.get(i+1) : null);
- return;
- }
- }
- if (!textBoxes.isEmpty())
- setFocusedTextBox(textBoxes.get(0));
- return;
- }
-
- if (focusedTextBox != null && focusedTextBox.textboxKeyTyped(c, key)){
- return;
- }
-
- if (key == 28 && focusedTextBox != null) { // enter
- applyTextBox(focusedTextBox);
- setFocusedTextBox(null);
- return;
- }
-
- if (key == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
- if (focusedTextBox != null) {
- applyTextBox(focusedTextBox);
- setFocusedTextBox(null);
- return;
- }
- closeScreen();
- return;
- }
- super.keyTyped(c, key);
- }
-
- /**
- * Button
- */
-
- @Override
- public void actionPerformed(GuiButton button) {
- selectedButton = button;
- }
-
- @Override
- public void clearSelectedButton() {
- selectedButton = null;
- }
- @Override
- public GuiButton getSelectedButton(){return selectedButton;}
-
- @Override
- public void buttonClicked(GuiButton button) {
-
- }
-
- /**
- * TextBoxes
- */
- private void setFocusedTextBox(GT_GuiIntegerTextBox boxToFocus) {
- for (GT_GuiIntegerTextBox textBox : textBoxes) {
- textBox.setFocused(textBox.equals(boxToFocus) && textBox.isEnabled());
- }
- }
-
- /**
- * Given textbox's value might have changed.
- */
- public void applyTextBox(GT_GuiIntegerTextBox box) {
-
- }
-
- /**
- * Reset the given textbox to the last valid value, NOT 0.
- */
- public void resetTextBox(GT_GuiIntegerTextBox box) {
-
- }
-
- /**
- * GT_IToolTipRenderer
- */
- @Override
- public void drawHoveringText(List text, int mouseX, int mouseY, FontRenderer render) {
- super.drawHoveringText(text, mouseX, mouseY, render);
- }
- @Override
- public FontRenderer getFontRenderer() {
- return super.fontRendererObj;
- }
- @Override
- public void addToolTip(GT_GuiTooltip toolTip) {
- ttManager.addToolTip(toolTip);
- }
- @Override
- public boolean removeToolTip(GT_GuiTooltip toolTip) {
- return ttManager.removeToolTip(toolTip);
- }
-
- /**
- * Junk
- */
- @Override
- public int getGuiTop() {
- return guiTop;
- }
- @Override
- public int getGuiLeft() {
- return guiLeft;
- }
- @Override
- public int getXSize() {
- return gui_width;
- }
- @Override
- public int getYSize() {
- return gui_height;
- }
-
- @Override
- public RenderItem getItemRenderer() {
- return itemRender;
- }
-
- @Override
- public void addElement(IGuiElement element) {
- if (elements.contains(element))
- return;
- elements.add(element);
- }
- @Override
- public boolean removeElement(IGuiElement element) {
- return elements.remove(element);
- }
+ public void onMouseWheel(int x, int y, int delta) {}
+
+ @Override
+ public void handleMouseInput() {
+ int delta = Mouse.getEventDWheel();
+ if (delta != 0) {
+ int i = Mouse.getEventX() * this.width / this.mc.displayWidth;
+ int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
+ onMouseWheel(i, j, delta);
+ }
+ super.handleMouseInput();
+ }
+
+ @Override
+ public void drawScreen(int mouseX, int mouseY, float parTicks) {
+ drawDefaultBackground();
+
+ drawBackground(mouseX, mouseY, parTicks);
+
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ if (drawButtons) {
+ RenderHelper.enableGUIStandardItemLighting();
+ for (IGuiElement e : elements) e.draw(mouseX, mouseY, parTicks);
+ }
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+
+ GL11.glPushMatrix();
+ GL11.glTranslatef(guiLeft, guiTop, 0.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ GL11.glDisable(GL11.GL_LIGHTING);
+ drawForegroundLayer(mouseX, mouseY, parTicks);
+ GL11.glEnable(GL11.GL_LIGHTING);
+
+ GL11.glPopMatrix();
+
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ RenderHelper.enableStandardItemLighting();
+ }
+
+ public void drawForegroundLayer(int mouseX, int mouseY, float parTicks) {
+ drawExtras(mouseX, mouseY, parTicks);
+ ttManager.onTick(this, mouseX, mouseY);
+ }
+
+ public void drawBackground(int mouseX, int mouseY, float parTicks) {
+ short[] color = Dyes.MACHINE_METAL.getRGBA();
+ GL11.glColor3ub((byte) color[0], (byte) color[1], (byte) color[2]);
+ this.mc.renderEngine.bindTexture(mGUIbackgroundLocation);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, gui_width, gui_height);
+ }
+
+ public void drawExtras(int mouseX, int mouseY, float parTicks) {
+ this.fontRendererObj.drawString(header, 25, 9, textColor);
+ }
+
+ @Override
+ public boolean doesGuiPauseGame() {
+ return false;
+ }
+
+ public void closeScreen() {
+ this.mc.displayGuiScreen(null);
+ this.mc.setIngameFocus();
+ }
+
+ @Override
+ public void updateScreen() {
+ super.updateScreen();
+ for (GuiTextField f : textBoxes) {
+ f.updateCursorCounter();
+ }
+ }
+
+ @Override
+ public void mouseClicked(int x, int y, int button) {
+ for (GT_GuiIntegerTextBox tBox : textBoxes) {
+ boolean hadFocus = tBox.isFocused();
+ if (tBox.isEnabled() || hadFocus) tBox.mouseClicked(x, y, button);
+
+ if (tBox.isFocused() && button == 1 && tBox.isEnabled()) // rightclick -> lcear it
+ tBox.setText("0");
+ else if (hadFocus && !tBox.isFocused()) applyTextBox(tBox);
+ }
+ super.mouseClicked(x, y, button);
+ }
+
+ @Override
+ public void keyTyped(char c, int key) {
+ GT_GuiIntegerTextBox focusedTextBox = null;
+ for (GT_GuiIntegerTextBox textBox : textBoxes) {
+ if (textBox.isFocused()) focusedTextBox = textBox;
+ }
+
+ if (key == 1) { // esc
+ if (focusedTextBox != null) {
+ resetTextBox(focusedTextBox);
+ setFocusedTextBox(null);
+ return;
+ } else {
+ closeScreen();
+ // don't fall through to parent
+ return;
+ }
+ }
+
+ if (c == '\t') { // tab
+ for (int i = 0; i < textBoxes.size(); i++) {
+ GT_GuiIntegerTextBox box = textBoxes.get(i);
+ if (box.isFocused()) {
+ applyTextBox(box);
+ setFocusedTextBox(((i + 1) < textBoxes.size()) ? textBoxes.get(i + 1) : null);
+ return;
+ }
+ }
+ if (!textBoxes.isEmpty()) setFocusedTextBox(textBoxes.get(0));
+ return;
+ }
+
+ if (focusedTextBox != null && focusedTextBox.textboxKeyTyped(c, key)) {
+ return;
+ }
+
+ if (key == 28 && focusedTextBox != null) { // enter
+ applyTextBox(focusedTextBox);
+ setFocusedTextBox(null);
+ return;
+ }
+
+ if (key == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
+ if (focusedTextBox != null) {
+ applyTextBox(focusedTextBox);
+ setFocusedTextBox(null);
+ return;
+ }
+ closeScreen();
+ return;
+ }
+ super.keyTyped(c, key);
+ }
+
+ /**
+ * Button
+ */
+ @Override
+ public void actionPerformed(GuiButton button) {
+ selectedButton = button;
+ }
+
+ @Override
+ public void clearSelectedButton() {
+ selectedButton = null;
+ }
+
+ @Override
+ public GuiButton getSelectedButton() {
+ return selectedButton;
+ }
+
+ @Override
+ public void buttonClicked(GuiButton button) {}
+
+ /**
+ * TextBoxes
+ */
+ private void setFocusedTextBox(GT_GuiIntegerTextBox boxToFocus) {
+ for (GT_GuiIntegerTextBox textBox : textBoxes) {
+ textBox.setFocused(textBox.equals(boxToFocus) && textBox.isEnabled());
+ }
+ }
+
+ /**
+ * Given textbox's value might have changed.
+ */
+ public void applyTextBox(GT_GuiIntegerTextBox box) {}
+
+ /**
+ * Reset the given textbox to the last valid value, NOT 0.
+ */
+ public void resetTextBox(GT_GuiIntegerTextBox box) {}
+
+ /**
+ * GT_IToolTipRenderer
+ */
+ @Override
+ public void drawHoveringText(List text, int mouseX, int mouseY, FontRenderer render) {
+ super.drawHoveringText(text, mouseX, mouseY, render);
+ }
+
+ @Override
+ public FontRenderer getFontRenderer() {
+ return super.fontRendererObj;
+ }
+
+ @Override
+ public void addToolTip(GT_GuiTooltip toolTip) {
+ ttManager.addToolTip(toolTip);
+ }
+
+ @Override
+ public boolean removeToolTip(GT_GuiTooltip toolTip) {
+ return ttManager.removeToolTip(toolTip);
+ }
+
+ /**
+ * Junk
+ */
+ @Override
+ public int getGuiTop() {
+ return guiTop;
+ }
+
+ @Override
+ public int getGuiLeft() {
+ return guiLeft;
+ }
+
+ @Override
+ public int getXSize() {
+ return gui_width;
+ }
+
+ @Override
+ public int getYSize() {
+ return gui_height;
+ }
+
+ @Override
+ public RenderItem getItemRenderer() {
+ return itemRender;
+ }
+
+ @Override
+ public void addElement(IGuiElement element) {
+ if (elements.contains(element)) return;
+ elements.add(element);
+ }
+
+ @Override
+ public boolean removeElement(IGuiElement element) {
+ return elements.remove(element);
+ }
}
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 ea1b8b82f8..bf5f8886b3 100644
--- a/src/main/java/gregtech/api/gui/GT_Slot_Holo.java
+++ b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java
@@ -10,12 +10,17 @@ import net.minecraft.item.ItemStack;
public class GT_Slot_Holo extends Slot {
public final int mSlotIndex;
public boolean mEnabled = true;
- public boolean
- mCanInsertItem,
- mCanStackItem;
+ public boolean mCanInsertItem, mCanStackItem;
public int mMaxStacksize = 127;
- public GT_Slot_Holo(IInventory inventory, int slotIndex, int xPos, int yPos, boolean aCanInsertItem, boolean aCanStackItem, int aMaxStacksize) {
+ public GT_Slot_Holo(
+ IInventory inventory,
+ int slotIndex,
+ int xPos,
+ int yPos,
+ boolean aCanInsertItem,
+ boolean aCanStackItem,
+ int aMaxStacksize) {
super(inventory, slotIndex, xPos, yPos);
mCanInsertItem = aCanInsertItem;
mCanStackItem = aCanStackItem;
@@ -40,8 +45,7 @@ public class GT_Slot_Holo extends Slot {
@Override
public ItemStack decrStackSize(int amount) {
- if (!mCanStackItem)
- return null;
+ if (!mCanStackItem) return null;
return super.decrStackSize(amount);
}
@@ -71,8 +75,7 @@ public class GT_Slot_Holo extends Slot {
*/
@Override
@SideOnly(Side.CLIENT)
- public boolean func_111238_b()
- {
+ public boolean func_111238_b() {
return isEnabled();
}
}
diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Holo_ME.java b/src/main/java/gregtech/api/gui/GT_Slot_Holo_ME.java
index 08a11d29f4..205a6d74dc 100644
--- a/src/main/java/gregtech/api/gui/GT_Slot_Holo_ME.java
+++ b/src/main/java/gregtech/api/gui/GT_Slot_Holo_ME.java
@@ -3,7 +3,8 @@ package gregtech.api.gui;
import net.minecraft.inventory.IInventory;
public class GT_Slot_Holo_ME extends GT_Slot_Holo {
- public GT_Slot_Holo_ME(IInventory inventory, int slotIndex, int xPos, int yPos, boolean aCanInsertItem, boolean aCanStackItem) {
+ public GT_Slot_Holo_ME(
+ IInventory inventory, int slotIndex, int xPos, int yPos, boolean aCanInsertItem, boolean aCanStackItem) {
super(inventory, slotIndex, xPos, yPos, aCanInsertItem, aCanStackItem, Integer.MAX_VALUE);
}
}
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 8f729771f6..525618589b 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java
@@ -1,36 +1,34 @@
package gregtech.api.gui.widgets;
-import java.awt.Rectangle;
-import java.util.List;
-
-import org.lwjgl.opengl.GL11;
-
import codechicken.nei.api.API;
import codechicken.nei.api.INEIGuiAdapter;
-import gregtech.api.enums.Dyes;
import gregtech.api.enums.GT_Values;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.net.GT_Packet_GtTileEntityGuiRequest;
import gregtech.common.GT_Proxy;
+import java.awt.Rectangle;
+import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
/**
* Let's you access a GregTech IGregTechTileEntity's covers as tabs on the GUI's sides
*/
public class GT_GuiCoverTabLine extends GT_GuiTabLine {
// Names of the block a cover could be on
- private final static String[] SIDES = new String[]{
+ 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.east"
+ };
// Not sure there's a point in JIT translation but that's what this is
private String[] translatedSides;
@@ -39,7 +37,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
/**
* Let's you access an IGregTechTileEntity's covers as tabs on the GUI's sides
- *
+ *
* @param gui GT_ITabRenderer gui which this tab line attaches to
* @param tabLineLeft left position of the tab line in relation to the gui
* @param tabLineTop top position of the tab line in relation to the gui
@@ -56,9 +54,19 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
* @param tile The IGregTechTileEntity the covers of which we are accessing
* @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) {
+ 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) {
super(gui, 6, tabLineLeft, tabLineTop, tabHeight, tabWidth, tabSpacing, xDir, yDir, displayMode, tabBackground);
this.tile = tile;
this.colorization = colorization;
@@ -76,12 +84,13 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
addCoverToTabs(tSide, cover);
}
}
- }
+ }
@Override
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));
+ GL11.glColor3ub((byte) ((colorization >> 16) & 0xFF), (byte) ((colorization >> 8) & 0xFF), (byte)
+ (colorization & 0xFF));
super.drawBackground(parTicks, mouseX, mouseY);
}
@@ -89,13 +98,13 @@ 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));
+ 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));
}
}
@@ -108,7 +117,6 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
boolean enabled = this.tile.getCoverBehaviorAtSideNew(side).hasCoverGUI();
this.setTab(side, cover, null, getTooltipForCoverTab(side, cover, enabled));
this.setTabEnabled(side, enabled);
-
}
/**
@@ -119,12 +127,13 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
* @return This cover tab's tooltip
*/
private String[] getTooltipForCoverTab(byte side, ItemStack cover, boolean enabled) {
- List tooltip = cover.getTooltip(Minecraft.getMinecraft().thePlayer, true);
- tooltip.set(0,
+ 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));
+ + getSideDescription(side)
+ + (enabled ? EnumChatFormatting.RESET + ": " : ": " + EnumChatFormatting.RESET)
+ + tooltip.get(0));
return tooltip.toArray(new String[0]);
}
@@ -138,7 +147,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
if (this.translatedSides[side] == null) {
this.translatedSides[side] = StatCollector.translateToLocal(SIDES[side]);
}
- return this.translatedSides[side] ;
+ return this.translatedSides[side];
}
return null;
}
@@ -146,7 +155,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
/**
* Hide any NEI slots that would intersect with a cover tab
*/
- static class CoverTabLineNEIHandler extends INEIGuiAdapter{
+ static class CoverTabLineNEIHandler extends INEIGuiAdapter {
@Override
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) {
Rectangle neiSlotArea = new Rectangle(x, y, w, h);
@@ -155,7 +164,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
if (!tabLine.visible) {
return false;
}
- for (int i = 0; i < tabLine.mTabs.length; i++ ) {
+ for (int i = 0; i < tabLine.mTabs.length; i++) {
if (tabLine.mTabs[i] != null && tabLine.mTabs[i].getBounds().intersects(neiSlotArea)) {
return true;
}
@@ -164,6 +173,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine {
return false;
}
}
+
static {
API.registerNEIGuiHandler(new CoverTabLineNEIHandler());
}
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 045730dd7f..7a57c49515 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiFakeItemButton.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiFakeItemButton.java
@@ -3,15 +3,14 @@ package gregtech.api.gui.widgets;
import codechicken.lib.gui.GuiDraw;
import gregtech.api.interfaces.IGuiScreen;
import gregtech.api.util.GT_UtilityClient;
+import java.awt.*;
+import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
-import java.awt.*;
-import java.util.List;
-
public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement {
private GT_GuiIcon bgIcon;
@@ -42,14 +41,13 @@ public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement {
this.gui = gui;
this.bgIcon = bgIcon;
item = null;
- rectangle = new Rectangle(x, y, 18, 18);
+ rectangle = new Rectangle(x, y, 18, 18);
gui.addElement(this);
}
public GT_GuiFakeItemButton setItem(ItemStack i) {
item = i;
- if (getMimicSlot())
- updateTooltip();
+ if (getMimicSlot()) updateTooltip();
return this;
}
@@ -57,7 +55,7 @@ public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement {
itemTooltips = item == null ? null : GT_UtilityClient.getTooltip(item, true);
}
- public ItemStack getItem(){
+ public ItemStack getItem() {
return item;
}
@@ -95,8 +93,7 @@ public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement {
@Override
public void onRemoved() {
- if (mimicSlot)
- gui.removeToolTip(tooltip);
+ if (mimicSlot) gui.removeToolTip(tooltip);
}
@Override
@@ -106,8 +103,8 @@ public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- if (bgIcon != null){
- GT_GuiIcon.render(bgIcon, xPosition-1, yPosition-1, 18, 18,0,true);
+ if (bgIcon != null) {
+ GT_GuiIcon.render(bgIcon, xPosition - 1, yPosition - 1, 18, 18, 0, true);
}
if (item != null) {
@@ -115,10 +112,15 @@ public class GT_GuiFakeItemButton implements IGuiScreen.IGuiElement {
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
- gui.getItemRenderer().renderItemAndEffectIntoGUI(gui.getFontRenderer(), Minecraft.getMinecraft().getTextureManager(), item, xPosition, yPosition);
-
- if (item.getItem() instanceof ItemBlock)
- GL11.glPopAttrib();
+ gui.getItemRenderer()
+ .renderItemAndEffectIntoGUI(
+ gui.getFontRenderer(),
+ Minecraft.getMinecraft().getTextureManager(),
+ item,
+ xPosition,
+ yPosition);
+
+ if (item.getItem() instanceof ItemBlock) GL11.glPopAttrib();
}
if (getMimicSlot())
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 0d6c2da243..37e1a6d960 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIcon.java
@@ -1,61 +1,59 @@
package gregtech.api.gui.widgets;
-import java.util.Arrays;
-
import gregtech.api.interfaces.IGuiIcon;
+import java.util.Arrays;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
-public enum GT_GuiIcon implements IGuiIcon{
- BUTTON_NORMAL (0, 0, 0),
- BUTTON_DOWN (0, 32, 0),
- BUTTON_HIGHLIGHT (0, 32*2, 0),
- BUTTON_HIGHLIGHT_DOWN (0, 32*3, 0),
- BUTTON_DISABLED (0, 32*4, 0),
-
- DISABLE (0, 0, 32),
- REDSTONE_OFF (0, 32, 32),
- REDSTONE_ON (0, 32*2, 32),
- CHECKMARK (0, 32*3, 32),
- CROSS (0, 32*4, 32),
- WHITELIST (0, 32*5, 32),
- BLACKLIST (0, 32*6, 32),
- PROGRESS (0, 32*7, 32),
-
- EXPORT (0, 0, 32*2),
- IMPORT (0, 32, 32*2),
- ALLOW_INPUT (0, 32*2, 32*2),
- BLOCK_INPUT (0, 32*3, 32*2),
- GREEN_ARROW_UP (0, 32*4, 32*2),
- GREEN_ARROW_DOWN (0, 32*5, 32*2),
- CYCLIC (0, 32*6, 32*2),
-
- SLOT_DARKGRAY (1, 176,0,18,18),
- SLOT_GRAY (1, 176,18,18,18),
-
- TAB_NORMAL (2, 0, 0,18,20),
- TAB_HIGHLIGHT (2, 18, 0,18,20),
- TAB_DISABLED (2, 18*2, 0,18,20),
- TAB_NORMAL_BRONZE (2, 0, 20,18,20),
- TAB_HIGHLIGHT_BRONZE (2, 18, 20,18,20),
- TAB_DISABLED_BRONZE (2, 18*2, 20,18,20),
- TAB_NORMAL_STEEL (2, 0,2*20,18,20),
- TAB_HIGHLIGHT_STEEL (2, 18,2*20,18,20),
- TAB_DISABLED_STEEL (2, 18*2,2*20,18,20),
- TAB_NORMAL_BRICK (2, 0,3*20,18,20),
- TAB_HIGHLIGHT_BRICK (2, 18,3*20,18,20),
- TAB_DISABLED_BRICK (2, 18*2,3*20,18,20),
- TAB_INFO_GRAY (2, 220, 0,18,20),
- TAB_INFO_BLUE (2,220+18, 0,18,20),
-;
-
+public enum GT_GuiIcon implements IGuiIcon {
+ BUTTON_NORMAL(0, 0, 0),
+ BUTTON_DOWN(0, 32, 0),
+ BUTTON_HIGHLIGHT(0, 32 * 2, 0),
+ BUTTON_HIGHLIGHT_DOWN(0, 32 * 3, 0),
+ BUTTON_DISABLED(0, 32 * 4, 0),
+
+ DISABLE(0, 0, 32),
+ REDSTONE_OFF(0, 32, 32),
+ REDSTONE_ON(0, 32 * 2, 32),
+ CHECKMARK(0, 32 * 3, 32),
+ CROSS(0, 32 * 4, 32),
+ WHITELIST(0, 32 * 5, 32),
+ BLACKLIST(0, 32 * 6, 32),
+ PROGRESS(0, 32 * 7, 32),
+
+ EXPORT(0, 0, 32 * 2),
+ IMPORT(0, 32, 32 * 2),
+ ALLOW_INPUT(0, 32 * 2, 32 * 2),
+ BLOCK_INPUT(0, 32 * 3, 32 * 2),
+ GREEN_ARROW_UP(0, 32 * 4, 32 * 2),
+ GREEN_ARROW_DOWN(0, 32 * 5, 32 * 2),
+ CYCLIC(0, 32 * 6, 32 * 2),
+
+ SLOT_DARKGRAY(1, 176, 0, 18, 18),
+ SLOT_GRAY(1, 176, 18, 18, 18),
+
+ TAB_NORMAL(2, 0, 0, 18, 20),
+ TAB_HIGHLIGHT(2, 18, 0, 18, 20),
+ TAB_DISABLED(2, 18 * 2, 0, 18, 20),
+ TAB_NORMAL_BRONZE(2, 0, 20, 18, 20),
+ TAB_HIGHLIGHT_BRONZE(2, 18, 20, 18, 20),
+ TAB_DISABLED_BRONZE(2, 18 * 2, 20, 18, 20),
+ TAB_NORMAL_STEEL(2, 0, 2 * 20, 18, 20),
+ TAB_HIGHLIGHT_STEEL(2, 18, 2 * 20, 18, 20),
+ TAB_DISABLED_STEEL(2, 18 * 2, 2 * 20, 18, 20),
+ TAB_NORMAL_BRICK(2, 0, 3 * 20, 18, 20),
+ TAB_HIGHLIGHT_BRICK(2, 18, 3 * 20, 18, 20),
+ TAB_DISABLED_BRICK(2, 18 * 2, 3 * 20, 18, 20),
+ TAB_INFO_GRAY(2, 220, 0, 18, 20),
+ TAB_INFO_BLUE(2, 220 + 18, 0, 18, 20),
+ ;
private static final int T_SIZE = 256;
private static ResourceLocation[] TEXTURES = {
- new ResourceLocation("gregtech", "textures/gui/GuiButtons.png"),
- new ResourceLocation("gregtech", "textures/gui/GuiCover.png"),
- new ResourceLocation("gregtech", "textures/gui/GuiTabs.png"),
+ new ResourceLocation("gregtech", "textures/gui/GuiButtons.png"),
+ new ResourceLocation("gregtech", "textures/gui/GuiCover.png"),
+ new ResourceLocation("gregtech", "textures/gui/GuiTabs.png"),
};
public final int x, y, width, height;
@@ -72,25 +70,34 @@ public enum GT_GuiIcon implements IGuiIcon{
}
GT_GuiIcon(int texID, int x, int y) {
- this(texID, x, y,32,32,null);
+ this(texID, x, y, 32, 32, null);
}
+
GT_GuiIcon(int texID, int x, int y, int width, int height) {
- this(texID, x, y, width, height,null);
+ this(texID, x, y, width, height, null);
}
- public static void render(IGuiIcon icon, double x, double y, double width, double height, double zLevel,
- boolean doDraw) {
+
+ public static void render(
+ IGuiIcon icon, double x, double y, double width, double height, double zLevel, 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) {
+ public static void render(
+ IGuiIcon icon,
+ double x,
+ double y,
+ double width,
+ double height,
+ double zLevel,
+ boolean doDraw,
+ boolean flipHoritontally) {
Tessellator tess = Tessellator.instance;
if (doDraw) {
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURES[icon.getTexId()]);
tess.startDrawingQuads();
}
double minU = (double) (icon.getX() + (flipHoritontally ? icon.getWidth() : 0)) / T_SIZE;
- double maxU = (double) (icon.getX() + (flipHoritontally ? 0: icon.getWidth())) / T_SIZE;
+ double maxU = (double) (icon.getX() + (flipHoritontally ? 0 : icon.getWidth())) / T_SIZE;
double minV = (double) icon.getY() / T_SIZE;
double maxV = (double) (icon.getY() + icon.getHeight()) / T_SIZE;
tess.addVertexWithUV(x, y + height, zLevel, minU, maxV);
@@ -98,11 +105,9 @@ public enum GT_GuiIcon implements IGuiIcon{
tess.addVertexWithUV(x + width, y + 0, zLevel, maxU, minV);
tess.addVertexWithUV(x, y + 0, zLevel, minU, minV);
- if (icon.getOverlay() != null)
- render(icon.getOverlay(), x, y, width, height, zLevel, false);
+ if (icon.getOverlay() != null) render(icon.getOverlay(), x, y, width, height, zLevel, false);
- if (doDraw)
- tess.draw();
+ if (doDraw) tess.draw();
}
/**
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 9de9b03df4..fd9a879902 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconButton.java
@@ -1,10 +1,10 @@
package gregtech.api.gui.widgets;
import gregtech.api.interfaces.IGuiScreen;
+import java.awt.Rectangle;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import org.lwjgl.opengl.GL11;
-import java.awt.Rectangle;
public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElement {
public static final int DEFAULT_WIDTH = 16;
@@ -16,7 +16,6 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
private GT_GuiTooltip tooltip;
-
public GT_GuiIconButton(IGuiScreen gui, int id, int x, int y, GT_GuiIcon icon) {
super(id, x, y, DEFAULT_WIDTH, DEFAULT_HEIGHT, "");
this.gui = gui;
@@ -28,8 +27,7 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
@Override
public void onInit() {
- if (tooltip != null)
- gui.addToolTip(tooltip);
+ if (tooltip != null) gui.addToolTip(tooltip);
xPosition = x0 + gui.getGuiLeft();
yPosition = y0 + gui.getGuiTop();
}
@@ -41,12 +39,14 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
- if (this.tooltip != null)
- this.tooltip.enabled = true;
+ if (this.tooltip != null) this.tooltip.enabled = true;
if (this.visible) {
- //moused over
- this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + width && mouseY < this.yPosition + height;
+ // moused over
+ this.field_146123_n = mouseX >= this.xPosition
+ && mouseY >= this.yPosition
+ && mouseX < this.xPosition + width
+ && mouseY < this.yPosition + height;
mouseDragged(mc, mouseX, mouseY);
@@ -56,17 +56,15 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
int x = xPosition;
int y = yPosition;
- if(!this.field_146123_n) {
- // GL11.glColor4f(200F/255F, 210F/255F, 1, 1);
- }
- else
- GL11.glColor4f(1, 1, 1, 1);
+ if (!this.field_146123_n) {
+ // GL11.glColor4f(200F/255F, 210F/255F, 1, 1);
+ } else GL11.glColor4f(1, 1, 1, 1);
GT_GuiIcon.render(getButtonTexture(this.field_146123_n), x, y, width, height, 0, true);
GL11.glColor4f(1, 1, 1, 1);
if (icon != null) {
- GT_GuiIcon.render(icon, x, y, width, height , 0, true);
+ GT_GuiIcon.render(icon, x, y, width, height, 0, true);
}
GL11.glPopAttrib();
@@ -76,13 +74,11 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
@Override
public void mouseReleased(int mouseX, int mouseY) {
this.gui.clearSelectedButton();
- if(mousePressed(Minecraft.getMinecraft(), mouseX, mouseY))
- this.gui.buttonClicked(this);
+ if (mousePressed(Minecraft.getMinecraft(), mouseX, mouseY)) this.gui.buttonClicked(this);
}
public GT_GuiIcon getButtonTexture(boolean mouseOver) {
- if (!enabled)
- return GT_GuiIcon.BUTTON_DISABLED;
+ if (!enabled) return GT_GuiIcon.BUTTON_DISABLED;
if (this.equals(this.gui.getSelectedButton()))
return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT_DOWN : GT_GuiIcon.BUTTON_DOWN;
@@ -92,6 +88,7 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
public GT_GuiIcon getIcon() {
return icon;
}
+
public GT_GuiIconButton setIcon(GT_GuiIcon icon) {
this.icon = icon;
return this;
@@ -102,10 +99,8 @@ public class GT_GuiIconButton extends GuiButton implements IGuiScreen.IGuiElemen
}
public GT_GuiIconButton setTooltipText(String... text) {
- if (tooltip == null)
- tooltip = new GT_GuiTooltip(getBounds(), text);
- else
- tooltip.setToolTipText(text);
+ if (tooltip == null) tooltip = new GT_GuiTooltip(getBounds(), text);
+ else tooltip.setToolTipText(text);
return this;
}
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 e7b6b9971d..113b19711b 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIconCheckButton.java
@@ -13,7 +13,15 @@ public class GT_GuiIconCheckButton extends GT_GuiIconButton {
this(gui, id, x, y, checkedIcon, normalIcon, null, null);
}
- public GT_GuiIconCheckButton(IGuiScreen gui, int id, int x, int y, GT_GuiIcon checkedIcon, GT_GuiIcon normalIcon, String checkedTooltip, String normalTooltip) {
+ public GT_GuiIconCheckButton(
+ IGuiScreen gui,
+ int id,
+ int x,
+ int y,
+ GT_GuiIcon checkedIcon,
+ GT_GuiIcon normalIcon,
+ String checkedTooltip,
+ String normalTooltip) {
super(gui, id, x, y, normalIcon);
this.checkedIcon = checkedIcon;
this.normalIcon = normalIcon;
@@ -23,8 +31,7 @@ public class GT_GuiIconCheckButton extends GT_GuiIconButton {
@Override
public GT_GuiIcon getButtonTexture(boolean mouseOver) {
- if (!enabled)
- return GT_GuiIcon.BUTTON_DISABLED;
+ if (!enabled) return GT_GuiIcon.BUTTON_DISABLED;
if (this.equals(super.gui.getSelectedButton()))
return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT_DOWN : GT_GuiIcon.BUTTON_DOWN;
return mouseOver ? GT_GuiIcon.BUTTON_HIGHLIGHT : GT_GuiIcon.BUTTON_NORMAL;
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 e2ba53e4c9..3e2ac1e296 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiIntegerTextBox.java
@@ -1,11 +1,10 @@
package gregtech.api.gui.widgets;
import gregtech.api.interfaces.IGuiScreen;
+import java.awt.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiTextField;
-import java.awt.*;
-
public class GT_GuiIntegerTextBox extends GuiTextField implements IGuiScreen.IGuiElement {
private final int x0, y0;
private final IGuiScreen gui;
@@ -44,7 +43,17 @@ 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) {
+ if (validChar(c, key)
+ || c == 1
+ || 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_GuiSlotTooltip.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiSlotTooltip.java
index 1fb25ecb1a..105e919149 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiSlotTooltip.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiSlotTooltip.java
@@ -1,8 +1,7 @@
package gregtech.api.gui.widgets;
-import java.awt.Rectangle;
-
import gregtech.api.util.GT_TooltipDataCache.TooltipData;
+import java.awt.Rectangle;
import net.minecraft.inventory.Slot;
public class GT_GuiSlotTooltip extends GT_GuiTooltip {
diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiSmartTooltip.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiSmartTooltip.java
index d4f7df6d2c..2bb28fb929 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiSmartTooltip.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiSmartTooltip.java
@@ -1,13 +1,13 @@
package gregtech.api.gui.widgets;
+import gregtech.api.util.GT_TooltipDataCache.TooltipData;
import java.awt.Rectangle;
-import gregtech.api.util.GT_TooltipDataCache.TooltipData;
+public class GT_GuiSmartTooltip extends GT_GuiTooltip {
+ public interface TooltipVisibilityProvider {
+ boolean shouldShowTooltip();
+ }
-public class GT_GuiSmartTooltip extends GT_GuiTooltip{
- public interface TooltipVisibilityProvider {
- boolean shouldShowTooltip();
- }
private final TooltipVisibilityProvider visibilityProvider;
public GT_GuiSmartTooltip(Rectangle bounds, TooltipVisibilityProvider visibilityProvider, TooltipData data) {
@@ -21,5 +21,4 @@ public class GT_GuiSmartTooltip extends GT_GuiTooltip{
// If disabled by super, stay disabled.
this.enabled = this.enabled && this.visibilityProvider.shouldShowTooltip();
}
-
}
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 60672db880..1bb2f6dbb7 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTab.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTab.java
@@ -1,16 +1,14 @@
package gregtech.api.gui.widgets;
-import java.awt.Rectangle;
-
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
import gregtech.api.gui.widgets.GT_GuiTabLine.GT_GuiTabIconSet;
import gregtech.api.gui.widgets.GT_GuiTabLine.GT_ITabRenderer;
import gregtech.api.interfaces.IGuiIcon;
+import java.awt.Rectangle;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
/**
* A tab to be attached to a tab line
@@ -18,10 +16,7 @@ import net.minecraft.item.ItemStack;
public class GT_GuiTab {
private static final int SLOT_SIZE = 18;
- public boolean
- visible = true,
- mousedOver,
- enabled = true;
+ public boolean visible = true, mousedOver, enabled = true;
private Rectangle bounds;
private GT_GuiTabIconSet tabBackground;
@@ -33,7 +28,7 @@ public class GT_GuiTab {
/**
* A tab to be attached to a tab line
- *
+ *
* @param gui IGregTechTileEntity the tab line this tab belongs to is attached to
* @param id both the ID and position in the tab line of this tab
* @param bounds bounds of this tab
@@ -43,8 +38,15 @@ public class GT_GuiTab {
* @param tooltipText tooltip of this tab
* @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) {
+ public GT_GuiTab(
+ GT_ITabRenderer gui,
+ int id,
+ Rectangle bounds,
+ GT_GuiTabIconSet tabBackground,
+ ItemStack item,
+ IGuiIcon overlay,
+ String[] tooltipText,
+ boolean flipHorizontally) {
this.gui = gui;
this.bounds = bounds;
this.item = item;
@@ -56,13 +58,13 @@ public class GT_GuiTab {
this.flipHorizontally = flipHorizontally;
}
- public GT_GuiTab( GT_ITabRenderer gui, int id, Rectangle bounds, GT_GuiTabIconSet tabBackground) {
+ public GT_GuiTab(GT_ITabRenderer gui, int id, Rectangle bounds, GT_GuiTabIconSet tabBackground) {
this(gui, id, bounds, tabBackground, null, null, null, false);
}
/**
* Set this tab's tooltip text
- *
+ *
* @param text
* @return This tab for chaining
*/
@@ -70,8 +72,7 @@ public class GT_GuiTab {
if (tooltip == null) {
tooltip = new GT_GuiTooltip(bounds, text);
gui.addToolTip(tooltip);
- }
- else {
+ } else {
tooltip.setToolTipText(text);
}
return this;
@@ -86,21 +87,28 @@ public class GT_GuiTab {
/**
* Draw the background texture for this tab
- *
+ *
* @param mouseX
* @param mouseY
* @param parTicks
*/
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);
+ GT_GuiIcon.render(
+ getBackgroundTexture(),
+ bounds.x,
+ bounds.y,
+ bounds.width,
+ bounds.height,
+ 1,
+ true,
+ this.flipHorizontally);
}
}
/**
* Draw overlay textures and items atop the background texture
- *
+ *
* @param mouseX
* @param mouseY
* @param parTicks
@@ -119,19 +127,22 @@ public class GT_GuiTab {
}
if (item != null) {
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
-
+
if (item.getItem() instanceof ItemBlock) {
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
int margin = (bounds.height - SLOT_SIZE);
- gui.getItemRenderer().renderItemAndEffectIntoGUI(gui.getFontRenderer(),
- Minecraft.getMinecraft().getTextureManager(), item,
- bounds.x + (this.flipHorizontally ? 0 : margin), bounds.y + margin);
-
- if (item.getItem() instanceof ItemBlock)
- GL11.glPopAttrib();
-
+ gui.getItemRenderer()
+ .renderItemAndEffectIntoGUI(
+ gui.getFontRenderer(),
+ Minecraft.getMinecraft().getTextureManager(),
+ item,
+ bounds.x + (this.flipHorizontally ? 0 : margin),
+ bounds.y + margin);
+
+ if (item.getItem() instanceof ItemBlock) GL11.glPopAttrib();
+
GL11.glPopAttrib();
}
}
@@ -141,8 +152,7 @@ public class GT_GuiTab {
* @return the texture this tab should currently use as it's background
*/
protected IGuiIcon getBackgroundTexture() {
- if (!enabled)
- return tabBackground.disabled;
+ if (!enabled) return tabBackground.disabled;
return mousedOver ? tabBackground.highlight : tabBackground.normal;
}
@@ -156,11 +166,11 @@ public class GT_GuiTab {
/**
* Reposition this tab on the screen
- *
+ *
* @param xPos
* @param yPos
*/
public void setPosition(int xPos, int yPos) {
- this.bounds = new Rectangle( xPos, yPos, bounds.width, bounds.height);
+ this.bounds = new Rectangle(xPos, yPos, bounds.width, bounds.height);
}
}
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 e7ac596dee..ff0ccc2ac1 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTabLine.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTabLine.java
@@ -1,13 +1,11 @@
package gregtech.api.gui.widgets;
-import java.awt.Rectangle;
-
-import org.lwjgl.opengl.GL11;
-
import gregtech.api.interfaces.IGuiIcon;
+import java.awt.Rectangle;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
+import org.lwjgl.opengl.GL11;
/**
* Draws clickable and configurable tabs on the left or right side of another GUI
@@ -20,11 +18,11 @@ public class GT_GuiTabLine {
public IGuiIcon disabled;
public IGuiIcon normal;
public IGuiIcon highlight;
-
+
public GT_GuiTabIconSet(IGuiIcon normalIcon, IGuiIcon highlightIcon, IGuiIcon disabledIcon) {
- this. normal = normalIcon;
- this. highlight = highlightIcon;
- this. disabled = disabledIcon;
+ this.normal = normalIcon;
+ this.highlight = highlightIcon;
+ this.disabled = disabledIcon;
}
}
@@ -32,11 +30,12 @@ public class GT_GuiTabLine {
* Controls the rendering style of the tab line
*/
public static enum DisplayStyle {
- NONE((byte)0),
- NORMAL((byte)1),
- INVERSE((byte)-1);
+ NONE((byte) 0),
+ NORMAL((byte) 1),
+ INVERSE((byte) -1);
private byte value;
+
DisplayStyle(byte value) {
this.value = value;
}
@@ -52,43 +51,37 @@ public class GT_GuiTabLine {
*/
public interface GT_ITabRenderer {
int getGuiLeft();
+
int getGuiTop();
+
int getXSize();
RenderItem getItemRenderer();
+
FontRenderer getFontRenderer();
- void addToolTip(GT_GuiTooltip tooltip);
+ void addToolTip(GT_GuiTooltip tooltip);
+
boolean removeToolTip(GT_GuiTooltip tooltip);
}
// The tabs are arranged according to their index in this array
protected final GT_GuiTab[] mTabs;
- private int
- tabLineLeft,
- tabLineTop,
- tabHeight,
- tabWidth,
- tabSpacing;
-
+ private int tabLineLeft, tabLineTop, tabHeight, tabWidth, tabSpacing;
+
// In which direction to draw the tab line
- private DisplayStyle
- xDir,
- yDir;
+ private DisplayStyle xDir, yDir;
// Whether to display on the right side of the GT_ITabRenderer instead of left
- protected boolean
- flipHorizontally,
- visible;
+ protected boolean flipHorizontally, visible;
private GT_GuiTabIconSet tabBackground;
private GT_ITabRenderer gui;
-
/**
* Draws clickable and configurable tabs on the left or right side of a GT_ITabRenderer
- *
+ *
* @param gui GT_ITabRenderer gui which this tab line attaches to
* @param numTabs number of tab positions in this tab line
* @param tabLineLeft left position of the tab line in relation to the gui
@@ -104,8 +97,18 @@ public class GT_GuiTabLine {
* (NORMAL), on it's right side (INVERSE) or not at all (NONE)
* @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) {
+ 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) {
this.gui = gui;
this.mTabs = new GT_GuiTab[numTabs];
this.tabLineLeft = tabLineLeft;
@@ -123,34 +126,37 @@ public class GT_GuiTabLine {
/**
* Creates a new tab at the specified position with the given parameters.
* This class handles the positioning.
- *
+ *
* @param tabId
* @param item
* @param overlay
* @param text
*/
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);
+ mTabs[tabId] = new GT_GuiTab(
+ this.gui,
+ tabId,
+ getBoundsForTab(tabId),
+ this.tabBackground,
+ item,
+ overlay,
+ text,
+ this.flipHorizontally);
}
/**
* Get the bounds a given tab should occupy
- *
+ *
* @param tabId
* @return
*/
protected Rectangle getBoundsForTab(int tabId) {
- return new Rectangle (
- getTabX(tabId),
- getTabY(tabId),
- this.tabWidth,
- this.tabHeight);
+ return new Rectangle(getTabX(tabId), getTabY(tabId), this.tabWidth, this.tabHeight);
}
/**
* Enable or disable a tab. Disabled tabs have a dark background.
- *
+ *
* @param tabId
* @param value
*/
@@ -159,13 +165,12 @@ public class GT_GuiTabLine {
mTabs[tabId].enabled = value;
}
}
-
/**
* Draw the tabs for this tab bar
* GT_ITabRenderer must call this method on drawGuiContainerBackgroundLayer
* or on drawScreen.
- *
+ *
* @param parTicks
* @param mouseX
* @param mouseY
@@ -183,7 +188,7 @@ public class GT_GuiTabLine {
/**
* Draw the tab's backgrounds first
- *
+ *
* @param parTicks
* @param mouseX
* @param mouseY
@@ -198,7 +203,7 @@ public class GT_GuiTabLine {
/**
* Draw anything that overlays the tab's background texture
- *
+ *
* @param parTicks
* @param mouseX
* @param mouseY
@@ -214,13 +219,13 @@ public class GT_GuiTabLine {
/**
* Call tabClick for every tab that was clicked.
* GT_ITabRenderer must call this method on mouseClicked.
- *
+ *
* @param mouseX
* @param mouseY
* @param mouseButton
*/
public void onMouseClicked(int mouseX, int mouseY, int mouseButton) {
- for(int tabId = 0; tabId < mTabs.length; tabId++) {
+ for (int tabId = 0; tabId < mTabs.length; tabId++) {
if (mTabs[tabId] != null && mTabs[tabId].getBounds().contains(mouseX, mouseY)) {
tabClicked(tabId, mouseButton);
return;
@@ -230,11 +235,11 @@ public class GT_GuiTabLine {
/**
* Act on a tab being clicked.
- *
+ *
* @param tabId
* @param mouseButton
*/
- protected void tabClicked(int tabId, int mouseButton) { }
+ protected void tabClicked(int tabId, int mouseButton) {}
/**
* Reposition ourselves whenever the GT_ITabRenderer does so.
@@ -250,18 +255,19 @@ public class GT_GuiTabLine {
/**
* Get the proper X position for a given tab
- *
+ *
* @param tabId
* @return
*/
private int getTabX(int tabId) {
- return this.gui.getGuiLeft() + (flipHorizontally ? (gui.getXSize() - tabLineLeft - tabWidth) : tabLineLeft)
- + (tabId * (tabWidth + tabSpacing) * xDir.getValue());
+ return this.gui.getGuiLeft()
+ + (flipHorizontally ? (gui.getXSize() - tabLineLeft - tabWidth) : tabLineLeft)
+ + (tabId * (tabWidth + tabSpacing) * xDir.getValue());
}
/**
* Get the proper Y position for a given tab
- *
+ *
* @param tabId
* @return
*/
diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltip.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltip.java
index 21648b74fe..ab755eb2c3 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltip.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltip.java
@@ -1,15 +1,13 @@
package gregtech.api.gui.widgets;
+import gregtech.api.util.GT_TooltipDataCache.TooltipData;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import java.util.Objects;
-
import org.lwjgl.input.Keyboard;
-import gregtech.api.util.GT_TooltipDataCache.TooltipData;
public class GT_GuiTooltip {
protected Rectangle bounds;
@@ -20,7 +18,7 @@ public class GT_GuiTooltip {
/**
* Used to create a tooltip that will appear over the specified bounds.
* This will initially be a "static" tooltip that doesn't respect verbosity levels or respond to the shift key.
- *
+ *
* @param bounds
* @param text
*/
@@ -32,7 +30,7 @@ public class GT_GuiTooltip {
/**
* Used to create a tooltip that will appear over the specified bounds.
* This will initially be a "dynamic" tooltip that respects verbosity levels and responds to the shift key.
- *
+ *
* @param bounds
* @param data
*/
@@ -43,10 +41,10 @@ public class GT_GuiTooltip {
}
private TooltipData sanitizeTooltipData(TooltipData data) {
- if (data.text == null){
+ if (data.text == null) {
data.text = Arrays.asList(new String[0]);
}
- if (data.shiftText == null){
+ if (data.shiftText == null) {
data.shiftText = Arrays.asList(new String[0]);
}
return data;
@@ -65,12 +63,11 @@ public class GT_GuiTooltip {
/**
* Called once this tooltip has been determined to be enabled
*/
- protected void updateText() {
- }
+ protected void updateText() {}
/**
* Used to set a "static" tooltip that doesn't respect verbosity levels or respond to the shift key
- *
+ *
* @param text
*/
public void setToolTipText(String... text) {
@@ -80,17 +77,17 @@ public class GT_GuiTooltip {
/**
* Used to set a "dynamic" tooltip that respects verbosity levels and responds to the shift key
- *
+ *
* @param data
*/
public void setToolTipText(TooltipData data) {
// Trust that the tooltips have already been formatted and colored, just make sure it has no nulls
this.data = sanitizeTooltipData(data);
}
-
+
/**
* Apply tooltip colors in case the text doesn't contain them and return as tooltip data
- *
+ *
* @param text
* @return colored tooltip lines as list
*/
@@ -100,18 +97,15 @@ public class GT_GuiTooltip {
list = new ArrayList<>(text.length);
for (int i = 0; i < text.length; i++) {
if (text[i] == null) continue;
- if (list.isEmpty())
- list.add("\u00a7f" + text[i]);
- else
- list.add("\u00a77" + text[i]);
+ if (list.isEmpty()) list.add("\u00a7f" + text[i]);
+ else list.add("\u00a77" + text[i]);
}
} else {
list = Collections.emptyList();
}
- return new TooltipData(list, list) ;
+ return new TooltipData(list, list);
}
-
public List getToolTipText() {
return this.displayedText;
}
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 abee1774f9..1c31670071 100644
--- a/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java
+++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltipManager.java
@@ -1,16 +1,19 @@
package gregtech.api.gui.widgets;
-import net.minecraft.client.gui.FontRenderer;
-
import java.util.ArrayList;
import java.util.List;
+import net.minecraft.client.gui.FontRenderer;
public class GT_GuiTooltipManager {
public interface GT_IToolTipRenderer {
int getGuiLeft();
+
int getGuiTop();
+
int getXSize();
+
FontRenderer getFontRenderer();
+
void drawHoveringText(List text, int mouseX, int mouseY, FontRenderer font);
}
@@ -29,8 +32,8 @@ public class GT_GuiTooltipManager {
}
public final void onTick(GT_IToolTipRenderer render, int mouseX, int mouseY) {
- if ((Math.abs(mouseX-lastMouseX) < 2 ) && (Math.abs(mouseY-lastMouseY) < 2 )) {
- mouseStopped = Math.min(mouseStopped+1, 50);
+ if ((Math.abs(mouseX - lastMouseX) < 2) && (Math.abs(mouseY - lastMouseY) < 2)) {
+ mouseStopped = Math.min(mouseStopped + 1, 50);
} else {
mouseStopped = 0;
}
@@ -43,7 +46,9 @@ public class GT_GuiTooltipManager {
for (GT_GuiTooltip tip : tips) {
// 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)) {
+ if (tip.enabled
+ && (!tip.isDelayed() || mouseStopped > DELAY)
+ && tip.getBounds().contains(mouseX, mouseY)) {
tip.updateText();
drawTooltip(tip, mouseX, mouseY, render);
break;
@@ -53,10 +58,9 @@ public class GT_GuiTooltipManager {
private void drawTooltip(GT_GuiTooltip tip, int mouseX, int mouseY, GT_IToolTipRenderer render) {
List text = tip.getToolTipText();
- if (text == null)
- return;
+ if (text == null) return;
- if (mouseX > render.getGuiLeft() + render.getXSize()/2) {
+ if (mouseX > render.getGuiLeft() + render.getXSize() / 2) {
int maxWidth = 0;
for (String s : text) {
int w = render.getFontRenderer().getStringWidth(s);
@@ -69,5 +73,4 @@ public class GT_GuiTooltipManager {
render.drawHoveringText(text, mouseX, mouseY, render.getFontRenderer());
}
-
}
diff --git a/src/main/java/gregtech/api/interfaces/IBlockContainer.java b/src/main/java/gregtech/api/interfaces/IBlockContainer.java
index 7949ae90ce..89bda5de12 100644
--- a/src/main/java/gregtech/api/interfaces/IBlockContainer.java
+++ b/src/main/java/gregtech/api/interfaces/IBlockContainer.java
@@ -4,5 +4,6 @@ import net.minecraft.block.Block;
public interface IBlockContainer {
Block getBlock();
+
byte getMeta();
}
diff --git a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java
index 35ca68336e..063f713fe4 100644
--- a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java
+++ b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java
@@ -1,8 +1,7 @@
package gregtech.api.interfaces;
-import net.minecraft.entity.player.EntityPlayer;
-
import java.util.ArrayList;
+import net.minecraft.entity.player.EntityPlayer;
/**
* You are allowed to include this File in your Download, as i will not change it.
diff --git a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
index cec499c5d3..cc825f9d1a 100644
--- a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
+++ b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
@@ -1,8 +1,5 @@
package gregtech.api.interfaces;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.world.World;
-
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
@@ -13,6 +10,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
// If you are adding very late-game content feel free to tap into this interface.
// The eventual goal is to bypass laser/dynamo stuff and have energy deposited directly from ultra-endgame
@@ -50,22 +49,22 @@ public interface IGlobalWirelessEnergy {
default void saveGlobalEnergyInfo(String world_name) {
// Replace chars because of bug in forge that doesn't understand MC converts . to _ upon world creation.
- world_name = world_name.replace('.','_');
+ world_name = world_name.replace('.', '_');
createStorageIfNotExist(world_name);
saveGlobalEnergyMap(world_name);
saveGlobalEnergyName(world_name);
saveGlobalEnergyTeam(world_name);
-
}
default void saveGlobalEnergyMap(String world_name) {
try {
- List lines = GlobalEnergy.entrySet()
- .stream()
- .map(entry -> entry.getKey() + ":" + entry.getValue())
- .collect(Collectors.toList());
+ List lines = GlobalEnergy.entrySet().stream()
+ .map(entry -> entry.getKey() + ":" + entry.getValue())
+ .collect(Collectors.toList());
- Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyMapFileName + ".txt").toAbsolutePath();
+ Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyMapFileName
+ + ".txt")
+ .toAbsolutePath();
Files.write(path, lines);
} catch (IOException e) {
@@ -75,12 +74,13 @@ public interface IGlobalWirelessEnergy {
default void saveGlobalEnergyName(String world_name) {
try {
- List lines = GlobalEnergyName.entrySet()
- .stream()
- .map(entry -> entry.getKey() + ":" + entry.getValue())
- .collect(Collectors.toList());
+ List lines = GlobalEnergyName.entrySet().stream()
+ .map(entry -> entry.getKey() + ":" + entry.getValue())
+ .collect(Collectors.toList());
- Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyNameFileName + ".txt").toAbsolutePath();
+ Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/"
+ + GlobalEnergyNameFileName + ".txt")
+ .toAbsolutePath();
Files.write(path, lines);
} catch (IOException e) {
@@ -90,12 +90,13 @@ public interface IGlobalWirelessEnergy {
default void saveGlobalEnergyTeam(String world_name) {
try {
- List lines = GlobalEnergyTeam.entrySet()
- .stream()
- .map(entry -> entry.getKey() + ":" + entry.getValue())
- .collect(Collectors.toList());
+ List lines = GlobalEnergyTeam.entrySet().stream()
+ .map(entry -> entry.getKey() + ":" + entry.getValue())
+ .collect(Collectors.toList());
- Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyTeamFileName + ".txt").toAbsolutePath();
+ Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/"
+ + GlobalEnergyTeamFileName + ".txt")
+ .toAbsolutePath();
Files.write(path, lines);
} catch (IOException e) {
@@ -107,7 +108,7 @@ public interface IGlobalWirelessEnergy {
default void loadGlobalEnergyInfo(World world) {
// Replace chars because of bug in forge that doesn't understand MC converts . to _ upon world creation.
- String world_name = world.getWorldInfo().getWorldName().replace('.','_');
+ String world_name = world.getWorldInfo().getWorldName().replace('.', '_');
PrivateGlobalEnergy.WorldName = world_name;
createStorageIfNotExist(world_name);
loadGlobalEnergyMap(world);
@@ -117,10 +118,12 @@ public interface IGlobalWirelessEnergy {
default void loadGlobalEnergyMap(World world) {
try {
- Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyMapFileName + ".txt").toAbsolutePath();
+ Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/" + GlobalEnergyFolderName + "/"
+ + GlobalEnergyMapFileName + ".txt")
+ .toAbsolutePath();
String[] data;
- for(String line : Files.readAllLines(path)) {
+ for (String line : Files.readAllLines(path)) {
data = line.split(":");
String UUID = data[0];
@@ -135,11 +138,12 @@ public interface IGlobalWirelessEnergy {
default void loadGlobalEnergyName(World world) {
try {
- Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/"
- + GlobalEnergyFolderName + "/" + GlobalEnergyNameFileName + ".txt").toAbsolutePath();
+ Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/" + GlobalEnergyFolderName + "/"
+ + GlobalEnergyNameFileName + ".txt")
+ .toAbsolutePath();
String[] data;
- for(String line : Files.readAllLines(path)) {
+ for (String line : Files.readAllLines(path)) {
data = line.split(":");
GlobalEnergyName.put(data[0], data[1]);
@@ -151,11 +155,12 @@ public interface IGlobalWirelessEnergy {
default void loadGlobalEnergyTeam(World world) {
try {
- Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/"
- + GlobalEnergyFolderName + "/" + GlobalEnergyTeamFileName + ".txt").toAbsolutePath();
+ Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/" + GlobalEnergyFolderName + "/"
+ + GlobalEnergyTeamFileName + ".txt")
+ .toAbsolutePath();
String[] data;
- for(String line : Files.readAllLines(path)) {
+ for (String line : Files.readAllLines(path)) {
data = line.split(":");
GlobalEnergyName.put(data[0], data[1]);
@@ -168,7 +173,8 @@ public interface IGlobalWirelessEnergy {
// ------------------
default void createStorageIfNotExist(String world_name) {
- Path folder_path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName).toAbsolutePath();
+ Path folder_path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName)
+ .toAbsolutePath();
// Create folder for storing global energy network info.
try {
@@ -188,7 +194,6 @@ public interface IGlobalWirelessEnergy {
} catch (IOException e) {
e.printStackTrace();
}
-
}
// Adds a user to the energy map if they do not already exist. Otherwise, do nothing. Will also check if the user
@@ -299,7 +304,6 @@ public interface IGlobalWirelessEnergy {
GlobalEnergyName.clear();
GlobalEnergyTeam.clear();
}
-
}
class PrivateGlobalEnergy {
diff --git a/src/main/java/gregtech/api/interfaces/IGuiIcon.java b/src/main/java/gregtech/api/interfaces/IGuiIcon.java
index 2167270e6c..3204c35b4e 100644
--- a/src/main/java/gregtech/api/interfaces/IGuiIcon.java
+++ b/src/main/java/gregtech/api/interfaces/IGuiIcon.java
@@ -5,9 +5,14 @@ package gregtech.api.interfaces;
*/
public interface IGuiIcon {
int getX();
+
int getY();
+
int getWidth();
+
int getHeight();
+
int getTexId();
+
IGuiIcon getOverlay();
}
diff --git a/src/main/java/gregtech/api/interfaces/IGuiScreen.java b/src/main/java/gregtech/api/interfaces/IGuiScreen.java
index 5f1ae9cd2b..2f12781a77 100644
--- a/src/main/java/gregtech/api/interfaces/IGuiScreen.java
+++ b/src/main/java/gregtech/api/interfaces/IGuiScreen.java
@@ -5,12 +5,13 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.entity.RenderItem;
-
public interface IGuiScreen {
interface IGuiElement {
void onInit();
+
default void onRemoved() {}
+
void draw(int mouseX, int mouseY, float parTicks);
}
@@ -19,18 +20,24 @@ public interface IGuiScreen {
boolean removeToolTip(GT_GuiTooltip toolTip);
GuiButton getSelectedButton();
+
void clearSelectedButton();
+
void buttonClicked(GuiButton button);
int getGuiLeft();
+
int getGuiTop();
int getXSize();
+
int getYSize();
void addElement(IGuiElement element);
+
boolean removeElement(IGuiElement element);
RenderItem getItemRenderer();
+
FontRenderer getFontRenderer();
}
diff --git a/src/main/java/gregtech/api/interfaces/IHatchElement.java b/src/main/java/gregtech/api/interfaces/IHatchElement.java
index 22dbbdf013..e1f68963e0 100644
--- a/src/main/java/gregtech/api/interfaces/IHatchElement.java
+++ b/src/main/java/gregtech/api/interfaces/IHatchElement.java
@@ -6,7 +6,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_StructureUtility;
import gregtech.api.util.IGT_HatchAdder;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -56,22 +55,23 @@ 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, BiPredicate super T2, ? super IGregTechTileEntity> aShouldSkip) {
+ default IStructureElement newAny(
+ int aCasingIndex, int aDot, BiPredicate super T2, ? super IGregTechTileEntity> 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 super T2> fallback) {
@@ -93,9 +93,9 @@ class HatchElementEither implements IHatchElement {
public List extends Class extends IMetaTileEntity>> mteClasses() {
if (mMteClasses == null)
mMteClasses = ImmutableList.>builder()
- .addAll(first.mteClasses())
- .addAll(second.mteClasses())
- .build();
+ .addAll(first.mteClasses())
+ .addAll(second.mteClasses())
+ .build();
return mMteClasses;
}
@@ -106,8 +106,7 @@ class HatchElementEither implements IHatchElement {
@Override
public String name() {
- if (name == null)
- name = first.name() + " or " + second.name();
+ if (name == null) name = first.name() + " or " + second.name();
return name;
}
@@ -124,7 +123,12 @@ class HatchElement implements IHatchElement {
private final IHatchElement super T> mBacking;
private final ToLongFunction super T> mCount;
- public HatchElement(List> aMteClasses, IGT_HatchAdder super T> aAdder, String aName, ToLongFunction super T> aCount, IHatchElement super T> aBacking) {
+ public HatchElement(
+ List> aMteClasses,
+ IGT_HatchAdder super T> aAdder,
+ String aName,
+ ToLongFunction super T> aCount,
+ IHatchElement super T> aBacking) {
this.mClasses = aMteClasses;
this.mAdder = aAdder;
this.mName = aName;
diff --git a/src/main/java/gregtech/api/interfaces/IHeatingCoil.java b/src/main/java/gregtech/api/interfaces/IHeatingCoil.java
index c8ceccf941..f30145165b 100644
--- a/src/main/java/gregtech/api/interfaces/IHeatingCoil.java
+++ b/src/main/java/gregtech/api/interfaces/IHeatingCoil.java
@@ -1,18 +1,18 @@
package gregtech.api.interfaces;
import gregtech.api.enums.HeatingCoilLevel;
-import net.minecraft.item.ItemStack;
-
import java.util.function.Consumer;
+import net.minecraft.item.ItemStack;
public interface IHeatingCoil {
HeatingCoilLevel getCoilHeat(int meta);
+
default HeatingCoilLevel getCoilHeat(ItemStack stack) {
return getCoilHeat(stack.getItemDamage());
}
void setOnCoilCheck(Consumer callback);
+
Consumer getOnCoilCheck();
}
-
diff --git a/src/main/java/gregtech/api/interfaces/IIconContainer.java b/src/main/java/gregtech/api/interfaces/IIconContainer.java
index 4682955603..8090ce7cb9 100644
--- a/src/main/java/gregtech/api/interfaces/IIconContainer.java
+++ b/src/main/java/gregtech/api/interfaces/IIconContainer.java
@@ -1,12 +1,12 @@
package gregtech.api.interfaces;
+import static gregtech.api.enums.GT_Values.UNCOLORED_RBGA;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
-import static gregtech.api.enums.GT_Values.UNCOLORED_RBGA;
-
public interface IIconContainer {
/**
* @return A regular Icon.
@@ -26,7 +26,8 @@ public interface IIconContainer {
@SideOnly(Side.CLIENT)
default int getIconPasses() {
return 1;
- };
+ }
+ ;
/**
* @return the Default Texture File for this Icon.
@@ -35,13 +36,12 @@ public interface IIconContainer {
ResourceLocation getTextureFile();
@SideOnly(Side.CLIENT)
- default public short[] getIconColor(int aRenderPass) {
+ public default short[] getIconColor(int aRenderPass) {
return UNCOLORED_RBGA;
}
@SideOnly(Side.CLIENT)
- default public boolean isUsingColorModulation(int aRenderPass) {
+ public default boolean isUsingColorModulation(int aRenderPass) {
return aRenderPass == 0;
}
-
}
diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java
index 85916ae0d7..9a513c2af5 100644
--- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java
+++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java
@@ -2,6 +2,7 @@ package gregtech.api.interfaces;
import gregtech.api.enums.SubTag;
import gregtech.api.items.GT_MetaBase_Item;
+import java.util.List;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -11,14 +12,34 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import java.util.List;
-
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);
-
- boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
+ boolean onItemUse(
+ E aItem,
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int aSide,
+ 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);
ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
@@ -34,7 +55,9 @@ 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);
+ EntityArrow getProjectile(
+ E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ);
- EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
+ EntityArrow getProjectile(
+ E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
}
diff --git a/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java b/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java
index 2e102e937c..de251017a1 100644
--- a/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java
+++ b/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java
@@ -11,13 +11,13 @@ import net.minecraft.nbt.NBTTagCompound;
* Usual NBT tag size limit applies.
*/
public interface INetworkUpdatableItem {
- /**
- * Receive update from client. Runs on server thread.
- * @param stack Stack being updated
- * @param player player holding the stack
- * @param tag received data
- * @return true if this stack should be kept inside the player inventory.
- * false if this stack should vanish (i.e. slot content set to null)
- */
- boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag);
+ /**
+ * Receive update from client. Runs on server thread.
+ * @param stack Stack being updated
+ * @param player player holding the stack
+ * @param tag received data
+ * @return true if this stack should be kept inside the player inventory.
+ * false if this stack should vanish (i.e. slot content set to null)
+ */
+ boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag);
}
diff --git a/src/main/java/gregtech/api/interfaces/IProjectileItem.java b/src/main/java/gregtech/api/interfaces/IProjectileItem.java
index 913339ef05..9441e2991b 100644
--- a/src/main/java/gregtech/api/interfaces/IProjectileItem.java
+++ b/src/main/java/gregtech/api/interfaces/IProjectileItem.java
@@ -20,5 +20,6 @@ public interface IProjectileItem {
/**
* @return an Arrow Entity to be spawned. If null then this is not an Arrow. Note: Other Projectiles still extend EntityArrow
*/
- EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
+ EntityArrow getProjectile(
+ SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
}
diff --git a/src/main/java/gregtech/api/interfaces/ITexture.java b/src/main/java/gregtech/api/interfaces/ITexture.java
index b05f31d14f..e2445a8204 100644
--- a/src/main/java/gregtech/api/interfaces/ITexture.java
+++ b/src/main/java/gregtech/api/interfaces/ITexture.java
@@ -18,7 +18,7 @@ public interface ITexture {
void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
boolean isValidTexture();
-
+
/**
* @return {@code true} if this texture is from the old package
*/
diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java
index a96e12c1ce..b2e170445c 100644
--- a/src/main/java/gregtech/api/interfaces/IToolStats.java
+++ b/src/main/java/gregtech/api/interfaces/IToolStats.java
@@ -1,6 +1,7 @@
package gregtech.api.interfaces;
import gregtech.api.items.GT_MetaGenerated_Tool;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -11,8 +12,6 @@ import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
-import java.util.List;
-
/**
* The Stats for GT Tools. Not including any Material Modifiers.
*
@@ -138,7 +137,18 @@ 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 convertBlockDrops(
+ List aDrops,
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ byte aMetaData,
+ int aFortune,
+ boolean aSilkTouch,
+ BlockEvent.HarvestDropsEvent aEvent);
/**
* @return Returns a broken Version of the Item.
@@ -159,5 +169,6 @@ 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);
+ float getMiningSpeed(
+ Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, int aY, int aZ);
}
diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java b/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java
index 22947b746d..19e7a56aad 100644
--- a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java
+++ b/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java
@@ -30,7 +30,7 @@ public interface IGT_Mod {
*/
EntityPlayer getThePlayer();
- //---------- Internal Usage Only ----------
+ // ---------- Internal Usage Only ----------
/**
* works only ClientSide otherwise returns 0
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 add54205ee..d29dc96316 100644
--- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
+++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
@@ -10,7 +10,13 @@ public interface IGT_RecipeAdder {
* Does not work anymore!
*/
@Deprecated
- boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion);
+ boolean addFusionReactorRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aOutput1,
+ int aFusionDurationInTicks,
+ int aFusionEnergyPerTick,
+ int aEnergyNeededForStartingFusion);
/**
* Adds a FusionreactorRecipe
@@ -23,9 +29,14 @@ public interface IGT_RecipeAdder {
* @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
-
@Deprecated
- boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion);
+ boolean addFusionReactorRecipe(
+ FluidStack aInput1,
+ FluidStack aInput2,
+ FluidStack aOutput1,
+ int aFusionDurationInTicks,
+ int aFusionEnergyPerTick,
+ int aEnergyNeededForStartingFusion);
/**
* Adds a Fusion Reactor Recipe
@@ -37,7 +48,12 @@ public interface IGT_RecipeAdder {
* @param aEnergyNeededForStartingFusion : EU needed to initialize the fusion reaction. (must be >= 0).
* @return true if the recipe got added, otherwise false.
*/
- boolean addFusionReactorRecipe(FluidStack[] FluidInputArray, FluidStack[] FluidOutputArray, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion);
+ boolean addFusionReactorRecipe(
+ FluidStack[] FluidInputArray,
+ FluidStack[] FluidOutputArray,
+ int aFusionDurationInTicks,
+ int aFusionEnergyPerTick,
+ int aEnergyNeededForStartingFusion);
/**
* Adds a Centrifuge Recipe
@@ -49,9 +65,28 @@ public interface IGT_RecipeAdder {
* @param aOutput4 can be null
* @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);
-
- boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt);
+ boolean addCentrifugeRecipe(
+ ItemStack aInput1,
+ int aInput2,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ 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);
/**
* Adds a Centrifuge Recipe
@@ -63,9 +98,36 @@ public interface IGT_RecipeAdder {
* @param aOutput4 can be null
* @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);
-
- 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);
+ 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 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);
/**
* @param aInput1 must be != null
@@ -86,7 +148,17 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @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);
+ boolean addElectrolyzerRecipe(
+ ItemStack aInput1,
+ int aInput2,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ ItemStack aOutput4,
+ ItemStack aOutput5,
+ ItemStack aOutput6,
+ int aDuration,
+ int aEUt);
/**
* Adds a Electrolyzer Recipe
@@ -99,7 +171,20 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @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);
+ 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);
/**
* Adds a Chemical Recipe
@@ -121,7 +206,13 @@ public interface IGT_RecipeAdder {
* @param aOutput must be != null
* @param aDuration must be > 0
*/
- boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration);
+ boolean addChemicalRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput,
+ int aDuration);
/**
* Adds a Chemical Recipe
@@ -133,8 +224,15 @@ public interface IGT_RecipeAdder {
* @param aOutput2 must be != null
* @param aDuration must be > 0
*/
- boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick);
-
+ boolean addChemicalRecipeForBasicMachineOnly(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUtick);
/**
* Adds a Chemical Recipe
@@ -145,7 +243,14 @@ public interface IGT_RecipeAdder {
* @param aOutput2 must be != null
* @param aDuration must be > 0
*/
- boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration);
+ boolean addChemicalRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput,
+ ItemStack aOutput2,
+ int aDuration);
/**
* Adds Recipes for creating a radically polymerized polymer from a base Material (for example Ethylene -> Polyethylene)
@@ -165,9 +270,25 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @param aEUtick must be > 0
*/
- boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, 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);
+ boolean addChemicalRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ 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);
/**
* Adds a Chemical Recipe
@@ -179,7 +300,15 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @param aEUtick must be > 0
*/
- boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick);
+ boolean addChemicalRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ ItemStack aOutput,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUtick);
/**
* Adds a Chemical Recipe that only exists in the Large Chemical Reactor
@@ -194,9 +323,13 @@ public interface IGT_RecipeAdder {
*
aOutputs and aFluidOutputs must contain at least one valid output.
*
*/
-
- boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick);
-
+ boolean addMultiblockChemicalRecipe(
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ FluidStack[] aFluidOutputs,
+ ItemStack[] aOutputs,
+ int aDuration,
+ int aEUtick);
/**
* Adds a Blast Furnace Recipe
@@ -210,7 +343,14 @@ public interface IGT_RecipeAdder {
* @param aLevel should be > 0 is the minimum Heat Level needed for this Recipe
*/
@Deprecated
- boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel);
+ boolean addBlastRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUt,
+ int aLevel);
/**
* Adds a Blast Furnace Recipe
@@ -223,9 +363,31 @@ public interface IGT_RecipeAdder {
* @param aEUt should be > 0
* @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);
-
- 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);
+ boolean addBlastRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ 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);
/**
* Adds a Plasma Forge Recipe
@@ -238,10 +400,22 @@ public interface IGT_RecipeAdder {
* @param aEUt Should be > 0. EU/t.
* @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);
-
- boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration);
+ boolean addPlasmaForgeRecipe(
+ ItemStack[] ItemInputArray,
+ FluidStack[] FluidInputArray,
+ ItemStack[] OutputItemArray,
+ FluidStack[] FluidOutputArray,
+ int aDuration,
+ int aEUt,
+ int coil_heat_level);
+ boolean addPrimitiveBlastRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ int aCoalAmount,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ int aDuration);
/**
* Adds a Canning Machine Recipe
@@ -251,7 +425,8 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0, 100 ticks is standard.
* @param aEUt should be > 0, 1 EU/t is standard.
*/
- boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt);
+ boolean addCannerRecipe(
+ ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt);
/**
* Adds an Alloy Smelter Recipe
@@ -264,8 +439,8 @@ 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 addAlloySmelterRecipe(
+ ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden);
/**
* Adds a CNC-Machine Recipe
@@ -297,7 +472,8 @@ public interface IGT_RecipeAdder {
* @param aEUt should be > 0
*
*/
- boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
+ boolean addAssemblerRecipe(
+ ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
/**
* Adds an Assembler Recipe
@@ -307,16 +483,43 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
- boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
-
- boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
-
- boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
-
- boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom);
-
- boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom);
-
+ boolean addAssemblerRecipe(
+ ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt);
+
+ boolean addAssemblerRecipe(
+ ItemStack aInput1,
+ Object aOreDict,
+ int aAmount,
+ FluidStack aFluidInput,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt);
+
+ boolean addAssemblerRecipe(
+ ItemStack[] aInputs,
+ Object aOreDict,
+ int aAmount,
+ FluidStack aFluidInput,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt);
+
+ boolean addAssemblerRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ FluidStack aFluidInput,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
+
+ boolean addAssemblerRecipe(
+ ItemStack[] aInputs,
+ FluidStack aFluidInput,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
/**
* Adds an Circuit Assembler Recipe
@@ -327,9 +530,16 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
- boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt);
+ boolean addCircuitAssemblerRecipe(
+ ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt);
- boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom);
+ boolean addCircuitAssemblerRecipe(
+ ItemStack[] aInputs,
+ FluidStack aFluidInput,
+ ItemStack aOutput,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
/**
* Adds an Assemblyline Recipe
@@ -340,7 +550,14 @@ public interface IGT_RecipeAdder {
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
- boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt);
+ boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ ItemStack[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt);
/**
* Adds a Assemblyline Recipe
@@ -349,7 +566,14 @@ public interface IGT_RecipeAdder {
* ItemStack[] for multiple equivalent items;
* {OreDict, amount} for oredict.
*/
- boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt);
+ boolean addAssemblylineRecipe(
+ ItemStack aResearchItem,
+ int aResearchTime,
+ Object[] aInputs,
+ FluidStack[] aFluidInputs,
+ ItemStack aOutput1,
+ int aDuration,
+ int aEUt);
/**
* Adds a Forge Hammer Recipe
@@ -423,9 +647,24 @@ public interface IGT_RecipeAdder {
* @param aEUt should be > 0
* @return
*/
- boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt);
-
- boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int[] aChances, int aDuration, int aEUt);
+ boolean addOreWasherRecipe(
+ ItemStack aInput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ FluidStack aFluidInput,
+ int aDuration,
+ int aEUt);
+
+ boolean addOreWasherRecipe(
+ ItemStack aInput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ FluidStack aFluidInput,
+ int[] aChances,
+ int aDuration,
+ int aEUt);
/**
* Adds an Implosion Compressor Recipe
@@ -447,7 +686,13 @@ public interface IGT_RecipeAdder {
* @param aOutput3 can be null
* @param aOutput4 can be null
*/
- boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4);
+ boolean addGrinderRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ ItemStack aOutput4);
/**
* Adds a Distillation Tower Recipe
@@ -456,20 +701,44 @@ public interface IGT_RecipeAdder {
* @param aOutputs must be != null 1-5 Fluids
* @param aOutput2 can be null
*/
- boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt);
- boolean addDistillationTowerRecipe(FluidStack aInput, ItemStack[] aCircuit, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt);
+ boolean addDistillationTowerRecipe(
+ FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt);
- boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt);
+ boolean addDistillationTowerRecipe(
+ FluidStack aInput,
+ ItemStack[] aCircuit,
+ FluidStack[] aOutputs,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUt);
- boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt);
+ boolean addSimpleArcFurnaceRecipe(
+ ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt);
- boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidPutput, int[] aChances, int aDuration, int aEUt);
+ boolean addPlasmaArcFurnaceRecipe(
+ ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt);
+ boolean addPlasmaArcFurnaceRecipe(
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ ItemStack[] aOutputs,
+ 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);
+ boolean addDistillationRecipe(
+ ItemStack aInput1,
+ int aInput2,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ ItemStack aOutput4,
+ int aDuration,
+ int aEUt);
/**
* Adds a Lathe Machine Recipe
@@ -479,18 +748,28 @@ public interface IGT_RecipeAdder {
/**
* Adds a Cutter Recipe
*/
- boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt);
+ boolean addCutterRecipe(
+ ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt);
/**
* Adds Cutter Recipes with default Lubricants
*/
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 addCutterRecipe(
+ ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom);
- boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt);
+ boolean addCutterRecipe(
+ ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt);
- boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom);
+ boolean addCutterRecipe(
+ ItemStack aInput,
+ ItemStack aCircuit,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial);
@@ -508,14 +787,23 @@ public interface IGT_RecipeAdder {
* @param aEUt should be > 0
* @return
*/
- boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt);
+ boolean addThermalCentrifugeRecipe(
+ ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt);
- boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt);
+ boolean addThermalCentrifugeRecipe(
+ ItemStack aInput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ int[] aChances,
+ int aDuration,
+ int aEUt);
/**
* Adds an Unboxing Recipe
*/
- boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt);
+ boolean addUnboxingRecipe(
+ ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt);
/**
* Adds a Vacuum Freezer Recipe
@@ -530,7 +818,13 @@ 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);
+ boolean addVacuumFreezerRecipe(
+ ItemStack[] aItemInput,
+ FluidStack[] aFluidInput,
+ ItemStack[] aItemOutput,
+ FluidStack[] aFluidOutput,
+ int aDuration,
+ int aEUt);
/**
* Adds a Fuel for My Generators
@@ -552,9 +846,11 @@ 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 addBrewingRecipe(
+ ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden);
- boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden);
+ boolean addBrewingRecipeCustom(
+ ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden);
/**
* Adds a Recipe for the Fermenter
@@ -571,14 +867,29 @@ 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);
- boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden);
+ boolean addDistilleryRecipe(
+ ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden);
- boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden);
+ boolean addDistilleryRecipe(
+ int circuitConfig,
+ FluidStack aInput,
+ FluidStack aOutput,
+ ItemStack aSolidOutput,
+ int aDuration,
+ int aEUt,
+ boolean aHidden);
- boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden);
-
- boolean addDistilleryRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden);
+ boolean addDistilleryRecipe(
+ int aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden);
/**
* Adds a Recipe for the Fluid Solidifier
@@ -588,36 +899,75 @@ public interface IGT_RecipeAdder {
/**
* Adds a Recipe for Fluid Smelting
*/
- boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+ boolean addFluidSmelterRecipe(
+ ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt);
/**
* Adds a Recipe for Fluid Smelting
*/
- boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden);
+ boolean addFluidSmelterRecipe(
+ ItemStack aInput,
+ ItemStack aRemains,
+ FluidStack aOutput,
+ int aChance,
+ int aDuration,
+ int aEUt,
+ boolean hidden);
/**
* Adds a Recipe for Fluid Extraction
*/
- boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+ boolean addFluidExtractionRecipe(
+ ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt);
/**
* Adds a Recipe for the Fluid Canner
*/
boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput);
- boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+ boolean addFluidCannerRecipe(
+ ItemStack aInput,
+ ItemStack aOutput,
+ FluidStack aFluidInput,
+ FluidStack aFluidOutput,
+ 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);
-
- boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt);
+ boolean addChemicalBathRecipe(
+ ItemStack aInput,
+ FluidStack aBathingFluid,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ 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);
/**
* Adds a Recipe for the Electromagnetic Separator
*/
- boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt);
+ boolean addElectromagneticSeparatorRecipe(
+ ItemStack aInput,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ int[] aChances,
+ int aDuration,
+ int aEUt);
/**
* Adds a Recipe for the Extractor
@@ -627,55 +977,168 @@ public interface IGT_RecipeAdder {
/**
* Adds a Recipe for the Printer
*/
- boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt);
+ boolean addPrinterRecipe(
+ ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt);
/**
* Adds a Recipe for the Autoclave
*/
- boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt);
-
- boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom);
-
- boolean addAutoclaveRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, int aChance, 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);
-
- boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom);
-
- boolean addAutoclaveSpaceRecipe(ItemStack aInput, ItemStack aCircuit, FluidStack aFluid, ItemStack aOutput, 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);
+ boolean addAutoclaveRecipe(
+ ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt);
+
+ boolean addAutoclaveRecipe(
+ ItemStack aInput,
+ FluidStack aFluid,
+ ItemStack aOutput,
+ int aChance,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
+
+ boolean addAutoclaveRecipe(
+ ItemStack aInput,
+ ItemStack aCircuit,
+ FluidStack aFluid,
+ ItemStack aOutput,
+ int aChance,
+ 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);
+
+ boolean addAutoclaveSpaceRecipe(
+ ItemStack aInput,
+ FluidStack aFluid,
+ ItemStack aOutput,
+ int aChance,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
+
+ boolean addAutoclaveSpaceRecipe(
+ ItemStack aInput,
+ ItemStack aCircuit,
+ FluidStack aFluid,
+ ItemStack aOutput,
+ 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);
/**
* 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);
+ boolean addMixerRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aInput3,
+ ItemStack aInput4,
+ 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);
+ boolean addMixerRecipe(
+ ItemStack aInput1,
+ ItemStack aInput2,
+ ItemStack aInput3,
+ ItemStack aInput4,
+ 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);
+ 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);
@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);
+ 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);
// Use me only from now on!
- boolean addMixerRecipe(ItemStack[] ItemInputArray, FluidStack[] FluidInputArray, ItemStack[] ItemOutputArray, FluidStack[] FluidOutputArray, int aDuration, int aEUt);
+ boolean addMixerRecipe(
+ ItemStack[] ItemInputArray,
+ FluidStack[] FluidInputArray,
+ ItemStack[] ItemOutputArray,
+ 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);
+ boolean addLaserEngraverRecipe(
+ ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt);
/**
* Adds a Recipe for the Laser Engraver.
*/
@Deprecated
- boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom);
+ boolean addLaserEngraverRecipe(
+ ItemStack aItemToEngrave,
+ ItemStack aLens,
+ ItemStack aEngravedItem,
+ int aDuration,
+ int aEUt,
+ boolean aCleanroom);
/**
* Adds a Generalised Laser Engraver Recipe.
@@ -688,12 +1151,20 @@ public interface IGT_RecipeAdder {
* @param aEUt Should be > 0. EU/t.
* @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);
+ boolean addLaserEngraverRecipe(
+ ItemStack[] ItemInputArray,
+ FluidStack[] FluidInputArray,
+ 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);
+ boolean addFormingPressRecipe(
+ ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt);
/**
* Adds a Recipe for the Sifter. (up to 9 Outputs)
@@ -708,8 +1179,8 @@ 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 addArcFurnaceRecipe(
+ ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden);
/**
* Adds a Recipe for the GT Pulveriser. (up to 4 Outputs)
@@ -719,7 +1190,8 @@ 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 addPulveriserRecipe(
+ ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden);
/**
* Adds a Distillation Tower Recipe
@@ -729,9 +1201,16 @@ public interface IGT_RecipeAdder {
* @param aOutputs must be != null 1-5 Fluids
* @param aOutput2 can be null
*/
- boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt);
+ boolean addUniversalDistillationRecipe(
+ FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt);
- boolean addUniversalDistillationRecipewithCircuit(FluidStack aInput, ItemStack[] aCircuit, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt);
+ boolean addUniversalDistillationRecipewithCircuit(
+ FluidStack aInput,
+ ItemStack[] aCircuit,
+ FluidStack[] aOutputs,
+ ItemStack aOutput2,
+ int aDuration,
+ int aEUt);
/**
* Adds Pyrolyse Recipe
@@ -743,7 +1222,14 @@ public interface IGT_RecipeAdder {
* @param aDuration
* @param aEUt
*/
- boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt);
+ boolean addPyrolyseRecipe(
+ ItemStack aInput,
+ FluidStack aFluidInput,
+ int intCircuit,
+ ItemStack aOutput,
+ FluidStack aFluidOutput,
+ int aDuration,
+ int aEUt);
/**
* Adds Oil Cracking Recipe
@@ -753,7 +1239,6 @@ public interface IGT_RecipeAdder {
* @param aDuration
* @param aEUt
*/
-
@Deprecated
boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt);
@@ -767,8 +1252,8 @@ public interface IGT_RecipeAdder {
* @param aDuration
* @param aEUt
*/
-
- boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt);
+ boolean addCrackingRecipe(
+ int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt);
/**
* Adds a Sound to the Sonictron9001
@@ -780,5 +1265,14 @@ 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);
+ boolean addChemicalBathRecipe(
+ ItemStack aInput,
+ FluidStack aBathingFluid,
+ ItemStack aOutput1,
+ ItemStack aOutput2,
+ ItemStack aOutput3,
+ FluidStack aFluidOutput,
+ int[] aChances,
+ int aDuration,
+ int aEUt);
}
diff --git a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java
index 34de41f381..330b9326c2 100644
--- a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java
+++ b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java
@@ -2,14 +2,12 @@ package gregtech.api.interfaces.internal;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
-import java.util.List;
-
public interface IThaumcraftCompat {
- int
- RESEARCH_TYPE_NORMAL = 0,
+ int RESEARCH_TYPE_NORMAL = 0,
RESEARCH_TYPE_SECONDARY = 1,
RESEARCH_TYPE_FREE = 2,
RESEARCH_TYPE_HIDDEN = 4,
@@ -21,8 +19,7 @@ public interface IThaumcraftCompat {
/**
* The Research Keys of GT
*/
- String
- IRON_TO_STEEL = "GT_IRON_TO_STEEL",
+ 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",
@@ -50,7 +47,26 @@ 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);
+ Object addInfusionRecipe(
+ String aResearch,
+ ItemStack aMainInput,
+ ItemStack[] aSideInputs,
+ ItemStack aOutput,
+ int aInstability,
+ List aAspects);
- 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);
+ 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);
}
diff --git a/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java b/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java
index b62740f610..821aa35f50 100644
--- a/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java
+++ b/src/main/java/gregtech/api/interfaces/internal/IUETileEntity.java
@@ -1,6 +1,5 @@
package gregtech.api.interfaces.internal;
-
public interface IUETileEntity /*extends IElectrical*/ {
//
}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java b/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java
index 7d6923e93f..59a70b450d 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java
@@ -1,11 +1,9 @@
package gregtech.api.interfaces.metatileentity;
+import gregtech.api.GregTech_API;
import java.util.List;
-
import net.minecraft.item.ItemStack;
-import gregtech.api.GregTech_API;
-
/**
* Implement this interface if your metatileentity supports configuration circuits
* to resolve recipe conflicts.
@@ -23,7 +21,7 @@ public interface IConfigurationCircuitSupport {
* This list is unmodifiable. Its elements are not supposed to be modified in any way!
*/
default List getConfigurationCircuits() {
- return GregTech_API.getConfigurationCircuitList(100);
+ return GregTech_API.getConfigurationCircuitList(100);
}
/**
@@ -41,5 +39,6 @@ public interface IConfigurationCircuitSupport {
}
int getCircuitSlotX();
+
int getCircuitSlotY();
}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
index cffcb4c4ab..84c991ade9 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
@@ -4,17 +4,17 @@ package gregtech.api.interfaces.metatileentity;
* For pipes, wires, and other MetaTiles which need to be decided whether they should connect to the block at each side.
*/
public interface IConnectable {
- int NO_CONNECTION = 0b00000000;
- int CONNECTED_DOWN = 0b00000001;
- int CONNECTED_UP = 0b00000010;
- int CONNECTED_NORTH = 0b00000100;
- int CONNECTED_SOUTH = 0b00001000;
- int CONNECTED_WEST = 0b00010000;
- int CONNECTED_EAST = 0b00100000;
- int CONNECTED_ALL = 0b00111111;
- int HAS_FRESHFOAM = 0b01000000;
+ int NO_CONNECTION = 0b00000000;
+ int CONNECTED_DOWN = 0b00000001;
+ int CONNECTED_UP = 0b00000010;
+ int CONNECTED_NORTH = 0b00000100;
+ int CONNECTED_SOUTH = 0b00001000;
+ int CONNECTED_WEST = 0b00010000;
+ int CONNECTED_EAST = 0b00100000;
+ int CONNECTED_ALL = 0b00111111;
+ int HAS_FRESHFOAM = 0b01000000;
int HAS_HARDENEDFOAM = 0b10000000;
- int HAS_FOAM = 0b11000000;
+ int HAS_FOAM = 0b11000000;
/**
* Try to connect to the Block at the specified side
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java
index e9ca4125a2..a1c00ebc97 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMachineCallback.java
@@ -2,6 +2,8 @@ package gregtech.api.interfaces.metatileentity;
public interface IMachineCallback {
Machinetype getCallbackBase();
+
void setCallbackBase(Machinetype callback);
+
Class> getType();
}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java
index 65848fe96f..c9d23e1f71 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java
@@ -9,6 +9,9 @@ import gregtech.api.interfaces.tileentity.IGregtechWailaProvider;
import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.GT_Config;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -24,16 +27,18 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fluids.IFluidTank;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Warning, this Interface has just been made to be able to add multiple kinds of MetaTileEntities (Cables, Pipes, Transformers, but not the regular Blocks)
*
* Don't implement this yourself and expect it to work. Extend @MetaTileEntity itself.
*/
-public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHandler, IGearEnergyTileEntity, IMachineBlockUpdateable, IGregtechWailaProvider {
+public interface IMetaTileEntity
+ extends ISidedInventory,
+ IFluidTank,
+ IFluidHandler,
+ IGearEnergyTileEntity,
+ IMachineBlockUpdateable,
+ IGregtechWailaProvider {
/**
* This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself.
*
@@ -143,7 +148,8 @@ 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);
+ boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ);
/**
* Called right before this Machine explodes
@@ -241,7 +247,8 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand
*
* @return
*/
- boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ);
+ boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ);
/**
* a Player leftclicks the Machine
@@ -317,7 +324,8 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand
/**
* returns the DebugLog
*/
- ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList);
+ ArrayList getSpecialDebugInfo(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList);
/**
* get a small Description
@@ -338,12 +346,18 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand
* @param aActive if the Machine is currently active (use this instead of calling mBaseMetaTileEntity.mActive!!!). Note: In case of Pipes this means if this Side is connected to something or not.
* @param aRedstone if the Machine is currently outputting a RedstoneSignal (use this instead of calling mBaseMetaTileEntity.mRedstone!!!)
*/
- ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone);
+ ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone);
/**
* The Textures used for the Item rendering. Return null if you want the regular 3D Block Rendering.
*/
- //public ITexture[] getItemTexture(ItemStack aStack);
+ // public ITexture[] getItemTexture(ItemStack aStack);
/**
* Register Icons here. This gets called when the Icons get initialized by the Base Block
@@ -389,7 +403,14 @@ 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);
+ void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider);
AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ);
@@ -420,7 +441,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand
* just return in should recurse since we are already in meta tile...
*/
@Override
- default boolean isMachineBlockUpdateRecursive(){
+ default boolean isMachineBlockUpdateRecursive() {
return true;
}
@@ -433,5 +454,4 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand
default void onRandomDisplayTick(IGregTechTileEntity aBaseMetaTileEntity) {
/* do nothing */
}
-
}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java
index 85237ac4f4..6b83ab4dba 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java
@@ -1,13 +1,13 @@
package gregtech.api.interfaces.metatileentity;
-import net.minecraft.tileentity.TileEntity;
-
import java.util.ArrayList;
import java.util.HashSet;
+import net.minecraft.tileentity.TileEntity;
public interface IMetaTileEntityCable extends IMetaTileEntity {
@Deprecated
- long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList);
+ long transferElectricity(
+ byte aSide, long aVoltage, long aAmperage, 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 90933b501f..1b1ce36871 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java
@@ -3,7 +3,6 @@ package gregtech.api.interfaces.metatileentity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.util.GT_Utility;
-
import java.util.Map;
public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
@@ -48,18 +47,30 @@ 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) {
+ public static Map scanPipes(
+ IMetaTileEntityItemPipe aMetaTileEntity,
+ Map aMap,
+ long aStep,
+ boolean aSuckItems,
+ boolean aIgnoreCapacity) {
aStep += aMetaTileEntity.getStepSize();
if (aIgnoreCapacity || aMetaTileEntity.pipeCapacityCheck())
if (aMap.get(aMetaTileEntity) == null || aMap.get(aMetaTileEntity) > aStep) {
IGregTechTileEntity aBaseMetaTileEntity = aMetaTileEntity.getBaseMetaTileEntity();
aMap.put(aMetaTileEntity, aStep);
for (byte i = 0, j = 0; i < 6; i++) {
- if (aMetaTileEntity instanceof IConnectable && !((IConnectable) aMetaTileEntity).isConnectedAtSide(i))
- continue;
+ if (aMetaTileEntity instanceof IConnectable
+ && !((IConnectable) aMetaTileEntity).isConnectedAtSide(i)) continue;
j = GT_Utility.getOppositeSide(i);
if (aSuckItems) {
- if (aBaseMetaTileEntity.getCoverBehaviorAtSideNew(i).letsItemsIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getComplexCoverDataAtSide(i), -2, aBaseMetaTileEntity)) {
+ if (aBaseMetaTileEntity
+ .getCoverBehaviorAtSideNew(i)
+ .letsItemsIn(
+ i,
+ aBaseMetaTileEntity.getCoverIDAtSide(i),
+ aBaseMetaTileEntity.getComplexCoverDataAtSide(i),
+ -2,
+ aBaseMetaTileEntity)) {
IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i);
if (aBaseMetaTileEntity.getColorization() >= 0) {
byte tColor = tItemPipe.getColorization();
@@ -69,13 +80,33 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
}
if (tItemPipe instanceof BaseMetaPipeEntity) {
IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity();
- if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSideNew(j).letsItemsOut(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getComplexCoverDataAtSide(j), -2, tItemPipe)) {
- scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
+ if (tMetaTileEntity instanceof IMetaTileEntityItemPipe
+ && tItemPipe
+ .getCoverBehaviorAtSideNew(j)
+ .letsItemsOut(
+ j,
+ tItemPipe.getCoverIDAtSide(j),
+ tItemPipe.getComplexCoverDataAtSide(j),
+ -2,
+ tItemPipe)) {
+ scanPipes(
+ (IMetaTileEntityItemPipe) tMetaTileEntity,
+ aMap,
+ aStep,
+ aSuckItems,
+ aIgnoreCapacity);
}
}
}
} else {
- if (aBaseMetaTileEntity.getCoverBehaviorAtSideNew(i).letsItemsOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getComplexCoverDataAtSide(i), -2, aBaseMetaTileEntity)) {
+ if (aBaseMetaTileEntity
+ .getCoverBehaviorAtSideNew(i)
+ .letsItemsOut(
+ i,
+ aBaseMetaTileEntity.getCoverIDAtSide(i),
+ aBaseMetaTileEntity.getComplexCoverDataAtSide(i),
+ -2,
+ aBaseMetaTileEntity)) {
IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i);
if (tItemPipe != null) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
@@ -86,8 +117,21 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
}
if (tItemPipe instanceof BaseMetaPipeEntity) {
IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity();
- if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSideNew(j).letsItemsIn(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getComplexCoverDataAtSide(j), -2, tItemPipe)) {
- scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
+ if (tMetaTileEntity instanceof IMetaTileEntityItemPipe
+ && tItemPipe
+ .getCoverBehaviorAtSideNew(j)
+ .letsItemsIn(
+ j,
+ tItemPipe.getCoverIDAtSide(j),
+ tItemPipe.getComplexCoverDataAtSide(j),
+ -2,
+ tItemPipe)) {
+ scanPipes(
+ (IMetaTileEntityItemPipe) tMetaTileEntity,
+ aMap,
+ aStep,
+ aSuckItems,
+ aIgnoreCapacity);
}
}
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java b/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java
index ca3db3354e..7b0bc9c690 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java
@@ -80,12 +80,16 @@ public interface IBasicEnergyContainer extends IEnergyConnected {
/**
* returns the amount of Steam contained in this Block, in EU units!
*/
- default long getStoredSteam() { return 0; }
+ default long getStoredSteam() {
+ return 0;
+ }
/**
* returns the amount of Steam containable in this Block, in EU units!
*/
- default long getSteamCapacity() { return 0; }
+ default long getSteamCapacity() {
+ return 0;
+ }
/**
* Increases stored Energy. Energy Base Value is in EU, even though it's Steam!
@@ -96,5 +100,7 @@ public interface IBasicEnergyContainer extends IEnergyConnected {
*
* And yes, you can't directly decrease the Steam of a Machine. That is done by decreaseStoredEnergyUnits
*/
- default boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) { return false; }
+ default boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java
index e496479bed..6beb34a305 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java
@@ -22,8 +22,11 @@ public interface ICoverable extends IRedstoneTileEntity, IHasInventory, IBasicEn
}
void setCoverIdAndDataAtSide(byte aSide, int aId, ISerializableObject aData);
+
void setCoverIDAtSide(byte aSide, int aID);
+
boolean setCoverIDAtSideNoUpdate(byte aSide, int aID);
+
void setCoverItemAtSide(byte aSide, ItemStack aCover);
@Deprecated
@@ -71,7 +74,8 @@ public interface ICoverable extends IRedstoneTileEntity, IHasInventory, IBasicEn
* Receiving a packet with cover data.
* @param aPlayer the player who made the change
*/
- default void receiveCoverData(byte aCoverSide, int aCoverID, ISerializableObject aCoverData, EntityPlayerMP aPlayer) {
+ default void receiveCoverData(
+ byte aCoverSide, int aCoverID, ISerializableObject aCoverData, EntityPlayerMP aPlayer) {
if (aCoverData instanceof ISerializableObject.LegacyCoverData)
receiveCoverData(aCoverSide, aCoverID, ((ISerializableObject.LegacyCoverData) aCoverData).get());
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IDebugableTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IDebugableTileEntity.java
index 0063eb57c6..4e3b03d970 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IDebugableTileEntity.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IDebugableTileEntity.java
@@ -1,8 +1,7 @@
package gregtech.api.interfaces.tileentity;
-import net.minecraft.entity.player.EntityPlayer;
-
import java.util.ArrayList;
+import net.minecraft.entity.player.EntityPlayer;
public interface IDebugableTileEntity {
/**
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
index 702f19a89d..c1ecc2b153 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
@@ -63,15 +63,21 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd
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))) {
- while (aAmperage > rUsedAmperes && ((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity).injectEnergy(ForgeDirection.getOrientation(j), aVoltage, aVoltage) < aVoltage)
- rUsedAmperes++;
+ 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) rUsedAmperes++;
}
} else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ final ForgeDirection tDirection =
+ ForgeDirection.getOrientation(i).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 2a8172a775..936de80b3e 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java
@@ -50,12 +50,16 @@ public interface IExperimentalEnergyTileEntity extends IColoredTileEntity, IHasW
Class tClass = cofh.api.energy.IEnergyReceiver.class;
tClass.getCanonicalName();
RF_ENERGY = true;
- } catch (Throwable e) {/**/}
+ } catch (Throwable e) {
+ /**/
+ }
try {
Class tClass = ic2.api.energy.tile.IEnergySink.class;
tClass.getCanonicalName();
IC_ENERGY = true;
- } catch (Throwable e) {/**/}
+ } catch (Throwable e) {
+ /**/
+ }
CHECK_ALL = false;
}
}
@@ -65,7 +69,8 @@ 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) {
+ public static final long emitEnergyToNetwork(
+ SubTag aEnergyType, long aPrimary, long aSecondary, IExperimentalEnergyTileEntity aEmitter) {
long rUsedSecondary = 0;
checkAvailabilities();
for (byte i = 0, j = 0; i < 6 && aSecondary > rUsedSecondary; i++)
@@ -77,14 +82,25 @@ 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);
- } 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++;
+ 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);
+ } 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/IGTEnet.java b/src/main/java/gregtech/api/interfaces/tileentity/IGTEnet.java
index cd4810eba6..77b894fea7 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IGTEnet.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IGTEnet.java
@@ -5,16 +5,15 @@ public interface IGTEnet {
/**
* @return true if this Device consumes Energy at all
*/
- default boolean isEnetInput() {
- return false;
+ default boolean isEnetInput() {
+ return false;
}
-
+
/**
- *
+ *
* @return true if this Device emits Energy at all
*/
- default boolean isEnetOutput() {
+ default boolean isEnetOutput() {
return false;
}
-
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java
index 94b93434e2..253deae29b 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java
@@ -5,6 +5,9 @@ import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.IDescribable;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.common.blocks.GT_Block_Machines;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -13,10 +16,6 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.fluids.IFluidHandler;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
/**
* A simple compound Interface for all my TileEntities.
*
@@ -24,7 +23,18 @@ import java.util.UUID;
*
* It can cause Problems to include this Interface!
*/
-public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTileEntity, ICoverable, IFluidHandler, ITurnable, IGregTechDeviceInformation, IUpgradableMachine, IDigitalChest, IDescribable, IMachineBlockUpdateable, IGregtechWailaProvider {
+public interface IGregTechTileEntity
+ extends ITexturedTileEntity,
+ IGearEnergyTileEntity,
+ ICoverable,
+ IFluidHandler,
+ ITurnable,
+ IGregTechDeviceInformation,
+ IUpgradableMachine,
+ IDigitalChest,
+ IDescribable,
+ IMachineBlockUpdateable,
+ IGregtechWailaProvider {
/**
* gets the Error displayed on the GUI
*/
@@ -133,7 +143,14 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil
*/
int getLightOpacity();
- void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider);
+ void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider);
AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ);
@@ -143,8 +160,8 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil
* Checks validity of meta tile and delegates to it
*/
@Override
- default void onMachineBlockUpdate(){
- if(!isDead() && getMetaTileEntity() != null && getMetaTileEntity().getBaseMetaTileEntity() == this){
+ default void onMachineBlockUpdate() {
+ if (!isDead() && getMetaTileEntity() != null && getMetaTileEntity().getBaseMetaTileEntity() == this) {
getMetaTileEntity().onMachineBlockUpdate();
}
}
@@ -154,12 +171,15 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil
*/
@Override
default boolean isMachineBlockUpdateRecursive() {
- return !isDead() && getMetaTileEntity() != null &&
- getMetaTileEntity().getBaseMetaTileEntity() == this &&
- getMetaTileEntity().isMachineBlockUpdateRecursive();
+ return !isDead()
+ && getMetaTileEntity() != null
+ && getMetaTileEntity().getBaseMetaTileEntity() == this
+ && getMetaTileEntity().isMachineBlockUpdateRecursive();
}
- default void setShutdownStatus(boolean newStatus) {return;}
+ default void setShutdownStatus(boolean newStatus) {
+ return;
+ }
/**
* A randomly called display update to be able to add particles or other items for display
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java
index ee3da0fa6f..a463cc91df 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregtechWailaProvider.java
@@ -1,5 +1,6 @@
package gregtech.api.interfaces.tileentity;
+import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -8,10 +9,16 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import java.util.List;
-
public interface IGregtechWailaProvider {
- default void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {}
+ default void getWailaBody(
+ ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {}
- default void getWailaNBTData(final EntityPlayerMP player, final TileEntity tile, final NBTTagCompound tag, final World world, int x, int y, int z) {}
+ default void getWailaNBTData(
+ final EntityPlayerMP player,
+ final TileEntity tile,
+ final NBTTagCompound tag,
+ final World world,
+ int x,
+ int y,
+ int z) {}
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IIC2Enet.java b/src/main/java/gregtech/api/interfaces/tileentity/IIC2Enet.java
index ee3516dfac..2593f1f3b5 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IIC2Enet.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IIC2Enet.java
@@ -13,5 +13,4 @@ public interface IIC2Enet {
* Update the ic2 enet
*/
void doEnetUpdate();
-
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java
index 31590f3d57..b8ce51a212 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java
@@ -17,7 +17,7 @@ public interface IMachineBlockUpdateable {
/**
* Should recurse?
*/
- default boolean isMachineBlockUpdateRecursive(){
+ default boolean isMachineBlockUpdateRecursive() {
return true;
}
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java
index 0c342b8cfc..54fa90218a 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java
@@ -49,7 +49,9 @@ public interface IMachineProgress extends IHasWorldObjectAndCoords {
* used to control Machines via Redstone Signal Strength by special Covers
* In case of 0 the Machine is very likely doing nothing, or is just not being controlled at all.
*/
- default byte getWorkDataValue() { return 0; }
+ default byte getWorkDataValue() {
+ return 0;
+ }
/**
* used to control Machines via Redstone Signal Strength by special Covers
@@ -73,5 +75,4 @@ public interface IMachineProgress extends IHasWorldObjectAndCoords {
default boolean wasShutdown() {
return false;
}
-
}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java b/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java
index 8c8ce443b0..e05fd44637 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/ITurnable.java
@@ -1,6 +1,5 @@
package gregtech.api.interfaces.tileentity;
-
import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
/**
@@ -38,7 +37,7 @@ public interface ITurnable {
*/
default boolean[] getValidFacings() {
final boolean[] validFacings = new boolean[6];
- for(byte facing : ALL_VALID_SIDES) {
+ for (byte facing : ALL_VALID_SIDES) {
validFacings[facing] = isValidFacing(facing);
}
return validFacings;
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java b/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java
index 0d027f6e30..cc59a4af34 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IUpgradableMachine.java
@@ -1,6 +1,5 @@
package gregtech.api.interfaces.tileentity;
-
/**
* To access my Machines a bit easier
*/
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 2a20ac4972..d37f0479ef 100644
--- a/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java
+++ b/src/main/java/gregtech/api/items/GT_Block_LongDistancePipe.java
@@ -9,6 +9,7 @@ import gregtech.api.interfaces.IIconContainer;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Item_LongDistancePipe;
import gregtech.common.blocks.GT_Material_Machines;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -22,24 +23,26 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import java.util.List;
-
public class GT_Block_LongDistancePipe extends GT_Generic_Block {
public IIconContainer[] mIcons;
+
public GT_Block_LongDistancePipe() {
super(GT_Item_LongDistancePipe.class, "gt.block.longdistancepipe", new GT_Material_Machines());
setStepSound(soundTypeMetal);
setCreativeTab(GregTech_API.TAB_GREGTECH);
GregTech_API.registerMachineBlock(this, -1);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName()+".0.name", "Long Distance Fluid Pipeline Pipe");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName()+".1.name", "Long Distance Item Pipeline Pipe");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Long Distance Fluid Pipeline Pipe");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Long Distance Item Pipeline Pipe");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
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};
+ mIcons = new IIconContainer[] {
+ Textures.BlockIcons.LONG_DISTANCE_PIPE_FLUID, Textures.BlockIcons.LONG_DISTANCE_PIPE_ITEM
+ };
}
+
@Override
public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
super.onBlockAdded(aWorld, aX, aY, aZ);
@@ -47,11 +50,13 @@ public class GT_Block_LongDistancePipe extends GT_Generic_Block {
GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
}
}
+
@Override
public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
super.breakBlock(aWorld, aX, aY, aZ, aBlock, aMetaData);
}
+
@Override
public String getHarvestTool(int aMeta) {
return "wrench";
@@ -72,7 +77,6 @@ public class GT_Block_LongDistancePipe extends GT_Generic_Block {
return Blocks.iron_block.getExplosionResistance(aTNT);
}
-
@Override
public String getUnlocalizedName() {
return this.mUnlocalizedName;
@@ -90,8 +94,7 @@ public class GT_Block_LongDistancePipe extends GT_Generic_Block {
@Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister aIconRegister) {
- }
+ public void registerBlockIcons(IIconRegister aIconRegister) {}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
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 bb65a9a057..c30987183b 100644
--- a/src/main/java/gregtech/api/items/GT_BreederCell_Item.java
+++ b/src/main/java/gregtech/api/items/GT_BreederCell_Item.java
@@ -5,6 +5,8 @@ import gregtech.api.util.GT_Utility;
import ic2.api.reactor.IReactor;
import ic2.api.reactor.IReactorComponent;
import ic2.core.IC2Potion;
+import java.util.List;
+import java.util.function.Supplier;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,9 +14,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-import java.util.List;
-import java.util.function.Supplier;
-
/**
* A {@link ic2.core.item.reactor.ItemReactorLithiumCell}, but can be used to produce anything!
*
@@ -25,7 +24,14 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp
protected final int mHeatBonusMultiplier;
protected ItemStack mProduct;
- public GT_BreederCell_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, int aHeatBonusStep, int aHeatBonusMultiplier, int aRequiredPulse, Supplier aProduct) {
+ public GT_BreederCell_Item(
+ String aUnlocalized,
+ String aEnglish,
+ String aEnglishTooltip,
+ int aHeatBonusStep,
+ int aHeatBonusMultiplier,
+ int aRequiredPulse,
+ Supplier aProduct) {
super(aUnlocalized, aEnglish, aEnglishTooltip);
this.mHeatBonusStep = aHeatBonusStep;
this.mHeatBonusMultiplier = aHeatBonusMultiplier;
@@ -61,9 +67,11 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp
color2 = EnumChatFormatting.WHITE;
break;
}
- aList.add(String.format(transItem("020", "Progress: %s/%s"), "" + color2 + aStack.getItemDamage() + EnumChatFormatting.RESET, "" + getMaxDamage()));
- if (aStack.getItemDamage() > 0)
- aList.add(EnumChatFormatting.RED + transItem("021", "Radiation Hazard"));
+ aList.add(String.format(
+ transItem("020", "Progress: %s/%s"),
+ "" + color2 + aStack.getItemDamage() + EnumChatFormatting.RESET,
+ "" + getMaxDamage()));
+ if (aStack.getItemDamage() > 0) aList.add(EnumChatFormatting.RED + transItem("021", "Radiation Hazard"));
}
@Override
@@ -72,17 +80,22 @@ public class GT_BreederCell_Item extends GT_Generic_Item implements IReactorComp
}
@Override
- public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y, boolean heatrun) {
- }
+ public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y, boolean heatrun) {}
@Override
- public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun) {
+ public boolean acceptUraniumPulse(
+ IReactor reactor,
+ ItemStack yourStack,
+ ItemStack pulsingStack,
+ int youX,
+ int youY,
+ int pulseX,
+ int pulseY,
+ boolean heatrun) {
if (heatrun) {
int myLevel = getNewDamage(reactor, yourStack);
- if (myLevel >= getMaxDamage())
- reactor.setItemAt(youX, youY, mProduct.copy());
- else
- yourStack.setItemDamage(myLevel);
+ if (myLevel >= getMaxDamage()) reactor.setItemAt(youX, youY, mProduct.copy());
+ else yourStack.setItemDamage(myLevel);
}
return true;
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 106897efd7..eb37b50ea6 100644
--- a/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java
+++ b/src/main/java/gregtech/api/items/GT_CoolantCellIC_Item.java
@@ -1,23 +1,27 @@
package gregtech.api.items;
-
import ic2.api.reactor.IReactor;
import ic2.api.reactor.IReactorComponent;
import net.minecraft.item.ItemStack;
-public class GT_CoolantCellIC_Item
- extends GT_CoolantCell_Item
- implements IReactorComponent {
+public class GT_CoolantCellIC_Item extends GT_CoolantCell_Item implements IReactorComponent {
public GT_CoolantCellIC_Item(String aUnlocalized, String aEnglish, int aMaxStore) {
super(aUnlocalized, aEnglish, aMaxStore);
}
@Override
- public void processChamber(IReactor aReactor, ItemStack aStack, int x, int y, boolean aHeatRun) {
- }
+ public void processChamber(IReactor aReactor, ItemStack aStack, int x, int y, boolean aHeatRun) {}
@Override
- public boolean acceptUraniumPulse(IReactor aReactor, ItemStack aStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean aHeatRun) {
+ public boolean acceptUraniumPulse(
+ IReactor aReactor,
+ ItemStack aStack,
+ ItemStack pulsingStack,
+ int youX,
+ int youY,
+ 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 12a075d181..116786532b 100644
--- a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java
+++ b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java
@@ -2,16 +2,14 @@ package gregtech.api.items;
import gregtech.api.GregTech_API;
import ic2.core.util.StackUtil;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-import java.util.List;
-
-public class GT_CoolantCell_Item
- extends GT_Generic_Item {
+public class GT_CoolantCell_Item extends GT_Generic_Item {
protected int heatStorage;
public GT_CoolantCell_Item(String aUnlocalized, String aEnglish, int aMaxStore) {
@@ -51,22 +49,33 @@ public class GT_CoolantCell_Item
@Override
public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- super.addAdditionalToolTips(aList, aStack, aPlayer);
+ super.addAdditionalToolTips(aList, aStack, aPlayer);
int rHeat = getHeatOfStack(aStack) * 10 / this.heatStorage;
EnumChatFormatting color;
switch (rHeat) {
- case 0: color = EnumChatFormatting.BLUE; break;
- case 1:
- case 2: color = EnumChatFormatting.GREEN; break;
- case 3:
- case 4:
- case 5:
- case 6: color = EnumChatFormatting.YELLOW; break;
- case 7:
- case 8: color = EnumChatFormatting.RED; break;
- default: color = EnumChatFormatting.DARK_RED; break;
+ case 0:
+ color = EnumChatFormatting.BLUE;
+ break;
+ case 1:
+ case 2:
+ color = EnumChatFormatting.GREEN;
+ break;
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ color = EnumChatFormatting.YELLOW;
+ break;
+ case 7:
+ case 8:
+ color = EnumChatFormatting.RED;
+ break;
+ default:
+ color = EnumChatFormatting.DARK_RED;
+ break;
}
- aList.add(EnumChatFormatting.WHITE + String.format(transItem("000", "Stored Heat: %s"), "" + color + getHeatOfStack(aStack)));
+ aList.add(EnumChatFormatting.WHITE
+ + String.format(transItem("000", "Stored Heat: %s"), "" + color + getHeatOfStack(aStack)));
switch (getControlTagOfStack(aStack)) {
case 1:
aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line1"));
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 904215b68a..7b4ac6afb8 100644
--- a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java
+++ b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java
@@ -1,11 +1,16 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
@@ -23,19 +28,25 @@ import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingFallEvent;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
-
public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor {
public static Map jumpChargeMap = new ConcurrentHashMap();
public int mCharge, mTransfer, mTier, mDamageEnergyCost, mSpecials;
public boolean mChargeProvider;
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) {
+ 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) {
super(ArmorMaterial.DIAMOND, aArmorIndex, aType);
setMaxStackSize(1);
setMaxDamage(100);
@@ -112,7 +123,8 @@ 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()) {
+ if (GT_ModHandler.canUseElectricItem(aStack, 50000)
+ && aPlayer.getFoodStats().needFood()) {
aPlayer.getFoodStats().addStats(1, 0.0F);
GT_ModHandler.useElectricItem(aStack, 50000, aPlayer);
}
@@ -134,7 +146,8 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor {
}
if (!aPlayer.worldObj.isRemote && (mSpecials & 128) != 0) {
- float jumpCharge = jumpChargeMap.containsKey(aPlayer) ? ((Float) jumpChargeMap.get(aPlayer)).floatValue() : 1.0F;
+ float jumpCharge =
+ jumpChargeMap.containsKey(aPlayer) ? ((Float) jumpChargeMap.get(aPlayer)).floatValue() : 1.0F;
if (GT_ModHandler.canUseElectricItem(aStack, 1000) && aPlayer.onGround && jumpCharge < 1.0F) {
jumpCharge = 1.0F;
@@ -159,7 +172,10 @@ 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())) {
+ if (GT_ModHandler.canUseElectricItem(aStack, 100)
+ && aPlayer.isSprinting()
+ && (aPlayer.onGround && Math.abs(aPlayer.motionX) + Math.abs(aPlayer.motionZ) > 0.10000000149011612D
+ || aPlayer.isInWater())) {
GT_ModHandler.useElectricItem(aStack, 100, aPlayer);
float bonus = 0.22F;
@@ -167,7 +183,6 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor {
GT_ModHandler.useElectricItem(aStack, 100, aPlayer);
bonus = 0.1F;
-
if (aPlayer.motionY > 0) {
aPlayer.motionY += 0.10000000149011612D;
}
@@ -187,13 +202,14 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor {
}
if (!aPlayer.worldObj.isRemote && (mSpecials & (16 | 32)) != 0) {
- //if (GregTech_API.sWorldTickCounter%20==0) {
+ // if (GregTech_API.sWorldTickCounter%20==0) {
ItemStack tTargetChargeItem = aStack, tTargetDechargeItem = aStack;
if (GT_ModHandler.chargeElectricItem(tTargetChargeItem, 1, Integer.MAX_VALUE, true, true) < 1) {
tTargetChargeItem = aPlayer.inventory.armorInventory[2];
}
- if (GT_ModHandler.dischargeElectricItem(tTargetDechargeItem, 10, Integer.MAX_VALUE, true, true, true) < 10) {
+ if (GT_ModHandler.dischargeElectricItem(tTargetDechargeItem, 10, Integer.MAX_VALUE, true, true, true)
+ < 10) {
tTargetDechargeItem = aPlayer.inventory.armorInventory[2];
}
@@ -201,18 +217,22 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor {
tTargetChargeItem = null;
}
- if (aPlayer.worldObj.isDaytime() && aPlayer.worldObj.canBlockSeeTheSky(MathHelper.floor_double(aPlayer.posX), MathHelper.floor_double(aPlayer.posY + 1), MathHelper.floor_double(aPlayer.posZ))) {
+ if (aPlayer.worldObj.isDaytime()
+ && aPlayer.worldObj.canBlockSeeTheSky(
+ 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);
}
} else {
- /* TODO:
- if ((mSpecials & 16) != 0 && tTargetDechargeItem != null && GT_ModHandler.canUseElectricItem(tTargetDechargeItem, 10)) {
- if (aPlayer.worldObj.getBlock ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ) == Blocks.air)
- aPlayer.worldObj.setBlock ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ, GregTech_API.sBlockList[3]);
- GT_ModHandler.useElectricItem(tTargetDechargeItem, 10, aPlayer);
- }*/
- //}
+ /* TODO:
+ if ((mSpecials & 16) != 0 && tTargetDechargeItem != null && GT_ModHandler.canUseElectricItem(tTargetDechargeItem, 10)) {
+ if (aPlayer.worldObj.getBlock ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ) == Blocks.air)
+ aPlayer.worldObj.setBlock ((int)aPlayer.posX, (int)aPlayer.posY+1, (int)aPlayer.posZ, GregTech_API.sBlockList[3]);
+ GT_ModHandler.useElectricItem(tTargetDechargeItem, 10, aPlayer);
+ }*/
+ // }
}
}
}
@@ -285,7 +305,9 @@ 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;
@@ -296,8 +318,17 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor {
}
@Override
- public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, 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);
+ public ISpecialArmor.ArmorProperties getProperties(
+ EntityLivingBase player, ItemStack armor, DamageSource source, 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);
}
@Override
@@ -306,8 +337,10 @@ 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);
+ 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);
}
private double getBaseAbsorptionRatio() {
diff --git a/src/main/java/gregtech/api/items/GT_Generic_Block.java b/src/main/java/gregtech/api/items/GT_Generic_Block.java
index 37d1e0c7d5..912841c145 100644
--- a/src/main/java/gregtech/api/items/GT_Generic_Block.java
+++ b/src/main/java/gregtech/api/items/GT_Generic_Block.java
@@ -1,13 +1,13 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.W;
+
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_LanguageManager;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemBlock;
-import static gregtech.api.enums.GT_Values.W;
-
public class GT_Generic_Block extends Block {
protected final String mUnlocalizedName;
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 796a414c78..347913e470 100644
--- a/src/main/java/gregtech/api/items/GT_Generic_Item.java
+++ b/src/main/java/gregtech/api/items/GT_Generic_Item.java
@@ -1,5 +1,8 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.MOD_ID;
+import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
+
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -10,6 +13,7 @@ import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
+import java.util.List;
import net.minecraft.block.BlockDispenser;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
@@ -26,11 +30,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.MOD_ID;
-import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
-
/**
* Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur.
*/
@@ -42,12 +41,14 @@ public class GT_Generic_Item extends Item implements IProjectileItem {
this(aUnlocalized, aEnglish, aEnglishTooltip, true);
}
- public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, boolean aWriteToolTipIntoLangFile) {
+ public GT_Generic_Item(
+ String aUnlocalized, String aEnglish, String aEnglishTooltip, 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);
+ GT_LanguageManager.addStringLocalization(
+ mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
else mTooltip = null;
setCreativeTab(GregTech_API.TAB_GREGTECH);
GameRegistry.registerItem(this, mName, MOD_ID);
@@ -120,12 +121,14 @@ 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) {
+ public EntityArrow getProjectile(
+ SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
return null;
}
@Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ public EntityArrow getProjectile(
+ SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
return null;
}
@@ -145,12 +148,12 @@ public class GT_Generic_Item extends Item implements IProjectileItem {
}
@Deprecated
- public String trans(String aKey, String aEnglish){
- return transItem(aKey, aEnglish);
+ public String trans(String aKey, String aEnglish) {
+ return transItem(aKey, aEnglish);
}
- public String transItem(String aKey, String aEnglish){
- return GT_LanguageManager.addStringLocalization("Item_DESCRIPTION_Index_"+aKey, aEnglish, false);
+ public String transItem(String aKey, String aEnglish) {
+ return GT_LanguageManager.addStringLocalization("Item_DESCRIPTION_Index_" + aKey, aEnglish, false);
}
public static class GT_Item_Dispense extends BehaviorProjectileDispense {
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 e0a70c093c..bf2b0d2d96 100644
--- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
+++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
@@ -1,5 +1,8 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.enums.SubTag;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.util.GT_LanguageManager;
@@ -10,6 +13,9 @@ import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -24,16 +30,11 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.D1;
-import static gregtech.api.enums.GT_Values.V;
-
-public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
+public abstract class GT_MetaBase_Item extends GT_Generic_Item
+ implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
/* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final ConcurrentHashMap>> mItemBehaviors = new ConcurrentHashMap>>();
+ private final ConcurrentHashMap>> mItemBehaviors =
+ new ConcurrentHashMap>>();
/**
* Creates the Item using these Parameters.
@@ -57,7 +58,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
*/
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;
}
@@ -69,44 +71,51 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
@Override
public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour tBehavior : tList)
- if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true;
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true;
return super.hasProjectile(aProjectileType, aStack);
}
@Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ public EntityArrow getProjectile(
+ SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, 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);
- if (rArrow != null) return rArrow;
- }
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList) {
+ EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ);
+ if (rArrow != null) return rArrow;
+ }
return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ);
}
@Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ public EntityArrow getProjectile(
+ SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, 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);
- if (rArrow != null) return rArrow;
- }
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList) {
+ EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed);
+ if (rArrow != null) return rArrow;
+ }
return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed);
}
@Override
public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour tBehavior : tList)
- if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack);
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack);
return super.onDispense(aSource, aStack);
}
@Override
public boolean isItemStackUsable(ItemStack aStack) {
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour tBehavior : tList)
- if (!tBehavior.isItemStackUsable(this, aStack)) return false;
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ if (!tBehavior.isItemStackUsable(this, aStack)) return false;
return super.isItemStackUsable(aStack);
}
@@ -115,11 +124,13 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
use(aStack, 0, aPlayer);
isItemStackUsable(aStack);
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour tBehavior : tList)
- if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
+ try {
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
if (aStack.stackSize <= 0) {
aPlayer.destroyCurrentEquippedItem();
return false;
@@ -131,15 +142,27 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
}
@Override
- public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ public boolean onItemUse(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int aSide,
+ float hitX,
+ float hitY,
+ float hitZ) {
use(aStack, 0, aPlayer);
isItemStackUsable(aStack);
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour tBehavior : tList)
- if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
+ try {
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
if (aStack.stackSize <= 0) {
aPlayer.destroyCurrentEquippedItem();
return false;
@@ -151,15 +174,27 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
}
@Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ int aSide,
+ float hitX,
+ float hitY,
+ float hitZ) {
use(aStack, 0, aPlayer);
isItemStackUsable(aStack);
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour tBehavior : tList)
- if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
+ try {
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
if (aStack.stackSize <= 0) {
aPlayer.destroyCurrentEquippedItem();
return false;
@@ -175,8 +210,10 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
use(aStack, 0, aPlayer);
isItemStackUsable(aStack);
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour tBehavior : tList)
- aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
+ try {
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
@@ -190,17 +227,34 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
for (String tString : tStrings)
if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
- Long[]
- tStats = getElectricStats(aStack);
+ Long[] tStats = getElectricStats(aStack);
if (tStats != null) {
if (tStats[3] > 0) {
- aList.add(EnumChatFormatting.AQUA + String.format(transItem("009", "Contains %s EU Tier: %s"), GT_Utility.formatNumbers(tStats[3]), "" + (tStats[2] >= 0 ? tStats[2] : 0)) + EnumChatFormatting.GRAY);
+ aList.add(EnumChatFormatting.AQUA
+ + String.format(
+ transItem("009", "Contains %s EU Tier: %s"),
+ GT_Utility.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);
+ aList.add(EnumChatFormatting.AQUA
+ + transItem("010", "Empty. You should recycle it properly.")
+ + EnumChatFormatting.GRAY);
} else {
- aList.add(String.valueOf(EnumChatFormatting.AQUA) + String.format(transItem("011", "%s / %s EU - Voltage: %s"), GT_Utility.formatNumbers(tCharge), GT_Utility.formatNumbers(Math.abs(tStats[0])), "" + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)]) + EnumChatFormatting.GRAY);
+ aList.add(String.valueOf(EnumChatFormatting.AQUA)
+ + String.format(
+ transItem("011", "%s / %s EU - Voltage: %s"),
+ GT_Utility.formatNumbers(tCharge),
+ GT_Utility.formatNumbers(Math.abs(tStats[0])),
+ ""
+ + V[
+ (int)
+ (tStats[2] >= 0
+ ? tStats[2] < V.length ? tStats[2] : V.length - 1
+ : 1)])
+ + EnumChatFormatting.GRAY);
}
}
}
@@ -208,13 +262,21 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
tStats = getFluidContainerStats(aStack);
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);
- aList.add(EnumChatFormatting.BLUE + String.format(transItem("013", "%sL / %sL"), "" + (tFluid == null ? 0 : tFluid.amount), "" + tStats[0]) + EnumChatFormatting.GRAY);
+ aList.add(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 : tFluid.amount), "" + tStats[0])
+ + EnumChatFormatting.GRAY);
}
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour tBehavior : tList)
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
addAdditionalToolTips(aList, aStack, aPlayer);
}
@@ -222,8 +284,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
@Override
public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
ArrayList> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour tBehavior : tList)
- tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
+ if (tList != null)
+ for (IItemBehaviour tBehavior : tList)
+ tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
}
@Override
@@ -248,20 +311,37 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
}
@Override
- public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
+ public final double charge(
+ ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, 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;
- //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)));
+ if (tStats == null
+ || tStats[2] > aTier
+ || !(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);
+ long tChargeBefore = getRealCharge(aStack),
+ tNewCharge =
+ Math.min(
+ 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) {
+ public final double discharge(
+ ItemStack aStack,
+ double aCharge,
+ int aTier,
+ boolean aIgnoreTransferLimit,
+ boolean aBatteryAlike,
+ boolean aSimulate) {
Long[] tStats = getElectricStats(aStack);
if (tStats == null || tStats[2] > aTier) return 0;
if (aBatteryAlike && !canProvideEnergy(aStack)) return 0;
@@ -270,7 +350,14 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
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;
}
@@ -308,7 +395,13 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
if (GT_ModHandler.isElectricItem(tArmor)) {
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);
+ double tCharge = ElectricItem.manager.discharge(
+ 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) {
@@ -464,8 +557,11 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
}
Long[] tStats = getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0)
- return 0;
+ if (tStats == null
+ || tStats[0] <= 0
+ || aFluid == null
+ || aFluid.getFluid().getID() <= 0
+ || aFluid.amount <= 0) return 0;
FluidStack tFluid = getFluidContent(aStack);
@@ -509,10 +605,10 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
if (tFluid != null && maxDrain >= tFluid.amount) {
ItemStack tStack = GT_Utility.getContainerItem(aStack, false);
if (tStack == null) {
- if(doDrain) aStack.stackSize = 0;
+ if (doDrain) aStack.stackSize = 0;
return tFluid;
}
- if(doDrain) {
+ if (doDrain) {
aStack.setItemDamage(tStack.getItemDamage());
aStack.func_150996_a(tStack.getItem());
}
@@ -558,10 +654,11 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
@Override
public int getItemStackLimit(ItemStack aStack) {
Long[] tStats = getElectricStats(aStack);
- if (tStats != null && (tStats[3] == -1 || tStats[3] == -2 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1;
+ if (tStats != null && (tStats[3] == -1 || tStats[3] == -2 || tStats[3] == -3) && getRealCharge(aStack) > 0)
+ return 1;
tStats = getFluidContainerStats(aStack);
if (tStats != null) return (int) (long) tStats[1];
- if(getDamage(aStack)==32763)return 1;
+ if (getDamage(aStack) == 32763) return 1;
return 64;
}
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 2743f35e3b..bf472101de 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item.java
@@ -1,5 +1,7 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.*;
+
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
@@ -19,6 +21,11 @@ import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.render.items.GT_GeneratedMaterial_Renderer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.BitSet;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -31,14 +38,6 @@ import net.minecraft.world.World;
import squeek.applecore.api.food.FoodValues;
import squeek.applecore.api.food.IEdible;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.BitSet;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.*;
-
/**
* @author Gregorius Techneticies
*
@@ -59,9 +58,10 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
*
* You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
*/
- public static final ConcurrentHashMap sInstances = new ConcurrentHashMap();
+ public static final ConcurrentHashMap sInstances =
+ new ConcurrentHashMap();
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
public final short mOffset, mItemAmount;
public final BitSet mEnabledItems;
@@ -132,7 +132,15 @@ 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);
+ 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);
}
tUseOreDict = false;
}
@@ -208,13 +216,22 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
* Use -3 if you want to make this Battery charge/discharge-able.
* @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) {
+ public final GT_MetaGenerated_Item setElectricStats(
+ int aMetaValue,
+ long aMaxCharge,
+ long aTransferLimit,
+ 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});
+ 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));
+ mIconList[aMetaValue - mOffset] = Arrays.copyOf(
+ mIconList[aMetaValue - mOffset], Math.max(9, mIconList[aMetaValue - mOffset].length));
}
return this;
}
@@ -229,7 +246,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
public final GT_MetaGenerated_Item setFluidContainerStats(int aMetaValue, long aCapacity, long aStacksize) {
if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this;
if (aCapacity < 0) mElectricStats.remove((short) aMetaValue);
- else mFluidContainerStats.put((short) aMetaValue, new Long[]{aCapacity, Math.max(1, aStacksize)});
+ else mFluidContainerStats.put((short) aMetaValue, new Long[] {aCapacity, Math.max(1, aStacksize)});
return this;
}
@@ -261,7 +278,7 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
return null;
}
- /* ---------- INTERNAL OVERRIDES ---------- */
+ /* ---------- INTERNAL OVERRIDES ---------- */
@Override
public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
@@ -287,9 +304,15 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
IFoodStat tStat = mFoodStats.get((short) getDamage(aStack));
if (tStat != null) {
if (Loader.isModLoaded(MOD_ID_APC)) {
- aPlayer.getFoodStats().func_151686_a((ItemFood) GT_Utility.callConstructor("squeek.applecore.api.food.ItemFoodProxy.ItemFoodProxy", 0, null, true, this), aStack);
+ aPlayer.getFoodStats()
+ .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));
+ aPlayer.getFoodStats()
+ .addStats(
+ tStat.getFoodLevel(this, aStack, aPlayer), tStat.getSaturation(this, aStack, aPlayer));
}
tStat.onEaten(this, aStack, aPlayer);
}
@@ -300,7 +323,9 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
@Optional.Method(modid = MOD_ID_APC)
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));
+ return tStat == null
+ ? null
+ : new FoodValues(tStat.getFoodLevel(this, aStack, null), tStat.getSaturation(this, aStack, null));
}
@Override
@@ -331,9 +356,11 @@ 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(RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k));
+ mIconList[i][k] = aIconRegister.registerIcon(
+ RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k));
}
- mIconList[i][0] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i));
+ mIconList[i][0] = aIconRegister.registerIcon(
+ RES_PATH_ITEM + (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 f04b4a3345..62aae22e24 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
@@ -1,5 +1,7 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.M;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
@@ -9,15 +11,12 @@ import gregtech.api.interfaces.IIconContainer;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.M;
-
/**
* @author Gregorius Techneticies
*
@@ -45,7 +44,9 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
public GT_MetaGenerated_Item_X01(String aUnlocalized, OrePrefixes aGeneratedPrefix, int aIconSetIndex) {
super(aUnlocalized, (short) 32000, (short) 766);
mPrefix = aGeneratedPrefix;
- mIconSetIndex = aIconSetIndex >= 0 ? aIconSetIndex : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0;
+ mIconSetIndex = aIconSetIndex >= 0
+ ? aIconSetIndex
+ : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0;
for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
OrePrefixes tPrefix = mPrefix;
@@ -54,8 +55,13 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
if (tMaterial == null) continue;
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));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M));
+ GT_LanguageManager.addStringLocalization(
+ 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));
String tOreName = getOreDictString(tPrefix, tMaterial);
tPrefix = OrePrefixes.getOrePrefix(tOreName);
if (tPrefix != null && tPrefix.mIsUnificatable) {
@@ -67,7 +73,7 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
}
}
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
/**
* @param aPrefix the OreDict Prefix
@@ -110,15 +116,14 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
return aMaterial.mIconSet.mTextures[mIconSetIndex];
}
- /* ---------- INTERNAL OVERRIDES ---------- */
+ /* ---------- INTERNAL OVERRIDES ---------- */
@Override
public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- int aDamage = aStack.getItemDamage();
- if (aDamage < 32000 && aDamage >= 0)
- return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
- return aName;
+ String aName = super.getItemStackDisplayName(aStack);
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0) return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
+ return aName;
}
@Override
@@ -136,19 +141,27 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
@Override
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;
+ return aMetaData < GregTech_API.sGeneratedMaterials.length
+ && 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;
+ return aMetaData < GregTech_API.sGeneratedMaterials.length
+ && GregTech_API.sGeneratedMaterials[aMetaData] != null
+ ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData])
+ : null;
}
@Override
@SideOnly(Side.CLIENT)
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)) {
+ 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);
@@ -166,12 +179,16 @@ public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
if (tIcon != null) return tIcon.getIcon();
return null;
}
- return aMetaData >= mOffset && aMetaData - mOffset < mIconList.length ? mIconList[aMetaData - mOffset][0] : null;
+ return aMetaData >= mOffset && aMetaData - mOffset < mIconList.length
+ ? mIconList[aMetaData - mOffset][0]
+ : null;
}
@Override
public int getItemStackLimit(ItemStack aStack) {
- return getDamage(aStack) < mOffset ? Math.min(super.getItemStackLimit(aStack), mPrefix.mDefaultStackSize) : super.getItemStackLimit(aStack);
+ return getDamage(aStack) < mOffset
+ ? Math.min(super.getItemStackLimit(aStack), mPrefix.mDefaultStackSize)
+ : 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 645764defb..c0f7b6b3c9 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
@@ -1,5 +1,7 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.M;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
@@ -11,16 +13,13 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.render.items.GT_GeneratedMaterial_Renderer;
+import java.util.Arrays;
+import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import java.util.Arrays;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.M;
-
/**
* @author Gregorius Techneticies
*
@@ -54,14 +53,22 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
if (tMaterial == null) continue;
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));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M));
+ GT_LanguageManager.addStringLocalization(
+ 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));
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)) {
+ if ((tPrefix == OrePrefixes.stick || tPrefix == OrePrefixes.wireFine || tPrefix == OrePrefixes.ingot)
+ && (tMaterial == Materials.Lead
+ || tMaterial == Materials.Tin
+ || tMaterial == Materials.SolderingAlloy)) {
GregTech_API.sSolderingMetalList.add(tStack);
GT_ModHandler.registerBoxableItemToToolBox(tStack);
}
@@ -69,7 +76,7 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
}
}
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
/**
* @return the Color Modulation the Material is going to be rendered with.
@@ -86,12 +93,13 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
* @return if this Item should be generated and visible.
*/
public boolean doesMaterialAllowGeneration(OrePrefixes aPrefix, Materials aMaterial) {
- // You have to check for at least these Conditions in every Case! So add a super Call like the following for this before executing your Code:
+ // You have to check for at least these Conditions in every Case! So add a super Call like the following for
+ // this before executing your Code:
// if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
return aPrefix != null && aMaterial != null && aPrefix.doGenerateItem(aMaterial);
}
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
/**
* @param aPrefix the OreDict Prefix
@@ -119,7 +127,10 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
* @return an Icon Container for the Item Display.
*/
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;
+ return mGeneratedPrefixList[aMetaData / 1000] != null
+ && mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0
+ ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex]
+ : null;
}
/**
@@ -132,15 +143,14 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
return true;
}
- /* ---------- INTERNAL OVERRIDES ---------- */
+ /* ---------- INTERNAL OVERRIDES ---------- */
@Override
public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- int aDamage = aStack.getItemDamage();
- if (aDamage < 32000 && aDamage >= 0)
- return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
- return aName;
+ String aName = super.getItemStackDisplayName(aStack);
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0) return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
+ return aName;
}
@Override
@@ -158,12 +168,16 @@ 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]);
+ return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null
+ ? null
+ : 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;
+ return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null
+ ? null
+ : GregTech_API.sGeneratedMaterials[aMetaData % 1000].renderer;
}
@Override
@@ -173,7 +187,8 @@ public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
OrePrefixes aPrefix = mGeneratedPrefixList[i / 1000];
Materials aMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
if (aPrefix != null && aMaterial != null) {
- if (doesMaterialAllowGeneration(aPrefix, aMaterial) && doesShowInCreative(aPrefix, aMaterial, GregTech_API.sDoShowAllItemsInCreative)) {
+ if (doesMaterialAllowGeneration(aPrefix, aMaterial)
+ && 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 7d94d73293..a7d31332a8 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
@@ -1,5 +1,9 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.MOD_ID_FR;
+import static gregtech.api.enums.GT_Values.MOD_ID_RC;
+import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow;
+
import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Optional;
@@ -19,6 +23,11 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.tools.GT_Tool_Turbine;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
import mods.railcraft.api.core.items.IToolCrowbar;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -46,31 +55,29 @@ import net.minecraftforge.common.IShearable;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.BlockEvent;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.MOD_ID_FR;
-import static gregtech.api.enums.GT_Values.MOD_ID_RC;
-import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow;
-
/**
* This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench:
* GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, Materials.Bismuth, Materials.Bismuth, null);
*/
-@Optional.InterfaceList(value = {@Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = MOD_ID_FR), @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"), @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")})
-public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool {
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = MOD_ID_FR),
+ @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC),
+ @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"),
+ @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")
+ })
+public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item
+ implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool {
/**
* All instances of this Item Class are listed here.
* This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true.
*
* You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
*/
- public static final ConcurrentHashMap sInstances = new ConcurrentHashMap();
+ public static final ConcurrentHashMap sInstances =
+ new ConcurrentHashMap();
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
public final ConcurrentHashMap mToolStats = new ConcurrentHashMap();
@@ -86,7 +93,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
sInstances.put(getUnlocalizedName(), this);
}
- /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
+ /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
public static final Materials getPrimaryMaterial(ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
@@ -106,7 +113,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
return Materials._NULL;
}
- /* ---------- INTERNAL OVERRIDES ---------- */
+ /* ---------- INTERNAL OVERRIDES ---------- */
public static final long getToolMaxDamage(ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
@@ -148,13 +155,16 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
* @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects.
* @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) {
+ public final ItemStack addTool(
+ int aID, String aEnglish, String aToolTip, IToolStats aToolStats, 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);
@@ -163,8 +173,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) {
if (tOreDictNameOrAspect instanceof TC_AspectStack)
((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects);
- else
- GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
+ else GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
}
if (GregTech_API.sThaumcraftCompat != null)
GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
@@ -183,14 +192,17 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
* @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool
* @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) {
+ public final ItemStack getToolWithStats(
+ int aToolID, int aAmount, Materials aPrimaryMaterial, Materials aSecondaryMaterial, long[] aElectricArray) {
ItemStack rStack = new ItemStack(this, aAmount, aToolID);
IToolStats tToolStats = getToolStats(rStack);
if (tToolStats != null) {
NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound();
if (aPrimaryMaterial != null) {
tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.mName);
- tToolNBT.setLong("MaxDamage", 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
+ tToolNBT.setLong(
+ "MaxDamage",
+ 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
}
if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.mName);
@@ -213,49 +225,86 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
* Called by the Block Harvesting Event within the GT_Proxy
*/
@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) {
+ 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) {
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());
+ doDamage(
+ 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)
- {
- IToolStats tStats = getToolStats(aStack);
- return tStats == null ? aDefault : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ);
- }
-
- @Override
- public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer)
- {
- if(aPlayer.worldObj.isRemote){
- return false;
- }
- IToolStats tStats = getToolStats(aStack);
- Block aBlock = aPlayer.worldObj.getBlock(aX, aY, aZ);
- if (tStats.isChainsaw()&&(aBlock instanceof IShearable))
- {
- IShearable target = (IShearable)aBlock;
- 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));
- for (ItemStack stack : drops)
- {
- float f = 0.7F;
- double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
- double d1 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
- double d2 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
- EntityItem entityitem = new EntityItem(aPlayer.worldObj, aX + d, aY + d1, aZ + d2, stack);
- entityitem.delayBeforeCanPickup = 10;
- aPlayer.worldObj.spawnEntityInWorld(entityitem);
- }
- aPlayer.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(aBlock)], 1);
- onBlockDestroyed(aStack, aPlayer.worldObj, aBlock, aX, aY, aZ, aPlayer);
+ public float onBlockBreakSpeedEvent(
+ float aDefault,
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ Block aBlock,
+ int aX,
+ 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);
+ }
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer) {
+ if (aPlayer.worldObj.isRemote) {
+ return false;
}
- return false;
- }
- return super.onBlockStartBreak(aStack, aX, aY, aZ, aPlayer);
+ IToolStats tStats = getToolStats(aStack);
+ Block aBlock = aPlayer.worldObj.getBlock(aX, aY, aZ);
+ if (tStats.isChainsaw() && (aBlock instanceof IShearable)) {
+ IShearable target = (IShearable) aBlock;
+ 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));
+ for (ItemStack stack : drops) {
+ float f = 0.7F;
+ double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d1 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d2 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ EntityItem entityitem = new EntityItem(aPlayer.worldObj, aX + d, aY + d1, aZ + d2, stack);
+ entityitem.delayBeforeCanPickup = 10;
+ aPlayer.worldObj.spawnEntityInWorld(entityitem);
+ }
+ aPlayer.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(aBlock)], 1);
+ onBlockDestroyed(aStack, aPlayer.worldObj, aBlock, aX, aY, aZ, aPlayer);
+ }
+ return false;
+ }
+ return super.onBlockStartBreak(aStack, aX, aY, aZ, aPlayer);
}
@Override
@@ -265,17 +314,46 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F);
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, aStack, aPlayer), tDamage = tStats.getNormalDamageAgainstEntity((float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + getToolCombatDamage(aStack), aEntity, aStack, aPlayer);
+ float
+ tMagicDamage =
+ tStats.getMagicDamageAgainstEntity(
+ 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);
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;
+ boolean tCriticalHit = aPlayer.fallDistance > 0.0F
+ && !aPlayer.onGround
+ && !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);
+ int tKnockcack = (aPlayer.isSprinting() ? 1 : 0)
+ + (aEntity instanceof EntityLivingBase
+ ? 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);
+ 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);
aPlayer.motionX *= 0.6D;
aPlayer.motionZ *= 0.6D;
aPlayer.setSprinting(false);
@@ -289,7 +367,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
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());
}
@@ -326,9 +405,8 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
ItemStack tStack = new ItemStack(this, 1, i);
isItemStackUsable(tStack);
aList.add(tStack);
- aList.add(getToolWithStats(i,1,Materials.Neutronium,Materials.Neutronium,null));
+ aList.add(getToolWithStats(i, 1, Materials.Neutronium, Materials.Neutronium, null));
}
-
}
}
@@ -357,63 +435,207 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
// Optimal Flow -> toolSpeed
// EU/t -> toolCombatDamage, toolSpeed
// Overflow Tier -> toolQuality
- int aBaseEff=(int)(5+getToolCombatDamage(aStack))*1000;
- int aOptFlow=GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50));
- aList.add(tOffset + 0, EnumChatFormatting.GRAY + String.format(transItem("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY);
- aList.add(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);
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(transItem("006", "Optimal Steam flow: %s L/t"), "" + EnumChatFormatting.GOLD + 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 + 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));
+ int aBaseEff = (int) (5 + getToolCombatDamage(aStack)) * 1000;
+ int aOptFlow = GT_Utility.safeInt((long) Math.max(
+ Float.MIN_NORMAL,
+ ((GT_MetaGenerated_Tool) aStack.getItem())
+ .getToolStats(aStack)
+ .getSpeedMultiplier()
+ * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed
+ * 50));
+ aList.add(
+ tOffset + 0,
+ EnumChatFormatting.GRAY
+ + String.format(
+ transItem("001", "Durability: %s/%s"),
+ "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ",
+ " " + tMaxDamage)
+ + EnumChatFormatting.GRAY);
+ aList.add(
+ 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);
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.WHITE
+ + String.format(
+ transItem("006", "Optimal Steam flow: %s L/t"),
+ "" + EnumChatFormatting.GOLD
+ + 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
+ + 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));
{
long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff);
int aOptFlowLoose = (int) calculatedFlow[0];
int aBaseEffLoose = (int) calculatedFlow[1];
- aList.add(tOffset + 5, EnumChatFormatting.AQUA + String.format(transItem("500", "Turbine Efficiency (Loose): %s"), "" + EnumChatFormatting.BLUE + aBaseEffLoose / 100 + "%" + EnumChatFormatting.GRAY));
- aList.add(tOffset + 6, EnumChatFormatting.AQUA + String.format(transItem("501", "Optimal Steam flow (Loose): %s L/t"), "" + EnumChatFormatting.GOLD + (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 + (aOptFlowLoose * getPrimaryMaterial(aStack).mSteamMultiplier/ 10000) * (aBaseEffLoose / 2) + EnumChatFormatting.GRAY));
- aList.add(tOffset + 8, EnumChatFormatting.GRAY + "(Superheated Steam EU values are 2x those of Steam)");
-
-
+ aList.add(
+ tOffset + 5,
+ EnumChatFormatting.AQUA
+ + String.format(
+ transItem("500", "Turbine Efficiency (Loose): %s"),
+ "" + EnumChatFormatting.BLUE + aBaseEffLoose / 100 + "%"
+ + EnumChatFormatting.GRAY));
+ aList.add(
+ tOffset + 6,
+ EnumChatFormatting.AQUA
+ + String.format(
+ transItem("501", "Optimal Steam flow (Loose): %s L/t"),
+ "" + EnumChatFormatting.GOLD
+ + (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
+ + (aOptFlowLoose
+ * getPrimaryMaterial(aStack).mSteamMultiplier
+ / 10000)
+ * (aBaseEffLoose / 2)
+ + EnumChatFormatting.GRAY));
+ aList.add(
+ 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 + 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 + 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)");
+ aList.add(
+ tOffset + 9,
+ EnumChatFormatting.LIGHT_PURPLE
+ + String.format(
+ transItem("007", "Energy from Optimal Gas Flow: %s EU/t"),
+ "" + EnumChatFormatting.GOLD
+ + 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
+ + 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)");
int toolQualityLevel = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality;
int overflowMultiplier = 0;
if (toolQualityLevel >= 6) {
overflowMultiplier = 3;
- }
- else if (toolQualityLevel >= 3) {
+ } else if (toolQualityLevel >= 3) {
overflowMultiplier = 2;
- }
- else {
+ } else {
overflowMultiplier = 1;
}
- aList.add(tOffset + 11, EnumChatFormatting.LIGHT_PURPLE + String.format(transItem("502", "Overflow Efficiency Tier: %s"), "" + EnumChatFormatting.GOLD + overflowMultiplier + EnumChatFormatting.GRAY));
+ aList.add(
+ tOffset + 11,
+ EnumChatFormatting.LIGHT_PURPLE
+ + String.format(
+ transItem("502", "Overflow Efficiency Tier: %s"),
+ "" + EnumChatFormatting.GOLD + overflowMultiplier + EnumChatFormatting.GRAY));
} else {
- aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(transItem("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY);
- aList.add(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);
- 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);
+ aList.add(
+ tOffset + 0,
+ EnumChatFormatting.WHITE
+ + String.format(
+ transItem("001", "Durability: %s/%s"),
+ "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ",
+ " " + tMaxDamage)
+ + EnumChatFormatting.GRAY);
+ aList.add(
+ 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);
+ 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);
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();
- if(aNBT.hasKey("HeatTime")){
- long tHeatTime = aNBT.getLong("HeatTime");
- if(tWorldTime>(tHeatTime+10)){
- tHeat = (int) (tHeat - ((tWorldTime-tHeatTime)/10));
- if(tHeat<300&&tHeat>-10000)tHeat=300;
- }
- aNBT.setLong("HeatTime", tWorldTime);
- if(tHeat>-10000)aNBT.setInteger("Heat", tHeat);
- }
-
- aList.add(tOffset + 3, EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat")+" K" + EnumChatFormatting.GRAY);
+ if (aNBT != null && aNBT.hasKey("Heat")) {
+ int tHeat = aNBT.getInteger("Heat");
+ long tWorldTime = aPlayer.getEntityWorld().getWorldTime();
+ if (aNBT.hasKey("HeatTime")) {
+ long tHeatTime = aNBT.getLong("HeatTime");
+ if (tWorldTime > (tHeatTime + 10)) {
+ tHeat = (int) (tHeat - ((tWorldTime - tHeatTime) / 10));
+ if (tHeat < 300 && tHeat > -10000) tHeat = 300;
+ }
+ aNBT.setLong("HeatTime", tWorldTime);
+ if (tHeat > -10000) aNBT.setInteger("Heat", tHeat);
+ }
+
+ aList.add(
+ tOffset + 3,
+ EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat") + " K"
+ + EnumChatFormatting.GRAY);
}
}
}
@@ -431,7 +653,12 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
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")};
+ return new Long[] {
+ aNBT.getLong("MaxCharge"),
+ aNBT.getLong("Voltage"),
+ aNBT.getLong("Tier"),
+ aNBT.getLong("SpecialData")
+ };
}
return null;
}
@@ -458,7 +685,6 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);
if (aStack.stackSize > 0) aStack.stackSize--;
-
}
}
return true;
@@ -485,7 +711,9 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
if (!isItemStackUsable(aStack)) return 0.0F;
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;
+ return tStats.isMinableBlock(aBlock, (byte) aMetaData)
+ ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed)
+ : 0.0F;
}
@Override
@@ -500,12 +728,14 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
}
@Override
- public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, EntityLivingBase aPlayer) {
+ public boolean onBlockDestroyed(
+ ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, 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()));
+ doDamage(aStack, (int)
+ Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
}
@@ -527,7 +757,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
doDamage(aStack, tStats.getToolDamagePerContainerCraft());
aStack = aStack.stackSize > 0 ? aStack : null;
if (playSound && GT_Mod.gregtechproxy.mTicksUntilNextCraftSound <= 0) {
- GT_Mod.gregtechproxy.mTicksUntilNextCraftSound = 10;
+ GT_Mod.gregtechproxy.mTicksUntilNextCraftSound = 10;
String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
GT_Utility.doSoundAtClient(sound, 1, 1.0F);
}
@@ -546,7 +776,9 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
@Override
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;
+ return tStats != null && tStats.isGrafter()
+ ? Math.min(100.0F, (1 + getHarvestLevel(aStack, "")) * 20.0F)
+ : 0.0F;
}
@Override
@@ -562,42 +794,41 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
}
- @Override
- public boolean canWrench(EntityPlayer player, int x, int y, int z) {
- if(player==null)return false;
- if(player.getCurrentEquippedItem()==null)return false;
+ @Override
+ public boolean canWrench(EntityPlayer player, int x, int y, int z) {
+ if (player == null) return false;
+ if (player.getCurrentEquippedItem() == null) return false;
if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
return tStats != null && tStats.isWrench();
- }
+ }
- @Override
- public void wrenchUsed(EntityPlayer player, int x, int y, int z) {
- if(player==null)return;
- if(player.getCurrentEquippedItem()==null)return;
+ @Override
+ public void wrenchUsed(EntityPlayer player, int x, int y, int z) {
+ if (player == null) return;
+ if (player.getCurrentEquippedItem() == null) return;
IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
if (tStats != null) doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
- }
-
- @Override
- public boolean canUse(ItemStack stack, EntityPlayer player, int x, int y, int z){
- return canWrench(player, x, y, z);
- }
-
- @Override
- public void used(ItemStack stack, EntityPlayer player, int x, int y, int z){
- wrenchUsed(player, x, y, z);
- }
-
- @Override
- public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
- if(player==null)return false;
- if(player.getCurrentEquippedItem()==null)return false;
- if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
- IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
- return tStats.isWrench();
- }
+ }
+
+ @Override
+ public boolean canUse(ItemStack stack, EntityPlayer player, int x, int y, int z) {
+ return canWrench(player, x, y, z);
+ }
+
+ @Override
+ public void used(ItemStack stack, EntityPlayer player, int x, int y, int z) {
+ wrenchUsed(player, x, y, z);
+ }
+ @Override
+ public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
+ if (player == null) return false;
+ if (player.getCurrentEquippedItem() == null) return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats.isWrench();
+ }
@Override
public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
@@ -671,10 +902,14 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
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]));
+ tMap.put(
+ 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)
+ if (tEntry.getKey() == 33
+ || (tEntry.getKey() == 20 && tEntry.getValue() > 2)
+ || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)
tResult.put(tEntry.getKey(), tEntry.getValue());
else
switch (Enchantment.enchantmentsList[tEntry.getKey()].type) {
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 7950672ec2..894c03db90 100644
--- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
+++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
@@ -1,20 +1,16 @@
package gregtech.api.items;
-
import gregtech.api.GregTech_API;
import gregtech.api.util.GT_Utility;
import ic2.api.reactor.IReactor;
import ic2.api.reactor.IReactorComponent;
import ic2.core.IC2Potion;
-import ic2.core.item.armor.ItemArmorHazmat;
+import java.util.ArrayList;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import java.util.ArrayList;
-
-
public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implements IReactorComponent {
public final int numberOfCells;
public final float sEnergy;
@@ -23,7 +19,16 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
public final ItemStack sDepleted;
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) {
+ public GT_RadioactiveCellIC_Item(
+ String aUnlocalized,
+ String aEnglish,
+ int aCellcount,
+ int maxDamage,
+ float aEnergy,
+ int aRadiation,
+ float aHeat,
+ ItemStack aDepleted,
+ boolean aMox) {
super(aUnlocalized, aEnglish, aCellcount);
setMaxStackSize(64);
this.maxDmg = maxDamage;
@@ -33,13 +38,14 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
this.sHeat = aHeat;
this.sDepleted = aDepleted;
this.sMox = aMox;
-
}
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))) {
+ if ((other != null)
+ && ((other.getItem() instanceof IReactorComponent))
+ && (((IReactorComponent) other.getItem())
+ .acceptUraniumPulse(reactor, other, me, x, y, mex, mey, heatrun))) {
return 1;
}
return 0;
@@ -56,16 +62,22 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
for (int i = 0; i < pulses; i++) {
acceptUraniumPulse(reactor, yourStack, yourStack, x, y, x, y, heatrun);
}
- 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 + 1, y, yourStack, x, y, heatrun);
+ checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun);
+ 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);
+ 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);
-// int heat = sumUp(pulses) * 4;
+ // int heat = sumUp(pulses) * 4;
int heat = triangularNumber(pulses) * 4;
-
+
heat = getFinalHeat(reactor, yourStack, x, y, heat);
-
+
ArrayList heatAcceptors = new ArrayList();
checkHeatAcceptor(reactor, x - 1, y, heatAcceptors);
checkHeatAcceptor(reactor, x + 1, y, heatAcceptors);
@@ -76,7 +88,13 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
int dheat = heat / heatAcceptors.size();
heat -= dheat;
- dheat = ((IReactorComponent) ((ItemStackCoord) heatAcceptors.get(0)).stack.getItem()).alterHeat(reactor, ((ItemStackCoord) heatAcceptors.get(0)).stack, ((ItemStackCoord) heatAcceptors.get(0)).x, ((ItemStackCoord) heatAcceptors.get(0)).y, dheat);
+ dheat = ((IReactorComponent) ((ItemStackCoord) heatAcceptors.get(0)).stack.getItem())
+ .alterHeat(
+ reactor,
+ ((ItemStackCoord) heatAcceptors.get(0)).stack,
+ ((ItemStackCoord) heatAcceptors.get(0)).x,
+ ((ItemStackCoord) heatAcceptors.get(0)).y,
+ dheat);
heat += dheat;
heatAcceptors.remove(0);
}
@@ -86,41 +104,49 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
}
}
if (getDamageOfStack(yourStack) >= getMaxDamageEx() - 1) {
- reactor.setItemAt(x, y, sDepleted.copy());
+ reactor.setItemAt(x, y, sDepleted.copy());
} else if (heatrun) {
damageItemStack(yourStack, 1);
}
}
-
- protected int getFinalHeat(IReactor reactor, ItemStack stack, int x, int y, int heat)
- {
- if (sMox&&reactor.isFluidCooled())
- {
- float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat();
- if (breedereffectiveness > 0.5D) {
- heat *= 2;
+
+ protected int getFinalHeat(IReactor reactor, ItemStack stack, int x, int y, int heat) {
+ if (sMox && reactor.isFluidCooled()) {
+ float breedereffectiveness = (float) reactor.getHeat() / (float) reactor.getMaxHeat();
+ if (breedereffectiveness > 0.5D) {
+ heat *= 2;
+ }
}
- }
- return heat;
+ return heat;
}
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))) {
+ if ((thing != null)
+ && ((thing.getItem() instanceof IReactorComponent))
+ && (((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) {
- if (!heatrun) {
- if(sMox){
- float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat();
- float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F;
- reactor.addOutput(ReaktorOutput * this.sEnergy);
- }else{
- reactor.addOutput((float) (1.0F * this.sEnergy));}
+ public boolean acceptUraniumPulse(
+ IReactor reactor,
+ ItemStack yourStack,
+ ItemStack pulsingStack,
+ int youX,
+ int youY,
+ int pulseX,
+ int pulseY,
+ boolean heatrun) {
+ if (!heatrun) {
+ if (sMox) {
+ float breedereffectiveness = (float) reactor.getHeat() / (float) reactor.getMaxHeat();
+ float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F;
+ reactor.addOutput(ReaktorOutput * this.sEnergy);
+ } else {
+ reactor.addOutput((float) (1.0F * this.sEnergy));
+ }
}
return true;
}
@@ -154,7 +180,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) {
if (this.sRadiation > 0 && (entity instanceof EntityLivingBase)) {
EntityLivingBase entityLiving = (EntityLivingBase) entity;
- if (!GregTech_API.mIC2Classic&&!GT_Utility.isWearingFullRadioHazmat(entityLiving)) {
+ if (!GregTech_API.mIC2Classic && !GT_Utility.isWearingFullRadioHazmat(entityLiving)) {
IC2Potion.radiation.applyTo(entityLiving, sRadiation * 20, sRadiation * 10);
}
}
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 e9c48991de..cff5bf38a8 100644
--- a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
+++ b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
@@ -3,15 +3,13 @@ package gregtech.api.items;
import gregtech.common.items.GT_DepletetCell_Item;
import ic2.api.item.IBoxable;
import ic2.core.util.StackUtil;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import java.util.List;
-
-public class GT_RadioactiveCell_Item
- extends GT_Generic_Item implements IBoxable{
+public class GT_RadioactiveCell_Item extends GT_Generic_Item implements IBoxable {
protected int cellCount;
protected int maxDmg;
protected int dura;
@@ -41,9 +39,8 @@ public class GT_RadioactiveCell_Item
return b;
}
- protected static int triangularNumber(int x)
- {
- return (x * x + x) / 2;
+ protected static int triangularNumber(int x) {
+ return (x * x + x) / 2;
}
protected boolean outputPulseForStack(ItemStack aStack) {
@@ -53,7 +50,7 @@ public class GT_RadioactiveCell_Item
aStack.setTagCompound(tNBT);
}
tNBT.setInteger("output", tNBT.getInteger("output") + 1);
- return false;//(this.pulserate > 0) || (tNBT.getInteger("output") % -this.pulserate == 0);
+ return false; // (this.pulserate > 0) || (tNBT.getInteger("output") % -this.pulserate == 0);
}
protected boolean incrementPulseForStack(ItemStack aStack) {
@@ -63,7 +60,7 @@ public class GT_RadioactiveCell_Item
aStack.setTagCompound(tNBT);
}
tNBT.setInteger("pulse", tNBT.getInteger("pulse") + 1);
- return false;//(this.pulserate > 0) || (tNBT.getInteger("pulse") % -this.pulserate == 0);
+ return false; // (this.pulserate > 0) || (tNBT.getInteger("pulse") % -this.pulserate == 0);
}
protected void setDurabilityForStack(ItemStack aStack, int aDurability) {
@@ -76,7 +73,7 @@ public class GT_RadioactiveCell_Item
}
public int getMaxNuclearDurability() {
- return 0;//return this.maxDelay;
+ return 0; // return this.maxDelay;
}
public int func_77619_b() {
@@ -133,24 +130,35 @@ public class GT_RadioactiveCell_Item
@Override
public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- super.addAdditionalToolTips(aList, aStack, aPlayer);
- //aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs");
+ super.addAdditionalToolTips(aList, aStack, aPlayer);
+ // aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs");
int rDmg = getDurabilityOfStack(aStack) * 6 / this.maxDmg;
EnumChatFormatting color2;
switch (rDmg) {
- case 0:
- case 1: color2 = EnumChatFormatting.WHITE; break;
- case 2:
- case 3:
- case 4: color2 = EnumChatFormatting.GRAY; break;
- default: color2 = EnumChatFormatting.DARK_GRAY; break;
+ case 0:
+ case 1:
+ color2 = EnumChatFormatting.WHITE;
+ break;
+ case 2:
+ case 3:
+ case 4:
+ color2 = EnumChatFormatting.GRAY;
+ break;
+ default:
+ color2 = EnumChatFormatting.DARK_GRAY;
+ break;
}
- EnumChatFormatting color1 = this instanceof GT_DepletetCell_Item ? color2 = EnumChatFormatting.DARK_GRAY : EnumChatFormatting.WHITE;
- aList.add(color1 + String.format(transItem("001", "Durability: %s/%s"), "" + color2 + (this.maxDmg - getDurabilityOfStack(aStack)) + color1, "" + this.maxDmg));
+ EnumChatFormatting color1 =
+ this instanceof GT_DepletetCell_Item ? color2 = EnumChatFormatting.DARK_GRAY : EnumChatFormatting.WHITE;
+ aList.add(color1
+ + String.format(
+ transItem("001", "Durability: %s/%s"),
+ "" + color2 + (this.maxDmg - getDurabilityOfStack(aStack)) + color1,
+ "" + this.maxDmg));
}
- @Override
- public boolean canBeStoredInToolbox(ItemStack itemstack) {
- return true;
- }
+ @Override
+ public boolean canBeStoredInToolbox(ItemStack itemstack) {
+ return true;
+ }
}
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 7725785276..7dfe0409a1 100644
--- a/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java
+++ b/src/main/java/gregtech/api/items/GT_SolderingTool_Item.java
@@ -1,36 +1,56 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.W;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ToolDictNames;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.W;
-
public class GT_SolderingTool_Item extends GT_Tool_Item {
- public GT_SolderingTool_Item(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDischargedGTID) {
- super(aUnlocalized, aEnglish, "To repair and construct Circuitry", aMaxDamage, aEntityDamage, true, -1, aDischargedGTID);
+ public GT_SolderingTool_Item(
+ String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDischargedGTID) {
+ super(
+ 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));
-// setBreakingSound(GregTech_API.sSoundList.get(103));
-// setEntityHitSound(GregTech_API.sSoundList.get(103));
-// setUsageAmounts(1, 1, 1);
+ // setCraftingSound(GregTech_API.sSoundList.get(103));
+ // setBreakingSound(GregTech_API.sSoundList.get(103));
+ // setEntityHitSound(GregTech_API.sSoundList.get(103));
+ // setUsageAmounts(1, 1, 1);
}
@Override
public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- aList.add(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!"));
+ aList.add(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!"));
}
@Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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_Bug_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Bug_Item.java
index 5b697748da..23bf3d87ad 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
@@ -11,7 +11,7 @@ import net.minecraft.world.World;
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);/*
+ super(aUnlocalized, aEnglish, "A very 'buggy' Spray", aMaxDamage, aEntityDamage, true); /*
addToEffectiveList(EntityCaveSpider.class.getName());
addToEffectiveList(EntitySpider.class.getName());
addToEffectiveList("EntityTFHedgeSpider");
@@ -41,14 +41,24 @@ 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) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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;
}
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if (aBlock == null) return false;
-// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
+ // byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
try {
@@ -60,7 +70,9 @@ public class GT_Spray_Bug_Item extends GT_Tool_Item {
return true;
}
}
- } catch (Throwable e) {/*Do nothing*/}
+ } catch (Throwable e) {
+ /*Do nothing*/
+ }
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 58bfafdffb..c2d4ff1231 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
@@ -1,5 +1,7 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.D1;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.util.GT_Log;
@@ -14,11 +16,9 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import static gregtech.api.enums.GT_Values.D1;
-
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);/*
+ super(aUnlocalized, aEnglish, "Precision Spray", aMaxDamage, aEntityDamage, true); /*
setCraftingSound(Sounds.IC2_TOOLS_PAINTER);
setBreakingSound(Sounds.IC2_TOOLS_PAINTER);
setEntityHitSound(Sounds.IC2_TOOLS_PAINTER);
@@ -57,7 +57,17 @@ 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) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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) {
@@ -65,7 +75,7 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item {
}
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if (aBlock == null) return false;
-// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
+ // byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
try {
@@ -121,7 +131,8 @@ 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)) {
+ 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);
return true;
@@ -129,9 +140,12 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item {
break;
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);
+ 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);
} else {
if (i == 0) return false;
break;
@@ -153,10 +167,21 @@ public class GT_Spray_Foam_Item extends GT_Tool_Item {
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))) {
+ if (GT_Utility.isBlockAir(
+ 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);
- 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);
+ 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);
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 4c8d64b5ee..bbcd170db0 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
@@ -1,5 +1,7 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.D1;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.util.GT_Log;
@@ -12,11 +14,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import static gregtech.api.enums.GT_Values.D1;
-
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);/*
+ super(aUnlocalized, aEnglish, "Construction Foam Hardener", aMaxDamage, aEntityDamage, true); /*
setCraftingSound(Sounds.IC2_TOOLS_PAINTER);
setBreakingSound(Sounds.IC2_TOOLS_PAINTER);
setEntityHitSound(Sounds.IC2_TOOLS_PAINTER);
@@ -24,14 +24,24 @@ public class GT_Spray_Hardener_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) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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;
}
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if (aBlock == null) return false;
-// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
+ // byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
try {
@@ -49,8 +59,12 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item {
if (D1) e.printStackTrace(GT_Log.err);
}
- ItemStack tStack1 = GT_ModHandler.getIC2Item("constructionFoam", 1), tStack2 = GT_ModHandler.getIC2Item("constructionFoamWall", 1);
- if (tStack1 != null && tStack1.isItemEqual(new ItemStack(aBlock)) && tStack2 != null && tStack2.getItem() instanceof ItemBlock) {
+ ItemStack tStack1 = GT_ModHandler.getIC2Item("constructionFoam", 1),
+ tStack2 = GT_ModHandler.getIC2Item("constructionFoamWall", 1);
+ if (tStack1 != null
+ && tStack1.isItemEqual(new ItemStack(aBlock))
+ && 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);
@@ -58,10 +72,12 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item {
return true;
}
- if (aTileEntity instanceof BaseMetaPipeEntity && (((BaseMetaPipeEntity) aTileEntity).mConnections & -64) == 64) {
+ if (aTileEntity instanceof BaseMetaPipeEntity
+ && (((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);
+ ((BaseMetaPipeEntity) aTileEntity).mConnections =
+ (byte) ((((BaseMetaPipeEntity) aTileEntity).mConnections & ~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 13ecdea3fa..e219220034 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
@@ -12,7 +12,7 @@ import net.minecraft.world.World;
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);/*
+ 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);
@@ -20,14 +20,24 @@ public class GT_Spray_Hydration_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) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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;
}
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if (aBlock == null) return false;
-// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
+ // byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
try {
@@ -39,10 +49,13 @@ public class GT_Spray_Hydration_Item extends GT_Tool_Item {
}
return true;
}
- } catch (Throwable e) {/*Do nothing*/}
+ } catch (Throwable e) {
+ /*Do nothing*/
+ }
if (aTileEntity instanceof IGregTechTileEntity) {
- if (((IGregTechTileEntity) aTileEntity).getColorization() >= 0 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) {
+ if (((IGregTechTileEntity) aTileEntity).getColorization() >= 0
+ && 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 ddd9062d73..cb21ce60b6 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
@@ -1,10 +1,13 @@
package gregtech.api.items;
+import static gregtech.api.enums.GT_Values.W;
+
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SoundResource;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
+import java.util.Arrays;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -12,13 +15,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.Arrays;
-
-import static gregtech.api.enums.GT_Values.W;
-
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);/*
+ super(aUnlocalized, aEnglish, "Very effective against Slimes", aMaxDamage, aEntityDamage, true); /*
addToEffectiveList(EntitySlime.class.getName());
addToEffectiveList("BlueSlime");
addToEffectiveList("SlimeClone");
@@ -31,22 +30,36 @@ public class GT_Spray_Ice_Item extends GT_Tool_Item {
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))) {
- GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Blocks.ice, 1, 0), new Object[]{new ItemStack(this, 1, W), tName});
+ for (Object tName : Arrays.asList(
+ 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});
}
}
- /*
- @Override
- public void onHitEntity(Entity aEntity) {
- if (aEntity instanceof EntityLiving) {
- ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 400, 2, false));
- ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 400, 2, false));
- }
- }
- */
+ /*
+ @Override
+ public void onHitEntity(Entity aEntity) {
+ if (aEntity instanceof EntityLiving) {
+ ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 400, 2, false));
+ ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 400, 2, false));
+ }
+ }
+ */
@Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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;
@@ -57,7 +70,7 @@ public class GT_Spray_Ice_Item extends GT_Tool_Item {
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if (aBlock == null) return false;
byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
-// TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ // TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (aBlock == Blocks.water || aBlock == Blocks.flowing_water) {
if (aMeta == 0 && GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) {
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 890ce9e8e9..355017b2ff 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
@@ -1,16 +1,15 @@
package gregtech.api.items;
import gregtech.api.util.GT_LanguageManager;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import java.util.List;
-
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);/*
+ 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));
@@ -19,32 +18,45 @@ public class GT_Spray_Pepper_Item extends GT_Tool_Item {
@Override
public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_1", "especially Pedobears, Care Bears,"));
- aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_2", "Confession Bears, Bear Grylls"));
- aList.add(GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".tooltip_3", "And ofcourse Man-Bear-Pig"));
+ aList.add(GT_LanguageManager.addStringLocalization(
+ getUnlocalizedName() + ".tooltip_1", "especially Pedobears, Care Bears,"));
+ aList.add(GT_LanguageManager.addStringLocalization(
+ getUnlocalizedName() + ".tooltip_2", "Confession Bears, Bear Grylls"));
+ aList.add(GT_LanguageManager.addStringLocalization(
+ getUnlocalizedName() + ".tooltip_3", "And ofcourse Man-Bear-Pig"));
+ }
+ /*
+ @Override
+ public void onHitEntity(Entity aEntity) {
+ if (aEntity instanceof EntityLiving) {
+ ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.blindness.getId(), 1200, 2, false));
+ ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 120, 2, false));
+ ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 200, 2, false));
+ ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.confusion.getId(), 600, 2, false));
+ }
}
- /*
- @Override
- public void onHitEntity(Entity aEntity) {
- if (aEntity instanceof EntityLiving) {
- ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.blindness.getId(), 1200, 2, false));
- ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 120, 2, false));
- ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 200, 2, false));
- ((EntityLiving)aEntity).addPotionEffect(new PotionEffect(Potion.confusion.getId(), 600, 2, false));
- }
- }
- */
+ */
@Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ public boolean onItemUseFirst(
+ ItemStack aStack,
+ EntityPlayer aPlayer,
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ 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;
}
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if (aBlock == null) return false;
-// byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
-// TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ // byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ);
+ // TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
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 736c7e4b13..78df3c9171 100644
--- a/src/main/java/gregtech/api/items/GT_Tool_Item.java
+++ b/src/main/java/gregtech/api/items/GT_Tool_Item.java
@@ -7,16 +7,54 @@ import net.minecraft.item.ItemStack;
* This is just a basic Tool, which has normal durability and could break Blocks.
*/
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) {
+ public GT_Tool_Item(
+ String aUnlocalized,
+ String aEnglish,
+ String aTooltip,
+ int aMaxDamage,
+ int aEntityDamage,
+ 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) {
- this(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) {
+ this(
+ 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) {
- super(aUnlocalized, aEnglish, aTooltip, aTooltip != null && !aTooltip.equals("Doesn't work as intended, this is a Bug"));
+ public GT_Tool_Item(
+ String aUnlocalized,
+ String aEnglish,
+ String aTooltip,
+ int aMaxDamage,
+ int aEntityDamage,
+ 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"));
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 16a8ec8cca..0fdaa90c1a 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -1,5 +1,8 @@
package gregtech.api.metatileentity;
+import static gregtech.GT_Mod.GT_FML_LOGGER;
+import static gregtech.api.enums.GT_Values.NW;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.SoundResource;
@@ -19,6 +22,7 @@ import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
+import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -35,22 +39,24 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
-import java.util.*;
-
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-import static gregtech.api.enums.GT_Values.NW;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
* This is the main TileEntity for EVERYTHING.
*/
-public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTechTileEntity, IPipeRenderedTileEntity, IDebugableTileEntity {
+public class BaseMetaPipeEntity extends CommonMetaTileEntity
+ 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;
+ private byte mColor = 0,
+ oColor = 0,
+ oStrongRedstone = 0,
+ oRedstoneData = 63,
+ oTextureData = 0,
+ oUpdateData = 0,
+ mLagWarningCount = 0;
private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0;
protected Node node;
protected NodePath nodePath;
@@ -100,8 +106,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
}
- public BaseMetaPipeEntity() {
- }
+ public BaseMetaPipeEntity() {}
@Override
public void writeToNBT(NBTTagCompound aNBT) {
@@ -141,7 +146,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
mColor = aNBT.getByte("mColor");
mWorks = !aNBT.getBoolean("mWorks");
- if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+ if (mSidedRedstone.length != 6) mSidedRedstone = new byte[] {0, 0, 0, 0, 0, 0};
readCoverNBT(aNBT);
loadMetaTileNBT(aNBT);
@@ -164,8 +169,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
oX = xCoord;
oY = yCoord;
oZ = zCoord;
- if (isServerSide())
- checkDropCover();
+ if (isServerSide()) checkDropCover();
else {
requestCoverDataIfNeeded();
}
@@ -186,15 +190,16 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
}
if (isServerSide() && mTickTimer > 10) {
- if (!doCoverThings())
- return;
+ if (!doCoverThings()) return;
final byte oldConnections = mConnections;
// Mask-out connection direction bits to keep only Foam related connections
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) {
- mConnections = (byte) ((mConnections & ~IConnectable.HAS_FRESHFOAM) | IConnectable.HAS_HARDENEDFOAM);
+ if ((mConnections & IConnectable.HAS_FOAM) == IConnectable.HAS_FRESHFOAM
+ && getRandomNumber(1000) == 0) {
+ mConnections =
+ (byte) ((mConnections & ~IConnectable.HAS_FRESHFOAM) | IConnectable.HAS_HARDENEDFOAM);
}
if (mTickTimer > 12 && oldConnections != mConnections)
GregTech_API.causeCableUpdate(worldObj, xCoord, yCoord, zCoord);
@@ -230,7 +235,12 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
byte tData = mMetaTileEntity.getUpdateData();
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));
+ 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));
if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
}
@@ -249,9 +259,16 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if (isServerSide() && hasValidMetaTileEntity()) {
tTime = System.nanoTime() - tTime;
if (mTimeStatistics.length > 0)
- mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
- if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING* 1000000L) && 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());
+ mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] =
+ (int) tTime;
+ if (tTime > 0
+ && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L)
+ && 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());
}
mWorkUpdate = mInventoryChanged = false;
@@ -260,20 +277,46 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
private void sendClientData() {
if (mSendClientData) {
NW.sendPacketToAllPlayersInRange(
- worldObj,
- new GT_Packet_TileEntity(
- xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], 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
- );
+ worldObj,
+ new GT_Packet_TileEntity(
+ xCoord,
+ (short) yCoord,
+ zCoord,
+ mID,
+ mCoverSides[0],
+ mCoverSides[1],
+ mCoverSides[2],
+ mCoverSides[3],
+ mCoverSides[4],
+ mCoverSides[5],
+ 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) {
+ 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) {
issueTextureUpdate();
if (aID > 0 && mID != aID) {
mID = aID;
@@ -347,7 +390,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
public ArrayList getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
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 : " "));
+ 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
+ : " "));
}
if (aLogLevel > 1) {
if (mTimeStatistics.length > 0) {
@@ -359,21 +408,27 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
tWorstTime = tTime;
}
}
- tList.add("Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + "ns since " + mTimeStatistics.length + " ticks with worst time of " + tWorstTime + "ns.");
+ tList.add("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.");
+ 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.");
}
if (mMetaTileEntity != null) {
- tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED+" not "+EnumChatFormatting.RESET) + "accessible for you");
+ tList.add("Is"
+ + (mMetaTileEntity.isAccessAllowed(aPlayer)
+ ? " "
+ : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET)
+ + "accessible for you");
}
}
- if(joinedIc2Enet)
- tList.add("Joined IC2 ENet");
+ if (joinedIc2Enet) tList.add("Joined IC2 ENet");
- return mMetaTileEntity != null ?
- mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList) :
- new ArrayList<>();
+ return mMetaTileEntity != null
+ ? mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList)
+ : new ArrayList<>();
}
@Override
@@ -382,7 +437,6 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
return false;
}
-
@Override
public byte getBackFacing() {
return GT_Utility.getOppositeSide(getFrontFacing());
@@ -415,7 +469,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
markDirty();
mInventoryChanged = true;
if (canAccessData())
- mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
+ mMetaTileEntity.setInventorySlotContents(
+ aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
}
@Override
@@ -432,14 +487,22 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
@Override
- public void openInventory() {/*Do nothing*/}
+ public void openInventory() {
+ /*Do nothing*/
+ }
@Override
- public void closeInventory() {/*Do nothing*/}
+ public void closeInventory() {
+ /*Do nothing*/
+ }
@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);
+ return hasValidMetaTileEntity()
+ && mTickTimer > 40
+ && getTileEntityOffset(0, 0, 0) == this
+ && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64
+ && mMetaTileEntity.isAccessAllowed(aPlayer);
}
@Override
@@ -541,7 +604,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
@Override
- public void setWorkDataValue(byte aValue) {/*Do nothing*/}
+ public void setWorkDataValue(byte aValue) {
+ /*Do nothing*/
+ }
@Override
public int getMetaTileID() {
@@ -559,7 +624,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
@Override
- public void setActive(boolean aActive) {/*Do nothing*/}
+ public void setActive(boolean aActive) {
+ /*Do nothing*/
+ }
@Override
public long getTimer() {
@@ -636,11 +703,10 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
return 0;
}
-
@Override
public ITexture[] getTexture(Block aBlock, byte aSide) {
ITexture rIcon = getCoverTexture(aSide);
- if (rIcon != null) return new ITexture[]{rIcon};
+ if (rIcon != null) return new ITexture[] {rIcon};
return getTextureUncovered(aSide);
}
@@ -664,11 +730,18 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if ((mConnections & IConnectable.HAS_HARDENEDFOAM) != 0) return Textures.BlockIcons.HARDENEDFOAMS[mColor];
if ((mConnections & IConnectable.HAS_FOAM) != 0) return Textures.BlockIcons.ERROR_RENDERING;
byte tConnections = mConnections;
- if (tConnections == IConnectable.CONNECTED_WEST || tConnections == IConnectable.CONNECTED_EAST) tConnections = (byte) (IConnectable.CONNECTED_WEST | IConnectable.CONNECTED_EAST);
- else if (tConnections == IConnectable.CONNECTED_DOWN || tConnections == IConnectable.CONNECTED_UP) tConnections = (byte) (IConnectable.CONNECTED_DOWN | IConnectable.CONNECTED_UP);
- else if (tConnections == IConnectable.CONNECTED_NORTH || tConnections == IConnectable.CONNECTED_SOUTH) tConnections = (byte) (IConnectable.CONNECTED_NORTH | IConnectable.CONNECTED_SOUTH);
+ if (tConnections == IConnectable.CONNECTED_WEST || tConnections == IConnectable.CONNECTED_EAST)
+ tConnections = (byte) (IConnectable.CONNECTED_WEST | IConnectable.CONNECTED_EAST);
+ else if (tConnections == IConnectable.CONNECTED_DOWN || tConnections == IConnectable.CONNECTED_UP)
+ tConnections = (byte) (IConnectable.CONNECTED_DOWN | IConnectable.CONNECTED_UP);
+ 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),
+ return mMetaTileEntity.getTexture(
+ this,
+ aSide,
+ tConnections,
+ (byte) (mColor - 1),
tConnections == 0 || (tConnections & (1 << aSide)) != 0,
getOutputRedstoneSignal(aSide) > 0);
return Textures.BlockIcons.ERROR_RENDERING;
@@ -679,7 +752,6 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;
}
-
@Override
public void doExplosion(long aAmount) {
if (canAccessData()) {
@@ -697,12 +769,11 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
for (byte i = 0; i < mCoverSides.length; i++) {
if (mCoverSides[i] != 0) {
if (mCoverData[i] != null) // this really shouldn't be null if a cover is there already, but whatever
- tNBT.setTag(COVER_DATA_NBT_KEYS[i], mCoverData[i].saveDataToNBT());
+ tNBT.setTag(COVER_DATA_NBT_KEYS[i], mCoverData[i].saveDataToNBT());
hasCover = true;
}
}
- if (hasCover)
- tNBT.setIntArray("mCoverSides", mCoverSides);
+ if (hasCover) tNBT.setIntArray("mCoverSides", mCoverSides);
if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT);
if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT);
return new ArrayList<>(Collections.singletonList(rStack));
@@ -711,9 +782,10 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
@Override
public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
if (isClientSide()) {
- //Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron
+ // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron
if (aPlayer.isSneaking()) {
- byte tSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) : aSide;
+ byte tSide =
+ (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) : aSide;
return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI());
} else if (getCoverBehaviorAtSideNew(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) {
return true;
@@ -722,7 +794,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if (isServerSide()) {
ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
if (tCurrentItem != null) {
- if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
+ if (getColorization() >= 0
+ && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
mMetaTileEntity.markDirty();
tCurrentItem.func_150996_a(Items.bucket);
setColorization((byte) -1);
@@ -733,33 +806,59 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if (mMetaTileEntity.onWrenchRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
mMetaTileEntity.markDirty();
GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
return true;
}
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) {
if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
- setCoverDataAtSide(tSide, getCoverBehaviorAtSideNew(tSide).onCoverScrewdriverClick(tSide, getCoverIDAtSide(tSide), getComplexCoverDataAtSide(tSide), this, aPlayer, 0.5F, 0.5F, 0.5F));
+ setCoverDataAtSide(
+ tSide,
+ getCoverBehaviorAtSideNew(tSide)
+ .onCoverScrewdriverClick(
+ tSide,
+ getCoverIDAtSide(tSide),
+ getComplexCoverDataAtSide(tSide),
+ this,
+ 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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
} else {
if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- setCoverDataAtSide(aSide, getCoverBehaviorAtSideNew(aSide).onCoverScrewdriverClick(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
+ setCoverDataAtSide(
+ aSide,
+ getCoverBehaviorAtSideNew(aSide)
+ .onCoverScrewdriverClick(
+ aSide,
+ getCoverIDAtSide(aSide),
+ getComplexCoverDataAtSide(aSide),
+ this,
+ 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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
}
return true;
}
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
- //if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord);
- //}
+ // if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord,
+ // zCoord);
+ // }
return true;
}
@@ -768,8 +867,14 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if (mWorks) disableWorking();
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")));
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1, xCoord, yCoord, zCoord);
+ GT_Utility.sendChatToPlayer(
+ 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);
}
return true;
}
@@ -777,23 +882,33 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) {
if (mMetaTileEntity.onWireCutterRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
mMetaTileEntity.markDirty();
- //logic handled internally
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
+ // logic handled internally
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
doEnetUpdate();
return true;
}
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
- if (mMetaTileEntity.onSolderingToolRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ if (mMetaTileEntity.onSolderingToolRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
mMetaTileEntity.markDirty();
- //logic handled internally
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 1.0F, -1, xCoord, yCoord, zCoord);
+ // logic handled internally
+ GT_Utility.sendSoundToPlayers(
+ 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")));
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 3.0F, -1, xCoord, yCoord, zCoord);
+ 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")));
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 3.0F, -1, xCoord, yCoord, zCoord);
issueBlockUpdate();
}
doEnetUpdate();
@@ -805,43 +920,59 @@ public class BaseMetaPipeEntity 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)))
- {
+ if (GregTech_API.getCoverBehaviorNew(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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
return true;
}
} else {
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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.RANDOM_BREAK, 1.0F, -1, xCoord, yCoord, zCoord);
dropCover(coverSide, aSide, false);
mMetaTileEntity.markDirty();
}
return true;
}
}
- }
- else if (aPlayer.isSneaking()) { //Sneak click, no tool -> open cover config or turn back.
+ } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config or turn back.
aSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) : aSide;
- return getCoverIDAtSide(aSide) > 0 && getCoverBehaviorAtSideNew(aSide).onCoverShiftRightClick(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this, aPlayer);
+ 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;
+ if (getCoverBehaviorAtSideNew(aSide)
+ .onCoverRightClick(
+ aSide,
+ getCoverIDAtSide(aSide),
+ getComplexCoverDataAtSide(aSide),
+ this,
+ aPlayer,
+ aX,
+ aY,
+ aZ)) return true;
}
- if (!getCoverBehaviorAtSideNew(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
- return false;
+ if (!getCoverBehaviorAtSideNew(aSide)
+ .isGUIClickable(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this)) return false;
try {
if (!aPlayer.isSneaking() && hasValidMetaTileEntity()) {
boolean handled = mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ);
- if(handled) {
+ if (handled) {
mMetaTileEntity.markDirty();
}
return handled;
@@ -896,8 +1027,21 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
*/
@Override
public int[] getAccessibleSlotsFromSide(int aSide) {
- if (canAccessData() && (getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getComplexCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getComplexCoverDataAtSide((byte) aSide), -1, this)))
- return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
+ if (canAccessData()
+ && (getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ -1,
+ this)
+ || getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ -1,
+ this))) return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
return GT_Values.emptyIntArray;
}
@@ -906,7 +1050,15 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
*/
@Override
public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return canAccessData() && getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getComplexCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
+ return canAccessData()
+ && getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ aIndex,
+ this)
+ && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
}
/**
@@ -914,7 +1066,15 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
*/
@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);
+ return canAccessData()
+ && getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ aIndex,
+ this)
+ && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
}
@Override
@@ -997,9 +1157,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
@Override
- public void setOwnerUuid(UUID uuid) {
-
- }
+ public void setOwnerUuid(UUID uuid) {}
@Override
public byte getComparatorValue(byte aSide) {
@@ -1039,42 +1197,63 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
private boolean canMoveFluidOnSide(ForgeDirection aSide, Fluid aFluid, boolean isFill) {
- if (aSide == ForgeDirection.UNKNOWN)
- return true;
+ if (aSide == ForgeDirection.UNKNOWN) return true;
IFluidHandler tTileEntity = getITankContainerAtSide((byte) aSide.ordinal());
- // Only require a connection if there's something to connect to - Allows fluid cells & buckets to interact with the pipe
- if (tTileEntity != null && !mMetaTileEntity.isConnectedAtSide((byte) aSide.ordinal()))
- return false;
-
- if(isFill && mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))
- return true;
-
- if (!isFill && mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
- && getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()),aFluid, this))
- return true;
+ // Only require a connection if there's something to connect to - Allows fluid cells & buckets to interact with
+ // the pipe
+ if (tTileEntity != null && !mMetaTileEntity.isConnectedAtSide((byte) aSide.ordinal())) return false;
+
+ if (isFill
+ && mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidIn(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid,
+ this)) return true;
+
+ if (!isFill
+ && mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid,
+ this)) return true;
return false;
}
@Override
public int fill(ForgeDirection aSide, FluidStack aFluidStack, boolean doFill) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true))
+ if (mTickTimer > 5
+ && canAccessData()
+ && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true))
return mMetaTileEntity.fill(aSide, aFluidStack, doFill);
return 0;
}
@Override
public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, mMetaTileEntity.getFluid() == null ? null : mMetaTileEntity.getFluid().getFluid(), false))
- return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
+ if (mTickTimer > 5
+ && canAccessData()
+ && canMoveFluidOnSide(
+ aSide,
+ mMetaTileEntity.getFluid() == null
+ ? null
+ : mMetaTileEntity.getFluid().getFluid(),
+ false)) return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
return null;
}
@Override
public FluidStack drain(ForgeDirection aSide, FluidStack aFluidStack, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false))
+ if (mTickTimer > 5
+ && canAccessData()
+ && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false))
return mMetaTileEntity.drain(aSide, aFluidStack, doDrain);
return null;
}
@@ -1096,15 +1275,26 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
if (canAccessData()
- && (aSide == ForgeDirection.UNKNOWN
- || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), null, this))
- || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), null, this))
- // Doesn't need to be connected to get Tank Info -- otherwise things can't connect
- )
- )
- return mMetaTileEntity.getTankInfo(aSide);
- return new FluidTankInfo[]{};
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidIn(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ null,
+ this))
+ || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ null,
+ this))
+ // Doesn't need to be connected to get Tank Info -- otherwise things can't connect
+ )) return mMetaTileEntity.getTankInfo(aSide);
+ return new FluidTankInfo[] {};
}
@Override
@@ -1117,7 +1307,9 @@ public class BaseMetaPipeEntity 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())) {
markDirty();
tStack.stackSize += aStack.stackSize;
return true;
@@ -1183,7 +1375,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
public String[] getInfoData() {
{
if (canAccessData()) return getMetaTileEntity().getInfoData();
- return new String[]{};
+ return new String[] {};
}
}
@@ -1196,7 +1388,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
if (canAccessData()) {
final IMetaTileEntity meta = getMetaTileEntity();
if (meta instanceof MetaPipeEntity) {
- // Trigger a checking of connections in case someone placed down a block that the pipe/wire shouldn't be connected to.
+ // Trigger a checking of connections in case someone placed down a block that the pipe/wire shouldn't be
+ // connected to.
// However; don't do it immediately in case the world isn't finished loading
// (This caused issues with AE2 GTEU p2p connections.
((MetaPipeEntity) meta).setCheckConnections();
@@ -1210,7 +1403,14 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
}
@Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) {
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ 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 b68715770c..911c1cabcb 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -1,5 +1,10 @@
package gregtech.api.metatileentity;
+import static gregtech.GT_Mod.GT_FML_LOGGER;
+import static gregtech.api.enums.GT_Values.NW;
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+
import appeng.api.networking.IGridNode;
import appeng.api.networking.security.IActionHost;
import appeng.api.util.AECableType;
@@ -9,11 +14,9 @@ import appeng.me.helpers.IGridProxyable;
import appeng.tile.TileEvent;
import appeng.tile.events.TileEventType;
import com.gtnewhorizon.structurelib.alignment.IAlignment;
-import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructableProvider;
-import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.ReflectionHelper;
import gregtech.GT_Mod;
@@ -38,6 +41,9 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.*;
import gregtech.common.GT_Pollution;
import ic2.api.Direction;
+import java.lang.reflect.Field;
+import java.util.*;
+import javax.annotation.Nullable;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.block.Block;
@@ -61,27 +67,34 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
-import javax.annotation.Nullable;
-import java.lang.reflect.Field;
-import java.util.*;
-
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-import static gregtech.api.enums.GT_Values.NW;
-import static gregtech.api.enums.GT_Values.V;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
* This is the main TileEntity for EVERYTHING.
*/
-@Optional.InterfaceList(value = {
- @Optional.Interface(iface = "appeng.api.networking.security.IActionHost", modid = "appliedenergistics2", striprefs = true),
- @Optional.Interface(iface = "appeng.me.helpers.IGridProxyable", modid = "appliedenergistics2", striprefs = true)})
-public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTechTileEntity, IActionHost, IGridProxyable, IAlignmentProvider, IConstructableProvider, IDebugableTileEntity, IGregtechWailaProvider {
- 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};
+@Optional.InterfaceList(
+ value = {
+ @Optional.Interface(
+ iface = "appeng.api.networking.security.IActionHost",
+ modid = "appliedenergistics2",
+ striprefs = true),
+ @Optional.Interface(
+ iface = "appeng.me.helpers.IGridProxyable",
+ modid = "appliedenergistics2",
+ striprefs = true)
+ })
+public class BaseMetaTileEntity extends CommonMetaTileEntity
+ implements IGregTechTileEntity,
+ IActionHost,
+ IGridProxyable,
+ IAlignmentProvider,
+ IConstructableProvider,
+ IDebugableTileEntity,
+ IGregtechWailaProvider {
+ 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];
public long mLastSoundTick = 0;
public boolean mWasShutdown = false;
@@ -89,12 +102,29 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
protected long mStoredEnergy = 0, mStoredSteam = 0;
protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0;
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;
+ 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;
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;
- private byte oLightValueClient = -1, oLightValue = -1, mLightValue = 0, mOtherUpgrades = 0, mFacing = 0, oFacing = 0, mWorkData = 0;
+ private byte mColor = 0,
+ oColor = 0,
+ oStrongRedstone = 0,
+ oRedstoneData = 63,
+ oTextureData = 0,
+ oUpdateData = 0,
+ oTexturePage = 0;
+ private byte oLightValueClient = -1,
+ oLightValue = -1,
+ mLightValue = 0,
+ mOtherUpgrades = 0,
+ mFacing = 0,
+ oFacing = 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;
@@ -103,8 +133,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
private NBTTagCompound mRecipeStuff = new NBTTagCompound();
private int cableUpdateDelay = 30;
- public BaseMetaTileEntity() {
- }
+ public BaseMetaTileEntity() {}
@Override
public void writeToNBT(NBTTagCompound aNBT) {
@@ -152,7 +181,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (aID > 0) mID = aID;
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});
+ mSidedRedstone = (hasValidMetaTileEntity() && mMetaTileEntity.hasSidedRedstoneOutputBehavior()
+ ? 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;
@@ -175,7 +206,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
mWorks = !aNBT.getBoolean("mWorks");
mInputDisabled = aNBT.getBoolean("mInputDisabled");
mOutputDisabled = aNBT.getBoolean("mOutputDisabled");
- mOtherUpgrades = (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries") + aNBT.getByte("mLiBatteries"));
+ mOtherUpgrades =
+ (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries") + aNBT.getByte("mLiBatteries"));
mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
final int nbtVersion = aNBT.getInteger("nbtVersion");
@@ -184,11 +216,11 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
}
if (mCoverData == null || mCoverData.length != 6) mCoverData = new ISerializableObject[6];
- if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
+ if (mCoverSides.length != 6) mCoverSides = new int[] {0, 0, 0, 0, 0, 0};
if (mSidedRedstone.length != 6)
if (hasValidMetaTileEntity() && mMetaTileEntity.hasSidedRedstoneOutputBehavior())
- mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
- else mSidedRedstone = new byte[]{15, 15, 15, 15, 15, 15};
+ mSidedRedstone = new byte[] {0, 0, 0, 0, 0, 0};
+ else mSidedRedstone = new byte[] {15, 15, 15, 15, 15, 15};
updateCoverBehavior();
}
@@ -205,14 +237,29 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
* Called when trying to charge Items
*/
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);
+ decreaseStoredEU(
+ GT_ModHandler.chargeElectricItem(
+ aStack,
+ (int) Math.min(Integer.MAX_VALUE, getStoredEU()),
+ (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()),
+ false,
+ false),
+ true);
}
/**
* Called when trying to discharge Items
*/
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);
+ 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);
}
protected boolean isRainPossible() {
@@ -274,7 +321,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (mNeedsUpdate) {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- //worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ // worldObj.func_147479_m(xCoord, yCoord, zCoord);
mNeedsUpdate = false;
}
}
@@ -340,12 +387,15 @@ 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 tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage);
+ 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);
if (tUsableAmperage > 0) {
- final long tEU = tOutputVoltage * Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this);
+ final long tEU =
+ tOutputVoltage * Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this);
mAverageEUOutput[mAverageEUOutputIndex] += tEU;
decreaseStoredEU(tEU, true);
}
@@ -362,26 +412,46 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
}
if (getRandomNumber(1000) == 0 && isRainPossible()) {
- final int precipitationHeightAtSide2 = worldObj.getPrecipitationHeight(xCoord, zCoord - 1);
- final int precipitationHeightAtSide3 = worldObj.getPrecipitationHeight(xCoord, zCoord + 1);
- final int precipitationHeightAtSide4 = worldObj.getPrecipitationHeight(xCoord - 1, zCoord);
- final int precipitationHeightAtSide5 = worldObj.getPrecipitationHeight(xCoord + 1, zCoord);
-
- if ((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)) {
+ final int precipitationHeightAtSide2 =
+ worldObj.getPrecipitationHeight(xCoord, zCoord - 1);
+ final int precipitationHeightAtSide3 =
+ worldObj.getPrecipitationHeight(xCoord, zCoord + 1);
+ final int precipitationHeightAtSide4 =
+ worldObj.getPrecipitationHeight(xCoord - 1, zCoord);
+ final int precipitationHeightAtSide5 =
+ worldObj.getPrecipitationHeight(xCoord + 1, zCoord);
+
+ if ((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)) {
if (GregTech_API.sMachineRainExplosions && worldObj.isRaining()) {
if (getRandomNumber(10) == 0) {
try {
- GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");
+ GT_Mod.achievements.issueAchievement(
+ 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!");
+ GT_Log.exp.println("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!");
+ GT_Log.exp.println("Machine at: " + this.getXCoord() + " | "
+ + this.getYCoord() + " | " + this.getZCoord() + " DIMID: "
+ + this.worldObj.provider.dimensionId
+ + " set to Fire due to rain!");
setOnFire();
}
}
@@ -389,12 +459,18 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
mRunningThroughTick = false;
return;
}
- if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getRandomNumber(3) == 0) {
+ if (GregTech_API.sMachineThunderExplosions
+ && worldObj.isThundering()
+ && getRandomNumber(3) == 0) {
try {
- GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");
+ GT_Mod.achievements.issueAchievement(
+ 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!");
+ GT_Log.exp.println("Machine at: " + this.getXCoord() + " | " + this.getYCoord()
+ + " | " + this.getZCoord() + " DIMID: "
+ + this.worldObj.provider.dimensionId
+ + " explosion due to Thunderstorm!");
doEnergyExplosion();
}
}
@@ -409,12 +485,21 @@ 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++) {
+ for (int i = mMetaTileEntity.dechargerSlotStartIndex(),
+ 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()) {
- increaseStoredEnergyUnits((long) ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]), false);
+ if ((getStoredEU()
+ + ic2.api.info.Info.itemEnergy.getEnergyValue(
+ mMetaTileEntity.mInventory[i]))
+ < getEUCapacity()) {
+ increaseStoredEnergyUnits(
+ (long) ic2.api.info.Info.itemEnergy.getEnergyValue(
+ mMetaTileEntity.mInventory[i]),
+ false);
mMetaTileEntity.mInventory[i].stackSize--;
mInventoryChanged = true;
}
@@ -429,7 +514,10 @@ 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++) {
+ for (int i = mMetaTileEntity.rechargerSlotStartIndex(),
+ k = mMetaTileEntity.rechargerSlotCount() + i;
+ i < k;
+ i++) {
if (getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) {
chargeItem(mMetaTileEntity.mInventory[i]);
if (mMetaTileEntity.mInventory[i].stackSize <= 0) {
@@ -460,7 +548,11 @@ 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));
+ byte tData = (byte) ((mFacing & 7)
+ | (mActive ? 8 : 0)
+ | (mRedstone ? 16 : 0)
+ | (mLockUpgrade ? 32 : 0)
+ | (mWorks ? 64 : 0));
if (tData != oTextureData)
sendBlockEvent(GregTechTileClientEvents.CHANGE_COMMON_DATA, oTextureData = tData);
@@ -470,10 +562,16 @@ 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
+ sendBlockEvent(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));
+ 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));
if (tData != oRedstoneData)
sendBlockEvent(GregTechTileClientEvents.CHANGE_REDSTONE_OUTPUT, oRedstoneData = tData);
if (mLightValue != oLightValue) {
@@ -505,16 +603,24 @@ 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;
- if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L) && 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());
+ mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] =
+ (int) tTime;
+ if (tTime > 0
+ && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L)
+ && 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());
}
mWorkUpdate = mInventoryChanged = mRunningThroughTick = false;
}
@Override
- public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(
+ ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
if (hasValidMetaTileEntity() && getMetaTileEntity() != null) {
getMetaTileEntity().getWailaBody(itemStack, currenttip, accessor, config);
}
@@ -522,7 +628,8 @@ 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) {
+ public void getWailaNBTData(
+ EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
if (hasValidMetaTileEntity() && getMetaTileEntity() != null) {
getMetaTileEntity().getWailaNBTData(player, tile, tag, world, x, y, z);
@@ -532,22 +639,55 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
private void sendClientData() {
if (mSendClientData) {
NW.sendPacketToAllPlayersInRange(
- worldObj,
- new GT_Packet_TileEntity(
- xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5],
- 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
- );
+ worldObj,
+ new GT_Packet_TileEntity(
+ xCoord,
+ (short) yCoord,
+ zCoord,
+ mID,
+ mCoverSides[0],
+ mCoverSides[1],
+ mCoverSides[2],
+ mCoverSides[3],
+ mCoverSides[4],
+ mCoverSides[5],
+ 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) {
+ 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) {
issueTextureUpdate();
if (mID != aID && aID > 0) {
mID = aID;
@@ -569,11 +709,33 @@ 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) {
- receiveMetaTileEntityData(aID, aCover0, aCover1, aCover2, aCover3, aCover4, aCover5, aTextureData, (byte) 0, aUpdateData, aRedstoneData, aColorData);
+ 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) {
+ receiveMetaTileEntityData(
+ aID,
+ aCover0,
+ aCover1,
+ aCover2,
+ aCover3,
+ aCover4,
+ aCover5,
+ aTextureData,
+ (byte) 0,
+ aUpdateData,
+ aRedstoneData,
+ aColorData);
}
-
@Override
public boolean receiveClientEvent(int aEventID, int aValue) {
super.receiveClientEvent(aEventID, aValue);
@@ -582,7 +744,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
try {
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!!!");
+ 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!!!");
e.printStackTrace(GT_Log.err);
}
}
@@ -594,15 +757,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
mFacing = (byte) (aValue & 7);
mActive = ((aValue & 8) != 0);
mRedstone = ((aValue & 16) != 0);
- //mLockUpgrade = ((aValue&32) != 0);
+ // mLockUpgrade = ((aValue&32) != 0);
mWorks = ((aValue & 64) != 0);
break;
case GregTechTileClientEvents.CHANGE_CUSTOM_DATA:
if (hasValidMetaTileEntity()) {
- if ((aValue & 0x80) == 0) //Is texture index
- mMetaTileEntity.onValueUpdate((byte) (aValue & 0x7F));
- else if (mMetaTileEntity instanceof GT_MetaTileEntity_Hatch)//is texture page and hatch
- ((GT_MetaTileEntity_Hatch) mMetaTileEntity).onTexturePageUpdate((byte) (aValue & 0x7F));
+ if ((aValue & 0x80) == 0) // Is texture index
+ mMetaTileEntity.onValueUpdate((byte) (aValue & 0x7F));
+ else if (mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) // is texture page and hatch
+ ((GT_MetaTileEntity_Hatch) mMetaTileEntity).onTexturePageUpdate((byte) (aValue & 0x7F));
}
break;
case GregTechTileClientEvents.CHANGE_COLOR:
@@ -641,7 +804,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
public ArrayList getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
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 : " "));
+ 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
+ : " "));
}
if (aLogLevel > 1) {
if (mTimeStatistics.length > 0) {
@@ -653,27 +822,40 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
tWorstTime = tTime;
}
// Uncomment this line to print out tick-by-tick times.
- //tList.add("tTime " + tTime);
+ // 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.");
- tList.add("Recorded " + GT_Utility.formatNumbers(mMetaTileEntity.mSoundRequests) + " sound requests in " + GT_Utility.formatNumbers(mTickTimer - mLastCheckTick) + " ticks.");
+ 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.");
+ tList.add("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.");
+ 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.");
}
- tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you");
+ tList.add("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");
- tList.add("Machine is " + (mActive ? EnumChatFormatting.GREEN + "active" + EnumChatFormatting.RESET : EnumChatFormatting.RED + "inactive" + EnumChatFormatting.RESET));
+ tList.add(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);
+ tList.add(
+ EnumChatFormatting.RED + "ATTENTION: This Device needs more power." + EnumChatFormatting.RESET);
}
- if (joinedIc2Enet)
- tList.add("Joined IC2 ENet");
+ if (joinedIc2Enet) tList.add("Joined IC2 ENet");
return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
}
@@ -729,7 +911,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
mInventoryChanged = true;
if (canAccessData()) {
markDirty();
- mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
+ mMetaTileEntity.setInventorySlotContents(
+ aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
}
}
@@ -758,9 +941,12 @@ 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);
+ 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);
}
@Override
@@ -774,8 +960,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
tileEntityInvalid = false;
leaveEnet();
if (canAccessData()) {
- if (GregTech_API.mAE2)
- invalidateAE();
+ if (GregTech_API.mAE2) invalidateAE();
mMetaTileEntity.onRemoval();
mMetaTileEntity.setBaseMetaTileEntity(null);
}
@@ -785,8 +970,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
public void onChunkUnload() {
super.onChunkUnload();
- if (GregTech_API.mAE2)
- onChunkUnloadAE();
+ if (GregTech_API.mAE2) onChunkUnloadAE();
}
@Override
@@ -898,7 +1082,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
if (!canAccessData()) return false;
- return mHasEnoughEnergy = decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy) || decreaseStoredSteam(aEnergy, false) || (aIgnoreTooLessEnergy && (decreaseStoredSteam(aEnergy, true)));
+ return mHasEnoughEnergy = decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy)
+ || decreaseStoredSteam(aEnergy, false)
+ || (aIgnoreTooLessEnergy && (decreaseStoredSteam(aEnergy, true)));
}
@Override
@@ -1039,9 +1225,10 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
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;
+ final ITexture[] textureUncovered = hasValidMetaTileEntity()
+ ? 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);
@@ -1054,8 +1241,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
private boolean isEnergyInputSide(byte aSide) {
if (aSide >= 0 && aSide < 6) {
- if (!getCoverBehaviorAtSideNew(aSide).letsEnergyIn(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
- return false;
+ if (!getCoverBehaviorAtSideNew(aSide)
+ .letsEnergyIn(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this)) return false;
if (isInvalid() || mReleaseEnergy) return false;
if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetInput())
return mMetaTileEntity.isInputFacing(aSide);
@@ -1065,7 +1252,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
private boolean isEnergyOutputSide(byte aSide) {
if (aSide >= 0 && aSide < 6) {
- if (!getCoverBehaviorAtSideNew(aSide).letsEnergyOut(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
+ if (!getCoverBehaviorAtSideNew(aSide)
+ .letsEnergyOut(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
return false;
if (isInvalid() || mReleaseEnergy) return mReleaseEnergy;
if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetOutput())
@@ -1133,7 +1321,10 @@ 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());
+ return !privateAccess()
+ || aPlayer.getDisplayName().equals("Player")
+ || mOwnerName.equals("Player")
+ || mOwnerName.equals(aPlayer.getDisplayName());
return true;
}
@@ -1144,10 +1335,15 @@ 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!");
-
- doExplosion(oOutput * (getUniversalEnergyStored() >= getUniversalEnergyCapacity() ? 4 : getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 2 ? 2 : 1));
- GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "electricproblems");
+ GT_Log.exp.println("Energy Explosion, injected " + getUniversalEnergyStored() + "EU >= "
+ + getUniversalEnergyCapacity() / 5D + "Capacity of the Machine!");
+
+ doExplosion(oOutput
+ * (getUniversalEnergyStored() >= getUniversalEnergyCapacity()
+ ? 4
+ : getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 2 ? 2 : 1));
+ GT_Mod.achievements.issueAchievement(
+ this.getWorldObj().getPlayerEntityByName(mOwnerName), "electricproblems");
}
}
@@ -1189,9 +1385,15 @@ 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()));
+ 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()));
if (tItem.hasTagCompound()) {
- tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
+ tItemEntity.getEntityItem().setTagCompound((NBTTagCompound)
+ tItem.getTagCompound().copy());
}
tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D);
tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D);
@@ -1199,8 +1401,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
tItemEntity.hurtResistantTime = 999999;
tItemEntity.lifespan = 60000;
try {
- if (ENTITY_ITEM_HEALTH_FIELD != null)
- ENTITY_ITEM_HEALTH_FIELD.setInt(tItemEntity, 99999999);
+ if (ENTITY_ITEM_HEALTH_FIELD != null) ENTITY_ITEM_HEALTH_FIELD.setInt(tItemEntity, 99999999);
} catch (Exception ignored) {
}
this.worldObj.spawnEntityInWorld(tItemEntity);
@@ -1232,34 +1433,43 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
if (isClientSide()) {
- //Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron
+ // 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;
+ final byte tSide =
+ (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) : aSide;
return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI());
} else if (getCoverBehaviorAtSideNew(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) {
return true;
}
- if (!getCoverBehaviorAtSideNew(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
+ if (!getCoverBehaviorAtSideNew(aSide)
+ .isGUIClickable(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
return false;
}
if (isServerSide()) {
if (!privateAccess() || aPlayer.getDisplayName().equalsIgnoreCase(getOwnerName())) {
final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
if (tCurrentItem != null) {
- if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
+ if (getColorization() >= 0
+ && 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))) {
+ if (aPlayer.isSneaking()
+ && mMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine
+ && ((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);
+ 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)) {
+ } 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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
cableUpdateDelay = 10;
}
return true;
@@ -1267,9 +1477,21 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
- setCoverDataAtSide(aSide, getCoverBehaviorAtSideNew(aSide).onCoverScrewdriverClick(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
+ setCoverDataAtSide(
+ aSide,
+ getCoverBehaviorAtSideNew(aSide)
+ .onCoverScrewdriverClick(
+ aSide,
+ 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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
return true;
}
@@ -1278,8 +1500,18 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
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"))));
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1, xCoord, yCoord, zCoord);
+ 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"))));
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1, xCoord, yCoord, zCoord);
}
return true;
}
@@ -1289,12 +1521,23 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (mWorks) disableWorking();
else enableWorking();
{
- String tChat = GT_Utility.trans("090", "Machine Processing: ") + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") : GT_Utility.trans("087", "Disabled"));
- if (getMetaTileEntity() != null && getMetaTileEntity().hasAlternativeModeText())
+ String tChat = GT_Utility.trans("090", "Machine Processing: ")
+ + (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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj,
+ SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE,
+ 1.0F,
+ -1,
+ xCoord,
+ yCoord,
+ zCoord);
}
return true;
}
@@ -1302,12 +1545,21 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
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);
+ // logic handled internally
+ GT_Utility.sendSoundToPlayers(
+ 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")));
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 3.0F, -1, xCoord, yCoord, zCoord);
+ 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")));
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_BATTERY_USE, 3.0F, -1, xCoord, yCoord, zCoord);
issueBlockUpdate();
}
doEnetUpdate();
@@ -1318,8 +1570,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) {
final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
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);
+ // logic handled internally
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
doEnetUpdate();
cableUpdateDelay = 10;
@@ -1331,38 +1584,60 @@ 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))) {
+ if (GregTech_API.getCoverBehaviorNew(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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1, xCoord, yCoord, zCoord);
}
return true;
}
} else {
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);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.RANDOM_BREAK, 1.0F, -1, xCoord, yCoord, zCoord);
dropCover(coverSide, aSide, false);
}
return true;
}
}
- } 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;
- return getCoverIDAtSide(aSide) > 0 && getCoverBehaviorAtSideNew(aSide).onCoverShiftRightClick(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this, aPlayer);
+ } 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;
+ 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;
-
- if (!getCoverBehaviorAtSideNew(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
+ if (getCoverBehaviorAtSideNew(aSide)
+ .onCoverRightClick(
+ aSide,
+ getCoverIDAtSide(aSide),
+ getComplexCoverDataAtSide(aSide),
+ this,
+ aPlayer,
+ aX,
+ aY,
+ aZ)) return true;
+
+ if (!getCoverBehaviorAtSideNew(aSide)
+ .isGUIClickable(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this))
return false;
if (isUpgradable() && tCurrentItem != null) {
if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) {
if (addMufflerUpgrade()) {
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.RANDOM_CLICK, 1.0F, -1, xCoord, yCoord, zCoord);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.RANDOM_CLICK, 1.0F, -1, xCoord, yCoord, zCoord);
if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--;
}
return true;
@@ -1372,7 +1647,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
mLockUpgrade = true;
setOwnerName(aPlayer.getDisplayName());
setOwnerUuid(aPlayer.getUniqueID());
- GT_Utility.sendSoundToPlayers(worldObj, SoundResource.RANDOM_CLICK, 1.0F, -1, xCoord, yCoord, zCoord);
+ GT_Utility.sendSoundToPlayers(
+ worldObj, SoundResource.RANDOM_CLICK, 1.0F, -1, xCoord, yCoord, zCoord);
if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--;
}
return true;
@@ -1385,7 +1661,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
if (!aPlayer.isSneaking() && hasValidMetaTileEntity())
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!!!");
+ 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!!!");
e.printStackTrace(GT_Log.err);
}
@@ -1397,7 +1674,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
try {
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!!!");
+ 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!!!");
e.printStackTrace(GT_Log.err);
}
}
@@ -1439,8 +1717,21 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
*/
@Override
public int[] getAccessibleSlotsFromSide(int aSide) {
- if (canAccessData() && (getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getComplexCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getComplexCoverDataAtSide((byte) aSide), -1, this)))
- return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
+ if (canAccessData()
+ && (getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ -1,
+ this)
+ || getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ -1,
+ this))) return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
return GT_Values.emptyIntArray;
}
@@ -1449,7 +1740,16 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
*/
@Override
public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return canAccessData() && (mRunningThroughTick || !mInputDisabled) && getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getComplexCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
+ return canAccessData()
+ && (mRunningThroughTick || !mInputDisabled)
+ && getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ aIndex,
+ this)
+ && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
}
/**
@@ -1457,7 +1757,16 @@ 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);
+ return canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ getCoverIDAtSide((byte) aSide),
+ getComplexCoverDataAtSide((byte) aSide),
+ aIndex,
+ this)
+ && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
}
@Override
@@ -1471,7 +1780,6 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
return mMetaTileEntity.allowGeneralRedstoneOutput() ? mSidedRedstone[aSide] : 0;
}
-
@Override
public boolean isSteamEngineUpgradable() {
return isUpgradable() && !hasSteamEngineUpgrade() && getSteamCapacity() > 0;
@@ -1546,22 +1854,17 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
public long getAverageElectricInput() {
long rEU = 0;
- for (int i = 0; i < mAverageEUInput.length; ++i)
- if (i != mAverageEUInputIndex)
- rEU += mAverageEUInput[i];
+ for (int i = 0; i < mAverageEUInput.length; ++i) if (i != mAverageEUInputIndex) rEU += mAverageEUInput[i];
return rEU / (mAverageEUInput.length - 1);
}
@Override
public long getAverageElectricOutput() {
long rEU = 0;
- for (int i = 0; i < mAverageEUOutput.length; ++i)
- if (i != mAverageEUOutputIndex)
- rEU += mAverageEUOutput[i];
+ for (int i = 0; i < mAverageEUOutput.length; ++i) if (i != mAverageEUOutputIndex) rEU += mAverageEUOutput[i];
return rEU / (mAverageEUOutput.length - 1);
}
-
@Override
protected void updateOutputRedstoneSignal(byte aSide) {
if (mMetaTileEntity.hasSidedRedstoneOutputBehavior()) {
@@ -1598,7 +1901,6 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
return canAccessData() ? mMetaTileEntity.getComparatorValue(aSide) : 0;
}
-
@Override
public ItemStack decrStackSize(int aIndex, int aAmount) {
if (canAccessData()) {
@@ -1610,14 +1912,27 @@ 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;
+ if (!canAccessData()
+ || !mMetaTileEntity.isElectric()
+ || !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)) {
+ if (increaseStoredEnergyUnits(
+ aVoltage
+ * (aAmperage = Math.min(
+ aAmperage,
+ Math.min(
+ mMetaTileEntity.maxAmperesIn() - mAcceptedAmperes,
+ 1 + ((getEUCapacity() - getStoredEU()) / aVoltage)))),
+ true)) {
mAverageEUInput[mAverageEUInputIndex] += aVoltage * aAmperage;
mAcceptedAmperes += aAmperage;
return aAmperage;
@@ -1627,8 +1942,10 @@ 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;
+ if (!canAccessData()
+ || !mMetaTileEntity.isElectric()
+ || !outputsEnergyTo(aSide)
+ || getStoredEU() - (aVoltage * aAmperage) < mMetaTileEntity.getMinimumStoredEU()) return false;
if (decreaseStoredEU(aVoltage * aAmperage, false)) {
mAverageEUOutput[mAverageEUOutputIndex] += aVoltage * aAmperage;
return true;
@@ -1650,81 +1967,90 @@ 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()) &&
- getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), aFluid == null ? null : aFluid.getFluid(), this)
- )
- )
- )
- return mMetaTileEntity.fill(aSide, aFluid, doFill);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mInputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidIn(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid == null ? null : aFluid.getFluid(),
+ this)))) return mMetaTileEntity.fill(aSide, aFluid, doFill);
return 0;
}
@Override
public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() &&
- (mRunningThroughTick || !mOutputDisabled) &&
- (
- aSide == ForgeDirection.UNKNOWN ||
- (
- mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) &&
- getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), mMetaTileEntity.getFluid() == null ? null : mMetaTileEntity.getFluid().getFluid(), this)
- )
- )
- )
- return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ mMetaTileEntity.getFluid() == null
+ ? null
+ : mMetaTileEntity
+ .getFluid()
+ .getFluid(),
+ this)))) return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
return null;
}
@Override
public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() &&
- (mRunningThroughTick || !mOutputDisabled) &&
- (
- aSide == ForgeDirection.UNKNOWN ||
- (
- mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) &&
- getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), aFluid == null ? null : aFluid.getFluid(), this)
- )
- )
- )
- return mMetaTileEntity.drain(aSide, aFluid, doDrain);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid == null ? null : aFluid.getFluid(),
+ this)))) return mMetaTileEntity.drain(aSide, aFluid, doDrain);
return null;
}
@Override
public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() &&
- (mRunningThroughTick || !mInputDisabled) &&
- (
- aSide == ForgeDirection.UNKNOWN ||
- (
- mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) &&
- getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), aFluid, this)
- )
- )
- )
- return mMetaTileEntity.canFill(aSide, aFluid);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mInputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidIn(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid,
+ this)))) return mMetaTileEntity.canFill(aSide, aFluid);
return false;
}
@Override
public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() &&
- (mRunningThroughTick || !mOutputDisabled) &&
- (
- aSide == ForgeDirection.UNKNOWN ||
- (
- mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) &&
- getCoverBehaviorAtSideNew((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getComplexCoverDataAtSide((byte) aSide.ordinal()), aFluid, this)
- )
- )
- )
- return mMetaTileEntity.canDrain(aSide, aFluid);
+ if (mTickTimer > 5
+ && canAccessData()
+ && (mRunningThroughTick || !mOutputDisabled)
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSideNew((byte) aSide.ordinal())
+ .letsFluidOut(
+ (byte) aSide.ordinal(),
+ getCoverIDAtSide((byte) aSide.ordinal()),
+ getComplexCoverDataAtSide((byte) aSide.ordinal()),
+ aFluid,
+ this)))) return mMetaTileEntity.canDrain(aSide, aFluid);
return false;
}
@@ -1732,17 +2058,25 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
final byte tSide = (byte) aSide.ordinal();
- if (canAccessData() &&
- (
- aSide == ForgeDirection.UNKNOWN ||
- (
- mMetaTileEntity.isLiquidInput(tSide) && getCoverBehaviorAtSideNew(tSide).letsFluidIn(tSide, getCoverIDAtSide(tSide), getComplexCoverDataAtSide(tSide), null, this)) ||
- (mMetaTileEntity.isLiquidOutput(tSide) && getCoverBehaviorAtSideNew(tSide).letsFluidOut(tSide, getCoverIDAtSide(tSide), getComplexCoverDataAtSide(tSide), null, this)
- )
- )
- )
- return mMetaTileEntity.getTankInfo(aSide);
- return new FluidTankInfo[]{};
+ if (canAccessData()
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidInput(tSide)
+ && getCoverBehaviorAtSideNew(tSide)
+ .letsFluidIn(
+ tSide,
+ getCoverIDAtSide(tSide),
+ getComplexCoverDataAtSide(tSide),
+ null,
+ this))
+ || (mMetaTileEntity.isLiquidOutput(tSide)
+ && getCoverBehaviorAtSideNew(tSide)
+ .letsFluidOut(
+ tSide,
+ getCoverIDAtSide(tSide),
+ getComplexCoverDataAtSide(tSide),
+ null,
+ this)))) return mMetaTileEntity.getTankInfo(aSide);
+ return new FluidTankInfo[] {};
}
public double getOutputEnergyUnitsPerTick() {
@@ -1771,7 +2105,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
}
public double getOfferedEnergy() {
- return (canAccessData() && getStoredEU() - mMetaTileEntity.getMinimumStoredEU() >= oOutput) ? Math.max(0, oOutput) : 0;
+ return (canAccessData() && getStoredEU() - mMetaTileEntity.getMinimumStoredEU() >= oOutput)
+ ? Math.max(0, oOutput)
+ : 0;
}
public void drawEnergy(double amount) {
@@ -1785,10 +2121,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
public int addEnergy(int aEnergy) {
if (!canAccessData()) return 0;
- if (aEnergy > 0)
- increaseStoredEnergyUnits(aEnergy, true);
- else
- decreaseStoredEU(-aEnergy, true);
+ if (aEnergy > 0) increaseStoredEnergyUnits(aEnergy, true);
+ else decreaseStoredEU(-aEnergy, true);
return (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getEUVar());
}
@@ -1852,7 +2186,9 @@ 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;
@@ -1894,7 +2230,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
public String[] getInfoData() {
{
if (canAccessData()) return getMetaTileEntity().getInfoData();
- return new String[]{};
+ return new String[] {};
}
}
@@ -1904,7 +2240,14 @@ 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) {
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider) {
mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
}
@@ -1935,9 +2278,10 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
final int chemistryUpdateVersion = GT_Mod.calculateTotalGTVersion(509, 31);
final int configCircuitAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 40);
// 4 is old GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT
- if (nbtVersion < configCircuitAdditionVersion && getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine && slotIndex >= 4)
- slotIndex += 1;
- if (mID >= 211 && mID <= 218) {//Assembler
+ if (nbtVersion < configCircuitAdditionVersion
+ && getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine
+ && slotIndex >= 4) slotIndex += 1;
+ if (mID >= 211 && mID <= 218) { // Assembler
if (nbtVersion < chemistryUpdateVersion) {
oldInputSize = 2;
oldOutputSize = 1;
@@ -1947,8 +2291,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
newInputSize = 6;
newOutputSize = 1;
-
- } else if (mID >= 421 && mID <= 428) {//Chemical Reactor
+ } else if (mID >= 421 && mID <= 428) { // Chemical Reactor
if (nbtVersion < chemistryUpdateVersion) {
oldInputSize = 2;
oldOutputSize = 1;
@@ -1958,7 +2301,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
newInputSize = 2;
newOutputSize = 2;
- } else if (mID >= 531 && mID <= 538) {//Distillery
+ } else if (mID >= 531 && mID <= 538) { // Distillery
if (nbtVersion < chemistryUpdateVersion) {
oldInputSize = 1;
oldOutputSize = 0;
@@ -1967,7 +2310,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
}
newInputSize = 1;
newOutputSize = 1;
- } else if (mID >= 581 && mID <= 588) {//Mixer
+ } else if (mID >= 581 && mID <= 588) { // Mixer
if (nbtVersion < chemistryUpdateVersion) {
oldInputSize = 4;
oldOutputSize = 1;
@@ -1994,8 +2337,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
@Optional.Method(modid = "appliedenergistics2")
public IGridNode getGridNode(ForgeDirection forgeDirection) {
- if (mFacing != forgeDirection.ordinal())
- return null;
+ if (mFacing != forgeDirection.ordinal()) return null;
final AENetworkProxy gp = getProxy();
return gp != null ? gp.getNode() : null;
}
@@ -2008,8 +2350,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
@Optional.Method(modid = "appliedenergistics2")
- public void securityBreak() {
- }
+ public void securityBreak() {}
@Override
@Optional.Method(modid = "appliedenergistics2")
@@ -2033,38 +2374,33 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
@Optional.Method(modid = "appliedenergistics2")
public void gridChanged() {
- if (mMetaTileEntity != null)
- mMetaTileEntity.gridChanged();
+ if (mMetaTileEntity != null) mMetaTileEntity.gridChanged();
}
@TileEvent(TileEventType.WORLD_NBT_READ)
@Optional.Method(modid = "appliedenergistics2")
public void readFromNBT_AENetwork(final NBTTagCompound data) {
final AENetworkProxy gp = getProxy();
- if (gp != null)
- getProxy().readFromNBT(data);
+ if (gp != null) getProxy().readFromNBT(data);
}
@TileEvent(TileEventType.WORLD_NBT_WRITE)
@Optional.Method(modid = "appliedenergistics2")
public void writeToNBT_AENetwork(final NBTTagCompound data) {
final AENetworkProxy gp = getProxy();
- if (gp != null)
- gp.writeToNBT(data);
+ if (gp != null) gp.writeToNBT(data);
}
@Optional.Method(modid = "appliedenergistics2")
void onChunkUnloadAE() {
final AENetworkProxy gp = getProxy();
- if (gp != null)
- gp.onChunkUnload();
+ if (gp != null) gp.onChunkUnload();
}
@Optional.Method(modid = "appliedenergistics2")
void invalidateAE() {
final AENetworkProxy gp = getProxy();
- if (gp != null)
- gp.invalidate();
+ if (gp != null) gp.invalidate();
}
@Override
@@ -2079,8 +2415,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
public IAlignment getAlignment() {
- return getMetaTileEntity() instanceof IAlignmentProvider ? ((IAlignmentProvider) getMetaTileEntity()).getAlignment() :
- getMetaTileEntity() instanceof IAlignment ? (IAlignment) getMetaTileEntity() : null;
+ return getMetaTileEntity() instanceof IAlignmentProvider
+ ? ((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 8e6206f612..1f6fb0c68d 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java
@@ -1,14 +1,22 @@
package gregtech.api.metatileentity;
+import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
+import static gregtech.api.enums.GT_Values.COMPASS_DIRECTIONS;
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.NW;
+import static gregtech.api.enums.GT_Values.SIDE_DOWN;
+import static gregtech.api.enums.GT_Values.SIDE_UP;
+
import gregtech.api.interfaces.tileentity.IGTEnet;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.api.interfaces.tileentity.IIC2Enet;
import gregtech.api.net.GT_Packet_Block_Event;
-import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
+import java.util.Arrays;
+import java.util.concurrent.ThreadLocalRandom;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -25,16 +33,6 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidHandler;
-import java.util.Arrays;
-import java.util.concurrent.ThreadLocalRandom;
-
-import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
-import static gregtech.api.enums.GT_Values.COMPASS_DIRECTIONS;
-import static gregtech.api.enums.GT_Values.GT;
-import static gregtech.api.enums.GT_Values.NW;
-import static gregtech.api.enums.GT_Values.SIDE_DOWN;
-import static gregtech.api.enums.GT_Values.SIDE_UP;
-
/**
* The Functions my old TileEntities and my BaseMetaTileEntities have in common.
*
@@ -63,17 +61,17 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
private final ChunkCoordinates mReturnedCoordinates = new ChunkCoordinates();
public static byte getSideForPlayerPlacing(Entity aPlayer, byte aDefaultFacing, boolean[] aAllowedFacings) {
- if(aPlayer != null) {
+ if (aPlayer != null) {
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];
+ final byte rFacing =
+ COMPASS_DIRECTIONS[MathHelper.floor_double(0.5D + 4.0F * aPlayer.rotationYaw / 360.0F) & 0x3];
if (aAllowedFacings[rFacing]) return rFacing;
}
for (final byte tSide : ALL_VALID_SIDES) if (aAllowedFacings[tSide]) return tSide;
return aDefaultFacing;
}
-
private void clearNullMarkersFromTileEntityBuffer() {
for (int i = 0; i < mBufferedTileEntities.length; i++)
if (mBufferedTileEntities[i] == this) mBufferedTileEntities[i] = null;
@@ -364,7 +362,9 @@ 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;
+ if (ignoreUnloadedChunks
+ && crossedChunkBorder(aCoords)
+ && !worldObj.blockExists(aCoords.posX, aCoords.posY, aCoords.posZ)) return Blocks.air;
return worldObj.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ);
}
@@ -426,7 +426,9 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
mBufferedTileEntities[aSide] = null;
return getTileEntityAtSide(aSide);
}
- if (mBufferedTileEntities[aSide].xCoord == tX && mBufferedTileEntities[aSide].yCoord == tY && mBufferedTileEntities[aSide].zCoord == tZ) {
+ if (mBufferedTileEntities[aSide].xCoord == tX
+ && mBufferedTileEntities[aSide].yCoord == tY
+ && mBufferedTileEntities[aSide].zCoord == tZ) {
return mBufferedTileEntities[aSide];
}
return null;
@@ -482,8 +484,11 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
worldObj.notifyBlockOfNeighborChange(x1, y1, z1, thisBlock);
// update if it was / is strong powered.
- if (((((mStrongRedstone | oStrongRedstone) >>> dir.ordinal()) & 1) != 0 ) && getBlock(x1, y1, z1).isNormalCube()) {
- final int skipUpdateSide = dir.getOpposite().ordinal(); //Don't update this block. Still updates diagonal blocks twice if conditions meet.
+ if (((((mStrongRedstone | oStrongRedstone) >>> dir.ordinal()) & 1) != 0)
+ && getBlock(x1, y1, z1).isNormalCube()) {
+ final int skipUpdateSide = dir.getOpposite()
+ .ordinal(); // Don't update this block. Still updates diagonal blocks twice if conditions
+ // meet.
for (final ForgeDirection dir2 : ForgeDirection.VALID_DIRECTIONS) {
final int x2 = x1 + dir2.offsetX, y2 = y1 + dir2.offsetY, z2 = z1 + dir2.offsetZ;
@@ -497,7 +502,8 @@ 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);
+ NW.sendPacketToAllPlayersInRange(
+ worldObj, new GT_Packet_Block_Event(xCoord, (short) yCoord, zCoord, aID, aValue), xCoord, zCoord);
}
protected boolean crossedChunkBorder(int aX, int aZ) {
@@ -520,14 +526,14 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
public void markDirty() {
// Avoid sending neighbor updates, just mark the chunk as dirty to make sure it gets saved
final Chunk chunk = worldObj.getChunkFromBlockCoords(xCoord, zCoord);
- if(chunk != null) {
+ if (chunk != null) {
chunk.setChunkModified();
}
}
@Deprecated
- public String trans(String aKey, String aEnglish){
- return GT_Utility.trans(aKey, aEnglish);
+ public String trans(String aKey, String aEnglish) {
+ return GT_Utility.trans(aKey, aEnglish);
}
/*
@@ -537,8 +543,8 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
protected boolean joinedIc2Enet = false;
protected void createIc2Sink() {
- if(ic2EnergySink == null && isServerSide() && shouldJoinIc2Enet()) {
- ic2EnergySink = new TileIC2EnergySink((IGregTechTileEntity)this);
+ if (ic2EnergySink == null && isServerSide() && shouldJoinIc2Enet()) {
+ ic2EnergySink = new TileIC2EnergySink((IGregTechTileEntity) this);
}
}
@@ -551,7 +557,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
protected void joinEnet() {
if (joinedIc2Enet || !shouldJoinIc2Enet()) return;
- if(ic2EnergySink == null) createIc2Sink();
+ if (ic2EnergySink == null) createIc2Sink();
if (ic2EnergySink != null) {
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(ic2EnergySink));
@@ -565,5 +571,4 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(ic2EnergySink));
}
}
-
}
diff --git a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java
index 766110d227..7e35f2e2c1 100644
--- a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity;
+import static gregtech.GT_Mod.GT_FML_LOGGER;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -12,9 +14,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.Packet;
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-import static gregtech.api.enums.GT_Values.ALL_SIDES;
-
public abstract class CommonMetaTileEntity extends CoverableTileEntity implements IGregTechTileEntity {
protected boolean mNeedsBlockUpdate = true, mNeedsUpdate = true, mSendClientData = false, mInventoryChanged = false;
@@ -30,6 +29,7 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity implement
}
return false;
}
+
protected void saveMetaTileNBT(NBTTagCompound aNBT) {
try {
if (hasValidMetaTileEntity()) {
@@ -158,5 +158,4 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity implement
final IMetaTileEntity meta = getMetaTileEntity();
return meta != null && meta.shouldJoinIc2Enet();
}
-
}
diff --git a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java
index f7104c9b93..6c61ae8599 100644
--- a/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java
@@ -1,10 +1,16 @@
package gregtech.api.metatileentity;
+import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.NW;
+import static gregtech.api.util.GT_LanguageManager.FACES;
+import static gregtech.api.util.GT_LanguageManager.getTranslation;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.tileentity.IGregtechWailaProvider;
import gregtech.api.net.GT_Packet_RequestCoverData;
import gregtech.api.net.GT_Packet_SendCoverData;
@@ -14,6 +20,10 @@ import gregtech.api.util.GT_CoverBehaviorBase;
import gregtech.api.util.ISerializableObject;
import gregtech.common.GT_Client;
import gregtech.common.covers.GT_Cover_Fluidfilter;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.IntStream;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.item.EntityItem;
@@ -25,27 +35,26 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidRegistry;
-import java.util.Arrays;
-import java.util.Objects;
-import java.util.stream.IntStream;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
-import static gregtech.api.enums.GT_Values.E;
-import static gregtech.api.enums.GT_Values.NW;
-import static gregtech.api.util.GT_LanguageManager.FACES;
-import static gregtech.api.util.GT_LanguageManager.getTranslation;
-
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);
- 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};
- protected byte[] mSidedRedstone = new byte[]{15, 15, 15, 15, 15, 15};
+ public static final String[] COVER_DATA_NBT_KEYS = Arrays.stream(ForgeDirection.VALID_DIRECTIONS)
+ .mapToInt(Enum::ordinal)
+ .mapToObj(i -> "mCoverData" + i)
+ .toArray(String[]::new);
+ 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
+ };
+ protected byte[] mSidedRedstone = new byte[] {15, 15, 15, 15, 15, 15};
protected boolean mRedstone = false;
protected byte mStrongRedstone = 0;
- protected int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
+ protected int[] mCoverSides = new int[] {0, 0, 0, 0, 0, 0};
protected ISerializableObject[] mCoverData = new ISerializableObject[6];
- protected final boolean[] mCoverNeedUpdate = new boolean[]{false, false, false, false, false, false};
+ protected final boolean[] mCoverNeedUpdate = new boolean[] {false, false, false, false, false, false};
protected short mID = 0;
public long mTickTimer = 0;
@@ -60,18 +69,18 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
if (mStrongRedstone > 0) aNBT.setByte("mStrongRedstone", mStrongRedstone);
if (hasCover) aNBT.setIntArray("mCoverSides", mCoverSides);
- if(!isDrop) {
+ if (!isDrop) {
aNBT.setByteArray("mRedstoneSided", mSidedRedstone);
aNBT.setBoolean("mRedstone", mRedstone);
}
-
}
-
protected void readCoverNBT(NBTTagCompound aNBT) {
- mCoverSides = aNBT.hasKey("mCoverSides") ? aNBT.getIntArray("mCoverSides") : new int[]{0, 0, 0, 0, 0, 0};
+ mCoverSides = aNBT.hasKey("mCoverSides") ? aNBT.getIntArray("mCoverSides") : new int[] {0, 0, 0, 0, 0, 0};
mRedstone = aNBT.getBoolean("mRedstone");
- mSidedRedstone = aNBT.hasKey("mRedstoneSided") ? aNBT.getByteArray("mRedstoneSided") : new byte[]{15, 15, 15, 15, 15, 15};
+ mSidedRedstone = aNBT.hasKey("mRedstoneSided")
+ ? aNBT.getByteArray("mRedstoneSided")
+ : new byte[] {15, 15, 15, 15, 15, 15};
mStrongRedstone = aNBT.getByte("mStrongRedstone");
for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehaviorNew(mCoverSides[i]);
@@ -81,10 +90,11 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
if (aNBT.hasKey("mCoverData", 11) && aNBT.getIntArray("mCoverData").length == 6) {
final int[] tOldData = aNBT.getIntArray("mCoverData");
for (int i = 0; i < tOldData.length; i++) {
- if(mCoverBehaviors[i] instanceof GT_Cover_Fluidfilter) {
+ if (mCoverBehaviors[i] instanceof GT_Cover_Fluidfilter) {
final String filterKey = String.format("fluidFilter%d", i);
if (aNBT.hasKey(filterKey)) {
- mCoverData[i] = mCoverBehaviors[i].createDataObject((tOldData[i] & 7) | (FluidRegistry.getFluidID(aNBT.getString(filterKey)) << 3));
+ mCoverData[i] = mCoverBehaviors[i].createDataObject(
+ (tOldData[i] & 7) | (FluidRegistry.getFluidID(aNBT.getString(filterKey)) << 3));
}
} else if (mCoverBehaviors[i] != null && mCoverBehaviors[i] != GregTech_API.sNoBehavior) {
mCoverData[i] = mCoverBehaviors[i].createDataObject(tOldData[i]);
@@ -92,18 +102,17 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
}
} else {
// no old data
- for (byte i = 0; i<6; i++) {
+ for (byte i = 0; i < 6; i++) {
if (mCoverBehaviors[i] == null) continue;
if (aNBT.hasKey(COVER_DATA_NBT_KEYS[i]))
mCoverData[i] = mCoverBehaviors[i].createDataObject(aNBT.getTag(COVER_DATA_NBT_KEYS[i]));
- else
- mCoverData[i] = mCoverBehaviors[i].createDataObject();
+ else mCoverData[i] = mCoverBehaviors[i].createDataObject();
if (mCoverBehaviors[i].isDataNeededOnClient(i, mCoverSides[i], mCoverData[i], this))
issueCoverUpdate(i);
}
}
-
}
+
public abstract boolean isStillValid();
protected boolean doCoverThings() {
@@ -112,8 +121,12 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
final GT_CoverBehaviorBase> tCover = getCoverBehaviorAtSideNew(i);
final int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
- final byte tRedstone = tCover.isRedstoneSensitive(i, getCoverIDAtSide(i), mCoverData[i], this, mTickTimer) ? getInputRedstoneSignal(i) : 0;
- mCoverData[i] = tCover.doCoverThings(i, tRedstone, getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
+ final byte tRedstone =
+ tCover.isRedstoneSensitive(i, getCoverIDAtSide(i), mCoverData[i], this, mTickTimer)
+ ? getInputRedstoneSignal(i)
+ : 0;
+ mCoverData[i] =
+ tCover.doCoverThings(i, tRedstone, getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
if (!isStillValid()) return false;
}
}
@@ -126,43 +139,50 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
protected void checkDropCover() {
for (byte i : ALL_VALID_SIDES)
if (getCoverIDAtSide(i) != 0)
- if (!allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
- dropCover(i, i, true);
+ if (!allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i)))) dropCover(i, i, true);
}
protected void updateCoverBehavior() {
- for (byte i : ALL_VALID_SIDES)
- mCoverBehaviors[i] = GregTech_API.getCoverBehaviorNew(mCoverSides[i]);
+ for (byte i : ALL_VALID_SIDES) mCoverBehaviors[i] = GregTech_API.getCoverBehaviorNew(mCoverSides[i]);
}
@Override
public void issueCoverUpdate(byte aSide) {
- // If we've got a null worldObj we're getting called as a part of readingNBT from a non tickable MultiTileEntity on chunk load before the world is set
+ // If we've got a null worldObj we're getting called as a part of readingNBT from a non tickable MultiTileEntity
+ // on chunk load before the world is set
// so we'll want to send a cover update.
- if (worldObj == null || (isServerSide() && getCoverBehaviorAtSideNew(aSide).isDataNeededOnClient(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this)))
+ if (worldObj == null
+ || (isServerSide()
+ && getCoverBehaviorAtSideNew(aSide)
+ .isDataNeededOnClient(
+ aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this)))
mCoverNeedUpdate[aSide] = true;
}
- public final ITexture getCoverTexture(byte aSide) {
- if (getCoverIDAtSide(aSide) == 0) return null;
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) {
- return Textures.BlockIcons.HIDDEN_TEXTURE[0]; // See through
- }
- final ITexture coverTexture = getCoverBehaviorAtSideNew(aSide).getSpecialCoverTexture(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this);
- return coverTexture != null ? coverTexture : GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
+ public final ITexture getCoverTexture(byte aSide) {
+ if (getCoverIDAtSide(aSide) == 0) return null;
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) {
+ return Textures.BlockIcons.HIDDEN_TEXTURE[0]; // See through
+ }
+ final ITexture coverTexture = getCoverBehaviorAtSideNew(aSide)
+ .getSpecialCoverTexture(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this);
+ return coverTexture != null
+ ? coverTexture
+ : GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
}
protected void requestCoverDataIfNeeded() {
- if(worldObj == null || !worldObj.isRemote) return;
+ if (worldObj == null || !worldObj.isRemote) return;
for (byte i : ALL_VALID_SIDES) {
- if (getCoverBehaviorAtSideNew(i).isDataNeededOnClient(i, getCoverIDAtSide(i), getComplexCoverDataAtSide(i), this))
+ if (getCoverBehaviorAtSideNew(i)
+ .isDataNeededOnClient(i, getCoverIDAtSide(i), getComplexCoverDataAtSide(i), this))
NW.sendToServer(new GT_Packet_RequestCoverData(i, getCoverIDAtSide(i), this));
}
}
@Override
public void setCoverIdAndDataAtSide(byte aSide, int aId, ISerializableObject aData) {
- if(setCoverIDAtSideNoUpdate(aSide, aId)) {
+ if (setCoverIDAtSideNoUpdate(aSide, aId)) {
setCoverDataAtSide(aSide, aData);
issueCoverUpdate(aSide);
issueBlockUpdate();
@@ -199,11 +219,12 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
@Override
public void setCoverDataAtSide(byte aSide, ISerializableObject aData) {
- if (aSide >= 0 && aSide < 6 && getCoverBehaviorAtSideNew(aSide) != null && getCoverBehaviorAtSideNew(aSide).cast(aData) != null)
- mCoverData[aSide] = aData;
+ if (aSide >= 0
+ && aSide < 6
+ && getCoverBehaviorAtSideNew(aSide) != null
+ && getCoverBehaviorAtSideNew(aSide).cast(aData) != null) mCoverData[aSide] = aData;
}
-
@Override
@Deprecated
public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) {
@@ -225,7 +246,8 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
@Override
public ItemStack getCoverItemAtSide(byte aSide) {
- return getCoverBehaviorAtSideNew(aSide).getDisplayStack(getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide));
+ return getCoverBehaviorAtSideNew(aSide)
+ .getDisplayStack(getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide));
}
@Override
@@ -248,25 +270,32 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
@Override
public ISerializableObject getComplexCoverDataAtSide(byte aSide) {
- if (aSide >= 0 && aSide < 6 && getCoverBehaviorAtSideNew(aSide) != null)
- return mCoverData[aSide];
+ if (aSide >= 0 && aSide < 6 && getCoverBehaviorAtSideNew(aSide) != null) return mCoverData[aSide];
return GregTech_API.sNoBehavior.createDataObject();
}
@Override
public GT_CoverBehaviorBase> getCoverBehaviorAtSideNew(byte aSide) {
- if (aSide >= 0 && aSide < 6)
- return mCoverBehaviors[aSide];
+ if (aSide >= 0 && aSide < 6) return mCoverBehaviors[aSide];
return GregTech_API.sNoBehavior;
}
@Override
public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) {
- if (getCoverBehaviorAtSideNew(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) {
- final ItemStack tStack = getCoverBehaviorAtSideNew(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this);
+ if (getCoverBehaviorAtSideNew(aSide)
+ .onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced)
+ || aForced) {
+ final ItemStack tStack = getCoverBehaviorAtSideNew(aSide)
+ .getDrop(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this);
if (tStack != null) {
- getCoverBehaviorAtSideNew(aSide).onDropped(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this);
- final EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack);
+ getCoverBehaviorAtSideNew(aSide)
+ .onDropped(aSide, getCoverIDAtSide(aSide), getComplexCoverDataAtSide(aSide), this);
+ final EntityItem tEntity = new EntityItem(
+ 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;
@@ -295,10 +324,10 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
setOutputRedstoneSignal(aSide, aStrength);
}
-
@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);
}
@@ -314,12 +343,17 @@ 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);
+ return (byte) IntStream.range(1, 6)
+ .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;
+ return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0
+ ? (byte) (mSidedRedstone[aSide] & 15)
+ : 0;
}
@Override
@@ -329,17 +363,30 @@ 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);
+ return (byte) (getCoverBehaviorAtSideNew(aSide)
+ .getRedstoneInput(
+ 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) {
@@ -348,13 +395,13 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
@Override
public void receiveCoverData(byte aCoverSide, int aCoverID, int aCoverData) {
- if ((aCoverSide >= 0 && aCoverSide < 6))
- setCoverIDAtSideNoUpdate(aCoverSide, aCoverID);
+ if ((aCoverSide >= 0 && aCoverSide < 6)) setCoverIDAtSideNoUpdate(aCoverSide, aCoverID);
setCoverDataAtSide(aCoverSide, aCoverData);
}
@Override
- public void receiveCoverData(byte aCoverSide, int aCoverID, ISerializableObject aCoverData, EntityPlayerMP aPlayer) {
+ public void receiveCoverData(
+ byte aCoverSide, int aCoverID, ISerializableObject aCoverData, EntityPlayerMP aPlayer) {
if ((aCoverSide >= 0 && aCoverSide < 6)) {
setCoverIDAtSideNoUpdate(aCoverSide, aCoverID);
setCoverDataAtSide(aCoverSide, aCoverData);
@@ -365,24 +412,25 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
}
protected void sendCoverDataIfNeeded() {
- if(worldObj == null || worldObj.isRemote) return;
+ if (worldObj == null || worldObj.isRemote) return;
final int mCoverNeedUpdateLength = mCoverNeedUpdate.length;
for (byte i = 0; i < mCoverNeedUpdateLength; i++) {
if (mCoverNeedUpdate[i]) {
NW.sendPacketToAllPlayersInRange(
worldObj,
new GT_Packet_SendCoverData(i, getCoverIDAtSide(i), getComplexCoverDataAtSide(i), this),
- xCoord, zCoord
- );
+ xCoord,
+ zCoord);
mCoverNeedUpdate[i] = false;
}
}
}
@Override
- public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(
+ ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();
- final byte side = (byte)accessor.getSide().ordinal();
+ final byte side = (byte) accessor.getSide().ordinal();
final int[] coverSides = tag.getIntArray("mCoverSides");
// Not all data is available on the client, so get it from the NBT packet
@@ -391,7 +439,8 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
final GT_CoverBehaviorBase> behavior = GregTech_API.getCoverBehaviorNew(coverId);
if (behavior != null && behavior != GregTech_API.sNoBehavior) {
if (tag.hasKey(CoverableTileEntity.COVER_DATA_NBT_KEYS[side])) {
- final ISerializableObject dataObject = behavior.createDataObject(tag.getTag(CoverableTileEntity.COVER_DATA_NBT_KEYS[side]));
+ final ISerializableObject dataObject =
+ behavior.createDataObject(tag.getTag(CoverableTileEntity.COVER_DATA_NBT_KEYS[side]));
final ItemStack coverStack = behavior.getDisplayStack(coverId, dataObject);
if (coverStack != null) currenttip.add(String.format("Cover: %s", coverStack.getDisplayName()));
final String behaviorDesc = behavior.getDescription(side, coverId, dataObject, null);
@@ -405,11 +454,13 @@ 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) {
+ public void getWailaNBTData(
+ EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
// No super implementation
// super.getWailaNBTData(player, tile, tag, world, x, y, z);
- // While we have some cover data on the client (enough to render it); we don't have all the information we want, such as
+ // While we have some cover data on the client (enough to render it); we don't have all the information we want,
+ // such as
// details on the fluid filter, so send it all here.
writeCoverNBT(tag, false);
}
@@ -420,7 +471,7 @@ public abstract class CoverableTileEntity extends BaseTileEntity implements ICov
* @param aList - List to add the information to
*/
public static void addInstalledCoversInformation(NBTTagCompound aNBT, List aList) {
- if (aNBT.hasKey("mCoverSides")){
+ if (aNBT.hasKey("mCoverSides")) {
final int[] mCoverSides = aNBT.getIntArray("mCoverSides");
if (mCoverSides != null && mCoverSides.length == 6) {
for (byte tSide : ALL_VALID_SIDES) {
@@ -429,10 +480,12 @@ 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()));
+ aList.add(String.format(
+ "Cover on %s side: %s", getTranslation(FACES[tSide]), coverStack.getDisplayName()));
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
index 9d07b1f9ba..96cca4ba1d 100644
--- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
@@ -1,5 +1,8 @@
package gregtech.api.metatileentity;
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gnu.trove.list.TIntList;
@@ -13,6 +16,10 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.*;
import gregtech.common.GT_Client;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -32,14 +39,6 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import static gregtech.api.enums.GT_Values.GT;
-import static gregtech.api.enums.GT_Values.V;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -59,11 +58,13 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
* This variable tells, which directions the Block is connected to. It is a Bitmask.
*/
public byte mConnections = 0;
+
protected boolean mCheckConnections = false;
/**
* Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName.
*/
public String mName;
+
public boolean doTickProfilingInThisTick = true;
/**
* accessibility to this Field is no longer given, see below
@@ -83,7 +84,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
* }
*/
public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- this(aID, aBasicName, aRegionalName, aInvSlotCount, true);
+ this(aID, aBasicName, aRegionalName, aInvSlotCount, true);
}
public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount, boolean aAddInfo) {
@@ -101,13 +102,13 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
mInventory = new ItemStack[aInvSlotCount];
if (aAddInfo && GT.isClientSide()) {
- addInfo(aID);
+ addInfo(aID);
}
}
protected final void addInfo(int aID) {
- if(!GT.isClientSide()) return;
-
+ if (!GT.isClientSide()) return;
+
ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
tStack.getItem().addInformation(tStack, null, new ArrayList(), true);
}
@@ -153,7 +154,10 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
@Override
public ItemStack getStackForm(long aAmount) {
- return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
+ return new ItemStack(
+ GregTech_API.sBlockMachines,
+ (int) aAmount,
+ getBaseMetaTileEntity().getMetaTileID());
}
public boolean isCoverOnSide(BaseMetaPipeEntity aPipe, EntityLivingBase aEntity) {
@@ -183,32 +187,44 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
if (aSide < 6 && mBaseMetaTileEntity.getCoverIDAtSide(aSide) > 0) {
tCovered = true;
}
- if(isConnectedAtSide(aSide)){
- tCovered = true;
+ if (isConnectedAtSide(aSide)) {
+ tCovered = true;
}
- //GT_FML_LOGGER.info("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide));
- //toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos)
+ // GT_FML_LOGGER.info("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide));
+ // toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos)
return tCovered;
}
@Override
- public void onServerStart() {/*Do nothing*/}
+ public void onServerStart() {
+ /*Do nothing*/
+ }
@Override
- public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
+ public void onWorldSave(File aSaveDirectory) {
+ /*Do nothing*/
+ }
@Override
- public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
+ public void onWorldLoad(File aSaveDirectory) {
+ /*Do nothing*/
+ }
@Override
- public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
+ public void onConfigLoad(GT_Config aConfig) {
+ /*Do nothing*/
+ }
@Override
- public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
+ public void setItemNBT(NBTTagCompound aNBT) {
+ /*Do nothing*/
+ }
@Override
@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
+ public void registerIcons(IIconRegister aBlockIconRegister) {
+ /*Do nothing*/
+ }
@Override
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
@@ -216,31 +232,42 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
}
@Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/}
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ /*Do nothing*/
+ }
@Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWrenchRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
return false;
}
@Override
- public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWireCutterRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
return false;
}
@Override
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
return false;
}
@Override
- public void onExplosion() {/*Do nothing*/}
+ public void onExplosion() {
+ /*Do nothing*/
+ }
@Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ /*Do nothing*/
+ }
@Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ /*Do nothing*/
+ }
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
@@ -254,38 +281,53 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
}
@Override
- public void inValidate() {/*Do nothing*/}
+ public void inValidate() {
+ /*Do nothing*/
+ }
@Override
- public void onRemoval() {/*Do nothing*/}
+ public void onRemoval() {
+ /*Do nothing*/
+ }
@Override
- public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
+ public void initDefaultModes(NBTTagCompound aNBT) {
+ /*Do nothing*/
+ }
/**
* When a GUI is opened
*/
- public void onOpenGUI() {/*Do nothing*/}
+ public void onOpenGUI() {
+ /*Do nothing*/
+ }
/**
* When a GUI is closed
*/
- public void onCloseGUI() {/*Do nothing*/}
+ public void onCloseGUI() {
+ /*Do nothing*/
+ }
/**
* a Player rightclicks the Machine
* Sneaky rightclicks are not getting passed to this!
*/
@Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
return false;
}
@Override
- public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ /*Do nothing*/
+ }
@Override
- public void onValueUpdate(byte aValue) {/*Do nothing*/}
+ public void onValueUpdate(byte aValue) {
+ /*Do nothing*/
+ }
@Override
public byte getUpdateData() {
@@ -293,13 +335,19 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
}
@Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ /*Do nothing*/
+ }
@Override
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ /*Do nothing*/
+ }
@Override
- public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
+ public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {
+ /*Do nothing*/
+ }
@Override
public final void sendSound(byte aIndex) {
@@ -340,7 +388,8 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
}
@Override
- public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList) {
+ public ArrayList getSpecialDebugInfo(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList) {
return aList;
}
@@ -415,10 +464,14 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
}
@Override
- public void onMachineBlockUpdate() {/*Do nothing*/}
+ public void onMachineBlockUpdate() {
+ /*Do nothing*/
+ }
@Override
- public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
+ public void receiveClientEvent(byte aEventID, byte aValue) {
+ /*Do nothing*/
+ }
@Override
public boolean isSimpleMachine() {
@@ -452,7 +505,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
@Override
public String[] getInfoData() {
- return new String[]{};
+ return new String[] {};
}
public boolean isDigitalChest() {
@@ -463,7 +516,9 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
return null;
}
- public void setItemCount(int aCount) {/*Do nothing*/}
+ public void setItemCount(int aCount) {
+ /*Do nothing*/
+ }
public int getMaxItemCount() {
return 0;
@@ -522,21 +577,59 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
public int[] getAccessibleSlotsFromSide(int aSide) {
TIntList tList = new TIntArrayList();
IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
- boolean tSkip = tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ boolean tSkip = tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ -2,
+ tTileEntity)
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ -2,
+ tTileEntity);
for (int i = 0; i < getSizeInventory(); i++)
- if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), i, tTileEntity)))
- tList.add(i);
+ if (isValidSlot(i)
+ && (tSkip
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ i,
+ tTileEntity)
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ i,
+ tTileEntity))) tList.add(i);
return tList.toArray();
}
@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);
+ return isValidSlot(aIndex)
+ && aStack != null
+ && 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);
+ return isValidSlot(aIndex)
+ && aStack != null
+ && aIndex < mInventory.length
+ && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
}
@Override
@@ -551,8 +644,8 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
- return new FluidTankInfo[]{getInfo()};
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {};
+ return new FluidTankInfo[] {getInfo()};
}
public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
@@ -683,30 +776,66 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
@Override
public void doExplosion(long aExplosionPower) {
- float tStrength =
- aExplosionPower < V[0] ? 1.0F :
- aExplosionPower < V[1] ? 2.0F :
- aExplosionPower < V[2] ? 3.0F :
- aExplosionPower < V[3] ? 4.0F :
- aExplosionPower < V[4] ? 5.0F :
- aExplosionPower < V[4] * 2 ? 6.0F :
- aExplosionPower < V[5] ? 7.0F :
- aExplosionPower < V[6] ? 8.0F :
- aExplosionPower < V[7] ? 9.0F :
- aExplosionPower < V[8] ? 10.0F :
- aExplosionPower < V[8] * 2 ? 11.0F :
- aExplosionPower < V[9] ? 12.0F :
- aExplosionPower < V[10] ? 13.0F :
- aExplosionPower < V[11] ? 14.0F :
- aExplosionPower < V[12] ? 15.0F :
- aExplosionPower < V[12] * 2 ? 16.0F :
- aExplosionPower < V[13] ? 17.0F :
- aExplosionPower < V[14] ? 18.0F :
- aExplosionPower < V[15] ? 19.0F : 20.0F;
- int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
+ float tStrength = aExplosionPower < V[0]
+ ? 1.0F
+ : aExplosionPower < V[1]
+ ? 2.0F
+ : aExplosionPower < V[2]
+ ? 3.0F
+ : aExplosionPower < V[3]
+ ? 4.0F
+ : aExplosionPower < V[4]
+ ? 5.0F
+ : aExplosionPower < V[4] * 2
+ ? 6.0F
+ : aExplosionPower < V[5]
+ ? 7.0F
+ : aExplosionPower < V[6]
+ ? 8.0F
+ : aExplosionPower < V[7]
+ ? 9.0F
+ : aExplosionPower < V[8]
+ ? 10.0F
+ : aExplosionPower < V[8] * 2
+ ? 11.0F
+ : aExplosionPower < V[9]
+ ? 12.0F
+ : aExplosionPower
+ < V[
+ 10]
+ ? 13.0F
+ : aExplosionPower
+ < V[
+ 11]
+ ? 14.0F
+ : aExplosionPower
+ < V[
+ 12]
+ ? 15.0F
+ : aExplosionPower
+ < V[
+ 12]
+ * 2
+ ? 16.0F
+ : aExplosionPower
+ < V[
+ 13]
+ ? 17.0F
+ : aExplosionPower
+ < V[
+ 14]
+ ? 18.0F
+ : aExplosionPower
+ < V[
+ 15]
+ ? 19.0F
+ : 20.0F;
+ int tX = getBaseMetaTileEntity().getXCoord(),
+ tY = getBaseMetaTileEntity().getYCoord(),
+ tZ = getBaseMetaTileEntity().getZCoord();
World tWorld = getBaseMetaTileEntity().getWorld();
tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions){
+ if (GregTech_API.sMachineExplosions) {
new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder()
.setStrength(tStrength)
.setSmoking(true)
@@ -722,7 +851,14 @@ 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) {
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider) {
AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
}
@@ -743,23 +879,23 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
}
@Override
- public boolean allowGeneralRedstoneOutput(){
+ public boolean allowGeneralRedstoneOutput() {
return false;
}
- @Override
- public boolean hasAlternativeModeText() {
- return false;
- }
+ @Override
+ public boolean hasAlternativeModeText() {
+ return false;
+ }
- @Override
- public String getAlternativeModeText() {
- return "";
- }
+ @Override
+ public String getAlternativeModeText() {
+ return "";
+ }
@Deprecated
- public String trans(String aKey, String aEnglish){
- return GT_Utility.trans(aKey, aEnglish);
+ public String trans(String aKey, String aEnglish) {
+ return GT_Utility.trans(aKey, aEnglish);
}
private boolean connectableColor(TileEntity tTileEntity) {
@@ -776,13 +912,13 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
return true;
}
- @Override
- public int connect(byte aSide) {
- if (aSide >= 6) return 0;
+ @Override
+ public int connect(byte aSide) {
+ if (aSide >= 6) return 0;
- final byte tSide = GT_Utility.getOppositeSide(aSide);
- final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- if (baseMetaTile == null || !baseMetaTile.isServerSide()) return 0;
+ final byte tSide = GT_Utility.getOppositeSide(aSide);
+ final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
+ if (baseMetaTile == null || !baseMetaTile.isServerSide()) return 0;
final GT_CoverBehaviorBase> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(aSide);
final int coverId = baseMetaTile.getCoverIDAtSide(aSide);
@@ -796,30 +932,36 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
TileEntity tTileEntity = baseMetaTile.getTileEntityAtSide(aSide);
if (!connectableColor(tTileEntity)) return 0;
- if ((alwaysLookConnected || letsIn || letsOut)) {
+ if ((alwaysLookConnected || letsIn || letsOut)) {
// Are we trying to connect to a pipe? let's do it!
- IMetaTileEntity tPipe = tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() : null;
- if (getClass().isInstance(tPipe) || (tPipe != null && tPipe.getClass().isInstance(this))) {
+ IMetaTileEntity tPipe = tTileEntity instanceof IGregTechTileEntity
+ ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()
+ : null;
+ if (getClass().isInstance(tPipe)
+ || (tPipe != null && tPipe.getClass().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
((MetaPipeEntity) tPipe).connect(tSide);
}
return 1;
- }
- else if((getGT6StyleConnection() && baseMetaTile.getAirAtSide(aSide)) || canConnect(aSide, tTileEntity)) {
- // Allow open connections to Air, if the GT6 style pipe/cables are enabled, so that it'll connect to the next block placed down next to it
+ } else if ((getGT6StyleConnection() && baseMetaTile.getAirAtSide(aSide))
+ || canConnect(aSide, tTileEntity)) {
+ // Allow open connections to Air, if the GT6 style pipe/cables are enabled, so that it'll connect to the
+ // next block placed down next to it
connectAtSide(aSide);
return 1;
}
- if (!baseMetaTile.getWorld().getChunkProvider().chunkExists(baseMetaTile.getOffsetX(aSide, 1) >> 4, baseMetaTile.getOffsetZ(aSide, 1) >> 4)) {
+ if (!baseMetaTile
+ .getWorld()
+ .getChunkProvider()
+ .chunkExists(baseMetaTile.getOffsetX(aSide, 1) >> 4, baseMetaTile.getOffsetZ(aSide, 1) >> 4)) {
// Target chunk unloaded
return -1;
}
-
}
- return 0;
- }
+ return 0;
+ }
protected void checkConnections() {
// Verify connections around us. If GT6 style cables are not enabled then revert to old behavior and try
@@ -832,32 +974,54 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
mCheckConnections = false;
}
- private void connectAtSide(byte aSide) {
+ private void connectAtSide(byte aSide) {
mConnections |= (1 << aSide);
}
- @Override
- public void disconnect(byte aSide) {
- if (aSide >= 6) return;
- mConnections &= ~(1 << aSide);
- byte tSide = GT_Utility.getOppositeSide(aSide);
- 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);
- }
+ @Override
+ public void disconnect(byte aSide) {
+ if (aSide >= 6) return;
+ mConnections &= ~(1 << aSide);
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ 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);
+ }
- @Override
+ @Override
public boolean isConnectedAtSide(int aSide) {
- return (mConnections & (1 << aSide)) != 0;
- }
+ return (mConnections & (1 << aSide)) != 0;
+ }
+
+ public boolean letsIn(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return false;
+ }
+ public boolean letsOut(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return false;
+ }
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; }
- public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; }
+ public boolean letsIn(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
+ return false;
+ }
- public boolean letsIn(GT_CoverBehaviorBase> coverBehavior, byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return false; }
- public boolean letsOut(GT_CoverBehaviorBase> coverBehavior, byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) { return false; }
+ public boolean letsOut(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
+ return false;
+ }
public boolean canConnect(byte aSide, TileEntity tTileEntity) {
return false;
@@ -877,6 +1041,5 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
return false;
}
- public void reloadLocks() {
- }
+ public void reloadLocks() {}
}
diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
index 13ea66e7d2..1e77057be9 100644
--- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity;
+import static gregtech.api.enums.GT_Values.V;
+
import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.pathing.IPathingGrid;
import appeng.api.util.AECableType;
@@ -23,6 +25,10 @@ import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Client;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.block.Block;
@@ -44,13 +50,6 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import static gregtech.api.enums.GT_Values.V;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -71,6 +70,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
* The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
*/
public final ItemStack[] mInventory;
+
public boolean doTickProfilingInThisTick = true;
private MetaTileEntity mCallBackTile;
@@ -80,7 +80,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
*/
private IGregTechTileEntity mBaseMetaTileEntity;
- public long mSoundRequests=0;
+ public long mSoundRequests = 0;
/**
* This registers your Machine at the List.
@@ -145,7 +145,10 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
@Override
public ItemStack getStackForm(long aAmount) {
- return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
+ return new ItemStack(
+ GregTech_API.sBlockMachines,
+ (int) aAmount,
+ getBaseMetaTileEntity().getMetaTileID());
}
public String getLocalName() {
@@ -153,23 +156,35 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public void onServerStart() {/*Do nothing*/}
+ public void onServerStart() {
+ /*Do nothing*/
+ }
@Override
- public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
+ public void onWorldSave(File aSaveDirectory) {
+ /*Do nothing*/
+ }
@Override
- public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
+ public void onWorldLoad(File aSaveDirectory) {
+ /*Do nothing*/
+ }
@Override
- public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
+ public void onConfigLoad(GT_Config aConfig) {
+ /*Do nothing*/
+ }
@Override
- public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
+ public void setItemNBT(NBTTagCompound aNBT) {
+ /*Do nothing*/
+ }
@Override
@SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
+ public void registerIcons(IIconRegister aBlockIconRegister) {
+ /*Do nothing*/
+ }
@Override
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
@@ -177,10 +192,13 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/}
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ /*Do nothing*/
+ }
@Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWrenchRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {
getBaseMetaTileEntity().setFrontFacing(aWrenchingSide);
return true;
@@ -189,39 +207,54 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if(!aPlayer.isSneaking()) return false;
+ public boolean onWireCutterRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, 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)) {
+ if ((tTileEntity instanceof IGregTechTileEntity)
+ && (((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);
+ return ((IGregTechTileEntity) tTileEntity)
+ .getMetaTileEntity()
+ .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) {
- if(!aPlayer.isSneaking()) return false;
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, 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)) {
+ if ((tTileEntity instanceof IGregTechTileEntity)
+ && (((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);
+ return ((IGregTechTileEntity) tTileEntity)
+ .getMetaTileEntity()
+ .onSolderingToolRightClick(aWrenchingSide, tSide, aPlayer, aX, aY, aZ);
}
return false;
}
@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.");
+ GT_Log.exp.println("Machine at " + this.getBaseMetaTileEntity().getXCoord() + " | "
+ + this.getBaseMetaTileEntity().getYCoord() + " | "
+ + this.getBaseMetaTileEntity().getZCoord() + " DIMID: "
+ + this.getBaseMetaTileEntity().getWorld().provider.dimensionId + " exploded.");
}
@Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ /*Do nothing*/
+ }
@Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ /*Do nothing*/
+ }
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
@@ -235,23 +268,33 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public void inValidate() {/*Do nothing*/}
+ public void inValidate() {
+ /*Do nothing*/
+ }
@Override
- public void onRemoval() {/*Do nothing*/}
+ public void onRemoval() {
+ /*Do nothing*/
+ }
@Override
- public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
+ public void initDefaultModes(NBTTagCompound aNBT) {
+ /*Do nothing*/
+ }
/**
* When a GUI is opened
*/
- public void onOpenGUI() {/*Do nothing*/}
+ public void onOpenGUI() {
+ /*Do nothing*/
+ }
/**
* When a GUI is closed
*/
- public void onCloseGUI() {/*Do nothing*/}
+ public void onCloseGUI() {
+ /*Do nothing*/
+ }
/**
* a Player rightclicks the Machine
@@ -262,15 +305,20 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ public boolean onRightclick(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
return onRightclick(aBaseMetaTileEntity, aPlayer);
}
@Override
- public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ /*Do nothing*/
+ }
@Override
- public void onValueUpdate(byte aValue) {/*Do nothing*/}
+ public void onValueUpdate(byte aValue) {
+ /*Do nothing*/
+ }
@Override
public byte getUpdateData() {
@@ -278,13 +326,19 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ /*Do nothing*/
+ }
@Override
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ /*Do nothing*/
+ }
@Override
- public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
+ public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {
+ /*Do nothing*/
+ }
@Override
public MetaTileEntity getCallbackBase() {
@@ -460,7 +514,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
* This is used to set the internal Steam Energy to the given Parameter.
*/
public void setSteamVar(long aSteam) {
- if(((BaseMetaTileEntity) mBaseMetaTileEntity).mStoredSteam != aSteam){
+ if (((BaseMetaTileEntity) mBaseMetaTileEntity).mStoredSteam != aSteam) {
markDirty();
((BaseMetaTileEntity) mBaseMetaTileEntity).mStoredSteam = aSteam;
}
@@ -531,7 +585,8 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public ArrayList getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList) {
+ public ArrayList getSpecialDebugInfo(
+ IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList aList) {
return aList;
}
@@ -585,10 +640,14 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public void onMachineBlockUpdate() {/*Do nothing*/}
+ public void onMachineBlockUpdate() {
+ /*Do nothing*/
+ }
@Override
- public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
+ public void receiveClientEvent(byte aEventID, byte aValue) {
+ /*Do nothing*/
+ }
@Override
public boolean isSimpleMachine() {
@@ -641,13 +700,17 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
/**
* When the Facing gets changed.
*/
- public void onFacingChange() {/*Do nothing*/}
+ public void onFacingChange() {
+ /*Do nothing*/
+ }
/**
* if the IC2 Teleporter can drain from this.
*/
public boolean isTeleporterCompatible() {
- return isEnetOutput() && getBaseMetaTileEntity().getOutputVoltage() >= 128 && getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000;
+ return isEnetOutput()
+ && getBaseMetaTileEntity().getOutputVoltage() >= 128
+ && getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000;
}
/**
@@ -680,7 +743,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
@Override
public String[] getInfoData() {
- return new String[]{};
+ return new String[] {};
}
public boolean isDigitalChest() {
@@ -691,7 +754,9 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
return null;
}
- public void setItemCount(int aCount) {/*Do nothing*/}
+ public void setItemCount(int aCount) {
+ /*Do nothing*/
+ }
public int getMaxItemCount() {
return 0;
@@ -712,14 +777,13 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
public void setInventorySlotContents(int aIndex, ItemStack aStack) {
markDirty();
if (this instanceof IConfigurationCircuitSupport) {
- IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)this;
+ IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) this;
if (ccs.allowSelectCircuit() && aIndex == ccs.getCircuitSlot() && aStack != null) {
mInventory[aIndex] = GT_Utility.copyAmount(0, aStack);
return;
}
}
- if (aIndex >= 0 && aIndex < mInventory.length)
- mInventory[aIndex] = aStack;
+ if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
}
@Override
@@ -747,8 +811,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
if (setStackToZeroInsteadOfNull(aIndex)) {
tStack.stackSize = 0;
markDirty();
- }
- else setInventorySlotContents(aIndex, null);
+ } else setInventorySlotContents(aIndex, null);
} else {
rStack = tStack.splitStack(aAmount);
markDirty();
@@ -763,21 +826,59 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
public int[] getAccessibleSlotsFromSide(int aSide) {
TIntList tList = new TIntArrayList();
IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
- boolean tSkip = tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ boolean tSkip = tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ -2,
+ tTileEntity)
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ -2,
+ tTileEntity);
for (int i = 0; i < getSizeInventory(); i++)
- if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), i, tTileEntity)))
- tList.add(i);
+ if (isValidSlot(i)
+ && (tSkip
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ i,
+ tTileEntity)
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ i,
+ tTileEntity))) tList.add(i);
return tList.toArray();
}
@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);
+ return isValidSlot(aIndex)
+ && aStack != null
+ && 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);
+ return isValidSlot(aIndex)
+ && aStack != null
+ && aIndex < mInventory.length
+ && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
}
@Override
@@ -792,8 +893,8 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
- return new FluidTankInfo[]{getInfo()};
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {};
+ return new FluidTankInfo[] {getInfo()};
}
public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
@@ -804,7 +905,12 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
@Override
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()));
+ int tSteam = (int) Math.min(
+ Integer.MAX_VALUE,
+ Math.min(
+ aFluid.amount / 2,
+ getBaseMetaTileEntity().getSteamCapacity()
+ - getBaseMetaTileEntity().getStoredSteam()));
if (tSteam > 0) {
markDirty();
if (doFill) getBaseMetaTileEntity().increaseStoredSteam(tSteam, true);
@@ -909,7 +1015,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
public void onColorChangeServer(byte aColor) {
final IGregTechTileEntity meta = getBaseMetaTileEntity();
final int aX = meta.getXCoord(), aY = meta.getYCoord(), aZ = meta.getZCoord();
- for (byte aSide = 0; aSide < 6 ; aSide++ ) {
+ for (byte aSide = 0; aSide < 6; aSide++) {
// Flag surrounding pipes/cables to revaluate their connection with us if we got painted
final TileEntity tTileEntity = meta.getTileEntityAtSide(aSide);
if ((tTileEntity instanceof BaseMetaPipeEntity)) {
@@ -937,27 +1043,63 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
@Override
public void doExplosion(long aExplosionPower) {
- float tStrength =
- aExplosionPower < V[0] ? 1.0F :
- aExplosionPower < V[1] ? 2.0F :
- aExplosionPower < V[2] ? 3.0F :
- aExplosionPower < V[3] ? 4.0F :
- aExplosionPower < V[4] ? 5.0F :
- aExplosionPower < V[4] * 2 ? 6.0F :
- aExplosionPower < V[5] ? 7.0F :
- aExplosionPower < V[6] ? 8.0F :
- aExplosionPower < V[7] ? 9.0F :
- aExplosionPower < V[8] ? 10.0F :
- aExplosionPower < V[8] * 2 ? 11.0F :
- aExplosionPower < V[9] ? 12.0F :
- aExplosionPower < V[10] ? 13.0F :
- aExplosionPower < V[11] ? 14.0F :
- aExplosionPower < V[12] ? 15.0F :
- aExplosionPower < V[12] * 2 ? 16.0F :
- aExplosionPower < V[13] ? 17.0F :
- aExplosionPower < V[14] ? 18.0F :
- aExplosionPower < V[15] ? 19.0F : 20.0F;
- int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
+ float tStrength = aExplosionPower < V[0]
+ ? 1.0F
+ : aExplosionPower < V[1]
+ ? 2.0F
+ : aExplosionPower < V[2]
+ ? 3.0F
+ : aExplosionPower < V[3]
+ ? 4.0F
+ : aExplosionPower < V[4]
+ ? 5.0F
+ : aExplosionPower < V[4] * 2
+ ? 6.0F
+ : aExplosionPower < V[5]
+ ? 7.0F
+ : aExplosionPower < V[6]
+ ? 8.0F
+ : aExplosionPower < V[7]
+ ? 9.0F
+ : aExplosionPower < V[8]
+ ? 10.0F
+ : aExplosionPower < V[8] * 2
+ ? 11.0F
+ : aExplosionPower < V[9]
+ ? 12.0F
+ : aExplosionPower
+ < V[
+ 10]
+ ? 13.0F
+ : aExplosionPower
+ < V[
+ 11]
+ ? 14.0F
+ : aExplosionPower
+ < V[
+ 12]
+ ? 15.0F
+ : aExplosionPower
+ < V[
+ 12]
+ * 2
+ ? 16.0F
+ : aExplosionPower
+ < V[
+ 13]
+ ? 17.0F
+ : aExplosionPower
+ < V[
+ 14]
+ ? 18.0F
+ : aExplosionPower
+ < V[
+ 15]
+ ? 19.0F
+ : 20.0F;
+ int tX = getBaseMetaTileEntity().getXCoord(),
+ tY = getBaseMetaTileEntity().getYCoord(),
+ tZ = getBaseMetaTileEntity().getZCoord();
World tWorld = getBaseMetaTileEntity().getWorld();
GT_Utility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1, tX, tY, tZ);
tWorld.setBlock(tX, tY, tZ, Blocks.air);
@@ -971,7 +1113,14 @@ 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) {
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider) {
AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
}
@@ -992,29 +1141,33 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
}
@Override
- public boolean allowGeneralRedstoneOutput(){
- return false;
+ public boolean allowGeneralRedstoneOutput() {
+ return false;
}
@Deprecated
- public String trans(String aKey, String aEnglish){
- return GT_Utility.trans(aKey, aEnglish);
+ public String trans(String aKey, String aEnglish) {
+ return GT_Utility.trans(aKey, aEnglish);
}
@Override
- public boolean hasAlternativeModeText(){
- return false;
+ public boolean hasAlternativeModeText() {
+ return false;
}
@Override
- public String getAlternativeModeText(){
- return "";
+ public String getAlternativeModeText() {
+ return "";
}
@Override
- public boolean shouldJoinIc2Enet() { return false; }
+ public boolean shouldJoinIc2Enet() {
+ return false;
+ }
- public boolean shouldTriggerBlockUpdate() { return false; }
+ public boolean shouldTriggerBlockUpdate() {
+ return false;
+ }
@Optional.Method(modid = "appliedenergistics2")
public AECableType getCableConnectionType(ForgeDirection forgeDirection) {
@@ -1030,33 +1183,32 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac
public void gridChanged() {}
@Override
- public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
- currenttip.add(String.format("Facing: %s", ForgeDirection.getOrientation(mBaseMetaTileEntity.getFrontFacing()).name()));
+ public void getWailaBody(
+ ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ currenttip.add(String.format(
+ "Facing: %s",
+ ForgeDirection.getOrientation(mBaseMetaTileEntity.getFrontFacing())
+ .name()));
}
@Override
- public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(
+ EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
/* Empty */
}
@Optional.Method(modid = "appliedenergistics2")
protected String getAEDiagnostics() {
try {
- if (getProxy() == null)
- return "(proxy)";
- if (getProxy().getNode() == null)
- return "(node)";
- if (getProxy().getNode().getGrid() == null)
- return "(grid)";
- if (!getProxy().getNode().meetsChannelRequirements())
- return "(channels)";
+ if (getProxy() == null) return "(proxy)";
+ if (getProxy().getNode() == null) return "(node)";
+ if (getProxy().getNode().getGrid() == null) return "(grid)";
+ if (!getProxy().getNode().meetsChannelRequirements()) return "(channels)";
IPathingGrid pg = getProxy().getNode().getGrid().getCache(IPathingGrid.class);
- if (!pg.isNetworkBooting())
- return "(booting)";
+ if (!pg.isNetworkBooting()) return "(booting)";
IEnergyGrid eg = getProxy().getNode().getGrid().getCache(IEnergyGrid.class);
- if (!eg.isNetworkPowered())
- return "(power)";
- } catch(Throwable ex) {
+ if (!eg.isNetworkPowered()) return "(power)";
+ } catch (Throwable ex) {
ex.printStackTrace();
}
return "";
diff --git a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java
index 16af004957..661dad730f 100644
--- a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java
+++ b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java
@@ -44,19 +44,18 @@ public class TileIC2EnergySink extends TileEntity implements IEnergySink {
*/
@Override
public double getDemandedEnergy() {
- if(cableMeta != null) {
- // We don't want everything to join the enet (treating the cable as a conductor) so we join it as a ink. We don't want to traverse all cables
- // connected to this (like we would during distribution) to see if it actually needs any EU... so we just always say we want it all. If there
- // are more than two things attached, and one of them is a GT cable that doesn't have anywhere to send it's energy, the distribution will be a bit
+ if (cableMeta != null) {
+ // We don't want everything to join the enet (treating the cable as a conductor) so we join it as a ink. We
+ // don't want to traverse all cables
+ // connected to this (like we would during distribution) to see if it actually needs any EU... so we just
+ // always say we want it all. If there
+ // are more than two things attached, and one of them is a GT cable that doesn't have anywhere to send it's
+ // energy, the distribution will be a bit
// weird. In that case only use one cable, or use a transformer.
return (cableMeta.mVoltage * cableMeta.mAmperage);
- }
- else
- return myMeta.getEUCapacity() - myMeta.getStoredEU();
+ } else return myMeta.getEUCapacity() - myMeta.getStoredEU();
}
-
-
/**
* Determine the tier of this energy sink.
* 1 = LV, 2 = MV, 3 = HV, 4 = EV etc.
@@ -82,20 +81,26 @@ 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 euPerAmp = (long)(amount / (amps * 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();
if (metaTile == null) return amount;
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);
- return amount - ( usedAmps * euPerAmp);
+ 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);
+ return amount - (usedAmps * euPerAmp);
// transferElectricity for cables
}
@@ -112,11 +117,9 @@ public class TileIC2EnergySink extends TileEntity implements IEnergySink {
@Override
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;
- else
- return myMeta.inputEnergyFrom((byte) direction.ordinal(), false);
-
+ if (metaTile instanceof IMetaTileEntityCable
+ && (direction == ForgeDirection.UNKNOWN
+ || ((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 431ed3cc30..be1904aaf5 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.examples;
+import static gregtech.api.enums.Textures.BlockIcons.*;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,45 +12,84 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
-import static gregtech.api.enums.Textures.BlockIcons.*;
-
/**
* This Example Implementation still works, however I use something completely different in my own Code.
*/
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",
+ 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.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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_E_Furnace(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, 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) {
+ public GT_MetaTileEntity_E_Furnace(
+ String aName,
+ int aTier,
+ String[] aDescription,
+ ITexture[][][] aTextures,
+ String aGUIName,
+ String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
}
@@ -69,14 +110,17 @@ public class GT_MetaTileEntity_E_Furnace extends GT_MetaTileEntity_BasicMachine
}
@Override
- protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64, aStack), false, null) != null;
+ protected boolean allowPutStackValidated(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64, aStack), false, null) != null;
}
@Override
public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) GT_Utility.doSoundAtClient(SoundResource.IC2_MACHINES_ELECTROFURNACE_LOOP, 10, 1.0F, aX, aY, aZ);
+ if (aIndex == 1)
+ GT_Utility.doSoundAtClient(SoundResource.IC2_MACHINES_ELECTROFURNACE_LOOP, 10, 1.0F, aX, aY, aZ);
}
@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 e92f61f1b9..fd3fe175c9 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.VN;
+
import cofh.api.energy.IEnergyReceiver;
import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
@@ -34,6 +36,9 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.api.energy.tile.IEnergySource;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.reactor.IReactorChamber;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -45,27 +50,37 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.VN;
-
public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
public final float mThickNess;
public final Materials mMaterial;
public final long mCableLossPerMeter, mAmperage, mVoltage;
public final boolean mInsulated, mCanShock;
- public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,mTransferredAmperageLast20OK=0,mTransferredAmperageOK=0;
- public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0,mTransferredVoltageLast20OK=0,mTransferredVoltageOK=0;
+ public int mTransferredAmperage = 0,
+ mTransferredAmperageLast20 = 0,
+ mTransferredAmperageLast20OK = 0,
+ mTransferredAmperageOK = 0;
+ public long mTransferredVoltageLast20 = 0,
+ mTransferredVoltage = 0,
+ mTransferredVoltageLast20OK = 0,
+ mTransferredVoltageOK = 0;
public long mRestRF;
public int mOverheat;
- public static short mMaxOverheat=(short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
+ public static short mMaxOverheat = (short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
private int[] lastAmperage;
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) {
+ public GT_MetaPipeEntity_Cable(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ Materials aMaterial,
+ long aCableLossPerMeter,
+ long aAmperage,
+ long aVoltage,
+ boolean aInsulated,
+ boolean aCanShock) {
super(aID, aName, aNameRegional, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -76,7 +91,15 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
mCableLossPerMeter = aCableLossPerMeter;
}
- public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ public GT_MetaPipeEntity_Cable(
+ String aName,
+ float aThickNess,
+ Materials aMaterial,
+ long aCableLossPerMeter,
+ long aAmperage,
+ long aVoltage,
+ boolean aInsulated,
+ boolean aCanShock) {
super(aName, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -94,36 +117,88 @@ 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);
+ return new GT_MetaPipeEntity_Cable(
+ mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
if (!mInsulated)
- return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
- 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))};
- 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))};
- 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))};
- 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))};
- 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))
+ };
+ 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))
+ };
+ 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))
+ };
+ 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))
+ };
+ 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))
+ };
}
- 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))
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
+ if (mCanShock
+ && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0
+ && aEntity instanceof EntityLivingBase
+ && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
+ GT_Utility.applyElectricityDamage(
+ (EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
}
@Override
@@ -158,34 +233,37 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (!isConnectedAtSide(aSide) && aSide != 6)
- return 0;
- if (!getBaseMetaTileEntity().getCoverBehaviorAtSideNew(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide), getBaseMetaTileEntity()))
- return 0;
+ if (!isConnectedAtSide(aSide) && aSide != 6) return 0;
+ if (!getBaseMetaTileEntity()
+ .getCoverBehaviorAtSideNew(aSide)
+ .letsEnergyIn(
+ aSide,
+ getBaseMetaTileEntity().getCoverIDAtSide(aSide),
+ getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide),
+ getBaseMetaTileEntity())) return 0;
HashSet nul = null;
- return transferElectricity(aSide, aVoltage, aAmperage,nul);
+ return transferElectricity(aSide, aVoltage, aAmperage, nul);
}
@Override
@Deprecated
- public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) {
+ public long transferElectricity(
+ byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList) {
return transferElectricity(aSide, aVoltage, aAmperage, new HashSet<>(aAlreadyPassedTileEntityList));
}
@Override
public long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet aAlreadyPassedSet) {
if (!getBaseMetaTileEntity().isServerSide() || !isConnectedAtSide(aSide) && aSide != 6) return 0;
- BaseMetaPipeEntity tBase =(BaseMetaPipeEntity) getBaseMetaTileEntity();
- if (!(tBase.getNode() instanceof PowerNode))
- return 0;
- PowerNode tNode =(PowerNode) tBase.getNode();
+ BaseMetaPipeEntity tBase = (BaseMetaPipeEntity) getBaseMetaTileEntity();
+ if (!(tBase.getNode() instanceof PowerNode)) return 0;
+ PowerNode tNode = (PowerNode) tBase.getNode();
if (tNode != null) {
int tPlace = 0;
Node[] tToPower = new Node[tNode.mConsumers.size()];
if (tNode.mHadVoltage) {
for (ConsumerNode consumer : tNode.mConsumers) {
- if (consumer.needsEnergy())
- tToPower[tPlace++] = consumer;
+ if (consumer.needsEnergy()) tToPower[tPlace++] = consumer;
}
} else {
tNode.mHadVoltage = true;
@@ -193,35 +271,39 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
tToPower[tPlace++] = consumer;
}
}
- return PowerNodes.powerNode(tNode,null,new NodeList(tToPower),(int)aVoltage,(int)aAmperage);
+ return PowerNodes.powerNode(tNode, null, new NodeList(tToPower), (int) aVoltage, (int) aAmperage);
}
return 0;
}
@Override
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- if(aBaseMetaTileEntity.isServerSide()) {
+ 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
+ lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime()
+ - 1; // sets initial value -1 since it is in the same tick as first on post tick
}
}
-
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aTick%20 == 0 && aBaseMetaTileEntity.isServerSide() && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) {
+ if (aTick % 20 == 0
+ && aBaseMetaTileEntity.isServerSide()
+ && (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections)) {
checkConnections();
}
}
@Override
- public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Mod.gregtechproxy.gt6Cable && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
- if(isConnectedAtSide(aWrenchingSide)) {
+ public boolean onWireCutterRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Cable
+ && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
+ if (isConnectedAtSide(aWrenchingSide)) {
disconnect(aWrenchingSide);
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected"));
- }else if(!GT_Mod.gregtechproxy.costlyCableConnection){
+ } else if (!GT_Mod.gregtechproxy.costlyCableConnection) {
if (connect(aWrenchingSide) > 0)
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected"));
}
@@ -231,8 +313,10 @@ 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) {
- if (GT_Mod.gregtechproxy.gt6Cable && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Cable
+ && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
if (isConnectedAtSide(aWrenchingSide)) {
disconnect(aWrenchingSide);
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected"));
@@ -246,26 +330,37 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
}
@Override
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
- public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsOut(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
}
@Override
- public boolean letsIn(GT_CoverBehaviorBase> coverBehavior, byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ 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) {
+ public boolean letsOut(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
}
-
@Override
public boolean canConnect(byte aSide, TileEntity tTileEntity) {
final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
@@ -274,20 +369,21 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
final ForgeDirection tDir = ForgeDirection.getOrientation(tSide);
// GT Machine handling
- if ((tTileEntity instanceof IEnergyConnected) &&
- (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false) || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false)))
- return true;
+ if ((tTileEntity instanceof IEnergyConnected)
+ && (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false)
+ || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false))) return true;
// Solar Panel Compat
if (coverBehavior instanceof GT_Cover_SolarPanel) return true;
- // ((tIsGregTechTileEntity && tIsTileEntityCable) && (tAlwaysLookConnected || tLetEnergyIn || tLetEnergyOut) ) --> Not needed
- if (Loader.isModLoaded("GalacticraftCore") && GT_GC_Compat.canConnect(tTileEntity,tDir))
- return true;
+ // ((tIsGregTechTileEntity && tIsTileEntityCable) && (tAlwaysLookConnected || tLetEnergyIn || tLetEnergyOut) )
+ // --> Not needed
+ if (Loader.isModLoaded("GalacticraftCore") && GT_GC_Compat.canConnect(tTileEntity, tDir)) return true;
// AE2-p2p Compat
if (GT_Mod.gregtechproxy.mAE2Integration) {
- if (tTileEntity instanceof appeng.tile.powersink.IC2 && ((appeng.tile.powersink.IC2)tTileEntity).acceptsEnergyFrom((TileEntity)baseMetaTile, tDir))
+ if (tTileEntity instanceof appeng.tile.powersink.IC2
+ && ((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir))
return true;
}
@@ -298,12 +394,14 @@ 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);
+ ic2Energy = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null)
+ ? 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;
+ if ((ic2Energy instanceof IEnergySink)
+ && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir)) return true;
// IC2 Source Compat
if (GT_Mod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) {
@@ -313,11 +411,14 @@ 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;
+ if (GregTech_API.mOutputRF
+ && tTileEntity instanceof IEnergyReceiver
+ && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir)) return true;
// RF Input Compat
- return GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
+ return GregTech_API.mInputRF
+ && (tTileEntity instanceof IEnergyEmitter
+ && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
}
@Override
@@ -326,7 +427,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
return GT_Mod.gregtechproxy.gt6Cable;
}
-
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
@@ -339,29 +439,32 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public String[] getDescription() {
- return new String[]{
- "Max Voltage: %%%" + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mVoltage) + " (" + GT_Values.TIER_COLORS[GT_Utility.getTier(mVoltage)] + VN[GT_Utility.getTier(mVoltage)] + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: %%%" + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mAmperage) + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + GT_Utility.formatNumbers(mCableLossPerMeter) + EnumChatFormatting.GRAY + "%%% EU-Volt"
+ return new String[] {
+ "Max Voltage: %%%" + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mVoltage) + " ("
+ + GT_Values.TIER_COLORS[GT_Utility.getTier(mVoltage)] + VN[GT_Utility.getTier(mVoltage)]
+ + EnumChatFormatting.GREEN + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: %%%" + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mAmperage)
+ + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + GT_Utility.formatNumbers(mCableLossPerMeter)
+ + EnumChatFormatting.GRAY + "%%% EU-Volt"
};
}
@Override
public float getThickNess() {
- if(GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
return mThickNess;
}
@Override
public void saveNBTData(NBTTagCompound aNBT) {
- if (GT_Mod.gregtechproxy.gt6Cable)
- aNBT.setByte("mConnections", mConnections);
+ if (GT_Mod.gregtechproxy.gt6Cable) aNBT.setByte("mConnections", mConnections);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
if (GT_Mod.gregtechproxy.gt6Cable) {
- mConnections = aNBT.getByte("mConnections");
+ mConnections = aNBT.getByte("mConnections");
}
}
@@ -373,73 +476,98 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public String[] getInfoData() {
BaseMetaPipeEntity base = (BaseMetaPipeEntity) getBaseMetaTileEntity();
- PowerNodePath path =(PowerNodePath) base.getNodePath();
+ PowerNodePath path = (PowerNodePath) base.getNodePath();
long amps = 0;
long volts = 0;
if (path != null) {
amps = path.getAmps();
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"
+ 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"
};
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- 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);
- }
+ float tSpace = (1f - mThickNess) / 2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0) {
+ tSide2 = tSide4 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide1 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0) {
+ tSide0 = tSide4 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide1 = tSide3 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0) {
+ tSide0 = tSide2 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) {
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
- AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
- }
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if ((tConn & (1 << ForgeDirection.DOWN.ordinal())) != 0) tSide0 = 0f;
+ if ((tConn & (1 << ForgeDirection.UP.ordinal())) != 0) tSide1 = 1f;
+ if ((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if ((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ 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);
+ }
+
+ @Override
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider) {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
}
@Override
@@ -448,15 +576,20 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if (mConnections != 0) {
final IGregTechTileEntity baseMeta = getBaseMetaTileEntity();
- 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);
-
- if (tEmitter instanceof IEnergyEmitter)
- return true;
-
- }
+ 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);
+
+ if (tEmitter instanceof IEnergyEmitter) return true;
+ }
}
return false;
}
@@ -471,7 +604,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if (coverBehavior instanceof GT_Cover_None) continue;
final int coverId = pipe.getCoverIDAtSide(i);
ISerializableObject coverData = pipe.getComplexCoverDataAtSide(i);
- if (!letsIn(coverBehavior, i, coverId, coverData, pipe) || !letsOut(coverBehavior, i, coverId, coverData, pipe)) {
+ if (!letsIn(coverBehavior, i, coverId, coverData, pipe)
+ || !letsOut(coverBehavior, i, coverId, coverData, pipe)) {
pipe.addToLock(pipe, i);
} else {
pipe.removeFromLock(pipe, i);
@@ -486,7 +620,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if (coverBehavior instanceof GT_Cover_None) continue;
final int coverId = pipe.getCoverIDAtSide(i);
ISerializableObject coverData = pipe.getComplexCoverDataAtSide(i);
- if (!letsIn(coverBehavior, i, coverId, coverData, pipe) || !letsOut(coverBehavior, i, coverId, coverData, pipe)) {
+ if (!letsIn(coverBehavior, i, coverId, coverData, pipe)
+ || !letsOut(coverBehavior, i, coverId, coverData, pipe)) {
dontAllow = 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 5f91c2acd1..d25f92b58b 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
@@ -1,10 +1,13 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+
import cpw.mods.fml.common.Optional;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.*;
+import gregtech.api.enums.ParticleFX;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
@@ -17,6 +20,8 @@ import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import gregtech.common.GT_Client;
import gregtech.common.covers.GT_Cover_Drain;
import gregtech.common.covers.GT_Cover_FluidRegulator;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -32,12 +37,6 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import org.apache.commons.lang3.tuple.MutableTriple;
-import java.util.ArrayList;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.D1;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public final float mThickNess;
public final Materials mMaterial;
@@ -50,11 +49,28 @@ 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) {
+ public GT_MetaPipeEntity_Fluid(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ Materials aMaterial,
+ 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) {
+ public GT_MetaPipeEntity_Fluid(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ Materials aMaterial,
+ int aCapacity,
+ int aHeatResistance,
+ boolean aGasProof,
+ int aFluidTypes) {
super(aID, aName, aNameRegional, 0, false);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -67,11 +83,24 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
@Deprecated
- public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ public GT_MetaPipeEntity_Fluid(
+ String aName,
+ float aThickNess,
+ Materials aMaterial,
+ int aCapacity,
+ 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) {
+ public GT_MetaPipeEntity_Fluid(
+ String aName,
+ float aThickNess,
+ Materials aMaterial,
+ int aCapacity,
+ int aHeatResistance,
+ boolean aGasProof,
+ int aFluidTypes) {
super(aName, 0);
mThickNess = aThickNess;
mMaterial = aMaterial;
@@ -89,14 +118,27 @@ 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);
+ return new GT_MetaPipeEntity_Fluid(
+ mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount);
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
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))};
+ return new ITexture[] {
+ aConnected
+ ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex)
+ : TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
+ };
byte tMask = 0;
byte[][] sRestrictionArray = {
{2, 3, 5, 4},
@@ -108,30 +150,51 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
};
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)};
+ // 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)
+ };
}
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));
+ return TextureFactory.of(
+ 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));
+ return TextureFactory.of(
+ 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));
+ return TextureFactory.of(
+ 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));
+ return TextureFactory.of(
+ 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));
+ return TextureFactory.of(
+ 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));
+ return TextureFactory.of(
+ 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));
- return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ return TextureFactory.of(
+ 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));
}
protected static ITexture getRestrictorTexture(byte aMask) {
@@ -236,14 +299,19 @@ 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) {
+ if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0
+ && aEntity instanceof EntityLivingBase) {
for (FluidStack tFluid : mFluids) {
if (tFluid != null) {
int tTemperature = tFluid.getFluid().getTemperature(tFluid);
- if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ 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)) {
+ } else if (tTemperature < 260
+ && !isCoverOnSide(
+ (BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
break;
}
@@ -278,7 +346,6 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
oLastReceivedFrom = mLastReceivedFrom;
-
}
}
@@ -291,21 +358,36 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
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);
+ 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);
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);
-
+ 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);
}
if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
tFluid.amount -= 5;
sendSound((byte) 9);
if (tTemperature > 320) {
try {
- for (EntityLivingBase tLiving : (ArrayList) 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))) {
+ for (EntityLivingBase tLiving : (ArrayList) 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))) {
GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
}
} catch (Throwable e) {
@@ -313,7 +395,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
} else if (tTemperature < 260) {
try {
- for (EntityLivingBase tLiving : (ArrayList) 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))) {
+ for (EntityLivingBase tLiving : (ArrayList) 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))) {
GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
}
} catch (Throwable e) {
@@ -341,9 +433,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
final IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aSide);
final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null;
- if (isConnectedAtSide(aSide) && tTank != null && (mLastReceivedFrom & (1 << aSide)) == 0 &&
- getBaseMetaTileEntity().getCoverBehaviorAtSideNew(aSide).letsFluidOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide), tFluid.getFluid(), getBaseMetaTileEntity()) &&
- (gTank == null || gTank.getCoverBehaviorAtSideNew(tSide).letsFluidIn(tSide, gTank.getCoverIDAtSide(tSide), gTank.getComplexCoverDataAtSide(tSide), tFluid.getFluid(), gTank))) {
+ if (isConnectedAtSide(aSide)
+ && tTank != null
+ && (mLastReceivedFrom & (1 << aSide)) == 0
+ && getBaseMetaTileEntity()
+ .getCoverBehaviorAtSideNew(aSide)
+ .letsFluidOut(
+ aSide,
+ getBaseMetaTileEntity().getCoverIDAtSide(aSide),
+ getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide),
+ tFluid.getFluid(),
+ getBaseMetaTileEntity())
+ && (gTank == null
+ || gTank.getCoverBehaviorAtSideNew(tSide)
+ .letsFluidIn(
+ tSide,
+ gTank.getCoverIDAtSide(tSide),
+ gTank.getComplexCoverDataAtSide(tSide),
+ tFluid.getFluid(),
+ gTank))) {
if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) {
tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0));
}
@@ -366,9 +474,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
// Now distribute
for (MutableTriple tEntry : tTanks) {
if (availableCapacity > tAmount)
- tEntry.right = (int) Math.floor(tEntry.right * tAmount / availableCapacity); // Distribue fluids based on percentage available space at destination
+ tEntry.right = (int) Math.floor(tEntry.right
+ * tAmount
+ / availableCapacity); // Distribue fluids based on percentage available space at destination
if (tEntry.right == 0)
- tEntry.right = (int) Math.min(1, tAmount); // If the percent is not enough to give at least 1L, try to give 1L
+ tEntry.right =
+ (int) Math.min(1, tAmount); // If the percent is not enough to give at least 1L, try to give 1L
if (tEntry.right <= 0) continue;
int tFilledAmount = tEntry.left.fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false);
@@ -377,11 +488,11 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (mFluids[index] == null || mFluids[index].amount <= 0) return;
}
-
}
@Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWrenchRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) {
byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
byte tMask = (byte) (1 << tSide);
@@ -389,16 +500,14 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (isInputDisabledAtSide(tSide)) {
mDisableInput &= ~tMask;
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("212", "Input enabled"));
- if (!isConnectedAtSide(tSide))
- connect(tSide);
+ if (!isConnectedAtSide(tSide)) connect(tSide);
} else {
mDisableInput |= tMask;
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("213", "Input disabled"));
}
} else {
if (!isConnectedAtSide(tSide)) {
- if (connect(tSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected"));
+ if (connect(tSide) > 0) GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected"));
} else {
disconnect(tSide);
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected"));
@@ -410,37 +519,49 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
@Override
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, 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) {
+ public boolean letsOut(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, 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) {
+ public boolean letsIn(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ 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) {
+ public boolean letsOut(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity);
}
@Override
public boolean canConnect(byte aSide, TileEntity tTileEntity) {
- if (tTileEntity == null)
- return false;
+ if (tTileEntity == null) return false;
- final byte tSide = (byte) ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
+ final byte tSide =
+ (byte) ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- if (baseMetaTile == null)
- return false;
+ if (baseMetaTile == null) return false;
final GT_CoverBehaviorBase> coverBehavior = baseMetaTile.getCoverBehaviorAtSideNew(aSide);
- final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
+ final IGregTechTileEntity gTileEntity =
+ (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
if (coverBehavior instanceof GT_Cover_Drain || (GregTech_API.mTConstruct && isTConstructFaucet(tTileEntity)))
return true;
@@ -451,9 +572,9 @@ 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;
-
+ || (GregTech_API.mTranslocator && isTranslocator(tTileEntity))
+ || gTileEntity != null
+ && gTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof GT_Cover_FluidRegulator;
}
}
return false;
@@ -484,20 +605,17 @@ 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()
- );
+ .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());
}
}
@@ -509,18 +627,16 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public FluidTankInfo getInfo() {
for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- return new FluidTankInfo(tFluid, mCapacity * 20);
+ if (tFluid != null) return new FluidTankInfo(tFluid, mCapacity * 20);
}
return new FluidTankInfo(null, mCapacity * 20);
}
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {};
ArrayList tList = new ArrayList<>();
- for (FluidStack tFluid : mFluids)
- tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
+ for (FluidStack tFluid : mFluids) tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
return tList.toArray(new FluidTankInfo[mPipeAmount]);
}
@@ -537,8 +653,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public final FluidStack getFluid() {
for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- return tFluid;
+ if (tFluid != null) return tFluid;
}
return null;
}
@@ -547,8 +662,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public final int getFluidAmount() {
int rAmount = 0;
for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- rAmount += tFluid.amount;
+ if (tFluid != null) rAmount += tFluid.amount;
}
return rAmount;
}
@@ -611,8 +725,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public final FluidStack drain(int maxDrain, boolean doDrain) {
FluidStack drained;
for (int i = 0; i < mPipeAmount; i++) {
- if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
- return drained;
+ if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null) return drained;
}
return null;
}
@@ -626,8 +739,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
int used = maxDrain;
- if (mFluids[index].amount < used)
- used = mFluids[index].amount;
+ if (mFluids[index].amount < used) used = mFluids[index].amount;
if (doDrain) {
mFluids[index].amount -= used;
@@ -651,14 +763,18 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
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
+ 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
};
} 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,
+ 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
};
}
@@ -688,8 +804,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ else return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
@@ -734,11 +849,19 @@ 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) {
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider) {
super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
@@ -748,12 +871,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (aFluid == null)
- return null;
+ if (aFluid == null) return null;
for (int i = 0; i < mFluids.length; ++i) {
final FluidStack f = mFluids[i];
- if (f == null || !f.isFluidEqual(aFluid))
- continue;
+ if (f == null || !f.isFluidEqual(aFluid)) continue;
return drainFromIndex(aFluid.amount, doDrain, i);
}
return null;
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 e1677b1deb..dce130325c 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.RA;
+
import gregtech.api.enums.Dyes;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -16,12 +18,9 @@ import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import static gregtech.api.enums.GT_Values.RA;
-
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.");
+ "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) {
@@ -29,8 +28,16 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
mMaterial = aMaterial;
GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1));
- GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial)});
- RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8);
+ GT_ModHandler.addCraftingRecipe(
+ getStackForm(2),
+ RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] {"SSS", "SwS", "SSS", 'S', OrePrefixes.stick.get(mMaterial)});
+ RA.addAssemblerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4),
+ ItemList.Circuit_Integrated.getWithDamage(0, 4),
+ getStackForm(1),
+ 64,
+ 8);
}
public GT_MetaPipeEntity_Frame(String aName, Materials aMaterial) {
@@ -49,8 +56,18 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
+ return new ITexture[] {
+ TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
+ };
}
@Override
@@ -84,26 +101,36 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
}
@Override
- public final void saveNBTData(NBTTagCompound aNBT) {/*Do nothing*/}
+ public final void saveNBTData(NBTTagCompound aNBT) {
+ /*Do nothing*/
+ }
@Override
- public final void loadNBTData(NBTTagCompound aNBT) {/*Do nothing*/}
+ public final void loadNBTData(NBTTagCompound aNBT) {
+ /*Do nothing*/
+ }
@Override
- public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public final boolean allowPutStack(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
@Override
- public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public final boolean allowPullStack(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
@Override
- public int connect(byte aSide) {return 0;}
+ public int connect(byte aSide) {
+ return 0;
+ }
@Override
- public void disconnect(byte aSide) {/* Do nothing*/}
+ public void disconnect(byte aSide) {
+ /* Do nothing*/
+ }
@Override
public boolean isMachineBlockUpdateRecursive() {
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 218e064f71..c919187927 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.Textures.BlockIcons.PIPE_RESTRICTOR;
+
import gregtech.GT_Mod;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.GT_Values;
@@ -18,6 +20,9 @@ import gregtech.api.util.GT_CoverBehaviorBase;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.ISerializableObject;
import gregtech.common.GT_Client;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -31,12 +36,6 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import static gregtech.api.enums.Textures.BlockIcons.PIPE_RESTRICTOR;
-
public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileEntityItemPipe {
public final float mThickNess;
public final Materials mMaterial;
@@ -47,7 +46,16 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
public boolean mIsRestrictive = false;
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) {
+ public GT_MetaPipeEntity_Item(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ Materials aMaterial,
+ int aInvSlotCount,
+ int aStepSize,
+ boolean aIsRestrictive,
+ int aTickTime) {
super(aID, aName, aNameRegional, aInvSlotCount, false);
mIsRestrictive = aIsRestrictive;
mThickNess = aThickNess;
@@ -57,11 +65,26 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
addInfo(aID);
}
- public GT_MetaPipeEntity_Item(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aInvSlotCount, int aStepSize, boolean aIsRestrictive) {
+ public GT_MetaPipeEntity_Item(
+ int aID,
+ String aName,
+ String aNameRegional,
+ float aThickNess,
+ Materials aMaterial,
+ 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) {
+ public GT_MetaPipeEntity_Item(
+ String aName,
+ float aThickNess,
+ Materials aMaterial,
+ int aInvSlotCount,
+ int aStepSize,
+ boolean aIsRestrictive,
+ int aTickTime) {
super(aName, aInvSlotCount);
mIsRestrictive = aIsRestrictive;
mThickNess = aThickNess;
@@ -77,43 +100,113 @@ 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);
+ return new GT_MetaPipeEntity_Item(
+ mName, mThickNess, mMaterial, mInventory.length, mStepSize, mIsRestrictive, mTickTime);
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ 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.374F)//0.375
- 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)};
- 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)};
- 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], 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)
+ };
+ 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)
+ };
+ 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)
+ };
+ 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)
+ };
+ 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],
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
- if (tThickNess < 0.374F)//0.375
- return new ITexture[]{TextureFactory.of(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))};
- if (tThickNess < 0.749F)//0.750
- return new ITexture[]{TextureFactory.of(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], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))
+ };
+ if (tThickNess < 0.499F) // 0.500
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))
+ };
+ 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],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
+ };
}
- return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[] {
+ TextureFactory.of(
+ mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex],
+ Dyes.getModulation(aColorIndex, mMaterial.mRGBa))
+ };
}
@Override
@@ -149,8 +242,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
- if (GT_Mod.gregtechproxy.gt6Pipe)
- aNBT.setByte("mConnections", mConnections);
+ if (GT_Mod.gregtechproxy.gt6Pipe) aNBT.setByte("mConnections", mConnections);
}
@Override
@@ -177,7 +269,9 @@ 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(IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false)).keySet()) {
+ for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending(
+ IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false))
+ .keySet()) {
if (temp) break;
tPipeList.add(tTileEntity);
while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity))
@@ -193,15 +287,15 @@ 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) {
+ public boolean onWrenchRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) {
byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
if (isConnectedAtSide(tSide)) {
disconnect(tSide);
GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("215", "Disconnected"));
} else {
- if (connect(tSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected"));
+ if (connect(tSide) > 0) GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("214", "Connected"));
}
return true;
}
@@ -209,22 +303,34 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
}
@Override
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean letsIn(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, 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) {
+ public boolean letsOut(
+ GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, 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) {
+ public boolean letsIn(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ 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) {
+ public boolean letsOut(
+ GT_CoverBehaviorBase> coverBehavior,
+ byte aSide,
+ int aCoverID,
+ ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return coverBehavior.letsItemsOut(aSide, aCoverID, aCoverVariable, -1, aTileEntity);
}
@@ -235,7 +341,8 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
final byte tSide = GT_Utility.getOppositeSide(aSide);
boolean connectable = GT_Utility.isConnectableNonInventoryPipe(tTileEntity, tSide);
- final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
+ final IGregTechTileEntity gTileEntity =
+ (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
if (gTileEntity != null) {
if (gTileEntity.getMetaTileEntity() == null) return false;
if (gTileEntity.getMetaTileEntity().connectsToItemPipe(tSide)) return true;
@@ -261,7 +368,6 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
return GT_Mod.gregtechproxy.gt6Pipe;
}
-
@Override
public boolean incrementTransferCounter(int aIncrement) {
mTransferredItems += aIncrement;
@@ -274,7 +380,8 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
byte tOffset = (byte) getBaseMetaTileEntity().getRandomNumber(6), tSide = 0;
for (byte i = 0; i < 6; i++) {
tSide = (byte) ((i + tOffset) % 6);
- if (isConnectedAtSide(tSide) && (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity()))) {
+ if (isConnectedAtSide(tSide)
+ && (isInventoryEmpty() || (tSide != mLastReceivedFrom || aSender != getBaseMetaTileEntity()))) {
if (insertItemStackIntoTileEntity(aSender, tSide)) return true;
}
}
@@ -284,11 +391,31 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide) {
- if (getBaseMetaTileEntity().getCoverBehaviorAtSideNew(aSide).letsItemsOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide), -1, getBaseMetaTileEntity())) {
+ if (getBaseMetaTileEntity()
+ .getCoverBehaviorAtSideNew(aSide)
+ .letsItemsOut(
+ aSide,
+ getBaseMetaTileEntity().getCoverIDAtSide(aSide),
+ getBaseMetaTileEntity().getComplexCoverDataAtSide(aSide),
+ -1,
+ getBaseMetaTileEntity())) {
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)) {
- return GT_Utility.moveMultipleItemStacks(aSender, tInventory, (byte) 6, GT_Utility.getOppositeSide(aSide), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1, 1) > 0;
+ if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser))
+ || 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;
}
}
}
@@ -333,10 +460,24 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public int[] getAccessibleSlotsFromSide(int aSide) {
IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
- boolean tAllow = tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getComplexCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ boolean tAllow = tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsIn(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ -2,
+ tTileEntity)
+ || tTileEntity
+ .getCoverBehaviorAtSideNew((byte) aSide)
+ .letsItemsOut(
+ (byte) aSide,
+ tTileEntity.getCoverIDAtSide((byte) aSide),
+ tTileEntity.getComplexCoverDataAtSide((byte) aSide),
+ -2,
+ tTileEntity);
if (tAllow) {
- if (cacheSides == null)
- cacheSides = super.getAccessibleSlotsFromSide(aSide);
+ if (cacheSides == null) cacheSides = super.getAccessibleSlotsFromSide(aSide);
return cacheSides;
} else {
return GT_Values.emptyIntArray;
@@ -358,11 +499,20 @@ 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)};
+ return new String[] {
+ "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/sec",
+ "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)};
+ return new String[] {
+ "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)};
+ return new String[] {
+ "Item Capacity: %%%" + getMaxPipeCapacity() + "%%% Stacks/%%%" + mTickTime + "%%% ticks",
+ "Routing Value: %%%" + GT_Utility.formatNumbers(mStepSize)
+ };
}
private boolean isInventoryEmpty() {
@@ -380,8 +530,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ else return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
@@ -426,11 +575,19 @@ 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) {
+ public void addCollisionBoxesToList(
+ World aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ AxisAlignedBB inputAABB,
+ List outputAABB,
+ Entity collider) {
super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
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 1a81e4d570..67c3c672ae 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.enums.Textures;
import gregtech.api.gui.*;
import gregtech.api.interfaces.ITexture;
@@ -15,8 +17,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import static gregtech.api.enums.GT_Values.V;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -30,38 +30,54 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
private long mStored = 0;
private long mMax = 0;
- public GT_MetaTileEntity_BasicBatteryBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ public GT_MetaTileEntity_BasicBatteryBuffer(
+ int aID, String aName, String aNameRegional, int aTier, 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) {
+ public GT_MetaTileEntity_BasicBatteryBuffer(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicBatteryBuffer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ public GT_MetaTileEntity_BasicBatteryBuffer(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
@Override
public String[] getDescription() {
- String[] desc = new String[mDescriptionArray.length + 1];
- System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
- desc[mDescriptionArray.length] = mInventory.length + " Slots";
- return desc;
+ String[] desc = new String[mDescriptionArray.length + 1];
+ System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
+ desc[mDescriptionArray.length] = mInventory.length + " Slots";
+ return desc;
}
@Override
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[2][17][];
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]};
+ 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]
+ };
}
return rTextures;
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
}
@@ -247,14 +263,15 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName().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")) {
- if(ic2.api.item.ElectricItem.manager.getCharge(aStack)==0){
- return true;}
+ 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")) {
+ if (ic2.api.item.ElectricItem.manager.getCharge(aStack) == 0) {
+ return true;
+ }
}
}
return false;
@@ -265,7 +282,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
if (!GT_Utility.isStackValid(aStack)) {
return false;
}
- if (mInventory[aIndex]==null && GT_ModHandler.isElectricItem(aStack, this.mTier)) {
+ if (mInventory[aIndex] == null && GT_ModHandler.isElectricItem(aStack, this.mTier)) {
return true;
}
return false;
@@ -277,8 +294,8 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
}
public long[] getStoredEnergy() {
- boolean scaleOverflow =false;
- boolean storedOverflow = false;
+ boolean scaleOverflow = false;
+ boolean storedOverflow = false;
long tScale = getBaseMetaTileEntity().getEUCapacity();
long tStored = getBaseMetaTileEntity().getStoredEU();
long tStep = 0;
@@ -289,10 +306,14 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
if (aStack.getItem() instanceof GT_MetaBase_Item) {
Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack);
if (stats != null) {
- if(stats[0]>Long.MAX_VALUE/2){scaleOverflow=true;}
+ if (stats[0] > Long.MAX_VALUE / 2) {
+ scaleOverflow = true;
+ }
tScale = tScale + stats[0];
tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
- if(tStep > Long.MAX_VALUE/2){storedOverflow=true;}
+ if (tStep > Long.MAX_VALUE / 2) {
+ storedOverflow = true;
+ }
tStored = tStored + tStep;
}
} else if (aStack.getItem() instanceof IElectricItem) {
@@ -301,11 +322,14 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
}
}
}
-
}
- if(scaleOverflow){tScale=Long.MAX_VALUE;}
- if(storedOverflow){tStored=Long.MAX_VALUE;}
- return new long[]{tStored, tScale};
+ if (scaleOverflow) {
+ tScale = Long.MAX_VALUE;
+ }
+ if (storedOverflow) {
+ tStored = Long.MAX_VALUE;
+ }
+ return new long[] {tStored, tScale};
}
@Override
@@ -317,15 +341,16 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
count = 0;
}
- 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"};
+ 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"
+ };
}
@Override
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 8a626460fb..091c364b4f 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.enums.ItemList;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
@@ -18,14 +20,14 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
-import static gregtech.api.enums.GT_Values.V;
-
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) {
+ public GT_MetaTileEntity_BasicGenerator(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, 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) {
+ public GT_MetaTileEntity_BasicGenerator(
+ int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
}
@@ -56,8 +58,21 @@ 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) {
- return mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ 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];
}
@Override
@@ -76,23 +91,23 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
}
public ITexture[] getFront(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBack(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTop(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getSides(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontActive(byte aColor) {
@@ -158,7 +173,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
@Override
public boolean doesFillContainers() {
return getBaseMetaTileEntity().isAllowedToWork();
- //return false;
+ // return false;
}
@Override
@@ -193,7 +208,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
@Override
public boolean isLiquidOutput(byte aSide) {
- //return super.isLiquidOutput(aSide);
+ // return super.isLiquidOutput(aSide);
return false;
}
@@ -206,39 +221,50 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
} else {
if (mInventory[getStackDisplaySlot()] == null)
mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- mInventory[getStackDisplaySlot()].setStackDisplayName("Draining internal buffer: " + GT_Utility.formatNumbers(aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
+ mInventory[getStackDisplaySlot()].setStackDisplayName("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);
- //long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);//TODO CHECK
- if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
+ long tFluidAmountToUse = Math.min(
+ 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)) {
// divided by two because this is called every 10 ticks, not 20
- GT_Pollution.addPollution(getBaseMetaTileEntity(),getPollution()/2);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2);
mFluid.amount -= tFluidAmountToUse * tConsumed;
}
}
}
- if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) && ((GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) != null) || solidFuelOverride(mInventory[getInputSlot()]))) {
+ if (mInventory[getInputSlot()] != null
+ && 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 );
+ // System.out.println(" tFuelValue : " + tFuelValue );
if (tFuelValue > 0) {
ItemStack tEmptyContainer = getEmptyContainer(mInventory[getInputSlot()]);
if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
// divided by two because this is called every 10 ticks, not 20
- GT_Pollution.addPollution(getBaseMetaTileEntity(),getPollution()/2);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2);
}
}
}
}
if (aBaseMetaTileEntity.isServerSide())
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
}
/**
@@ -246,18 +272,24 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
* @return if the stack is a solid fuel
*/
public boolean solidFuelOverride(ItemStack stack) {
- //this could be used for a coal generator for example aswell...
+ // this could be used for a coal generator for example aswell...
ItemData association = GT_OreDictUnificator.getAssociation(stack);
- //if it is a gregtech Item, make sure its not a VOLUMETRIC_FLASK or any type of cell, else do vanilla checks
+ // 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);
+ return !OrePrefixes.CELL_TYPES.contains(association.mPrefix)
+ && !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...
+ 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...
}
}
@@ -309,7 +341,9 @@ 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);
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && (getFuelValue(aStack, 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 f6535d2ddc..31420386ee 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
@@ -1,5 +1,7 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -7,22 +9,30 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-import static gregtech.api.enums.GT_Values.V;
-
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) {
+ public GT_MetaTileEntity_BasicHull(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, 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) {
+ public GT_MetaTileEntity_BasicHull(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_BasicHull(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
-
- public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+
+ public GT_MetaTileEntity_BasicHull(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -107,7 +117,13 @@ 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) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aConnected,
+ boolean aRedstone) {
return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0)][aColorIndex + 1];
}
@@ -115,12 +131,18 @@ public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank {
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[6][17][];
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]};
- 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]};
- rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]};
+ 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]};
+ 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]
+ };
+ rTextures[4][i + 1] = new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], 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]
+ };
}
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 54fe2b32a6..716d9d2c12 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
@@ -4,20 +4,29 @@ import gregtech.api.interfaces.ITexture;
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) {
+ public GT_MetaTileEntity_BasicHull_NonElectric(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
- public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_NonElectric(
+ String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 1, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicHull_NonElectric(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_NonElectric(
+ String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 1, aDescription, aTextures);
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aConnections,
+ 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 ce5c1b9ee4..25c7c2991e 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
@@ -1,5 +1,11 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.debugCleanroom;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
+import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
@@ -16,6 +22,8 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.common.power.BasicMachineEUPower;
import gregtech.common.power.Power;
import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Cleanroom;
+import java.util.Arrays;
+import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.entity.player.EntityPlayer;
@@ -32,34 +40,32 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-import java.util.Arrays;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.V;
-import static gregtech.api.enums.GT_Values.debugCleanroom;
-import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
-import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
-import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
* This is the main construct for my Basic Machines such as the Automatic Extractor
* Extend this class to make a simple Machine
*/
-public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank implements IConfigurationCircuitSupport {
+public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_BasicTank
+ implements IConfigurationCircuitSupport {
/**
* return values for checkRecipe()
*/
- protected static final int
- DID_NOT_FIND_RECIPE = 0,
+ protected static final int DID_NOT_FIND_RECIPE = 0,
FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
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;
+ public boolean mAllowInputFromOutputSide = false,
+ mFluidTransfer = false,
+ mItemTransfer = 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;
@@ -71,6 +77,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
*/
protected GT_Recipe mLastRecipe = null;
+
private FluidStack mFluidOut;
/**
@@ -90,8 +97,26 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* 12 = SideFacingPipeActive
* 13 = 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) {
- super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays);
+ 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) {
+ super(
+ 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;
@@ -100,8 +125,26 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mPower = buildPower();
}
- 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) {
- super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays);
+ 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) {
+ super(
+ 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;
@@ -109,7 +152,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mNEIName = aNEIName;
mPower = buildPower();
}
- public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+
+ public GT_MetaTileEntity_BasicMachine(
+ String aName,
+ int aTier,
+ int aAmperage,
+ String aDescription,
+ 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)];
@@ -119,7 +172,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mPower = buildPower();
}
- public GT_MetaTileEntity_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ public GT_MetaTileEntity_BasicMachine(
+ String aName,
+ int aTier,
+ int aAmperage,
+ String[] aDescription,
+ 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)];
@@ -137,18 +199,18 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
protected boolean isValidMainFacing(byte aSide) {
- return aSide > 1;
+ return aSide > 1;
}
- public boolean setMainFacing(byte aSide){
- if (!isValidMainFacing(aSide)) return false;
- mMainFacing = aSide;
- if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){
- getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
- }
+ public boolean setMainFacing(byte aSide) {
+ if (!isValidMainFacing(aSide)) return false;
+ mMainFacing = aSide;
+ if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
+ getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
+ }
onFacingChange();
onMachineBlockUpdate();
- return true;
+ return true;
}
@Override
@@ -157,10 +219,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
aTextures = Arrays.copyOf(aTextures, 14);
for (int i = 0; i < aTextures.length; i++)
- if (aTextures[i] != null) for (byte c = -1; c < 16; c++) {
- if (rTextures[i][c + 1] == null)
- rTextures[i][c + 1] = new ITexture[]{MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
- }
+ if (aTextures[i] != null)
+ for (byte c = -1; c < 16; c++) {
+ if (rTextures[i][c + 1] == null)
+ rTextures[i][c + 1] = new ITexture[] {MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
+ }
for (byte c = -1; c < 16; c++) {
if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
@@ -182,8 +245,28 @@ 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) {
- return mTextures[mMainFacing < 2 ? aSide == aFacing ? aActive ? 2 : 3 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 : aSide == mMainFacing ? aActive ? 2 : 3 : (showPipeFacing() && aSide == aFacing) ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1];
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return mTextures[
+ mMainFacing < 2
+ ? aSide == aFacing
+ ? aActive ? 2 : 3
+ : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1
+ : aSide == mMainFacing
+ ? aActive ? 2 : 3
+ : (showPipeFacing() && aSide == aFacing)
+ ? aSide == 0
+ ? aActive ? 8 : 9
+ : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13
+ : aSide == 0
+ ? aActive ? 6 : 7
+ : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][
+ aColorIndex + 1];
}
@Override
@@ -208,7 +291,10 @@ 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;
+ return aIndex > 0
+ && super.isValidSlot(aIndex)
+ && aIndex != getCircuitSlot()
+ && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@Override
@@ -238,7 +324,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
+ return aSide != mMainFacing
+ && (mAllowInputFromOutputSide
+ || aSide != getBaseMetaTileEntity().getFrontFacing());
}
@Override
@@ -268,7 +356,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public long maxAmperesIn() {
- return ((long)mEUt * 2L) / V[mTier] + 1L;
+ return ((long) mEUt * 2L) / V[mTier] + 1L;
}
@Override
@@ -329,7 +417,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
+ return getFillableStack() != null
+ || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
}
@Override
@@ -392,17 +481,17 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
- if(!GT_Mod.gregtechproxy.mForceFreeFace) {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
+ if (!GT_Mod.gregtechproxy.mForceFreeFace) {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
}
- for(byte i=0;i < 6; i++){
- if(aBaseMetaTileEntity.getAirAtSide(i)){
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
+ for (byte i = 0; i < 6; i++) {
+ if (aBaseMetaTileEntity.getAirAtSide(i)) {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
}
- GT_Utility.sendChatToPlayer(aPlayer,"No free Side!");
+ GT_Utility.sendChatToPlayer(aPlayer, "No free Side!");
return true;
}
@@ -413,14 +502,22 @@ 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 : "");
+ return new GT_GUIContainer_BasicMachine(
+ 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();
@@ -487,8 +584,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
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]))
- break;
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break;
if (mOutputFluid != null)
if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
else if (mOutputFluid.isFluidEqual(getDrainableStack()))
@@ -503,8 +600,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
endProcess();
}
if (mProgresstime > 5) mStuttering = false;
- //XSTR aXSTR = new XSTR();
- //if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ // XSTR aXSTR = new XSTR();
+ // if(GT_Mod.gregtechproxy.mAprilFool &&
+ // aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(),
+ // GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(),
+ // aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
} else {
if (!mStuttering) {
stutterProcess();
@@ -518,38 +618,72 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
boolean tRemovedOutputFluid = false;
- if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) {
+ if (doesAutoOutputFluids()
+ && getDrainableStack() != null
+ && 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);
+ tTank.fill(
+ 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)) {
+ if (doesAutoOutput()
+ && !isOutputEmpty()
+ && 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);
-// for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
-// tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
-// if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
-// }
+ 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);
+ // for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 &&
+ // aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
+ // tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
+ // aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64,
+ // (byte) 1, (byte) 64, (byte) 1);
+ // if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
+ // }
}
- if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0;
- else mOutputBlocked++;
+ if (mOutputBlocked != 0)
+ if (isOutputEmpty()) mOutputBlocked = 0;
+ else mOutputBlocked++;
if (allowToCheckRecipe()) {
- if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) {
+ if (mMaxProgresstime <= 0
+ && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid
+ || tSucceeded
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && hasEnoughEnergyToCheckRecipe()) {
if (checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) {
if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null;
for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
@@ -584,7 +718,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
// Value | Class | Field
// 1 | GT_MetaTileEntity_BasicMachine | mStuttering
// 64 | GT_MetaTileEntity_BasicMachine_Bronze | mNeedsSteamVenting
- aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127));// | (mStuttering ? 1 : 0));
+ aBaseMetaTileEntity.setErrorDisplayID(
+ (aBaseMetaTileEntity.getErrorDisplayID() & ~127)); // | (mStuttering ? 1 : 0));
}
protected void doDisplayThings() {
@@ -606,7 +741,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());
}
}
}
@@ -649,14 +785,20 @@ 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));
+ return aRecipe != null
+ && (aRecipe.mNeedsEmptyOutput
+ ? isOutputEmpty() && getDrainableStack() == null
+ : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
}
protected boolean canOutput(ItemStack... aOutputs) {
if (aOutputs == null) return true;
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())) {
+ 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;
}
@@ -664,7 +806,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
protected boolean canOutput(FluidStack aOutput) {
- return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity()));
+ return getDrainableStack() == null
+ || aOutput == null
+ || (getDrainableStack().isFluidEqual(aOutput)
+ && (getDrainableStack().amount <= 0
+ || getDrainableStack().amount + aOutput.amount <= getCapacity()));
}
protected ItemStack getInputAt(int aIndex) {
@@ -675,8 +821,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
int tRealInputSlotCount = this.mInputSlotCount + (allowSelectCircuit() ? 1 : 0);
ItemStack[] rInputs = new ItemStack[tRealInputSlotCount];
for (int i = 0; i < mInputSlotCount; i++) rInputs[i] = getInputAt(i);
- if (allowSelectCircuit())
- rInputs[mInputSlotCount] = getStackInSlot(getCircuitSlot());
+ if (allowSelectCircuit()) rInputs[mInputSlotCount] = getStackInSlot(getCircuitSlot());
return rInputs;
}
@@ -771,17 +916,21 @@ 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"
+ 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"
};
}
@@ -793,24 +942,31 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
- if (aPlayer.isSneaking()){
+ if (aPlayer.isSneaking()) {
mDisableFilter = !mDisableFilter;
- GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + mDisableFilter));
+ GT_Utility.sendChatToPlayer(
+ 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"));
+ GT_Utility.sendChatToPlayer(
+ 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) {
- if(!aPlayer.isSneaking()) return false;
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, 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));
+ GT_Utility.sendChatToPlayer(
+ aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableMultiStack." + mDisableMultiStack));
return true;
}
@@ -818,7 +974,12 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
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());}
+ return tBehavior.isGUIClickable(
+ aSide,
+ GT_Utility.stackToInt(aCoverID.toStack()),
+ tBehavior.createDataObject(),
+ getBaseMetaTileEntity());
+ }
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
@@ -827,10 +988,13 @@ 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;
+ if (aSide == mMainFacing
+ || aIndex < getInputSlot()
+ || 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;
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i]) && mDisableMultiStack)
+ return i == aIndex;
return mDisableFilter || allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack);
}
@@ -839,7 +1003,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* If mDisableMultiStack is false, before execution of this method it is ensured there is no such kind of item inside any input slots already.
* Otherwise, you don't need to check for it anyway.
*/
- protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return !mDisableMultiStack || mInventory[aIndex] == null;
}
@@ -866,7 +1031,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
@Override
- public int getCircuitGUISlot() { return 3; }
+ public int getCircuitGUISlot() {
+ return 3;
+ }
@Override
public List getConfigurationCircuits() {
@@ -893,16 +1060,15 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
return checkRecipe(false);
}
- 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");
+ 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");
}
-
/**
*
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
@@ -910,43 +1076,53 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
* FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
* FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
*/
- public int checkRecipe(boolean skipOC){
+ public int checkRecipe(boolean skipOC) {
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());
+ GT_Recipe tRecipe = tMap.findRecipe(
+ 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))
+ if (GT_Mod.gregtechproxy.mLowGravProcessing
+ && (tRecipe.mSpecialValue == -100 || tRecipe.mSpecialValue == -300)
+ && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
if (!canOutput(tRecipe)) {
mOutputBlocked++;
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))
+ if (tRecipe.mSpecialValue == -200
+ && (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()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < mOutputItems.length; i++)
if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
mOutputItems[i] = tRecipe.getOutput(i);
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
- );
- }
+ 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;
}
mOutputFluid = tRecipe.getFluidOutput(0);
- if(!skipOC){
+ if (!skipOC) {
calculateOverclockedNess(tRecipe);
- //In case recipe is too OP for that machine
+ // In case recipe is too OP for that machine
if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
@@ -954,75 +1130,79 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
+ return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
- public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(
+ ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();
- currenttip.add(String.format("Progress: %d s / %d s", tag.getInteger("progressSingleBlock"), tag.getInteger("maxProgressSingleBlock")));
+ currenttip.add(String.format(
+ "Progress: %d s / %d s",
+ tag.getInteger("progressSingleBlock"), tag.getInteger("maxProgressSingleBlock")));
super.getWailaBody(itemStack, currenttip, accessor, config);
}
@Override
- public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(
+ EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setInteger("progressSingleBlock", mProgresstime / 20);
- tag.setInteger("maxProgressSingleBlock", mMaxProgresstime / 20);
+ tag.setInteger("maxProgressSingleBlock", mMaxProgresstime / 20);
}
public Power getPower() {
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 f185a9c246..aa893c0bc2 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
@@ -1,8 +1,12 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.Textures.BlockIcons.*;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+
import gregtech.api.GregTech_API;
-import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.Dyes;
+import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -14,17 +18,12 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import gregtech.common.power.Power;
import gregtech.common.power.SteamPower;
+import java.util.ArrayList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.ArrayList;
-
-import static gregtech.api.enums.GT_Values.D1;
-import static gregtech.api.enums.Textures.BlockIcons.*;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -35,15 +34,44 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
private static final int NEEDS_STEAM_VENTING = 64;
public boolean mNeedsSteamVenting = false;
- public GT_MetaTileEntity_BasicMachine_Bronze(int aID, String aName, String aNameRegional, String aDescription, int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
- super(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) {
+ public GT_MetaTileEntity_BasicMachine_Bronze(
+ int aID,
+ String aName,
+ String aNameRegional,
+ String aDescription,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ boolean aHighPressure) {
+ super(
+ 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) {
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) {
+ public GT_MetaTileEntity_BasicMachine_Bronze(
+ String aName,
+ String[] aDescription,
+ ITexture[][][] aTextures,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ boolean aHighPressure) {
super(aName, aHighPressure ? 2 : 1, 0, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, "", "");
}
@@ -140,11 +168,53 @@ 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))) {
+ 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))) {
sendSound((byte) 9);
mNeedsSteamVenting = false;
try {
- for (EntityLivingBase tLiving : (ArrayList) 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))) {
+ for (EntityLivingBase tLiving : (ArrayList) 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))) {
GT_Utility.applyHeatDamage(tLiving, getSteamDamage());
}
} catch (Throwable e) {
@@ -156,8 +226,12 @@ 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());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, 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()))) {
this.mOutputItems[0] = tRecipe.getOutput(0);
calculateOverclockedNess(tRecipe);
return 2;
@@ -184,20 +258,26 @@ 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()
- );
+ .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());
}
}
@@ -208,7 +288,8 @@ 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);
+ return GregTech_API.getCoverBehaviorNew(aCoverID.toStack()).isSimpleCover()
+ && super.allowCoverOnSide(aSide, aCoverID);
}
public float getSteamDamage() {
@@ -217,71 +298,133 @@ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ isBricked() ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)),
+ TextureFactory.of(OVERLAY_PIPE_OUT)
+ };
}
}
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 b09639e292..419ab1fb14 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
@@ -1,10 +1,16 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.VN;
+import static gregtech.api.enums.GT_Values.W;
+import static gregtech.api.enums.GT_Values.ticksBetweenSounds;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.*;
+import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.Textures.BlockIcons.CustomIcon;
import gregtech.api.gui.GT_Container_BasicMachine;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
@@ -19,6 +25,7 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import ic2.core.Ic2Items;
+import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
@@ -28,14 +35,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
-import java.util.Locale;
-
-import static gregtech.api.enums.GT_Values.V;
-import static gregtech.api.enums.GT_Values.VN;
-import static gregtech.api.enums.GT_Values.W;
-import static gregtech.api.enums.GT_Values.ticksBetweenSounds;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
@@ -51,36 +50,99 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
private final byte mGUIParameterA, mGUIParameterB;
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
- ) {
- super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName,
+ 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) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ aRecipes.mAmperage,
+ aDescription,
+ aInputSlots,
+ aOutputSlots,
+ aGUIName,
+ aRecipes.mNEIName,
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()),
+ 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()),
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(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(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(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(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(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(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(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())
- );
+ 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;
@@ -90,8 +152,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
this.mGUIParameterA = (byte) aGUIParameterA;
this.mGUIParameterB = (byte) aGUIParameterB;
-
- //TODO: CHECK
+ // TODO: CHECK
if (aRecipe != null) {
for (int i = 3; i < aRecipe.length; i++) {
if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT) {
@@ -128,12 +189,12 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
case 6:
case 7:
case 8:
- if (Loader.isModLoaded("bartworks")) {//todo remove via provider pattern on all enums?
+ if (Loader.isModLoaded("bartworks")) { // todo remove via provider pattern on all enums?
aRecipe[i] = "blockGlass" + VN[aTier];
break;
}
default:
- if (Loader.isModLoaded("bartworks")) {//todo remove via provider pattern on all enums?
+ if (Loader.isModLoaded("bartworks")) { // todo remove via provider pattern on all enums?
aRecipe[i] = "blockGlass" + VN[8];
} else {
aRecipe[i] = Ic2Items.reinforcedGlass;
@@ -700,26 +761,57 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier);
}
- if (
- !GT_ModHandler.addCraftingRecipe(
+ if (!GT_ModHandler.addCraftingRecipe(
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());
+ 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
- ) {
+ 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) {
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);
}
/**
@@ -731,20 +823,63 @@ 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
- ) {
- this(aID, aName, aNameRegional, aTier, aDescription, aRecipes,
- aInputSlots, aOutputSlots, aTankCapacity, aGUIParameterA, aGUIParameterB, aGUIName, new ResourceLocation(aSound), aSharedTank,
- aRequiresFluidForFiltering, SpecialEffects.fromId(aSpecialEffect), aOverlays, aRecipe);
+ 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) {
+ this(
+ 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
- ) {
+ 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) {
super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
@@ -757,10 +892,23 @@ 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
- ) {
+ 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) {
super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
@@ -775,10 +923,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()
- );
+ 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());
}
@Override
@@ -789,61 +950,74 @@ 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) {
+ protected boolean allowPutStackValidated(
+ IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
switch (this.mInputSlotCount) {
case 0:
return false;
case 1:
if (this.getFillableStack() == null)
- return !this.mRequiresFluidForFiltering && this.getRecipeList().containsInput(aStack);
+ return !this.mRequiresFluidForFiltering
+ && this.getRecipeList().containsInput(aStack);
else
- return this.getRecipeList().findRecipe(
- this.getBaseMetaTileEntity(), this.mLastRecipe, true, true, V[this.mTier], new FluidStack[]{this.getFillableStack()},
- this.getSpecialSlot(), appendSelectedCircuit(aStack)
- ) != null;
+ return this.getRecipeList()
+ .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, true, V[this.mTier],
- new FluidStack[]{this.getFillableStack()},
- this.getSpecialSlot(), aIndex == this.getInputSlot() ?
- appendSelectedCircuit(aStack, this.getInputAt(1)) :
- appendSelectedCircuit(this.getInputAt(0), aStack)
- ) != null
- )
- )
- )
- );
+ 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))));
default: {
int tID = this.getBaseMetaTileEntity().getMetaTileID();
- if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) { //assembler lv-iv; circuit asseblers lv - uv; assemblers luv-uev
+ if (tID >= 211 && tID <= 218
+ || tID >= 1180 && tID <= 1187
+ || tID >= 10780
+ && tID <= 10786) { // assembler lv-iv; circuit asseblers lv - uv; assemblers luv-uev
if (GT_Utility.isStackValid(aStack))
for (int oreID : OreDictionary.getOreIDs(aStack)) {
- if (OreDictionary.getOreName(oreID).startsWith("circuit"))
- return true;
+ if (OreDictionary.getOreName(oreID).startsWith("circuit")) return true;
}
}
return this.getRecipeList().containsInput(aStack);
}
-
}
}
@@ -859,23 +1033,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
//noinspection SwitchStatementWithTooFewBranches
switch (this.mSpecialEffect) {
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 WorldSpawnedEventBuilder.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();
+ .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();
}
break;
default:
@@ -902,8 +1074,8 @@ 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.getCoverIDAtSide(mainFacing) == 0
+ && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) {
final double oX = aBaseMetaTileEntity.getXCoord();
final double oY = aBaseMetaTileEntity.getYCoord();
@@ -938,8 +1110,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
mZ = .05D;
}
- ParticleEventBuilder particleEventBuilder =
- (new ParticleEventBuilder())
+ ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder())
.setMotion(mX, 0, mZ)
.setPosition(x, y, z)
.setWorld(getBaseMetaTileEntity().getWorld());
@@ -1001,7 +1172,31 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
return !this.mSharedTank;
}
- public enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC}
+ public enum X {
+ PUMP,
+ WIRE,
+ WIRE4,
+ HULL,
+ PIPE,
+ GLASS,
+ PLATE,
+ MOTOR,
+ ROTOR,
+ SENSOR,
+ PISTON,
+ CIRCUIT,
+ EMITTER,
+ CONVEYOR,
+ ROBOT_ARM,
+ COIL_HEATING,
+ COIL_ELECTRIC,
+ STICK_MAGNETIC,
+ STICK_DISTILLATION,
+ BETTER_CIRCUIT,
+ FIELD_GENERATOR,
+ COIL_HEATING_DOUBLE,
+ STICK_ELECTROMAGNETIC
+ }
/**
* Special Effects
@@ -1011,11 +1206,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
TOP_SMOKE,
MAIN_RANDOM_SPARKS;
- static final SpecialEffects[] VALID_SPECIAL_EFFECTS = {
- NONE,
- TOP_SMOKE,
- MAIN_RANDOM_SPARKS
- };
+ static final SpecialEffects[] VALID_SPECIAL_EFFECTS = {NONE, TOP_SMOKE, MAIN_RANDOM_SPARKS};
static SpecialEffects fromId(int id) {
return id >= 0 && id < VALID_SPECIAL_EFFECTS.length ? VALID_SPECIAL_EFFECTS[id] : NONE;
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 a58cf6345d..d69ab3aa14 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
@@ -1,11 +1,5 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Dyes;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.render.TextureFactory;
-import gregtech.common.power.Power;
-import gregtech.common.power.SteamPower;
-
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP;
@@ -14,6 +8,11 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEEL_SIDE;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEEL_TOP;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
+import gregtech.api.enums.Dyes;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.render.TextureFactory;
+import gregtech.common.power.Power;
+import gregtech.common.power.SteamPower;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -22,15 +21,34 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
* Extend this class to make a simple Machine
*/
public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEntity_BasicMachine_Bronze {
- public GT_MetaTileEntity_BasicMachine_Steel(int aID, String aName, String aNameRegional, String aDescription, int aInputSlotCount, int aOutputSlotCount, boolean aHighPressure) {
+ public GT_MetaTileEntity_BasicMachine_Steel(
+ int aID,
+ String aName,
+ String aNameRegional,
+ String aDescription,
+ 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) {
+ public GT_MetaTileEntity_BasicMachine_Steel(
+ String aName,
+ String aDescription,
+ ITexture[][][] aTextures,
+ 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) {
+
+ public GT_MetaTileEntity_BasicMachine_Steel(
+ String aName,
+ String[] aDescription,
+ ITexture[][][] aTextures,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ boolean aHighPressure) {
super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aHighPressure);
}
@@ -41,71 +59,133 @@ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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))};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ 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)};
+ return new ITexture[] {
+ TextureFactory.of(
+ isBricked() ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE,
+ Dyes.getModulation(aColor, Dyes._NULL.mRGBa)),
+ TextureFactory.of(OVERLAY_PIPE_OUT)
+ };
}
}
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 bc031e0e6f..c1b734baf6 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
@@ -19,7 +19,8 @@ import net.minecraftforge.fluids.FluidTankInfo;
*
* 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 {
+public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_TieredMachineBlock
+ implements IHasFluidDisplayItem {
public FluidStack mFluid;
protected int mOpenerCount;
@@ -27,19 +28,35 @@ 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) {
+ public GT_MetaTileEntity_BasicTank(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_BasicTank(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_BasicTank(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicTank(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -138,8 +155,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
public void onOpenGUI() {
super.onOpenGUI();
mOpenerCount++;
- if (mOpenerCount == 1)
- updateFluidDisplayItem();
+ if (mOpenerCount == 1) updateFluidDisplayItem();
}
@Override
@@ -154,23 +170,29 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
if (isFluidChangingAllowed() && getFillableStack() != null && getFillableStack().amount <= 0)
setFillableStack(null);
- if (mOpenerCount > 0)
- updateFluidDisplayItem();
+ if (mOpenerCount > 0) updateFluidDisplayItem();
if (doesEmptyContainers()) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true);
if (tFluid != null && isFluidInputAllowed(tFluid)) {
if (getFillableStack() == null) {
if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), 1)) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot(),
+ GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
+ 1)) {
setFillableStack(tFluid.copy());
this.onEmptyingContainerWhenEmpty();
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
} else {
- if (tFluid.isFluidEqual(getFillableStack()) && ((long)tFluid.amount + getFillableStack().amount) <= (long)getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), 1)) {
+ if (tFluid.isFluidEqual(getFillableStack())
+ && ((long) tFluid.amount + getFillableStack().amount) <= (long) getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot(),
+ GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
+ 1)) {
getFillableStack().amount += tFluid.amount;
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
@@ -180,7 +202,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);
@@ -198,7 +221,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());
}
}
}
@@ -215,8 +239,11 @@ 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;
+ if (aFluid == null
+ || aFluid.getFluid().getID() <= 0
+ || aFluid.amount <= 0
+ || !canTankBeFilled()
+ || !isFluidInputAllowed(aFluid)) return 0;
if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) {
if (aFluid.amount <= getCapacity()) {
@@ -234,8 +261,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
return getCapacity();
}
- if (!getFillableStack().isFluidEqual(aFluid))
- return 0;
+ if (!getFillableStack().isFluidEqual(aFluid)) return 0;
int space = getCapacity() - getFillableStack().amount;
if (aFluid.amount <= space) {
@@ -245,8 +271,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
return aFluid.amount;
}
- if (doFill)
- getFillableStack().amount = getCapacity();
+ if (doFill) getFillableStack().amount = getCapacity();
return space;
}
@@ -260,8 +285,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
int used = maxDrain;
- if (getDrainableStack().amount < used)
- used = getDrainableStack().amount;
+ if (getDrainableStack().amount < used) used = getDrainableStack().amount;
if (doDrain) {
getDrainableStack().amount -= used;
@@ -281,14 +305,14 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[] {};
if (isDrainableStackSeparate()) {
- return new FluidTankInfo[]{
- new FluidTankInfo(getFillableStack(), getCapacity()),
- new FluidTankInfo(getDrainableStack(), getCapacity())
+ return new FluidTankInfo[] {
+ new FluidTankInfo(getFillableStack(), getCapacity()),
+ new FluidTankInfo(getDrainableStack(), getCapacity())
};
} else {
- return new FluidTankInfo[]{new FluidTankInfo(this)};
+ return new FluidTankInfo[] {new FluidTankInfo(this)};
}
}
@@ -302,7 +326,7 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
return aIndex == getInputSlot();
}
- protected void onEmptyingContainerWhenEmpty(){
- //Do nothing
+ protected void onEmptyingContainerWhenEmpty() {
+ // Do nothing
}
}
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 32067744d5..e249be541e 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
@@ -1,19 +1,18 @@
package gregtech.api.metatileentity.implementations;
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.Textures.BlockIcons.*;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
+import java.util.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
-import java.util.*;
-
-import static gregtech.api.enums.GT_Values.V;
-import static gregtech.api.enums.Textures.BlockIcons.*;
-
public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock {
private static final int OUTPUT_INDEX = 0;
private static final int ARROW_RIGHT_INDEX = 1;
@@ -24,22 +23,30 @@ 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;
+ public boolean bOutput = false,
+ bRedstoneIfFull = false,
+ bInvert = false,
+ bStockingMode = 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) {
+ public GT_MetaTileEntity_Buffer(
+ int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, 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) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ public GT_MetaTileEntity_Buffer(
+ int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
- public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Buffer(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_Buffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Buffer(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -61,18 +68,24 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
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};
- rTextures[ARROW_DOWN_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tDown, tIcon};
- rTextures[ARROW_LEFT_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tLeft, tIcon};
- rTextures[ARROW_UP_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tUp, tIcon};
- rTextures[FRONT_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tIcon};
+ rTextures[OUTPUT_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tOut};
+ rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tRight, tIcon};
+ rTextures[ARROW_DOWN_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tDown, tIcon};
+ rTextures[ARROW_LEFT_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tLeft, tIcon};
+ rTextures[ARROW_UP_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tUp, tIcon};
+ rTextures[FRONT_INDEX][i] = new ITexture[] {MACHINE_CASINGS[mTier][i], tIcon};
}
return rTextures;
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
int colorIndex = aColorIndex + 1;
ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[aSide];
ForgeDirection facing = ForgeDirection.VALID_DIRECTIONS[aFacing];
@@ -237,9 +250,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
if (aNBT.hasKey("bStockingMode")) { // Adding new key to existing NBT, need to protect if it is not there.
bStockingMode = aNBT.getBoolean("bStockingMode");
}
- if (aNBT.hasKey("bSortStacks")) {
- bSortStacks = aNBT.getBoolean("bSortStacks");
- }
+ if (aNBT.hasKey("bSortStacks")) {
+ bSortStacks = aNBT.getBoolean("bSortStacks");
+ }
mTargetStackSize = aNBT.getInteger("mTargetStackSize");
}
@@ -253,18 +266,22 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (aSide == getBaseMetaTileEntity().getBackFacing()) {
- mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking()? -1 : 1)) % 65);
- if(mTargetStackSize <0){mTargetStackSize = mMaxStackSize;}
+ mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking() ? -1 : 1)) % 65);
+ if (mTargetStackSize < 0) {
+ mTargetStackSize = mMaxStackSize;
+ }
if (mTargetStackSize == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("098","Do not regulate Item Stack Size"));
+ 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);
+ GT_Utility.sendChatToPlayer(
+ 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) {
+ public boolean onWrenchRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aWrenchingSide = GT_Utility.getOppositeSide(aWrenchingSide);
if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {
getBaseMetaTileEntity().setFrontFacing(aWrenchingSide);
@@ -282,20 +299,22 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
break;
}
}
- if (bInvert)
- hasEmptySlots = !hasEmptySlots;
+ if (bInvert) hasEmptySlots = !hasEmptySlots;
for (byte b = 0; b < 6; b++)
aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, hasEmptySlots ? (byte) 0 : (byte) 15);
- }
- else {
- for(byte b = 0;b<6;b++)
- aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte)0);
+ } else {
+ for (byte b = 0; b < 6; b++) aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte) 0);
}
}
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
+ if (aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.isServerSide()
+ && (aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTimer % 200 == 0
+ || mSuccess > 0)) {
mSuccess--;
updateSlots();
moveItems(aBaseMetaTileEntity, aTimer);
@@ -305,8 +324,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
@Override
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- for(byte b = 0;b<6;b++)
- aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b,(byte)0);
+ for (byte b = 0; b < 6; b++) aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b, (byte) 0);
}
protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
@@ -314,15 +332,37 @@ 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);
- 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);
-
- if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- mSuccess = 50;
- }
+ 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);
+ 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);
+
+ if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ mSuccess = 50;
+ }
}
@Override
@@ -336,15 +376,14 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
}
@Override
- public boolean allowGeneralRedstoneOutput(){
- return true;
+ public boolean allowGeneralRedstoneOutput() {
+ return true;
}
public void updateSlots() {
for (int i = 0; i < mInventory.length; i++)
if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
- if (bSortStacks)
- fillStacksIntoFirstSlots();
+ if (bSortStacks) fillStacksIntoFirstSlots();
}
protected void fillStacksIntoFirstSlots() {
@@ -353,24 +392,20 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
List order = new ArrayList<>(mInventory.length);
List validSlots = new ArrayList<>(mInventory.length);
for (int i = 0; i < mInventory.length - 1; i++) {
- if (!isValidSlot(i))
- continue;
+ if (!isValidSlot(i)) continue;
validSlots.add(i);
ItemStack s = mInventory[i];
- if(s == null)
- continue;
+ if (s == null) continue;
GT_Utility.ItemId sID = GT_Utility.ItemId.createNoCopy(s);
slots.merge(sID, s.stackSize, Integer::sum);
- if(!stacks.containsKey(sID))
- stacks.put(sID, s);
+ if (!stacks.containsKey(sID)) stacks.put(sID, s);
order.add(sID);
mInventory[i] = null;
}
int slotindex = 0;
for (GT_Utility.ItemId sID : order) {
int toSet = slots.get(sID);
- if (toSet == 0)
- continue;
+ if (toSet == 0) continue;
int slot = validSlots.get(slotindex);
slotindex++;
mInventory[slot] = stacks.get(sID).copy();
@@ -381,14 +416,15 @@ 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) {
+ public boolean onSolderingToolRightClick(
+ byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, 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 ? "Enabled" : "Disabled")));
+ GT_Utility.sendChatToPlayer(
+ aPlayer, GT_Utility.trans("200", "Sort mode: " + (bSortStacks ? "Enabled" : "Disabled")));
return true;
}
- return super.onSolderingToolRightClick(aSide,aWrenchingSide,aPlayer,aX,aY,aZ);
+ return super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ);
}
-
}
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 c2212e331e..e9e2e8f575 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
@@ -1,5 +1,11 @@
package gregtech.api.metatileentity.implementations;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.enums.GT_HatchElement.*;
+
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
@@ -9,17 +15,10 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_StructureUtility;
+import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
-import java.util.List;
-
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.*;
-
/**
* A simple 3x3x3 hollow cubic multiblock, that can be arbitrarily rotated, made of a single type of machine casing and accepts hatches everywhere.
* Controller will be placed in front center of the structure.
@@ -35,100 +34,102 @@ import static gregtech.api.enums.GT_HatchElement.*;
*
* @param
*/
-public abstract class GT_MetaTileEntity_CubicMultiBlockBase> extends GT_MetaTileEntity_EnhancedMultiBlockBase implements ISurvivalConstructable {
- protected static final String STRUCTURE_PIECE_MAIN = "main";
- protected static final ClassValue>> STRUCTURE_DEFINITION = new ClassValue>>() {
- @Override
- protected IStructureDefinition> 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();
- }
- };
- private int mCasingAmount = 0;
-
- protected GT_MetaTileEntity_CubicMultiBlockBase(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
+public abstract class GT_MetaTileEntity_CubicMultiBlockBase