aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
commitcbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch)
treeb85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/xmod
parentc40416b036c0e89451e1558253ccf07bbee028d0 (diff)
downloadGT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r--src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java38
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java391
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java175
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java459
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java103
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java74
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java98
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java137
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java15
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java126
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java141
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java118
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java142
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java146
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java402
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java1932
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java284
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java323
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java111
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java50
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java36
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java44
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java36
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java178
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java139
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java172
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java47
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java96
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java43
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java110
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java96
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java86
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java89
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java151
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java186
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java303
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java605
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java1213
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java378
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java728
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java741
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java123
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java213
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java292
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java418
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java301
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java563
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java563
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java460
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java466
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java110
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java614
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java559
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java85
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java1849
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java601
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java625
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java376
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java558
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java4189
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java1312
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java85
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java494
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java110
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java1779
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java483
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java388
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java265
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java84
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java314
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java814
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java966
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java1234
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java71
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java56
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java232
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java81
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java343
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java125
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java108
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java791
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java802
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java901
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java285
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java77
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java979
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java81
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java203
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java736
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java634
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java267
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java261
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java162
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java259
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java233
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java212
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java252
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java354
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java445
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java360
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java486
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java355
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java353
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java290
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java336
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java294
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java778
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java547
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java609
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java274
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java258
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java162
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java326
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java36
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java141
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java270
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT.java229
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java153
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java126
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java162
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java259
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java460
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java47
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java66
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java46
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java581
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java123
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java203
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java80
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java80
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java154
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java54
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java54
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java98
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java191
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java12
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java241
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java79
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java109
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java129
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java488
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java81
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java130
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java134
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java84
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java85
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java159
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java251
-rw-r--r--src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java38
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java339
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java337
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java39
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java84
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java109
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java73
201 files changed, 24217 insertions, 30011 deletions
diff --git a/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java b/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java
index 385cf0ae08..c83441c350 100644
--- a/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java
+++ b/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java
@@ -1,43 +1,41 @@
package gtPlusPlus.xmod.Computronics;
import gregtech.GT_Mod;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.lib.LoadedMods;
public class HANDLER_Computronics {
- public static void init() {
- if (LoadedMods.Computronics) {
+ public static void preInit(){
+ if (LoadedMods.Computronics){
}
- else {
- GT_Mod.gregtechproxy.addFluid("Argon", "Argon", Materials.Argon, 2, 295,
- GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Argon, 1L),
- GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), 1000);
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 1L),
- Materials.Air.getGas(1000L), Materials.Nitrogen.getGas(780L), 1600, 32, false);
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 2L),
- Materials.Air.getGas(1000L), Materials.Oxygen.getGas(210L), 1600, 128, false);
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 3L),
- Materials.Air.getGas(1000L), Materials.Argon.getGas(5L), 6000, 512, false);
- GT_Values.RA.addElectrolyzerRecipe(ItemList.Cell_Air.get(1), null, null, Materials.Air.getGas(2000L),
- ItemList.Cell_Empty.get(1), null, null, null, null, null, null, 800, 30);
- }
+
}
- public static void postInit() {
- if (LoadedMods.Computronics) {
+ public static void init(){
+ if (LoadedMods.Computronics){
}
-
+ else {
+ GT_Mod.gregtechproxy.addFluid("Argon", "Argon", Materials.Argon, 2, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Argon, 1L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), 1000);
+ GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 1L), Materials.Air.getGas(1000L), Materials.Nitrogen.getGas(780L), 1600, 32, false);
+ GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 2L), Materials.Air.getGas(1000L), Materials.Oxygen.getGas(210L), 1600, 128, false);
+ GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 3L), Materials.Air.getGas(1000L), Materials.Argon.getGas(5L), 6000, 512, false);
+ GT_Values.RA.addElectrolyzerRecipe(ItemList.Cell_Air.get(1), null, null, Materials.Air.getGas(2000L), ItemList.Cell_Empty.get(1), null, null, null, null, null, null, 800, 30);
+ }
}
- public static void preInit() {
- if (LoadedMods.Computronics) {
+ public static void postInit(){
+ if (LoadedMods.Computronics){
}
}
+
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
index 8052b98dac..ff26064e98 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
@@ -1,34 +1,34 @@
package gtPlusPlus.xmod.forestry;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry;
import gtPlusPlus.xmod.forestry.bees.recipe.FR_Gregtech_Recipes;
+import cpw.mods.fml.common.registry.GameRegistry;
public class HANDLER_FR {
- public static void Init() {
- if (LoadedMods.Forestry) {
- // FR_TileHandler.init();
- // new FR_GuiIDRegistry();
- }
- }
-
- public static void postInit() {
- if (LoadedMods.Forestry) {
- FR_Gregtech_Recipes.registerItems();
- }
- }
-
- public static void preInit() {
- if (LoadedMods.Forestry) {
+ public static void preInit(){
+ if (LoadedMods.Forestry){
FR_ItemRegistry.Register();
- if (CORE.configSwitches.enableCustomAlvearyBlocks) {
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
GameRegistry.registerTileEntity(TileAlvearyFrameHousing.class, "FrameHousing");
}
- // FR_BlockRegistryApiculture.RegistryApiculture();
- }
+ //FR_BlockRegistryApiculture.RegistryApiculture();
+ }
+ }
+
+ public static void Init(){
+ if (LoadedMods.Forestry){
+ //FR_TileHandler.init();
+ //new FR_GuiIDRegistry();
+ }
}
+
+ public static void postInit(){
+ if (LoadedMods.Forestry){
+ FR_Gregtech_Recipes.registerItems();
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java
index 039c80fe00..6736c54309 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java
@@ -6,13 +6,13 @@ import gtPlusPlus.xmod.forestry.bees.alveary.gui.InventoryFrameHousing;
public class AlvearyBeeListener extends DefaultBeeListener {
private final IAlvearyFrameHousing apiary;
- public AlvearyBeeListener(final IAlvearyFrameHousing apiary) {
+ public AlvearyBeeListener(IAlvearyFrameHousing apiary) {
this.apiary = apiary;
}
@Override
- public void wearOutEquipment(final int amount) {
- final InventoryFrameHousing apiaryInventory = this.apiary.getAlvearyInventory();
- apiaryInventory.wearOutFrames(this.apiary, amount);
+ public void wearOutEquipment(int amount) {
+ InventoryFrameHousing apiaryInventory = apiary.getAlvearyInventory();
+ apiaryInventory.wearOutFrames(apiary, amount);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java
index 5c6956ec86..2f4437afd1 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java
@@ -1,11 +1,15 @@
package gtPlusPlus.xmod.forestry.bees.alveary;
+import net.minecraft.util.ChunkCoordinates;
+
import com.mojang.authlib.GameProfile;
-import forestry.api.multiblock.*;
-import net.minecraft.util.ChunkCoordinates;
+import forestry.api.multiblock.IAlvearyComponent;
+import forestry.api.multiblock.IMultiblockComponent;
+import forestry.api.multiblock.IMultiblockController;
+import forestry.api.multiblock.IMultiblockLogicAlveary;
-public class FR_AlvearyFrameBlock implements IAlvearyComponent, IMultiblockComponent {
+public class FR_AlvearyFrameBlock implements IAlvearyComponent, IMultiblockComponent{
@Override
public ChunkCoordinates getCoordinates() {
@@ -14,28 +18,28 @@ public class FR_AlvearyFrameBlock implements IAlvearyComponent, IMultiblockCompo
}
@Override
- public IMultiblockLogicAlveary getMultiblockLogic() {
+ public GameProfile getOwner() {
// TODO Auto-generated method stub
return null;
}
@Override
- public GameProfile getOwner() {
+ public void onMachineAssembled(IMultiblockController arg0,
+ ChunkCoordinates arg1, ChunkCoordinates arg2) {
// TODO Auto-generated method stub
- return null;
+
}
@Override
- public void onMachineAssembled(final IMultiblockController arg0, final ChunkCoordinates arg1,
- final ChunkCoordinates arg2) {
+ public void onMachineBroken() {
// TODO Auto-generated method stub
-
+
}
@Override
- public void onMachineBroken() {
+ public IMultiblockLogicAlveary getMultiblockLogic() {
// TODO Auto-generated method stub
-
+ return null;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java
index d4fce6465b..f087ad75f4 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java
@@ -3,15 +3,6 @@ package gtPlusPlus.xmod.forestry.bees.alveary;
import java.util.ArrayList;
import java.util.List;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import forestry.apiculture.MaterialBeehive;
-import forestry.apiculture.multiblock.TileAlvearyPlain;
-import forestry.core.blocks.BlockStructure;
-import forestry.core.render.TextureManager;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -22,250 +13,262 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import forestry.apiculture.MaterialBeehive;
+import forestry.apiculture.multiblock.TileAlvearyPlain;
+import forestry.core.blocks.BlockStructure;
+import forestry.core.render.TextureManager;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.creative.AddToCreativeTab;
-public class FR_BlockAlveary extends BlockStructure {
-
- public static enum Type {
- PLAIN, ERROR, FRAME, MUTATOR,
+public class FR_BlockAlveary extends BlockStructure
+{
- // Placeholder Values
+ public static enum Type
+ {
+ PLAIN,
+ ERROR,
+ FRAME,
+ MUTATOR,
+
+ //Placeholder Values
HEATER, HYGRO, STABILIZER, SIEVE;
- public static final Type[] VALUES = Type.values();
+ public static final Type[] VALUES = values();
- private Type() {
- }
+ private Type() {}
}
- /* ICONS */
- public static final int PLAIN = 0;
-
- public static final int ENTRANCE = 1;
-
- public static final int BOTTOM = 2;
-
- public static final int LEFT = 3;
-
- public static final int RIGHT = 4;
-
- public static final int ALVEARY_FRAME_OFF = 5;
-
- public static final int ALVEARY_FRAME_ON = 6;
-
- public static final int ALVEARY_MUTATOR_OFF = 7;
+ public FR_BlockAlveary()
+ {
+ super(new MaterialBeehive(false));
+ setHardness(1.0F);
+ setCreativeTab(AddToCreativeTab.tabBlock);
+ setHarvestLevel("axe", 0);
+
+ }
- public static final int ALVEARY_MUTATOR_ON = 8;
+ @Override
+ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ {
+ if (world.isRemote) return true;
+
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null && te instanceof TileAlvearyFrameHousing)
+ {
+ player.openGui(GTplusplus.instance, 0, world, x, y, z);
+ return true;
+ }
+ /*else if (te != null && te instanceof TileAlvearyFrameHousing)
+ {
+ player.openGui(GTplusplus.instance, 0, world, x, y, z);
+ return true;
+ }*/
+ return false;
+ }
+ @Override
@SideOnly(Side.CLIENT)
- private IIcon[] icons;
+ public void getSubBlocks(Item item, CreativeTabs tab, List list)
+ {
+ for (int i = 0; i < 4; i++) {
+ if (i != 1 && i != 0) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+ }
- public FR_BlockAlveary() {
- super(new MaterialBeehive(false));
- this.setHardness(1.0F);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHarvestLevel("axe", 0);
+ @Override
+ public int getRenderType()
+ {
+ return 0;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return true;
+ }
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ {
+ ArrayList<ItemStack> drop = new ArrayList<ItemStack>();
+ drop.add(new ItemStack(this, 1, metadata != 1 ? metadata : 0));
+ return drop;
}
+
@Override
- public TileEntity createNewTileEntity(final World world, final int meta) {
- return this.createTileEntity(world, meta);
+ public int getDamageValue(World world, int x, int y, int z)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ return meta != 1 ? meta : 0;
}
+
@Override
- public TileEntity createTileEntity(final World world, final int metadata) {
- if (metadata < 0 || metadata > Type.VALUES.length) {
+ public TileEntity createTileEntity(World world, int metadata)
+ {
+ if ((metadata < 0) || (metadata > Type.VALUES.length)) {
return null;
}
-
- final Type type = Type.VALUES[metadata];
- switch (type) {
- case FRAME:
- LanguageRegistry.addName(this, "Alveary Frame Housing");
- case MUTATOR:
- LanguageRegistry.addName(this, "Alveary Mutator Block");
- case ERROR:
- LanguageRegistry.addName(this, "Invalid Alveary Block");
- default:
- LanguageRegistry.addName(this, "Unnamed Alveary Block");
+
+
+
+ Type type = Type.VALUES[metadata];
+ switch (type)
+ {
+ case FRAME:
+ LanguageRegistry.addName(this, "Alveary Frame Housing");
+ case MUTATOR:
+ LanguageRegistry.addName(this, "Alveary Mutator Block");
+ case ERROR:
+ LanguageRegistry.addName(this, "Invalid Alveary Block");
+ default:
+ LanguageRegistry.addName(this, "Unnamed Alveary Block");
}
- switch (type) {
- case FRAME:
- return new TileAlvearyFrameHousing();
- case MUTATOR:
- return new TileAlvearyPlain();
- case ERROR:
- return new TileAlvearyPlain();
- default:
- return new TileAlvearyPlain();
+ switch (type)
+ {
+ case FRAME:
+ return new TileAlvearyFrameHousing();
+ case MUTATOR:
+ return new TileAlvearyPlain();
+ case ERROR:
+ return new TileAlvearyPlain();
+ default:
+ return new TileAlvearyPlain();
}
}
- public ItemStack get(final Type type) {
- return new ItemStack(this, 1, type.ordinal());
+
+ @Override
+ public Block setBlockName(String name) {
+ //int meta = this.
+ return super.setBlockName(name);
}
- @SideOnly(Side.CLIENT)
- private IIcon getBlockTextureFromSideAndTile(final IBlockAccess world, final int x, final int y, final int z,
- final int side) {
- final TileEntity tile = world.getTileEntity(x, y, z);
- if (!(tile instanceof FR_TileAlveary)) {
- return this.getIcon(side, 0);
- }
- return this.icons[((FR_TileAlveary) tile).getIcon(side)];
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int meta)
+ {
+ return createTileEntity(world, meta);
}
+
+ /* ICONS */
+ public static final int PLAIN = 0;
+ public static final int ENTRANCE = 1;
+ public static final int BOTTOM = 2;
+ public static final int LEFT = 3;
+ public static final int RIGHT = 4;
+ public static final int ALVEARY_FRAME_OFF = 5;
+ public static final int ALVEARY_FRAME_ON = 6;
+ public static final int ALVEARY_MUTATOR_OFF = 7;
+ public static final int ALVEARY_MUTATOR_ON = 8;
+ @SideOnly(Side.CLIENT)
+ private IIcon[] icons;
+ @SideOnly(Side.CLIENT)
@Override
- public int getDamageValue(final World world, final int x, final int y, final int z) {
- final int meta = world.getBlockMetadata(x, y, z);
- return meta != 1 ? meta : 0;
+ public void registerBlockIcons(IIconRegister register) {
+ icons = new IIcon[9];
+ icons[0] = TextureManager.registerTex(register, "apiculture/alveary.plain");
+ icons[1] = TextureManager.registerTex(register, "apiculture/alveary.entrance");
+ icons[2] = TextureManager.registerTex(register, "apiculture/alveary.bottom");
+ icons[3] = TextureManager.registerTex(register, "apiculture/alveary.left");
+ icons[4] = TextureManager.registerTex(register, "apiculture/alveary.right");
+ icons[5] = TextureManager.registerTex(register, "apiculture/alveary.framehousing.off");
+ icons[6] = TextureManager.registerTex(register, "apiculture/alveary.framehousing.on");
+ icons[7] = TextureManager.registerTex(register, "apiculture/alveary.mutator.off");
+ icons[8] = TextureManager.registerTex(register, "apiculture/alveary.mutator.on");
}
+ @SideOnly(Side.CLIENT)
@Override
- public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata,
- final int fortune) {
- final ArrayList<ItemStack> drop = new ArrayList<ItemStack>();
- drop.add(new ItemStack(this, 1, metadata != 1 ? metadata : 0));
- return drop;
+ public IIcon getIcon(int side, int metadata) {
+ if ((metadata <= 1
+ || metadata == Type.FRAME.ordinal() || metadata == Type.MUTATOR.ordinal())
+ && (side == 1 || side == 0)) {
+ return icons[BOTTOM];
+ }
+ Type type = Type.VALUES[metadata];
+ switch (type) {
+ case ERROR:
+ return icons[PLAIN];
+ case FRAME:
+ return icons[ALVEARY_FRAME_OFF];
+ case MUTATOR:
+ return icons[ALVEARY_MUTATOR_OFF];
+ case HEATER:
+ return icons[ALVEARY_MUTATOR_OFF];
+ case HYGRO:
+ return icons[ALVEARY_MUTATOR_OFF];
+ case STABILIZER:
+ return icons[PLAIN];
+ case SIEVE:
+ return icons[PLAIN];
+ default:
+ return null;
+ }
}
@SideOnly(Side.CLIENT)
@Override
- public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
- final int meta = world.getBlockMetadata(x, y, z);
+ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
+ int meta = world.getBlockMetadata(x, y, z);
if (meta == 1) {
return this.getIcon(side, meta);
+ } else if (meta > 1) {
+ return getBlockTextureFromSideAndTile(world, x, y, z, side);
}
- else if (meta > 1) {
- return this.getBlockTextureFromSideAndTile(world, x, y, z, side);
- }
- final Block blockXP = world.getBlock(x + 1, y, z);
- final Block blockXM = world.getBlock(x - 1, y, z);
+ Block blockXP = world.getBlock(x + 1, y, z);
+ Block blockXM = world.getBlock(x - 1, y, z);
if (blockXP == this && blockXM != this) {
if (world.getBlockMetadata(x + 1, y, z) == 1) {
if (world.getBlock(x, y, z + 1) != this) {
- return this.switchForSide(42, side);
+ return switchForSide(42, side);
}
- return this.switchForSide(41, side);
+ return switchForSide(41, side);
}
return this.getIcon(side, meta);
- }
- else if (blockXP != this && blockXM == this) {
+ } else if (blockXP != this && blockXM == this) {
if (world.getBlockMetadata(x - 1, y, z) == 1) {
if (world.getBlock(x, y, z + 1) != this) {
- return this.switchForSide(41, side);
+ return switchForSide(41, side);
}
- return this.switchForSide(42, side);
+ return switchForSide(42, side);
}
return this.getIcon(side, meta);
}
return this.getIcon(side, meta);
}
@SideOnly(Side.CLIENT)
- @Override
- public IIcon getIcon(final int side, final int metadata) {
- if ((metadata <= 1 || metadata == Type.FRAME.ordinal() || metadata == Type.MUTATOR.ordinal())
- && (side == 1 || side == 0)) {
- return this.icons[FR_BlockAlveary.BOTTOM];
- }
- final Type type = Type.VALUES[metadata];
- switch (type) {
- case ERROR:
- return this.icons[FR_BlockAlveary.PLAIN];
- case FRAME:
- return this.icons[FR_BlockAlveary.ALVEARY_FRAME_OFF];
- case MUTATOR:
- return this.icons[FR_BlockAlveary.ALVEARY_MUTATOR_OFF];
- case HEATER:
- return this.icons[FR_BlockAlveary.ALVEARY_MUTATOR_OFF];
- case HYGRO:
- return this.icons[FR_BlockAlveary.ALVEARY_MUTATOR_OFF];
- case STABILIZER:
- return this.icons[FR_BlockAlveary.PLAIN];
- case SIEVE:
- return this.icons[FR_BlockAlveary.PLAIN];
- default:
- return null;
+ private IIcon getBlockTextureFromSideAndTile(IBlockAccess world, int x, int y, int z, int side) {
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if (!(tile instanceof FR_TileAlveary)) {
+ return getIcon(side, 0);
}
+ return icons[((FR_TileAlveary) tile).getIcon(side)];
}
- @Override
- public int getRenderType() {
- return 0;
- }
-
- @Override
@SideOnly(Side.CLIENT)
- public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
- for (int i = 0; i < 4; i++) {
- if (i != 1 && i != 0) {
- list.add(new ItemStack(item, 1, i));
+ private IIcon switchForSide(int textureId, int side) {
+ if (side == 4 || side == 5) {
+ if (textureId == 41) {
+ return icons[LEFT];
}
+ return icons[RIGHT];
+ } else if (textureId == 41) {
+ return icons[RIGHT];
+ } else {
+ return icons[LEFT];
}
}
-
@Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileAlvearyFrameHousing) {
- player.openGui(GTplusplus.instance, 0, world, x, y, z);
- return true;
- }
- /*
- * else if (te != null && te instanceof TileAlvearyFrameHousing) {
- * player.openGui(GTplusplus.instance, 0, world, x, y, z); return true;
- * }
- */
- return false;
- }
-
- @Override
- public void onNeighborBlockChange(final World world, final int x, final int y, final int z, final Block block) {
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
super.onNeighborBlockChange(world, x, y, z, block);
- final TileEntity tileEntity = world.getTileEntity(x, y, z);
+ TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof FR_TileAlveary) {
- final FR_TileAlveary tileAlveary = (FR_TileAlveary) tileEntity;
+ FR_TileAlveary tileAlveary = (FR_TileAlveary) tileEntity;
// We must check that the slabs on top were not removed
tileAlveary.getMultiblockLogic().getController().reassemble();
}
}
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(final IIconRegister register) {
- this.icons = new IIcon[9];
- this.icons[0] = TextureManager.registerTex(register, "apiculture/alveary.plain");
- this.icons[1] = TextureManager.registerTex(register, "apiculture/alveary.entrance");
- this.icons[2] = TextureManager.registerTex(register, "apiculture/alveary.bottom");
- this.icons[3] = TextureManager.registerTex(register, "apiculture/alveary.left");
- this.icons[4] = TextureManager.registerTex(register, "apiculture/alveary.right");
- this.icons[5] = TextureManager.registerTex(register, "apiculture/alveary.framehousing.off");
- this.icons[6] = TextureManager.registerTex(register, "apiculture/alveary.framehousing.on");
- this.icons[7] = TextureManager.registerTex(register, "apiculture/alveary.mutator.off");
- this.icons[8] = TextureManager.registerTex(register, "apiculture/alveary.mutator.on");
- }
-
- @Override
- public boolean renderAsNormalBlock() {
- return true;
- }
-
- @Override
- public Block setBlockName(final String name) {
- // int meta = this.
- return super.setBlockName(name);
- }
-
- @SideOnly(Side.CLIENT)
- private IIcon switchForSide(final int textureId, final int side) {
- if (side == 4 || side == 5) {
- if (textureId == 41) {
- return this.icons[FR_BlockAlveary.LEFT];
- }
- return this.icons[FR_BlockAlveary.RIGHT];
- }
- else if (textureId == 41) {
- return this.icons[FR_BlockAlveary.RIGHT];
- }
- else {
- return this.icons[FR_BlockAlveary.LEFT];
- }
+ public ItemStack get(Type type) {
+ return new ItemStack(this, 1, type.ordinal());
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java
index 2db809ae90..b5b3b73e6b 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java
@@ -3,160 +3,197 @@ package gtPlusPlus.xmod.forestry.bees.alveary;
import java.io.IOException;
import java.util.List;
-import forestry.api.apiculture.*;
-import forestry.api.core.*;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.util.Vec3;
+import net.minecraft.world.biome.BiomeGenBase;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeHousingInventory;
+import forestry.api.apiculture.IBeeListener;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IBeekeepingLogic;
+import forestry.api.core.EnumHumidity;
+import forestry.api.core.EnumTemperature;
+import forestry.api.core.IErrorLogic;
import forestry.api.multiblock.IAlvearyComponent;
import forestry.api.multiblock.IMultiblockController;
import forestry.apiculture.multiblock.MultiblockLogicAlveary;
-import forestry.core.access.*;
+import forestry.core.access.EnumAccess;
+import forestry.core.access.IAccessHandler;
+import forestry.core.access.IRestrictedAccess;
import forestry.core.config.Config;
import forestry.core.gui.IGuiHandlerForestry;
import forestry.core.gui.IHintSource;
import forestry.core.inventory.IInventoryAdapter;
import forestry.core.multiblock.MultiblockTileEntityForestry;
-import forestry.core.network.*;
+import forestry.core.network.DataInputStreamForestry;
+import forestry.core.network.DataOutputStreamForestry;
+import forestry.core.network.IStreamableGui;
import forestry.core.tiles.IClimatised;
import forestry.core.tiles.ITitled;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.util.Vec3;
-import net.minecraft.world.biome.BiomeGenBase;
-public abstract class FR_TileAlveary extends MultiblockTileEntityForestry<MultiblockLogicAlveary>
- implements IBeeHousing, IAlvearyComponent, IRestrictedAccess, IStreamableGui, ITitled, IClimatised, IHintSource,
- IGuiHandlerForestry {
+public abstract class FR_TileAlveary
+extends MultiblockTileEntityForestry<MultiblockLogicAlveary>
+implements IBeeHousing, IAlvearyComponent, IRestrictedAccess, IStreamableGui, ITitled, IClimatised, IHintSource, IGuiHandlerForestry
+{
private final String unlocalizedTitle;
- protected FR_TileAlveary() {
+ protected FR_TileAlveary()
+ {
this(FR_BlockAlveary.Type.ERROR);
}
- protected FR_TileAlveary(final FR_BlockAlveary.Type type) {
+ protected FR_TileAlveary(FR_BlockAlveary.Type type)
+ {
super(new MultiblockLogicAlveary());
- this.unlocalizedTitle = "advanced.tile.for.alveary." + type.ordinal() + ".name";
-
+ this.unlocalizedTitle = ("advanced.tile.for.alveary." + type.ordinal() + ".name");
+
}
- @Override
- public boolean canBlockSeeTheSky() {
- return this.getMultiblockLogic().getController().canBlockSeeTheSky();
+ public int getIcon(int side)
+ {
+ return 0;
}
@Override
- public IAccessHandler getAccessHandler() {
- return this.getMultiblockLogic().getController().getAccessHandler();
+ public void onMachineAssembled(IMultiblockController multiblockController, ChunkCoordinates minCoord, ChunkCoordinates maxCoord)
+ {
+ if (this.worldObj.isRemote) {
+ this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
+ }
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, getBlockType());
+ markDirty();
}
@Override
- public Vec3 getBeeFXCoordinates() {
- return this.getMultiblockLogic().getController().getBeeFXCoordinates();
+ public void onMachineBroken()
+ {
+ if (this.worldObj.isRemote) {
+ this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
+ }
+ this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, getBlockType());
+ markDirty();
}
@Override
- public IBeeHousingInventory getBeeInventory() {
- return this.getMultiblockLogic().getController().getBeeInventory();
+ public BiomeGenBase getBiome()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBiome();
}
@Override
- public IBeekeepingLogic getBeekeepingLogic() {
- return this.getMultiblockLogic().getController().getBeekeepingLogic();
+ public Iterable<IBeeModifier> getBeeModifiers()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeModifiers();
}
@Override
- public Iterable<IBeeListener> getBeeListeners() {
- return this.getMultiblockLogic().getController().getBeeListeners();
+ public Iterable<IBeeListener> getBeeListeners()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeListeners();
}
@Override
- public Iterable<IBeeModifier> getBeeModifiers() {
- return this.getMultiblockLogic().getController().getBeeModifiers();
+ public IBeeHousingInventory getBeeInventory()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeInventory();
}
@Override
- public BiomeGenBase getBiome() {
- return this.getMultiblockLogic().getController().getBiome();
+ public IBeekeepingLogic getBeekeepingLogic()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeekeepingLogic();
}
@Override
- public int getBlockLightValue() {
- return this.getMultiblockLogic().getController().getBlockLightValue();
+ public Vec3 getBeeFXCoordinates()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeFXCoordinates();
}
@Override
- public IErrorLogic getErrorLogic() {
- return this.getMultiblockLogic().getController().getErrorLogic();
+ public EnumTemperature getTemperature()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getTemperature();
}
@Override
- public float getExactHumidity() {
- return this.getMultiblockLogic().getController().getExactHumidity();
+ public EnumHumidity getHumidity()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getHumidity();
}
@Override
- public float getExactTemperature() {
- return this.getMultiblockLogic().getController().getExactTemperature();
+ public int getBlockLightValue()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBlockLightValue();
}
@Override
- public List<String> getHints() {
- return Config.hints.get("apiary");
+ public boolean canBlockSeeTheSky()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().canBlockSeeTheSky();
}
@Override
- public EnumHumidity getHumidity() {
- return this.getMultiblockLogic().getController().getHumidity();
+ public IErrorLogic getErrorLogic()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getErrorLogic();
}
- public int getIcon(final int side) {
- return 0;
+ @Override
+ public IAccessHandler getAccessHandler()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getAccessHandler();
}
@Override
- public IInventoryAdapter getInternalInventory() {
- return this.getMultiblockLogic().getController().getInternalInventory();
+ public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess)
+ {
+ ((MultiblockLogicAlveary)getMultiblockLogic()).getController().onSwitchAccess(oldAccess, newAccess);
}
@Override
- public EnumTemperature getTemperature() {
- return this.getMultiblockLogic().getController().getTemperature();
+ public IInventoryAdapter getInternalInventory()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getInternalInventory();
}
@Override
- public String getUnlocalizedTitle() {
+ public String getUnlocalizedTitle()
+ {
return this.unlocalizedTitle;
}
@Override
- public void onMachineAssembled(final IMultiblockController multiblockController, final ChunkCoordinates minCoord,
- final ChunkCoordinates maxCoord) {
- if (this.worldObj.isRemote) {
- this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
- }
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.markDirty();
+ public List<String> getHints()
+ {
+ return Config.hints.get("apiary");
}
@Override
- public void onMachineBroken() {
- if (this.worldObj.isRemote) {
- this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
- }
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.markDirty();
+ public float getExactTemperature()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getExactTemperature();
}
@Override
- public void onSwitchAccess(final EnumAccess oldAccess, final EnumAccess newAccess) {
- this.getMultiblockLogic().getController().onSwitchAccess(oldAccess, newAccess);
+ public float getExactHumidity()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getExactHumidity();
}
@Override
- public void readGuiData(final DataInputStreamForestry data) throws IOException {
- this.getMultiblockLogic().getController().readGuiData(data);
+ public void writeGuiData(DataOutputStreamForestry data)
+ throws IOException
+ {
+ ((MultiblockLogicAlveary)getMultiblockLogic()).getController().writeGuiData(data);
}
@Override
- public void writeGuiData(final DataOutputStreamForestry data) throws IOException {
- this.getMultiblockLogic().getController().writeGuiData(data);
+ public void readGuiData(DataInputStreamForestry data)
+ throws IOException
+ {
+ ((MultiblockLogicAlveary)getMultiblockLogic()).getController().readGuiData(data);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java
index c5c2e0c8f4..b55d2d37a6 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java
@@ -5,16 +5,24 @@ import forestry.api.core.IClimateControlled;
import forestry.api.multiblock.IMultiblockComponent;
import forestry.api.multiblock.IMultiblockLogicAlveary;
-public abstract interface IAlvearyComponentAdvanced<T extends IMultiblockLogicAlveary> extends IMultiblockComponent {
- public static abstract interface BeeModifier extends IAlvearyComponentAdvanced {
- public abstract IBeeModifier getBeeModifier();
- }
+public abstract interface IAlvearyComponentAdvanced<T extends IMultiblockLogicAlveary>
+extends IMultiblockComponent
+{
+ @Override
+ public abstract T getMultiblockLogic();
- public static abstract interface FrameHouse extends IAlvearyComponentAdvanced {
+
+ public static abstract interface FrameHouse
+ extends IAlvearyComponentAdvanced
+ {
public abstract void changeClimate(int paramInt, IClimateControlled paramIClimateControlled);
}
- @Override
- public abstract T getMultiblockLogic();
+
+ public static abstract interface BeeModifier
+ extends IAlvearyComponentAdvanced
+ {
+ public abstract IBeeModifier getBeeModifier();
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java
index d4166b00c9..6eeefa2696 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java
@@ -5,6 +5,5 @@ import gtPlusPlus.xmod.forestry.bees.alveary.gui.InventoryFrameHousing;
public interface IAlvearyFrameHousing extends IBeeHousing {
InventoryFrameHousing getAlvearyInventory();
-
void wearOutFrames(IBeeHousing beeHousing, int amount);
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java
index f8724fc840..523c3e2434 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java
@@ -1,8 +1,10 @@
package gtPlusPlus.xmod.forestry.bees.alveary;
-import forestry.api.apiculture.IBeeHousing;
import net.minecraft.inventory.ISidedInventory;
+import forestry.api.apiculture.IBeeHousing;
-public abstract interface ISidedFrameWearingInventory extends ISidedInventory {
- public abstract void wearOutFrames(IBeeHousing paramIBeeHousing, int paramInt);
+public abstract interface ISidedFrameWearingInventory
+ extends ISidedInventory
+{
+ public abstract void wearOutFrames(IBeeHousing paramIBeeHousing, int paramInt);
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java
index af1e0b95b3..794b5d1be8 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java
@@ -1,14 +1,37 @@
package gtPlusPlus.xmod.forestry.bees.alveary;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
-import forestry.api.apiculture.*;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import forestry.api.apiculture.BeeManager;
+import forestry.api.apiculture.DefaultBeeListener;
+import forestry.api.apiculture.IBee;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeListener;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IBeekeepingMode;
+import forestry.api.apiculture.IHiveFrame;
import forestry.api.arboriculture.EnumGermlingType;
-import forestry.api.genetics.*;
+import forestry.api.genetics.AlleleManager;
+import forestry.api.genetics.IIndividual;
+import forestry.api.genetics.ISpeciesRoot;
import forestry.api.multiblock.IAlvearyComponent;
import forestry.apiculture.AlvearyBeeModifier;
+import forestry.apiculture.multiblock.MultiblockLogicAlveary;
import forestry.apiculture.network.packets.PacketActiveUpdate;
-import forestry.apiculture.worldgen.*;
+import forestry.apiculture.worldgen.Hive;
+import forestry.apiculture.worldgen.HiveDecorator;
+import forestry.apiculture.worldgen.HiveDescriptionSwarmer;
import forestry.core.inventory.IInventoryAdapter;
import forestry.core.inventory.wrappers.IInvSlot;
import forestry.core.inventory.wrappers.InventoryIterator;
@@ -16,52 +39,21 @@ import forestry.core.proxy.Proxies;
import forestry.core.tiles.IActivatable;
import forestry.core.utils.ItemStackUtil;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.xmod.forestry.bees.alveary.gui.*;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-
-public class TileAlvearyFrameHousing extends FR_TileAlveary implements ISidedFrameWearingInventory, IActivatable,
- IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyFrameHousing, IAlvearyComponent.BeeListener {
- static class AlvearyFrameHousingBeeListener extends DefaultBeeListener {
- private final InventoryFrameHousing inventory;
-
- public AlvearyFrameHousingBeeListener(final InventoryFrameHousing inventory) {
- this.inventory = inventory;
- }
-
- @Override
- public boolean onPollenRetrieved(final IIndividual pollen) {
- /*
- * if (!((Object) this.inventory).canStorePollen()) { return false;
- * }
- */
- final ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(pollen.getClass());
-
- final ItemStack pollenStack = speciesRoot.getMemberStack(pollen, EnumGermlingType.POLLEN.ordinal());
- if (pollenStack != null) {
- // ((Object) this.inventory).storePollenStack(pollenStack);
- return true;
- }
- return false;
- }
- }
- private final InventoryFrameHousing inventory;
- private final IBeeListener beeListener;
- private final Stack<ItemStack> pendingSpawns = new Stack<ItemStack>();
-
- private boolean active;
-
- private final IBeeModifier beeModifier = new AlvearyBeeModifier();
-
- // private final IBeeListener beeListener = new AlvearyBeeListener(this);
- private final Iterable<IBeeListener> beeListenerList = this.getMultiblockLogic().getController()
- .getBeeListeners();
-
- public TileAlvearyFrameHousing() {
+import gtPlusPlus.xmod.forestry.bees.alveary.gui.CONTAINER_FrameHousing;
+import gtPlusPlus.xmod.forestry.bees.alveary.gui.GUI_FrameHousing;
+import gtPlusPlus.xmod.forestry.bees.alveary.gui.InventoryFrameHousing;
+
+public class TileAlvearyFrameHousing
+extends FR_TileAlveary
+implements ISidedFrameWearingInventory, IActivatable, IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyFrameHousing, IAlvearyComponent.BeeListener
+{
+ private final InventoryFrameHousing inventory;
+ private final IBeeListener beeListener;
+ private final Stack<ItemStack> pendingSpawns = new Stack<ItemStack>();
+ private boolean active;
+
+ public TileAlvearyFrameHousing()
+ {
super(FR_BlockAlveary.Type.FRAME);
this.inventory = new InventoryFrameHousing(this);
this.beeListener = new AlvearyFrameHousingBeeListener(this.inventory);
@@ -69,101 +61,113 @@ public class TileAlvearyFrameHousing extends FR_TileAlveary implements ISidedFra
}
@Override
- public boolean allowsAutomation() {
+ public IInventoryAdapter getInternalInventory()
+ {
+ return this.inventory;
+ }
+
+ @Override
+ public boolean allowsAutomation()
+ {
return true;
}
- private int consumeInducerAndGetChance() {
- if (this.getInternalInventory() == null) {
- return 0;
+ @Override
+ public void updateServer(int tickCount)
+ {
+
+ if (getInternalInventory() == null) {
+ return;
}
- for (final Iterator<?> i$ = InventoryIterator.getIterable(this.getInternalInventory()).iterator(); i$
- .hasNext();) {
- final IInvSlot slot = (IInvSlot) i$.next();
- final ItemStack stack = slot.getStackInSlot();
- for (final Map.Entry<ItemStack, Integer> entry : BeeManager.inducers.entrySet()) {
- if (ItemStackUtil.isIdenticalItem(entry.getKey(), stack)) {
- slot.decreaseStackInSlot();
- return entry.getValue().intValue();
+
+ if (this.inventory.getStackInSlot(0) != null)
+ {
+ if (((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeekeepingLogic().canWork()){
+ setActive(true);
+ if (tickCount % 1000 == 0) {
+ wearOutFrames(this, 1);
}
}
- }
- final IInvSlot slot;
- final ItemStack stack;
- return 0;
- }
+ else {
+ Utils.LOG_INFO("Cannot work - Probably no queen alive.");
+ }
- @Override
- protected void decodeDescriptionPacket(final NBTTagCompound packetData) {
- super.decodeDescriptionPacket(packetData);
- this.setActive(packetData.getBoolean("Active"));
- }
+ }
+ else
+ {
+ setActive(false);
+ }
+ if (tickCount % 500 != 0) {
+ return;
+ }
- @Override
- protected void encodeDescriptionPacket(final NBTTagCompound packetData) {
- super.encodeDescriptionPacket(packetData);
- packetData.setBoolean("Active", this.active);
}
@Override
- public InventoryFrameHousing getAlvearyInventory() {
- return this.inventory;
- }
+ public void updateClient(int tickCount) {}
- @Override
- public IBeeListener getBeeListener() {
- return this.beeListener;
+ private ItemStack getPrincessStack()
+ {
+ ItemStack princessStack = ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeInventory().getQueen();
+ if (BeeManager.beeRoot.isMated(princessStack)) {
+ return princessStack;
+ }
+ return null;
}
- @Override
- public IBeeModifier getBeeModifier() {
- final List<IBeeModifier> beeModifiers = new ArrayList<IBeeModifier>();
-
- // beeModifiers.add(this.beeModifier);
- for (final IHiveFrame frame : this.getFrames(this.inventory)) {
- beeModifiers.add(frame.getBeeModifier());
+ private int consumeInducerAndGetChance()
+ {
+ if (getInternalInventory() == null) {
+ return 0;
}
- return beeModifiers.get(0);
+ for (Iterator<?> i$ = InventoryIterator.getIterable(getInternalInventory()).iterator(); i$.hasNext();)
+ {
+ IInvSlot slot = (IInvSlot)i$.next();
+ ItemStack stack = slot.getStackInSlot();
+ for (Map.Entry<ItemStack, Integer> entry : BeeManager.inducers.entrySet()) {
+ if (ItemStackUtil.isIdenticalItem((ItemStack)entry.getKey(), stack))
+ {
+ slot.decreaseStackInSlot();
+ return ((Integer)entry.getValue()).intValue();
+ }
+ }
+ }
+ IInvSlot slot;
+ ItemStack stack;
+ return 0;
}
- @Override
- public Collection<IBeeModifier> getBeeModifiers() {
- final List<IBeeModifier> beeModifiers = new ArrayList<IBeeModifier>();
+ private void trySpawnSwarm()
+ {
+ ItemStack toSpawn = (ItemStack)this.pendingSpawns.peek();
+ HiveDescriptionSwarmer hiveDescription = new HiveDescriptionSwarmer(new ItemStack[] { toSpawn });
+ Hive hive = new Hive(hiveDescription);
- beeModifiers.add(this.beeModifier);
- for (final IHiveFrame frame : this.getFrames(this.inventory)) {
- beeModifiers.add(frame.getBeeModifier());
+ int chunkX = (this.xCoord + this.worldObj.rand.nextInt(80) - 40) / 16;
+ int chunkZ = (this.zCoord + this.worldObj.rand.nextInt(80) - 40) / 16;
+ if (HiveDecorator.genHive(this.worldObj, this.worldObj.rand, chunkX, chunkZ, hive)) {
+ this.pendingSpawns.pop();
}
- return beeModifiers;
}
@Override
- public Object getContainer(final EntityPlayer player, final int data) {
- return new CONTAINER_FrameHousing(this, player);
- }
-
- public Collection<IHiveFrame> getFrames(final IInventory inventory) {
- final Collection<IHiveFrame> hiveFrames = new ArrayList<IHiveFrame>(inventory.getSizeInventory());
- for (int i = 0; i < inventory.getSizeInventory(); i++) {
- final ItemStack stackInSlot = this.getStackInSlot(i);
- if (stackInSlot != null) {
- final Item itemInSlot = stackInSlot.getItem();
- if (itemInSlot instanceof IHiveFrame) {
- hiveFrames.add((IHiveFrame) itemInSlot);
- }
- }
- }
- return hiveFrames;
+ protected void encodeDescriptionPacket(NBTTagCompound packetData)
+ {
+ super.encodeDescriptionPacket(packetData);
+ packetData.setBoolean("Active", this.active);
}
@Override
- public Object getGui(final EntityPlayer player, final int data) {
- return new GUI_FrameHousing(this, player);
+ protected void decodeDescriptionPacket(NBTTagCompound packetData)
+ {
+ super.decodeDescriptionPacket(packetData);
+ setActive(packetData.getBoolean("Active"));
}
@Override
- public int getIcon(final int side) {
- if (side == 0 || side == 1) {
+ public int getIcon(int side)
+ {
+ if ((side == 0) || (side == 1)) {
return 2;
}
if (this.active) {
@@ -173,41 +177,48 @@ public class TileAlvearyFrameHousing extends FR_TileAlveary implements ISidedFra
}
@Override
- public IInventoryAdapter getInternalInventory() {
- return this.inventory;
- }
+ public void readFromNBT(NBTTagCompound nbttagcompound)
+ {
+ super.readFromNBT(nbttagcompound);
+ setActive(nbttagcompound.getBoolean("Active"));
- private ItemStack getPrincessStack() {
- final ItemStack princessStack = this.getMultiblockLogic().getController().getBeeInventory().getQueen();
- if (BeeManager.beeRoot.isMated(princessStack)) {
- return princessStack;
+ NBTTagList nbttaglist = nbttagcompound.getTagList("PendingSpawns", 10);
+ for (int i = 0; i < nbttaglist.tagCount(); i++)
+ {
+ NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
+ this.pendingSpawns.add(ItemStack.loadItemStackFromNBT(nbttagcompound1));
}
- return null;
- }
- private ItemStack getQueenStack() {
- final ItemStack queenStack = this.getMultiblockLogic().getController().getBeeInventory().getQueen();
- return queenStack;
}
@Override
- public boolean isActive() {
- return this.active;
+ public void writeToNBT(NBTTagCompound nbttagcompound)
+ {
+ super.writeToNBT(nbttagcompound);
+ nbttagcompound.setBoolean("Active", this.active);
+
+ NBTTagList nbttaglist = new NBTTagList();
+ ItemStack[] offspring = (ItemStack[])this.pendingSpawns.toArray(new ItemStack[this.pendingSpawns.size()]);
+ for (int i = 0; i < offspring.length; i++) {
+ if (offspring[i] != null)
+ {
+ NBTTagCompound nbttagcompound1 = new NBTTagCompound();
+ nbttagcompound1.setByte("Slot", (byte)i);
+ offspring[i].writeToNBT(nbttagcompound1);
+ nbttaglist.appendTag(nbttagcompound1);
+ }
+ }
+ nbttagcompound.setTag("PendingSpawns", nbttaglist);
}
@Override
- public void readFromNBT(final NBTTagCompound nbttagcompound) {
- super.readFromNBT(nbttagcompound);
- this.setActive(nbttagcompound.getBoolean("Active"));
-
- final NBTTagList nbttaglist = nbttagcompound.getTagList("PendingSpawns", 10);
- for (int i = 0; i < nbttaglist.tagCount(); i++) {
- final NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
- this.pendingSpawns.add(ItemStack.loadItemStackFromNBT(nbttagcompound1));
- }
+ public boolean isActive()
+ {
+ return this.active;
}
@Override
- public void setActive(final boolean active) {
+ public void setActive(boolean active)
+ {
if (this.active == active) {
return;
}
@@ -217,91 +228,133 @@ public class TileAlvearyFrameHousing extends FR_TileAlveary implements ISidedFra
}
}
- private void trySpawnSwarm() {
- final ItemStack toSpawn = this.pendingSpawns.peek();
- final HiveDescriptionSwarmer hiveDescription = new HiveDescriptionSwarmer(new ItemStack[] {
- toSpawn
- });
- final Hive hive = new Hive(hiveDescription);
-
- final int chunkX = (this.xCoord + this.worldObj.rand.nextInt(80) - 40) / 16;
- final int chunkZ = (this.zCoord + this.worldObj.rand.nextInt(80) - 40) / 16;
- if (HiveDecorator.genHive(this.worldObj, this.worldObj.rand, chunkX, chunkZ, hive)) {
- this.pendingSpawns.pop();
- }
+ @Override
+ public Object getGui(EntityPlayer player, int data)
+ {
+ return new GUI_FrameHousing(this, player);
}
@Override
- public void updateClient(final int tickCount) {
+ public Object getContainer(EntityPlayer player, int data)
+ {
+ return new CONTAINER_FrameHousing(this, player);
}
+ private final IBeeModifier beeModifier = new AlvearyBeeModifier();
+ //private final IBeeListener beeListener = new AlvearyBeeListener(this);
+ private final Iterable<IBeeListener> beeListenerList = ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeListeners();
+
@Override
- public void updateServer(final int tickCount) {
+ public Collection<IBeeModifier> getBeeModifiers()
+ {
+ List<IBeeModifier> beeModifiers = new ArrayList<IBeeModifier>();
- if (this.getInternalInventory() == null) {
- return;
+ beeModifiers.add(this.beeModifier);
+ for (IHiveFrame frame : getFrames(this.inventory)) {
+ beeModifiers.add(frame.getBeeModifier());
}
+ return beeModifiers;
+ }
- if (this.inventory.getStackInSlot(0) != null) {
- if (this.getMultiblockLogic().getController().getBeekeepingLogic().canWork()) {
- this.setActive(true);
- if (tickCount % 1000 == 0) {
- this.wearOutFrames(this, 1);
+ public Collection<IHiveFrame> getFrames(IInventory inventory)
+ {
+ Collection<IHiveFrame> hiveFrames = new ArrayList<IHiveFrame>(inventory.getSizeInventory());
+ for (int i = 0; i < inventory.getSizeInventory(); i++)
+ {
+ ItemStack stackInSlot = getStackInSlot(i);
+ if (stackInSlot != null)
+ {
+ Item itemInSlot = stackInSlot.getItem();
+ if ((itemInSlot instanceof IHiveFrame)) {
+ hiveFrames.add((IHiveFrame)itemInSlot);
}
}
- else {
- Utils.LOG_INFO("Cannot work - Probably no queen alive.");
- }
-
}
- else {
- this.setActive(false);
- }
- if (tickCount % 500 != 0) {
- return;
+ return hiveFrames;
+ }
+
+ @Override
+ public IBeeModifier getBeeModifier() {
+ List<IBeeModifier> beeModifiers = new ArrayList<IBeeModifier>();
+
+ //beeModifiers.add(this.beeModifier);
+ for (IHiveFrame frame : getFrames(this.inventory)) {
+ beeModifiers.add(frame.getBeeModifier());
}
+ return beeModifiers.get(0);
+ }
+ private ItemStack getQueenStack()
+ {
+ ItemStack queenStack = ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeInventory().getQueen();
+ return queenStack;
}
@Override
- public void wearOutFrames(final IBeeHousing beeHousing, final int amount) {
- final IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(beeHousing.getWorld());
- final int wear = Math.round(amount * beekeepingMode.getWearModifier());
- for (int i = 0; i < this.inventory.getSizeInventory(); i++) {
- final ItemStack hiveFrameStack = this.getStackInSlot(i);
- if (hiveFrameStack != null) {
- final Item hiveFrameItem = hiveFrameStack.getItem();
- if (hiveFrameItem instanceof IHiveFrame) {
- final IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
- Utils.LOG_INFO("Wearing out frame by " + amount);
- final ItemStack queenStack = this.getQueenStack();
- final IBee queen = BeeManager.beeRoot.getMember(queenStack);
- final ItemStack usedFrame = hiveFrame.frameUsed(beeHousing, hiveFrameStack, queen, wear);
-
- // ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeListeners().
-
- this.setInventorySlotContents(i, usedFrame);
+ public void wearOutFrames(IBeeHousing beeHousing, int amount)
+ {
+ IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(beeHousing.getWorld());
+ int wear = Math.round(amount * beekeepingMode.getWearModifier());
+ for (int i = 0; i < this.inventory.getSizeInventory(); i++)
+ {
+ ItemStack hiveFrameStack = getStackInSlot(i);
+ if (hiveFrameStack != null)
+ {
+ Item hiveFrameItem = hiveFrameStack.getItem();
+ if ((hiveFrameItem instanceof IHiveFrame))
+ {
+ IHiveFrame hiveFrame = (IHiveFrame)hiveFrameItem;
+ Utils.LOG_INFO("Wearing out frame by "+amount);
+ ItemStack queenStack = getQueenStack();
+ IBee queen = BeeManager.beeRoot.getMember(queenStack);
+ ItemStack usedFrame = hiveFrame.frameUsed(beeHousing, hiveFrameStack, queen, wear);
+
+ //((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeListeners().
+
+ setInventorySlotContents(i, usedFrame);
}
}
}
}
@Override
- public void writeToNBT(final NBTTagCompound nbttagcompound) {
- super.writeToNBT(nbttagcompound);
- nbttagcompound.setBoolean("Active", this.active);
-
- final NBTTagList nbttaglist = new NBTTagList();
- final ItemStack[] offspring = this.pendingSpawns.toArray(new ItemStack[this.pendingSpawns.size()]);
- for (int i = 0; i < offspring.length; i++) {
- if (offspring[i] != null) {
- final NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- nbttagcompound1.setByte("Slot", (byte) i);
- offspring[i].writeToNBT(nbttagcompound1);
- nbttaglist.appendTag(nbttagcompound1);
- }
- }
- nbttagcompound.setTag("PendingSpawns", nbttaglist);
+ public InventoryFrameHousing getAlvearyInventory() {
+ return inventory;
}
+ @Override
+ public IBeeListener getBeeListener() {
+ return beeListener;
+ }
+
+ static class AlvearyFrameHousingBeeListener
+ extends DefaultBeeListener
+ {
+ private final InventoryFrameHousing inventory;
+
+ public AlvearyFrameHousingBeeListener(InventoryFrameHousing inventory)
+ {
+ this.inventory = inventory;
+ }
+
+ @Override
+ public boolean onPollenRetrieved(IIndividual pollen)
+ {
+ /*if (!((Object) this.inventory).canStorePollen()) {
+ return false;
+ }*/
+ ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(pollen.getClass());
+
+ ItemStack pollenStack = speciesRoot.getMemberStack(pollen, EnumGermlingType.POLLEN.ordinal());
+ if (pollenStack != null)
+ {
+ // ((Object) this.inventory).storePollenStack(pollenStack);
+ return true;
+ }
+ return false;
+ }
+ }
+
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
index c8e4081ee3..c685482266 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
@@ -1,85 +1,98 @@
package gtPlusPlus.xmod.forestry.bees.alveary.gui;
-import forestry.api.apiculture.IHiveFrame;
-import forestry.core.gui.tooltips.ToolTip;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.slots.SlotFrame;
-import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
+import forestry.api.apiculture.IHiveFrame;
+import forestry.core.gui.tooltips.ToolTip;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.slots.SlotFrame;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
-public class CONTAINER_FrameHousing extends Container {
- public static final int INPUT_1 = 0;
+public class CONTAINER_FrameHousing extends Container
+{
+ private TileAlvearyFrameHousing te;
- private final TileAlvearyFrameHousing te;
- private final ResourceLocation beeFrameIcon = new ResourceLocation(CORE.MODID,
- "textures/items/machine_Charger.png");
- public ToolTip newTip = new ToolTip();
- private final SlotFrame beeFrameSlot;
+ public static final int INPUT_1 = 0;
+ private final ResourceLocation beeFrameIcon = new ResourceLocation(CORE.MODID, "textures/items/machine_Charger.png");
+ public ToolTip newTip = new ToolTip();
+ private final SlotFrame beeFrameSlot;
- private int slotID = 0;
+ private int slotID = 0;
- public CONTAINER_FrameHousing(final TileAlvearyFrameHousing te, final EntityPlayer player) {
+ public CONTAINER_FrameHousing(TileAlvearyFrameHousing te, EntityPlayer player)
+ {
this.te = te;
- this.beeFrameSlot = new SlotFrame(te, this.slotID++, 80, 35);
+ this.beeFrameSlot = new SlotFrame(te, slotID++, 80, 35);
- // Fuel Slot A
- this.beeFrameSlot.setBackgroundIconTexture(this.beeFrameIcon);
+ //Fuel Slot A
+ beeFrameSlot.setBackgroundIconTexture(beeFrameIcon);
+
+ addSlotToContainer(beeFrameSlot);
- this.addSlotToContainer(this.beeFrameSlot);
-
- // Inventory
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 9; j++) {
- this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ //Inventory
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 9; j++)
+ {
+ addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
// Hotbar
- for (int i = 0; i < 9; i++) {
- this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ for (int i = 0; i < 9; i++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
- public boolean canInteractWith(final EntityPlayer player) {
- return this.te.isUseableByPlayer(player);
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer player, final int slotRaw) {
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
ItemStack stack = null;
- final Slot slot = (Slot) this.inventorySlots.get(slotRaw);
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
- if (slot != null && slot.getHasStack()) {
- final ItemStack stackInSlot = slot.getStack();
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack stackInSlot = slot.getStack();
stack = stackInSlot.copy();
-
- // If your inventory only stores certain instances of Items,
- // you can implement shift-clicking to your inventory like this:
+
+
+ //If your inventory only stores certain instances of Items,
+ //you can implement shift-clicking to your inventory like this:
// Check that the item is the right type
- if (!(stack.getItem() instanceof IHiveFrame)) {
- return null;
+ if (!(stack.getItem() instanceof IHiveFrame)){
+ return null;
}
- if (slotRaw < 1) {
- if (!this.mergeItemStack(stackInSlot, 3 * 9, this.inventorySlots.size(), true)) {
+ if (slotRaw < 1)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
return null;
}
}
- else if (!this.mergeItemStack(stackInSlot, 0, 3 * 9, false)) {
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
return null;
}
- if (stackInSlot.stackSize == 0) {
- slot.putStack((ItemStack) null);
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
}
- else {
+ else
+ {
slot.onSlotChanged();
}
}
return stack;
}
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return te.isUseableByPlayer(player);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
index 1acbfd534e..dcf8da3a1a 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.forestry.bees.alveary.gui;
-import org.lwjgl.opengl.GL11;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import net.minecraft.client.Minecraft;
@@ -11,41 +9,41 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-public class GUI_FrameHousing extends GuiContainer {
- private final ResourceLocation texture = new ResourceLocation(CORE.MODID,
- "textures/gui/machine_Charger.png");
-
- private final InventoryPlayer inventory;
- private final TileAlvearyFrameHousing te;
-
- public GUI_FrameHousing(final TileAlvearyFrameHousing te, final EntityPlayer player) {
- super(new CONTAINER_FrameHousing(te, player));
- this.inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- Minecraft.getMinecraft().renderEngine.bindTexture(this.texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
-
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(I18n.format("Alveary Frame Housing"),
- this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format("Alveary Frame Housing")) / 2, 6,
- 4210752, false);
- this.fontRendererObj.drawString(I18n.format(this.inventory.getInventoryName()), 8, this.ySize - 96 + 2,
- 4210752);
- // fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"),
- // 8, ySize - 96 + 2, 4210752);
- // fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"),
- // 80, ySize - 96 + 2, 4210752);
- }
+public class GUI_FrameHousing extends GuiContainer
+{
+ private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
+
+ private InventoryPlayer inventory;
+ private TileAlvearyFrameHousing te;
+
+ public GUI_FrameHousing(TileAlvearyFrameHousing te, EntityPlayer player)
+ {
+ super(new CONTAINER_FrameHousing(te, player));
+ inventory = player.inventory;
+ this.te = te;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ fontRendererObj.drawString(I18n.format("Alveary Frame Housing"), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format("Alveary Frame Housing")) / 2), 6, 4210752, false);
+ fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
+ //fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"), 8, ySize - 96 + 2, 4210752);
+ //fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
index 1c562936bd..9d6dd06f2d 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
@@ -1,111 +1,121 @@
package gtPlusPlus.xmod.forestry.bees.alveary.gui;
-import com.mojang.authlib.GameProfile;
-
-import forestry.api.apiculture.*;
-import forestry.api.core.*;
-import forestry.core.inventory.InventoryAdapterTile;
-import forestry.core.utils.ItemStackUtil;
-import gtPlusPlus.xmod.forestry.bees.alveary.IAlvearyFrameHousing;
-import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
-public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing>
- implements IAlvearyFrameHousing {
+import com.mojang.authlib.GameProfile;
- TileAlvearyFrameHousing alvearyFrame;
+import forestry.api.apiculture.BeeManager;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeHousingInventory;
+import forestry.api.apiculture.IBeeListener;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IBeekeepingLogic;
+import forestry.api.core.EnumHumidity;
+import forestry.api.core.EnumTemperature;
+import forestry.api.core.IErrorLogic;
+import forestry.core.inventory.InventoryAdapterTile;
+import forestry.core.utils.ItemStackUtil;
+import gtPlusPlus.xmod.forestry.bees.alveary.IAlvearyFrameHousing;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
- public InventoryFrameHousing(final TileAlvearyFrameHousing alvearyFrame) {
+public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing> implements IAlvearyFrameHousing
+{
+
+ TileAlvearyFrameHousing alvearyFrame;
+
+ public InventoryFrameHousing(TileAlvearyFrameHousing alvearyFrame)
+ {
super(alvearyFrame, 1, "FrameHousingInv");
this.alvearyFrame = alvearyFrame;
}
@Override
- public boolean canBlockSeeTheSky() {
- return this.alvearyFrame.canBlockSeeTheSky();
- }
-
- @Override
- public boolean canSlotAccept(final int slotIndex, final ItemStack itemStack) {
+ public boolean canSlotAccept(int slotIndex, ItemStack itemStack)
+ {
return ItemStackUtil.containsItemStack(BeeManager.inducers.keySet(), itemStack);
}
@Override
- public InventoryFrameHousing getAlvearyInventory() {
- return this;
+ public boolean canBlockSeeTheSky() {
+ return alvearyFrame.canBlockSeeTheSky();
}
@Override
public Vec3 getBeeFXCoordinates() {
- return this.alvearyFrame.getBeeFXCoordinates();
+ return alvearyFrame.getBeeFXCoordinates();
}
@Override
public IBeeHousingInventory getBeeInventory() {
- return this.alvearyFrame.getBeeInventory();
+ return alvearyFrame.getBeeInventory();
}
@Override
- public IBeekeepingLogic getBeekeepingLogic() {
- return this.alvearyFrame.getBeekeepingLogic();
+ public Iterable<IBeeListener> getBeeListeners() {
+ return alvearyFrame.getBeeListeners();
}
@Override
- public Iterable<IBeeListener> getBeeListeners() {
- return this.alvearyFrame.getBeeListeners();
+ public Iterable<IBeeModifier> getBeeModifiers() {
+ return alvearyFrame.getBeeModifiers();
}
@Override
- public Iterable<IBeeModifier> getBeeModifiers() {
- return this.alvearyFrame.getBeeModifiers();
+ public IBeekeepingLogic getBeekeepingLogic() {
+ return alvearyFrame.getBeekeepingLogic();
}
@Override
public BiomeGenBase getBiome() {
- return this.alvearyFrame.getBiome();
+ return alvearyFrame.getBiome();
}
@Override
public int getBlockLightValue() {
- return this.alvearyFrame.getBlockLightValue();
+ return alvearyFrame.getBlockLightValue();
}
@Override
- public ChunkCoordinates getCoordinates() {
- return this.alvearyFrame.getCoordinates();
+ public EnumHumidity getHumidity() {
+ return alvearyFrame.getHumidity();
}
@Override
- public IErrorLogic getErrorLogic() {
- return this.alvearyFrame.getErrorLogic();
+ public GameProfile getOwner() {
+ return alvearyFrame.getOwner();
}
@Override
- public EnumHumidity getHumidity() {
- return this.alvearyFrame.getHumidity();
+ public EnumTemperature getTemperature() {
+ return alvearyFrame.getTemperature();
}
@Override
- public GameProfile getOwner() {
- return this.alvearyFrame.getOwner();
+ public World getWorld() {
+ return alvearyFrame.getWorld();
}
@Override
- public EnumTemperature getTemperature() {
- return this.alvearyFrame.getTemperature();
+ public ChunkCoordinates getCoordinates() {
+ return alvearyFrame.getCoordinates();
}
@Override
- public World getWorld() {
- return this.alvearyFrame.getWorld();
+ public IErrorLogic getErrorLogic() {
+ return alvearyFrame.getErrorLogic();
+ }
+
+ @Override
+ public InventoryFrameHousing getAlvearyInventory() {
+ return this;
}
@Override
- public void wearOutFrames(final IBeeHousing beeHousing, final int amount) {
- this.alvearyFrame.wearOutFrames(beeHousing, amount);
+ public void wearOutFrames(IBeeHousing beeHousing, int amount) {
+ alvearyFrame.wearOutFrames(beeHousing, amount);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
index a4d1d8544d..edd04661d7 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
@@ -9,94 +9,89 @@
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package gtPlusPlus.xmod.forestry.bees.items;
-
+import net.minecraft.block.Block;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.WeightedRandomChestContent;
+import net.minecraftforge.common.ChestGenHooks;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.core.items.ItemBlockForestry;
import forestry.core.utils.StringUtil;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.forestry.bees.alveary.FR_BlockAlveary;
-import net.minecraft.block.Block;
-import net.minecraft.item.*;
-import net.minecraft.util.WeightedRandomChestContent;
-import net.minecraftforge.common.ChestGenHooks;
public class FR_ItemRegistry {
- // ----- Apiary Frames ----------------------
- // public static FR_ItemHiveFrame frameUntreated;
- // public static FR_ItemHiveFrame frameImpregnated;
- // public static FR_ItemHiveFrame frameProven;
-
- // Magic Bee Frame Items
- public static MB_ItemFrame hiveFrameAccelerated;
- public static MB_ItemFrame hiveFrameVoid;
- public static MB_ItemFrame hiveFrameMutagenic;
- public static MB_ItemFrame haveFrameBusy;
-
- // Extra Bee Frame Items
- public static MB_ItemFrame hiveFrameCocoa;
- public static MB_ItemFrame hiveFrameCaged;
- public static MB_ItemFrame hiveFrameSoul;
- public static MB_ItemFrame hiveFrameClay;
- public static MB_ItemFrame hiveFrameNova;
-
- // Alveary Stuff
- public static FR_BlockAlveary alveary;
-
- public static void Register() {
-
- // Forestry Frames
- // frameUntreated = registerItem(new FR_ItemHiveFrame(80, 0.9f),
- // "frameUntreated");
- // frameImpregnated = registerItem(new FR_ItemHiveFrame(240, 0.4f),
- // "frameImpregnated");
- // frameProven = registerItem(new FR_ItemHiveFrame(720, 0.3f),
- // "frameProven");
-
- // Magic Bee like Frames
- FR_ItemRegistry.hiveFrameAccelerated = new MB_ItemFrame(MB_FrameType.ACCELERATED,
- "Longevity for bees isn't very common.");
- FR_ItemRegistry.hiveFrameVoid = new MB_ItemFrame(MB_FrameType.VOID, EnumRarity.rare, "??? (Dungeon Loot)");
- FR_ItemRegistry.hiveFrameMutagenic = new MB_ItemFrame(MB_FrameType.MUTAGENIC, EnumRarity.epic,
- "Evolution of the fitest, finest and fastest.");
- FR_ItemRegistry.haveFrameBusy = new MB_ItemFrame(MB_FrameType.BUSY,
- "Busy bee, Busy Bee, make more honey please for me.");
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR,
- new WeightedRandomChestContent(new ItemStack(FR_ItemRegistry.hiveFrameVoid), 1, 1, 18));
- ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY,
- new WeightedRandomChestContent(new ItemStack(FR_ItemRegistry.hiveFrameVoid), 1, 3, 23));
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST,
- new WeightedRandomChestContent(new ItemStack(FR_ItemRegistry.hiveFrameMutagenic), 1, 1, 18));
- ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST,
- new WeightedRandomChestContent(new ItemStack(FR_ItemRegistry.hiveFrameMutagenic), 1, 3, 23));
-
- // Extra Bee like Frames
- if (!LoadedMods.ExtraBees) {
- FR_ItemRegistry.hiveFrameCocoa = new MB_ItemFrame(MB_FrameType.COCOA, EnumRarity.common, "");
- FR_ItemRegistry.hiveFrameCaged = new MB_ItemFrame(MB_FrameType.CAGE, EnumRarity.common, "");
- FR_ItemRegistry.hiveFrameSoul = new MB_ItemFrame(MB_FrameType.SOUL, EnumRarity.common, "");
- FR_ItemRegistry.hiveFrameClay = new MB_ItemFrame(MB_FrameType.CLAY, EnumRarity.common, "");
- FR_ItemRegistry.hiveFrameNova = new MB_ItemFrame(MB_FrameType.NOVA, EnumRarity.epic,
- "A Creative Only Frame.");
- if (CORE.configSwitches.enableCustomAlvearyBlocks) {
- FR_ItemRegistry.alveary = FR_ItemRegistry.registerBlock(new FR_BlockAlveary(), ItemBlockForestry.class,
- "alveary");
+
+ //----- Apiary Frames ----------------------
+ //public static FR_ItemHiveFrame frameUntreated;
+ //public static FR_ItemHiveFrame frameImpregnated;
+ //public static FR_ItemHiveFrame frameProven;
+
+ //Magic Bee Frame Items
+ public static MB_ItemFrame hiveFrameAccelerated;
+ public static MB_ItemFrame hiveFrameVoid;
+ public static MB_ItemFrame hiveFrameMutagenic;
+ public static MB_ItemFrame haveFrameBusy;
+
+ //Extra Bee Frame Items
+ public static MB_ItemFrame hiveFrameCocoa;
+ public static MB_ItemFrame hiveFrameCaged;
+ public static MB_ItemFrame hiveFrameSoul;
+ public static MB_ItemFrame hiveFrameClay;
+ public static MB_ItemFrame hiveFrameNova;
+
+ //Alveary Stuff
+ public static FR_BlockAlveary alveary;
+
+ public static void Register() {
+
+ //Forestry Frames
+ //frameUntreated = registerItem(new FR_ItemHiveFrame(80, 0.9f), "frameUntreated");
+ //frameImpregnated = registerItem(new FR_ItemHiveFrame(240, 0.4f), "frameImpregnated");
+ //frameProven = registerItem(new FR_ItemHiveFrame(720, 0.3f), "frameProven");
+
+ //Magic Bee like Frames
+ hiveFrameAccelerated = new MB_ItemFrame(MB_FrameType.ACCELERATED, "Longevity for bees isn't very common.");
+ hiveFrameVoid = new MB_ItemFrame(MB_FrameType.VOID, EnumRarity.rare, "??? (Dungeon Loot)");
+ hiveFrameMutagenic = new MB_ItemFrame(MB_FrameType.MUTAGENIC, EnumRarity.epic, "Evolution of the fitest, finest and fastest.");
+ haveFrameBusy = new MB_ItemFrame(MB_FrameType.BUSY, "Busy bee, Busy Bee, make more honey please for me.");
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 1, 18));
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new ItemStack(hiveFrameVoid), 1, 3, 23));
+ ChestGenHooks.addItem(ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 1, 18));
+ ChestGenHooks.addItem(ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new ItemStack(hiveFrameMutagenic), 1, 3, 23));
+
+ //Extra Bee like Frames
+ if (!LoadedMods.ExtraBees){
+ hiveFrameCocoa = new MB_ItemFrame(MB_FrameType.COCOA, EnumRarity.common, "");
+ hiveFrameCaged = new MB_ItemFrame(MB_FrameType.CAGE, EnumRarity.common, "");
+ hiveFrameSoul = new MB_ItemFrame(MB_FrameType.SOUL, EnumRarity.common, "");
+ hiveFrameClay = new MB_ItemFrame(MB_FrameType.CLAY, EnumRarity.common, "");
+ hiveFrameNova = new MB_ItemFrame(MB_FrameType.NOVA, EnumRarity.epic, "A Creative Only Frame.");
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
+ alveary = registerBlock(new FR_BlockAlveary(), ItemBlockForestry.class, "alveary");
}
}
- }
- protected static <T extends Block> T registerBlock(final T block, final Class<? extends ItemBlock> itemClass,
- final String name, final Object... itemCtorArgs) {
- block.setBlockName("for." + name);
- GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block), itemCtorArgs);
- return block;
+
+
}
- protected static <T extends Item> T registerItem(final T item, final String name) {
+ protected static <T extends Item> T registerItem(T item, String name) {
item.setUnlocalizedName(name);
GameRegistry.registerItem(item, StringUtil.cleanItemName(item));
return item;
}
+
+ protected static <T extends Block> T registerBlock(T block, Class<? extends ItemBlock> itemClass, String name, Object... itemCtorArgs) {
+ block.setBlockName("for." + name);
+ GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block), itemCtorArgs);
+ return block;
+ }
}
+
+
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
index f493e2cbbb..69065bec24 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
@@ -2,16 +2,21 @@ package gtPlusPlus.xmod.forestry.bees.items;
import net.minecraft.util.StatCollector;
-public class FR_StringUtil {
- public static String getLocalizedString(final String key) {
- if (StatCollector.canTranslate(key)) {
+public class FR_StringUtil
+{
+ public static String getLocalizedString(String key)
+ {
+ if(StatCollector.canTranslate(key))
+ {
return StatCollector.translateToLocal(key);
}
return StatCollector.translateToFallback(key);
}
- public static String getLocalizedString(final String key, final Object... objects) {
- if (StatCollector.canTranslate(key)) {
+ public static String getLocalizedString(String key, Object... objects)
+ {
+ if(StatCollector.canTranslate(key))
+ {
return String.format(StatCollector.translateToLocal(key), objects);
}
return String.format(StatCollector.translateToFallback(key), objects);
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java b/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
index 76e5f76e03..5a61c94196 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
@@ -3,44 +3,48 @@ package gtPlusPlus.xmod.forestry.bees.items;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeModifier;
-public enum MB_FrameType implements IBeeModifier {
- // ExtraBees Clone Frames
- // Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production
- // rate, genetic decay (1f)
- COCOA("Chocolate", 240, 1.0f, 1.0f, 0.50f, 1.50f, 1f), CAGE("Restraint", 240, 0.5f, 1.0f, 0.75f, 0.75f, 1f), SOUL(
- "Soul", 80, 1.0f, 1.5f, 0.75f, 0.25f, 1f), CLAY("Healing", 240, 1.0f, 0.5f, 1.50f, 0.75f,
- 1f), NOVA("Nova", 240, 1.0f, 100.0f, 0.0001f, 1.00f, 1f),
-
- // Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production
- // rate, genetic decay (1f)
- ACCELERATED("Accelerated", 175, 1f, 2.5f, 0.9f, 1.8f, 1f), VOID("Void", 20, 1f, 1f, 0.0001f, 10f,
- 1f), MUTAGENIC("Mutagenic", 3, 1f, 10f, 0.0001f, 10f, 1f), BUSY("Busy", 2000, 1f, 0f, 3f, 4f, 1f);
-
- private final String frameName;
- public final int maxDamage;
-
- private final float territoryMod;
- private final float mutationMod;
- private final float lifespanMod;
- private final float productionMod;
- private final float floweringMod;
- private final float geneticDecayMod;
- private final boolean isSealed;
- private final boolean isLit;
- private final boolean isSunlit;
- private final boolean isHellish;
-
- MB_FrameType(final String name, final int damage, final float territory, final float mutation, final float lifespan,
- final float production, final float geneticDecay) {
+public enum MB_FrameType implements IBeeModifier
+{
+ //ExtraBees Clone Frames
+ //Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production rate, genetic decay (1f)
+ COCOA("Chocolate", 240, 1.0f, 1.0f, 0.50f, 1.50f, 1f),
+ CAGE("Restraint", 240, 0.5f, 1.0f, 0.75f, 0.75f, 1f),
+ SOUL("Soul", 80, 1.0f, 1.5f, 0.75f, 0.25f, 1f),
+ CLAY("Healing", 240, 1.0f, 0.5f, 1.50f, 0.75f, 1f),
+ NOVA("Nova", 240, 1.0f, 100.0f, 0.0001f, 1.00f, 1f),
+
+
+ //Name, FrameHP, territory (1f), Mutation rate, lifespan rate, production rate, genetic decay (1f)
+ ACCELERATED("Accelerated", 175, 1f, 2.5f, 0.9f, 1.8f, 1f),
+ VOID("Void", 20, 1f, 1f, 0.0001f, 10f, 1f),
+ MUTAGENIC("Mutagenic", 3, 1f, 10f, 0.0001f, 10f, 1f),
+ BUSY("Busy", 2000, 1f, 0f, 3f, 4f, 1f);
+
+ private final String frameName;
+ public final int maxDamage;
+
+ private final float territoryMod;
+ private final float mutationMod;
+ private final float lifespanMod;
+ private final float productionMod;
+ private final float floweringMod;
+ private final float geneticDecayMod;
+ private final boolean isSealed;
+ private final boolean isLit;
+ private final boolean isSunlit;
+ private final boolean isHellish;
+
+ MB_FrameType(String name, int damage, float territory, float mutation, float lifespan, float production, float geneticDecay) {
this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false);
}
-
- MB_FrameType(final String name, final int damage, final float territory, final float mutation, final float lifespan,
- final float production, final float flowering, final float geneticDecay, final boolean sealed,
- final boolean lit, final boolean sunlit, final boolean hellish) {
+
+ MB_FrameType(String name, int damage,
+ float territory, float mutation, float lifespan, float production, float flowering, float geneticDecay,
+ boolean sealed, boolean lit, boolean sunlit, boolean hellish)
+ {
this.frameName = name;
this.maxDamage = damage;
-
+
this.territoryMod = territory;
this.mutationMod = mutation;
this.lifespanMod = lifespan;
@@ -53,61 +57,63 @@ public enum MB_FrameType implements IBeeModifier {
this.isHellish = hellish;
}
- @Override
- public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
- return this.floweringMod;
+ public String getName()
+ {
+ return this.frameName;
}
-
- @Override
- public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
- return this.geneticDecayMod;
+
+ public String getLocalizedName()
+ {
+ return FR_StringUtil.getLocalizedString("frame." + this.frameName);
}
@Override
- public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.lifespanMod;
- }
-
- public String getLocalizedName() {
- return FR_StringUtil.getLocalizedString("frame." + this.frameName);
+ public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
+ return territoryMod;
}
@Override
- public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.mutationMod;
+ public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return mutationMod;
}
- public String getName() {
- return this.frameName;
+ @Override
+ public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return lifespanMod;
}
@Override
- public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
- return this.productionMod;
+ public float getProductionModifier(IBeeGenome genome, float currentModifier) {
+ return productionMod;
}
@Override
- public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
- return this.territoryMod;
+ public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
+ return floweringMod;
}
@Override
- public boolean isHellish() {
- return this.isHellish;
+ public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
+ return geneticDecayMod;
}
@Override
public boolean isSealed() {
- return this.isSealed;
+ return isSealed;
}
@Override
public boolean isSelfLighted() {
- return this.isLit;
+ return isLit;
}
@Override
public boolean isSunlightSimulated() {
- return this.isSunlit;
+ return isSunlit;
+ }
+
+ @Override
+ public boolean isHellish() {
+ return isHellish;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java b/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
index f46391c725..0f0e7d3109 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
@@ -2,23 +2,36 @@ package gtPlusPlus.xmod.forestry.bees.items;
import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import forestry.api.apiculture.*;
+import forestry.api.apiculture.IBee;
+import forestry.api.apiculture.IBeeGenome;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IHiveFrame;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.*;
-import net.minecraft.util.EnumChatFormatting;
-public class MB_ItemFrame extends Item implements IHiveFrame {
- private final MB_FrameType type;
- private EnumRarity rarity_value = EnumRarity.uncommon;
- private final String toolTip;
+public class MB_ItemFrame extends Item implements IHiveFrame
+{
+ private MB_FrameType type;
+ private EnumRarity rarity_value = EnumRarity.uncommon;
+ private final String toolTip;
- public MB_ItemFrame(final MB_FrameType frameType, final EnumRarity rarity, final String description) {
+ public MB_ItemFrame(MB_FrameType frameType, String description)
+ {
+ this(frameType, EnumRarity.uncommon, description);
+ }
+
+ public MB_ItemFrame(MB_FrameType frameType, EnumRarity rarity, String description)
+ {
super();
this.type = frameType;
this.setMaxDamage(this.type.maxDamage);
@@ -29,21 +42,26 @@ public class MB_ItemFrame extends Item implements IHiveFrame {
this.toolTip = description;
GameRegistry.registerItem(this, "frame" + frameType.getName());
}
-
- public MB_ItemFrame(final MB_FrameType frameType, final String description) {
- this(frameType, EnumRarity.uncommon, description);
- }
-
+
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.toolTip != "" || !this.toolTip.equals("")) {
- list.add(EnumChatFormatting.GRAY + this.toolTip);
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (toolTip != "" || !toolTip.equals("")){
+ list.add(EnumChatFormatting.GRAY+toolTip);
}
super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister)
+ {
+ this.itemIcon = par1IconRegister.registerIcon(CORE.MODID + ":frame" + type.getName());
}
-
+
+ // --------- IHiveFrame functions -----------------------------------------
+
@Override
- public ItemStack frameUsed(final IBeeHousing housing, ItemStack frame, final IBee queen, final int wear) {
+ public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
frame.setItemDamage(frame.getItemDamage() + wear);
if (frame.getItemDamage() >= frame.getMaxDamage()) {
@@ -53,77 +71,70 @@ public class MB_ItemFrame extends Item implements IHiveFrame {
return frame;
}
-
- // --------- IHiveFrame functions -----------------------------------------
-
+
+
@Override
- public IBeeModifier getBeeModifier() {
- return this.type;
- }
-
- public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
- return this.type.getFloweringModifier(genome, currentModifier);
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return rarity_value;
}
-
- public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
- return this.type.getGeneticDecay(genome, currentModifier);
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ if (rarity_value == EnumRarity.uncommon || rarity_value == EnumRarity.common){
+ return false;
+ }
+ return true;
}
- public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.type.getLifespanModifier(genome, mate, currentModifier);
+ public IBeeModifier getBeeModifier() {
+ return type;
}
-
- public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
- return this.type.getMutationModifier(genome, mate, currentModifier);
+
+ @Override
+ public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2)
+ {
+ return false;
}
-
- public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
- return this.type.getProductionModifier(genome, currentModifier);
+
+ public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
+ return type.getTerritoryModifier(genome, currentModifier);
}
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return this.rarity_value;
+ public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return type.getMutationModifier(genome, mate, currentModifier);
}
- public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
- return this.type.getTerritoryModifier(genome, currentModifier);
+ public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return type.getLifespanModifier(genome, mate, currentModifier);
}
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- if (this.rarity_value == EnumRarity.uncommon || this.rarity_value == EnumRarity.common) {
- return false;
- }
- return true;
+ public float getProductionModifier(IBeeGenome genome, float currentModifier) {
+ return type.getProductionModifier(genome, currentModifier);
}
- @Override
- public boolean isBookEnchantable(final ItemStack itemstack1, final ItemStack itemstack2) {
- return false;
+ public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
+ return type.getFloweringModifier(genome, currentModifier);
}
- public boolean isHellish() {
- return this.type.isHellish();
+ public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
+ return type.getGeneticDecay(genome, currentModifier);
}
public boolean isSealed() {
- return this.type.isSealed();
+ return type.isSealed();
}
public boolean isSelfLighted() {
- return this.type.isSelfLighted();
+ return type.isSelfLighted();
}
public boolean isSunlightSimulated() {
- return this.type.isSunlightSimulated();
+ return type.isSunlightSimulated();
}
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister par1IconRegister) {
- this.itemIcon = par1IconRegister.registerIcon(CORE.MODID + ":frame" + this.type.getName());
+
+ public boolean isHellish(){
+ return type.isHellish();
}
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
index 5470891b68..ced6dd1d27 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
@@ -9,62 +9,74 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class FR_Gregtech_Recipes {
+
+ private static String rod_ElectrumFlux = "stickElectrumFlux";
+ private static String rod_LongElectrumFlux = "stickLongElectrumFlux";
+ private static String foil_Electrum = "foilElectrum";
+ private static String rod_Uranium = "stickUranium";
+ private static String rod_LongUranium = "stickLongUranium";
+ private static String foil_Uranium235 = "foilUranium235";
+ private static ItemStack hiveFrameAccelerated = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated);
+ private static ItemStack hiveFrameMutagenic = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic);
+
- private static String rod_ElectrumFlux = "stickElectrumFlux";
- private static String rod_LongElectrumFlux = "stickLongElectrumFlux";
- private static String foil_Electrum = "foilElectrum";
- private static String rod_Uranium = "stickUranium";
- private static String rod_LongUranium = "stickLongUranium";
- private static String foil_Uranium235 = "foilUranium235";
- private static ItemStack hiveFrameAccelerated = ItemUtils
- .getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated);
- private static ItemStack hiveFrameMutagenic = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic);
+ private static ItemStack hiveFrameCocoa = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa);
+ private static ItemStack hiveFrameCaged = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCaged);
+ private static ItemStack hiveFrameSoul = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSoul);
+ private static ItemStack hiveFrameClay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameClay);
+ private static ItemStack hiveFrameNova = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameNova);
+
+ private static ItemStack hiveFrameImpregnated = ItemUtils.getItemStack("Forestry:frameImpregnated", 1);
+ private static ItemStack blockSoulSand = new ItemStack(Blocks.soul_sand, 1);
+ private static ItemStack blockIronBars = new ItemStack (Blocks.iron_bars, 1);
+ private static ItemStack itemClayDust = new ItemStack(Items.clay_ball, 1);
+ private static ItemStack itemCocoaBeans = new ItemStack(Items.dye, 1, 3);
- private static ItemStack hiveFrameCocoa = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa);
- private static ItemStack hiveFrameCaged = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCaged);
- private static ItemStack hiveFrameSoul = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSoul);
- private static ItemStack hiveFrameClay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameClay);
- private static ItemStack hiveFrameNova = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameNova);
- private static ItemStack hiveFrameImpregnated = ItemUtils.getItemStack("Forestry:frameImpregnated", 1);
- private static ItemStack blockSoulSand = new ItemStack(Blocks.soul_sand, 1);
- private static ItemStack blockIronBars = new ItemStack(Blocks.iron_bars, 1);
- private static ItemStack itemClayDust = new ItemStack(Items.clay_ball, 1);
- private static ItemStack itemCocoaBeans = new ItemStack(Items.dye, 1, 3);
-
- public static void registerItems() {
-
- // Magic Bee Like Frames
- RecipeUtils.recipeBuilder(FR_Gregtech_Recipes.rod_LongElectrumFlux, FR_Gregtech_Recipes.rod_ElectrumFlux,
- FR_Gregtech_Recipes.rod_LongElectrumFlux, FR_Gregtech_Recipes.rod_LongElectrumFlux,
- FR_Gregtech_Recipes.foil_Electrum, FR_Gregtech_Recipes.rod_LongElectrumFlux,
- FR_Gregtech_Recipes.rod_ElectrumFlux, FR_Gregtech_Recipes.rod_ElectrumFlux,
- FR_Gregtech_Recipes.rod_ElectrumFlux, FR_Gregtech_Recipes.hiveFrameAccelerated);
-
- RecipeUtils.recipeBuilder(FR_Gregtech_Recipes.rod_LongUranium, FR_Gregtech_Recipes.rod_Uranium,
- FR_Gregtech_Recipes.rod_LongUranium, FR_Gregtech_Recipes.rod_LongUranium,
- FR_Gregtech_Recipes.foil_Uranium235, FR_Gregtech_Recipes.rod_LongUranium,
- FR_Gregtech_Recipes.rod_Uranium, FR_Gregtech_Recipes.rod_Uranium, FR_Gregtech_Recipes.rod_Uranium,
- FR_Gregtech_Recipes.hiveFrameMutagenic);
-
- if (!LoadedMods.ExtraBees) {
- // Extra Bee Like Frames
- RecipeUtils.recipeBuilder(null, FR_Gregtech_Recipes.itemCocoaBeans, null,
- FR_Gregtech_Recipes.itemCocoaBeans, FR_Gregtech_Recipes.hiveFrameImpregnated,
- FR_Gregtech_Recipes.itemCocoaBeans, null, FR_Gregtech_Recipes.itemCocoaBeans, null,
- FR_Gregtech_Recipes.hiveFrameCocoa);
-
- RecipeUtils.recipeBuilder(FR_Gregtech_Recipes.hiveFrameImpregnated, FR_Gregtech_Recipes.blockIronBars, null,
- null, null, null, null, null, null, FR_Gregtech_Recipes.hiveFrameCaged);
-
- RecipeUtils.recipeBuilder(FR_Gregtech_Recipes.hiveFrameImpregnated, FR_Gregtech_Recipes.blockSoulSand, null,
- null, null, null, null, null, null, FR_Gregtech_Recipes.hiveFrameSoul);
-
- RecipeUtils.recipeBuilder(null, FR_Gregtech_Recipes.itemClayDust, null, FR_Gregtech_Recipes.itemClayDust,
- FR_Gregtech_Recipes.hiveFrameImpregnated, FR_Gregtech_Recipes.itemClayDust, null,
- FR_Gregtech_Recipes.itemClayDust, null, FR_Gregtech_Recipes.hiveFrameClay);
+ public static void registerItems(){
+
+ //Magic Bee Like Frames
+ RecipeUtils.recipeBuilder(
+ rod_LongElectrumFlux, rod_ElectrumFlux, rod_LongElectrumFlux,
+ rod_LongElectrumFlux, foil_Electrum, rod_LongElectrumFlux,
+ rod_ElectrumFlux, rod_ElectrumFlux, rod_ElectrumFlux,
+ hiveFrameAccelerated);
+
+ RecipeUtils.recipeBuilder(
+ rod_LongUranium, rod_Uranium, rod_LongUranium,
+ rod_LongUranium, foil_Uranium235, rod_LongUranium,
+ rod_Uranium, rod_Uranium, rod_Uranium,
+ hiveFrameMutagenic);
+
+ if (!LoadedMods.ExtraBees){
+ //Extra Bee Like Frames
+ RecipeUtils.recipeBuilder(
+ null, itemCocoaBeans, null,
+ itemCocoaBeans, hiveFrameImpregnated, itemCocoaBeans,
+ null, itemCocoaBeans, null,
+ hiveFrameCocoa);
+
+ RecipeUtils.recipeBuilder(
+ hiveFrameImpregnated, blockIronBars, null,
+ null, null, null,
+ null, null, null,
+ hiveFrameCaged);
+
+ RecipeUtils.recipeBuilder(
+ hiveFrameImpregnated, blockSoulSand, null,
+ null, null, null,
+ null, null, null,
+ hiveFrameSoul);
+
+ RecipeUtils.recipeBuilder(
+ null, itemClayDust, null,
+ itemClayDust, hiveFrameImpregnated, itemClayDust,
+ null, itemClayDust, null,
+ hiveFrameClay);
}
-
+
+
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index a234d006da..2b3c23daf1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -6,7 +6,9 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
-import gtPlusPlus.xmod.gregtech.loaders.*;
+import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks;
+import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelterGT;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
public class HANDLER_GT {
@@ -14,33 +16,33 @@ public class HANDLER_GT {
public static GT_Config mMaterialProperties = null;
@SuppressWarnings("unused")
- public static void init() {
+ public static void preInit(){
+ new MetaGeneratedGregtechItems();
+ if (mMaterialProperties != null){
+ GT_Materials.init(mMaterialProperties);
+ }
+ GregtechFluidHandler.run();
+ }
- // Load General Blocks and set up some Basic Meta Tile Entitie states
- Gregtech_Blocks.run();
+ @SuppressWarnings("unused")
+ public static void init(){
- // Register Tile Entities
+ //Load General Blocks and set up some Basic Meta Tile Entitie states
+ Gregtech_Blocks.run();
+
+ //Register Tile Entities
COMPAT_HANDLER.registerGregtechMachines();
-
- // Add Custom Pipes, Wires and Cables.
+
+ //Add Custom Pipes, Wires and Cables.
GregtechConduits.run();
new MetaGeneratedGregtechTools();
new ProcessingToolHeadChoocher().run();
RecipeGen_BlastSmelterGT.generateRecipes();
-
- }
-
- public static void postInit() {
-
+
}
- @SuppressWarnings("unused")
- public static void preInit() {
- new MetaGeneratedGregtechItems();
- if (HANDLER_GT.mMaterialProperties != null) {
- GT_Materials.init(HANDLER_GT.mMaterialProperties);
- }
- GregtechFluidHandler.run();
+ public static void postInit(){
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
index 561899ea99..4ec4589c03 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
@@ -10,8 +10,7 @@ import net.minecraft.item.ItemStack;
*/
public interface IC2ElectricItem {
/**
- * Determine if the item can be used in a machine or as an armor part to
- * supply energy.
+ * Determine if the item can be used in a machine or as an armor part to supply energy.
*
* @return Whether the item can supply energy
*/
@@ -40,8 +39,7 @@ public interface IC2ElectricItem {
/**
* Get the item's tier, lower tiers can't send energy to higher ones.
- * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are
- * Tier 3.
+ * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3.
*
* @return Item's tier
*/
@@ -54,3 +52,4 @@ public interface IC2ElectricItem {
*/
double getTransferLimit(ItemStack itemStack);
}
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
index 9ffc803494..311947e5e6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
@@ -4,124 +4,92 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
/**
- * This interface specifies a manager to handle the various tasks for electric
- * items.
+ * This interface specifies a manager to handle the various tasks for electric items.
*
- * The default implementation does the following: - store and retrieve the
- * charge - handle charging, taking amount, tier, transfer limit,
- * canProvideEnergy and simulate into account - replace item IDs if appropriate
- * (getChargedItemId() and getEmptyItemId()) - update and manage the damage
- * value for the visual charge indicator
- *
- * @note If you're implementing your own variant (ISpecialElectricItem), you can
- * delegate to the default implementations through
- * ElectricItem.rawManager. The default implementation is designed to
- * minimize its dependency on its own constraints/structure and delegates
- * most work back to the more atomic features in the gateway manager.
+ * The default implementation does the following:
+ * - store and retrieve the charge
+ * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account
+ * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId())
+ * - update and manage the damage value for the visual charge indicator
+ *
+ * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the
+ * default implementations through ElectricItem.rawManager. The default implementation is designed
+ * to minimize its dependency on its own constraints/structure and delegates most work back to the
+ * more atomic features in the gateway manager.
*/
public interface IC2ElectricItemManager {
/**
- * Determine if the specified electric item has at least a specific amount
- * of EU. This is supposed to be used in the item code during operation, for
- * example if you want to implement your own electric item. BatPacks are not
- * taken into account.
- *
- * @param itemStack
- * electric item's stack
- * @param amount
- * minimum amount of energy required
- * @return true if there's enough energy
- */
- boolean canUse(ItemStack stack, double amount);
-
- /**
* Charge an item with a specified amount of energy.
*
- * @param itemStack
- * electric item's stack
- * @param amount
- * amount of energy to charge in EU
- * @param tier
- * tier of the charging device, has to be at least as high as the
- * item to charge
- * @param ignoreTransferLimit
- * ignore the transfer limit specified by getTransferLimit()
- * @param simulate
- * don't actually change the item, just determine the return
- * value
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to charge in EU
+ * @param tier tier of the charging device, has to be at least as high as the item to charge
+ * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
+ * @param simulate don't actually change the item, just determine the return value
* @return Energy transferred into the electric item
*/
double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
/**
- * Charge an item from the BatPack a player is wearing. This is supposed to
- * be used in the item code during operation, for example if you want to
- * implement your own electric item. use() already contains this
- * functionality.
- *
- * @param itemStack
- * electric item's stack
- * @param entity
- * entity holding the item
- */
- void chargeFromArmor(ItemStack stack, EntityLivingBase entity);
-
- /**
* Discharge an item by a specified amount of energy
*
- * @param itemStack
- * electric item's stack
- * @param amount
- * amount of energy to discharge in EU
- * @param tier
- * tier of the discharging device, has to be at least as high as
- * the item to discharge
- * @param ignoreTransferLimit
- * ignore the transfer limit specified by getTransferLimit()
- * @param externally
- * use the supplied item externally, i.e. to power something else
- * as if it was a battery
- * @param simulate
- * don't actually discharge the item, just determine the return
- * value
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to discharge in EU
+ * @param tier tier of the discharging device, has to be at least as high as the item to discharge
+ * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
+ * @param externally use the supplied item externally, i.e. to power something else as if it was a battery
+ * @param simulate don't actually discharge the item, just determine the return value
* @return Energy retrieved from the electric item
*/
- double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally,
- boolean simulate);
+ double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
/**
* Determine the charge level for the specified item.
- *
- * @param itemStack
- * ItemStack containing the electric item
+ *
+ * @param itemStack ItemStack containing the electric item
* @return charge level in EU
*/
double getCharge(ItemStack stack);
/**
- * Get the tool tip to display for electric items.
+ * Determine if the specified electric item has at least a specific amount of EU.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ * BatPacks are not taken into account.
*
- * @param itemStack
- * ItemStack to determine the tooltip for
- * @return tool tip string or null for none
+ * @param itemStack electric item's stack
+ * @param amount minimum amount of energy required
+ * @return true if there's enough energy
*/
- String getToolTip(ItemStack stack);
+ boolean canUse(ItemStack stack, double amount);
/**
- * Try to retrieve a specific amount of energy from an Item, and if
- * applicable, a BatPack. This is supposed to be used in the item code
- * during operation, for example if you want to implement your own electric
- * item.
+ * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
*
- * @param itemStack
- * electric item's stack
- * @param amount
- * amount of energy to discharge in EU
- * @param entity
- * entity holding the item
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to discharge in EU
+ * @param entity entity holding the item
* @return true if the operation succeeded
*/
boolean use(ItemStack stack, double amount, EntityLivingBase entity);
+ /**
+ * Charge an item from the BatPack a player is wearing.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ * use() already contains this functionality.
+ *
+ * @param itemStack electric item's stack
+ * @param entity entity holding the item
+ */
+ void chargeFromArmor(ItemStack stack, EntityLivingBase entity);
+
+ /**
+ * Get the tool tip to display for electric items.
+ *
+ * @param itemStack ItemStack to determine the tooltip for
+ * @return tool tip string or null for none
+ */
+ String getToolTip(ItemStack stack);
+
// TODO: add tier getter
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java
index d6031edb23..e2af820c16 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java
@@ -10,72 +10,82 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public class CustomGtTextures {
- public enum ItemIcons implements IIconContainer, Runnable {
- VOID // The Empty Texture
- , RENDERING_ERROR, WRENCH, MORTAR, CROWBAR, JACKHAMMER, WIRE_CUTTER, KNIFE, BUTCHERYKNIFE, SICKLE, SCOOP, GRAFTER, PLUNGER, ROLLING_PIN, HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW, HANDLE_SCREWDRIVER, HANDLE_BUZZSAW, HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING, POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV, 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_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,
-
- SKOOKUMCHOOCHER, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName);
- this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + this.mIconName + "_OVERLAY");
- }
- }
-
- public static final ITexture[] ERROR_RENDERING = new ITexture[] {
- new GT_RenderedTexture(RENDERING_ERROR)
- };
-
- protected IIcon mIcon, mOverlay;
-
- private ItemIcons() {
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this);
- this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
- }
- }
+ public enum ItemIcons implements IIconContainer, Runnable {
+ VOID // The Empty Texture
+ , RENDERING_ERROR, WRENCH, MORTAR, CROWBAR,
+ JACKHAMMER, WIRE_CUTTER, KNIFE, BUTCHERYKNIFE,
+ SICKLE, SCOOP, GRAFTER, PLUNGER, ROLLING_PIN,
+ HANDLE_SWORD, HANDLE_FILE, HANDLE_SAW,
+ HANDLE_SCREWDRIVER, HANDLE_BUZZSAW,
+ HANDLE_ELECTRIC_SCREWDRIVER, HANDLE_SOLDERING,
+ POWER_UNIT_LV, POWER_UNIT_MV, POWER_UNIT_HV,
+ 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_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,
+
+ SKOOKUMCHOOCHER, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
+
+ public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private ItemIcons() {
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + mIconName);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 52c34bf4f1..9837c6944f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.enums;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.util.*;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.xmod.gregtech.api.interfaces.GregtechItemContainer;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -14,272 +16,250 @@ import net.minecraftforge.fluids.Fluid;
public enum GregtechItemList implements GregtechItemContainer {
Energy_Buffer_CREATIVE,
-
- // Energy Buffers
+
+ //Energy Buffers
Energy_Buffer_1by1_ULV, Energy_Buffer_1by1_LV, Energy_Buffer_1by1_MV, Energy_Buffer_1by1_HV, Energy_Buffer_1by1_EV, Energy_Buffer_1by1_IV, Energy_Buffer_1by1_LuV, Energy_Buffer_1by1_ZPM, Energy_Buffer_1by1_UV, Energy_Buffer_1by1_MAX,
-
- // Cobble Generators
+
+ //Cobble Generators
Cobble_Generator_ULV, Cobble_Generator_LV, Cobble_Generator_MV, Cobble_Generator_HV, Cobble_Generator_EV, Cobble_Generator_IV, Cobble_Generator_LuV, Cobble_Generator_ZPM, Cobble_Generator_UV, Cobble_Generator_MAX,
-
- // The max Steam condenser
- Condensor_MAX,
-
- // Player owned Safes
+
+ //The max Steam condenser
+ Condensor_MAX,
+
+ //Player owned Safes
GT_Safe_ULV, GT_Safe_LV, GT_Safe_MV, GT_Safe_HV, GT_Safe_EV, GT_Safe_IV, GT_Safe_LuV, GT_Safe_ZPM, GT_Safe_UV, GT_Safe_MAX,
-
- // Rocket Engines
+
+ //Rocket Engines
Rocket_Engine_EV, Rocket_Engine_IV, Rocket_Engine_LuV,
-
- // IronBlastFurnace Machine_Bronze_BlastFurnace
+
+ //IronBlastFurnace Machine_Bronze_BlastFurnace
Machine_Iron_BlastFurnace, Casing_IronPlatedBricks,
-
- // Machine Casings
- Casing_Shielding,
-
- // Large Centrifuge
+
+ //Machine Casings
+ Casing_Shielding,
+
+ //Large Centrifuge
Industrial_Centrifuge, Casing_Centrifuge1,
-
- // Coke Oven
- Industrial_CokeOven, Casing_CokeOven, Casing_CokeOven_Coil1, Casing_CokeOven_Coil2,
-
- // Bending Maching // Plate Press // Press
- Casing_MaterialPress, Industrial_PlatePress,
-
- // Gregtech Machine Parts
- Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX, Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, Electric_Pump_MAX, Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, Conveyor_Module_MAX, Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, Electric_Piston_MAX, Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, Robot_Arm_MAX, Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX, Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX, Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX,
-
- // Circuits
- Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, Circuit_IV, Circuit_LuV, Circuit_ZPM,
- // Circuit Parts
- Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM,
-
- // Unused Machine Casings
- Casing_MacerationStack, Casing_MatterGen, Casing_MatterFab, Casing_U7,
- // Unused Machine Coils
+
+ //Coke Oven
+ Industrial_CokeOven, Casing_CokeOven, Casing_CokeOven_Coil1, Casing_CokeOven_Coil2,
+
+ //Bending Maching // Plate Press // Press
+ Casing_MaterialPress, Industrial_PlatePress,
+
+ //Gregtech Machine Parts
+ Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX,
+ Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, Electric_Pump_MAX,
+ Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, Conveyor_Module_MAX,
+ Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, Electric_Piston_MAX,
+ Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, Robot_Arm_MAX,
+ Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX,
+ Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX,
+ Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX,
+
+ //Circuits
+ Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
+ Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ //Circuit Parts
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM,
+
+ //Unused Machine Casings
+ Casing_MacerationStack, Casing_MatterGen, Casing_MatterFab, Casing_U7,
+ //Unused Machine Coils
Casing_Coil_U1, Casing_Coil_U2, Casing_Coil_BlastSmelter, Casing_BlastSmelter,
-
- // Windmill Shaft Shape for Extruder
- Shape_Extruder_WindmillShaft,
-
- // Batteries
+
+ //Windmill Shaft Shape for Extruder
+ Shape_Extruder_WindmillShaft,
+
+ //Batteries
Battery_RE_EV_Sodium, Battery_RE_EV_Cadmium, Battery_RE_EV_Lithium,
-
- // Industrial Electrolyzer
- Casing_Electrolyzer, Industrial_Electrolyzer,
-
- // Industrial Maceration Stack
- Casing_WireFactory, Industrial_MacerationStack,
-
- // Industrial Wire Factory
- Industrial_WireFactory,
-
- Industrial_MassFab,
-
- // Solar Generators
- GT_Solar_ULV, GT_Solar_LV, GT_Solar_MV, GT_Solar_HV, GT_Solar_EV, GT_Solar_IV, GT_Solar_LuV, GT_Solar_ZPM, GT_Solar_UV, GT_Solar_MAX,
-
- // Cooked Raisin Toast for ImQ009
- Food_Baked_Raisin_Bread,
-
- // For sintering TODO
- Industrial_AlloyBlastSmelter,
-
- // Block that enables uplink to a superconductor network
- SuperConductorInputNode,
-
- // The two tiers of reactor casings
- Casing_Reactor_I, Casing_Reactor_II,
-
- // Power sub-station for mass storage. 3 hatches for input and output,
- // whatever voltages you desire.
- PowerSubStation,
-
- // Chemical Dehydrators for nuclear fuels
+
+ //Industrial Electrolyzer
+ Casing_Electrolyzer, Industrial_Electrolyzer,
+
+ //Industrial Maceration Stack
+ Casing_WireFactory, Industrial_MacerationStack,
+
+ //Industrial Wire Factory
+ Industrial_WireFactory,
+
+ Industrial_MassFab,
+
+ //Solar Generators
+ GT_Solar_ULV, GT_Solar_LV, GT_Solar_MV,
+ GT_Solar_HV, GT_Solar_EV, GT_Solar_IV,
+ GT_Solar_LuV, GT_Solar_ZPM, GT_Solar_UV, GT_Solar_MAX,
+
+
+
+ //Cooked Raisin Toast for ImQ009
+ Food_Baked_Raisin_Bread,
+
+ //For sintering TODO
+ Industrial_AlloyBlastSmelter,
+
+ //Block that enables uplink to a superconductor network
+ SuperConductorInputNode,
+
+ //The two tiers of reactor casings
+ Casing_Reactor_I, Casing_Reactor_II,
+
+ //Power sub-station for mass storage. 3 hatches for input and output, whatever voltages you desire.
+ PowerSubStation,
+
+ //Chemical Dehydrators for nuclear fuels
GT_Dehydrator_EV, GT_Dehydrator_IV, GT_Dehydrator_LuV, GT_Dehydrator_ZPM,
-
- // Fluid Storage Tanks
- GT_FluidTank_ULV, GT_FluidTank_LV, GT_FluidTank_MV, GT_FluidTank_HV, GT_FluidTank_EV, GT_FluidTank_IV, GT_FluidTank_LuV, GT_FluidTank_ZPM, GT_FluidTank_UV, GT_FluidTank_MAX,
-
- // Fluid Cells to regulate flows.
- Fluid_Cell_1L, Fluid_Cell_16L, Fluid_Cell_36L, Fluid_Cell_144L,
-
- // Multitank
- Industrial_MultiTank, Industrial_MultiTankDense, Casing_MultitankExterior,
-
- // Gt4 Workbenches
- GT4_Workbench_Bronze, GT4_Workbench_Advanced,
-
- // Geothermal Engines
- Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV,
-
- // Tesseracts
- GT4_Tesseract_Generator, GT4_Tesseract_Terminal,
-
- // Casings Tier 2 [17-32]
- Casing_StructuralGlass, Casing_PlaceHolder1, Casing_PlaceHolder2, Casing_PlaceHolder3, Casing_PlaceHolder4, Casing_PlaceHolder5, Casing_PlaceHolder6, Casing_PlaceHolder7, Casing_PlaceHolder8, Casing_PlaceHolder9, Casing_PlaceHolder10, Casing_PlaceHolder11, Casing_PlaceHolder12, Casing_PlaceHolder13, Casing_PlaceHolder14, Casing_PlaceHolder15,
-
- // LFTR
- ThoriumReactor,;
-
- public static final GregtechItemList[] DYE_ONLY_ITEMS = {
- Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV
- };
- public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas;
- private ItemStack mStack;
-
- private boolean mHasNotBeenSet = true;
+
+ //Fluid Storage Tanks
+ GT_FluidTank_ULV, GT_FluidTank_LV, GT_FluidTank_MV, GT_FluidTank_HV, GT_FluidTank_EV,
+ GT_FluidTank_IV, GT_FluidTank_LuV, GT_FluidTank_ZPM, GT_FluidTank_UV, GT_FluidTank_MAX,
+
+ //Fluid Cells to regulate flows.
+ Fluid_Cell_1L, Fluid_Cell_16L, Fluid_Cell_36L, Fluid_Cell_144L,
+
+ //Multitank
+ Industrial_MultiTank, Industrial_MultiTankDense, Casing_MultitankExterior,
+
+ //Gt4 Workbenches
+ GT4_Workbench_Bronze, GT4_Workbench_Advanced,
+
+ //Geothermal Engines
+ Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV,
+
+ //Tesseracts
+ GT4_Tesseract_Generator, GT4_Tesseract_Terminal,
+
+ //Casings Tier 2 [17-32]
+ Casing_StructuralGlass,
+ Casing_PlaceHolder1, Casing_PlaceHolder2, Casing_PlaceHolder3,
+ Casing_PlaceHolder4, Casing_PlaceHolder5, Casing_PlaceHolder6,
+ Casing_PlaceHolder7, Casing_PlaceHolder8, Casing_PlaceHolder9,
+ Casing_PlaceHolder10, Casing_PlaceHolder11, Casing_PlaceHolder12,
+ Casing_PlaceHolder13, Casing_PlaceHolder14, Casing_PlaceHolder15,
+
+ //LFTR
+ ThoriumReactor,
+ ;
+
+ public static final GregtechItemList[]
+ DYE_ONLY_ITEMS = {
+ Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV };
+ private ItemStack mStack;
+ private boolean mHasNotBeenSet = true;
+
+ public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas;
@Override
- public ItemStack get(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(this.mStack));
+ public GregtechItemList set(Item aItem) {
+ mHasNotBeenSet = false;
+ if (aItem == null) return this;
+ ItemStack aStack = new ItemStack(aItem, 1, 0);
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
}
@Override
- public ItemStack getAlmostBroken(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1,
- GT_OreDictUnificator.get(this.mStack));
+ public GregtechItemList set(ItemStack aStack) {
+ mHasNotBeenSet = false;
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
}
@Override
- public Block getBlock() {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- return GT_Utility.getBlockFromStack(this.getItem());
+ public Item getItem() {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return null;
+ return mStack.getItem();
}
@Override
- public Item getItem() {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return null;
- }
- return this.mStack.getItem();
+ public Block getBlock() {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ return GT_Utility.getBlockFromStack(getItem());
}
@Override
- public ItemStack getUndamaged(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(this.mStack));
+ public final boolean hasBeenSet() {
+ return !mHasNotBeenSet;
}
@Override
- public ItemStack getWildcard(final long aAmount, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, GT_Values.W, GT_OreDictUnificator.get(this.mStack));
+ public boolean isStackEqual(Object aStack) {
+ return isStackEqual(aStack, false, false);
}
@Override
- public ItemStack getWithCharge(final long aAmount, final int aEnergy, final Object... aReplacements) {
- final ItemStack rStack = this.get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) {
- return null;
- }
- GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
- return GT_Utility.copyAmount(aAmount, rStack);
+ public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ return GT_Utility.areUnificationsEqual((ItemStack)aStack, aWildcard?getWildcard(1):get(1), aIgnoreNBT);
}
@Override
- public ItemStack getWithDamage(final long aAmount, final long aMetaValue, final Object... aReplacements) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(this.mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(this.mStack));
+ public ItemStack get(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
}
@Override
- public ItemStack getWithName(final long aAmount, final String aDisplayName, final Object... aReplacements) {
- final ItemStack rStack = this.get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) {
- return null;
- }
- rStack.setStackDisplayName(aDisplayName);
- return GT_Utility.copyAmount(aAmount, rStack);
+ public ItemStack getWildcard(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
}
@Override
- public final boolean hasBeenSet() {
- return !this.mHasNotBeenSet;
+ public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
}
@Override
- public boolean isStackEqual(final Object aStack) {
- return this.isStackEqual(aStack, false, false);
+ public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage()-1, GT_OreDictUnificator.get(mStack));
}
@Override
- public boolean isStackEqual(final Object aStack, final boolean aWildcard, final boolean aIgnoreNBT) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1),
- aIgnoreNBT);
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
+ ItemStack rStack = get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) return null;
+ rStack.setStackDisplayName(aDisplayName);
+ return GT_Utility.copyAmount(aAmount, rStack);
}
@Override
- public GregtechItemList registerOre(final Object... aOreNames) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- for (final Object tOreName : aOreNames) {
- GT_OreDictUnificator.registerOre(tOreName, this.get(1));
- }
- return this;
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
+ ItemStack rStack = get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) return null;
+ GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
+ return GT_Utility.copyAmount(aAmount, rStack);
}
@Override
- public GregtechItemList registerWildcardAsOre(final Object... aOreNames) {
- if (this.mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + this.name() + "' has not been set to an Item at this time!");
- }
- for (final Object tOreName : aOreNames) {
- GT_OreDictUnificator.registerOre(tOreName, this.getWildcard(1));
- }
- return this;
+ public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
}
@Override
- public GregtechItemList set(final Item aItem) {
- this.mHasNotBeenSet = false;
- if (aItem == null) {
- return this;
- }
- final ItemStack aStack = new ItemStack(aItem, 1, 0);
- this.mStack = GT_Utility.copyAmount(1, aStack);
+ public GregtechItemList registerOre(Object... aOreNames) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1));
return this;
}
@Override
- public GregtechItemList set(final ItemStack aStack) {
- this.mHasNotBeenSet = false;
- this.mStack = GT_Utility.copyAmount(1, aStack);
+ public GregtechItemList registerWildcardAsOre(Object... aOreNames) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
return this;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
index d573144fca..dcb075349d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
@@ -12,24 +12,28 @@ package gtPlusPlus.xmod.gregtech.api.enums;
* Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal
* Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb
* Infinite (Cheaty)
-*
+*
Circuits
- Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
- Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
+ Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
+ Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
Circuit_IV, Circuit_LuV, Circuit_ZPM,
Circuit Parts
- Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
*/
public enum GregtechOreDictNames {
- buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM, Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
+ buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
public String unlocalisedName;
private void ModObject() {
- this.unlocalisedName = this.name();
+ unlocalisedName = name();
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
index 3530b3d084..9a1ef1376d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -1,1195 +1,758 @@
package gtPlusPlus.xmod.gregtech.api.enums;
-import java.util.*;
-
-import gregtech.api.enums.*;
+import static gregtech.api.enums.GT_Values.B;
+import static gregtech.api.enums.GT_Values.D2;
+import static gregtech.api.enums.GT_Values.M;
+import static gtPlusPlus.core.util.Utils.getTcAspectStack;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Element;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
-import gregtech.api.interfaces.*;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.interfaces.IColorModulationContainer;
+import gregtech.api.interfaces.ICondition;
+import gregtech.api.interfaces.ISubTagContainer;
import gregtech.api.objects.GT_FluidStack;
import gregtech.api.objects.MaterialStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechItemData;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechMaterialStack;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public enum GregtechOrePrefixes {
- /*
- * Electric Components.
+ /* Electric Components.
*
- * usual Materials for this are: Primitive (Tier 1) Basic (Tier 2) as used
- * by UE as well : IC2 Circuit and RE-Battery Good (Tier 3) Advanced (Tier
- * 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium
- * Battery Data (Tier 5) : Data Storage Circuit Elite (Tier 6) as used by UE
- * as well : Energy Crystal and Data Control Circuit Master (Tier 7) :
- * Energy Flow Circuit and Lapotron Crystal Ultimate (Tier 8) : Data Orb and
- * Lapotronic Energy Orb Infinite (Cheaty)
+ * usual Materials for this are:
+ * Primitive (Tier 1)
+ * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery
+ * Good (Tier 3)
+ * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery
+ * Data (Tier 5) : Data Storage Circuit
+ * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit
+ * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal
+ * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb
+ * Infinite (Cheaty)
*/
- ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false,
- GT_Values.B[1], GT_Values.M * 1, 16, 12), // A hot Ingot, which has
- // to be cooled down by
- // a Vacuum Freezer.
- ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, GT_Values.B[1],
- GT_Values.M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam
- dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false,
- GT_Values.B[0] | GT_Values.B[1] | GT_Values.B[2] | GT_Values.B[3], GT_Values.M / 9, 64, 0), // 1/9th
- // of
- // a
- // Dust.
- dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false,
- false, GT_Values.B[0] | GT_Values.B[1] | GT_Values.B[2] | GT_Values.B[3], GT_Values.M / 4, 64, 1), // 1/4th
- // of
- // a
- // Dust.
- dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false,
- true, GT_Values.B[3], GT_Values.M * 1, 64, 3), // Dust with
- // impurities. 1
- // Unit of Main
- // Material and 1/9
- // - 1/4 Unit of
- // secondary
- // Material
- dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true,
- false, true, GT_Values.B[3], GT_Values.M * 1, 64, 2), dustPure("Purified Dusts", "Purified Pile of ",
- " Dust", true, true, false, false, false, false, false, true, false, true, GT_Values.B[3],
- GT_Values.M * 1, 64,
- 4), dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false,
- GT_Values.B[0] | GT_Values.B[1] | GT_Values.B[2] | GT_Values.B[3], GT_Values.M * 1, 64, 2), // Pure
- // Dust
- // worth
- // of
- // one
- // Ingot
- // or
- // Gem.
- // Introduced
- // by
- // Alblaka.
- nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, GT_Values.B[1],
- GT_Values.M / 9, 64, 9), // A Nugget. Introduced by Eloraam
- plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false,
- GT_Values.B[1] | GT_Values.B[2], GT_Values.M * 1, 64, 17), // Regular
- // Plate
- // made
- // of
- // one
- // Ingot/Dust.
- // Introduced
- // by
- // Calclavia
- block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0,
- GT_Values.M * 9, 64, 71), // Storage Block consisting out of 9
- // Ingots/Gems/Dusts. Introduced by
- // CovertJaguar
- gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, GT_Values.B[2],
- GT_Values.M * 1, 64, 8), // A regular Gem worth one Dust. Introduced
- // by Eloraam
- gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false,
- GT_Values.B[2], GT_Values.M / 4, 64, 59), // A regular Gem worth one
- // small Dust.
- // Introduced by
- // TerraFirmaCraft
- gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false,
- GT_Values.B[2], GT_Values.M / 2, 64, 60), // A regular Gem worth two
- // small Dusts.
- // Introduced by
- // TerraFirmaCraft
- gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false,
- GT_Values.B[2], GT_Values.M * 2, 32, 61), // A regular Gem worth two
- // Dusts. Introduced by
- // TerraFirmaCraft
- gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false,
- false, GT_Values.B[2], GT_Values.M * 4, 16, 62), // A regular Gem
- // worth four
- // Dusts.
- // Introduced by
- // TerraFirmaCraft
- stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false,
- GT_Values.B[1] | GT_Values.B[2], GT_Values.M / 2, 64, 23), // Stick
- // made
- // of
- // half
- // an
- // Ingot.
- // Introduced
- // by
- // Eloraam
- type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0,
- GT_Values.M * 8, 64, -1),
-
- toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true,
- false, false, GT_Values.B[6], GT_Values.M * 6, 16, 37), // consisting
- // out of 6
- // Ingots.
-
- batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false,
- false, 0, -1, 64, -1), battery("Reusable Batteries", "", "", false, true, false, false, false, false, false,
- false, false, false, 0, -1, 64, -1), // Introduced by
- // Calclavia
- circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced
- // by
- // Calclavia
- chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced
- // by
- // Buildcraft
- computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A
- // whole
- // Computer.
- // "computerMaster"
- // =
- // ComputerCube
+ ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer.
+ ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam
+ dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust.
+ dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust.
+ dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material
+ dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 2),
+ dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 4),
+ dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka.
+ nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, 9), // A Nugget. Introduced by Eloraam
+ plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
+ block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar
+ gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam
+ gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft
+ gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft
+ gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft
+ gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft
+ stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam
+ type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1),
+
+ toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
+
+
+
+ batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
+ circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
+ chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft
+ computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A whole Computer. "computerMaster" = ComputerCube
+
+ public static volatile int VERSION = 508;
+
+ static {
+
+ ingotHot.mHeatDamage = 3.0F;
+
+ }
+
+ public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<ItemStack>();
+ public final short mTextureIndex;
+ public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost;
+ public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem;
+ public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
+ public final Collection<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<GregtechOrePrefixes>();
+ /**
+ * Used to determine the amount of Material this Prefix contains.
+ * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot.
+ * 0 = Null
+ * Negative = Undefined Amount
+ */
+ public final long mMaterialAmount;
+ private final Collection<Materials> mNotGeneratedItems = new HashSet<Materials>(), mIgnoredMaterials = new HashSet<Materials>(), mGeneratedItems = new HashSet<Materials>();
+ private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<Interface_OreRecipeRegistrator>();
+ private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessingFake = new ArrayList<Interface_OreRecipeRegistrator>();
+ public ItemStack mContainerItem = null;
+ public ICondition<ISubTagContainer> mCondition = null;
+ public byte mDefaultStackSize = 64;
+ public GregtechMaterialStack mSecondaryMaterial = null;
+ public GregtechOrePrefixes mPrefixInto = this;
+ public float mHeatDamage = 0.0F; // Negative for Frost Damage
+ /**
+ * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
+ */
+ public int mMaterialGenerationBits = 0;
+ private GregtechOrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) {
+ mIsUnificatable = aIsUnificatable;
+ mIsMaterialBased = aIsMaterialBased;
+ mIsSelfReferencing = aIsSelfReferencing;
+ mIsContainer = aIsContainer;
+ mDontUnificateActively = aDontUnificateActively;
+ mIsUsedForBlocks = aIsUsedForBlocks;
+ mAllowNormalRecycling = aAllowNormalRecycling;
+ mGenerateDefaultItem = aGenerateDefaultItem;
+ mIsEnchantable = aIsEnchantable;
+ mIsUsedForOreProcessing = aIsUsedForOreProcessing;
+ mMaterialGenerationBits = aMaterialGenerationBits;
+ mMaterialAmount = aMaterialAmount;
+ mRegularLocalName = aRegularLocalName;
+ mLocalizedMaterialPre = aLocalizedMaterialPre;
+ mLocalizedMaterialPost = aLocalizedMaterialPost;
+ mDefaultStackSize = (byte) aDefaultStackSize;
+ mTextureIndex = (short) aTextureindex;
+
+
+ //TODO - Utilise some form of way to check if it's gt 5.9 if so, use string switch.
+ if (name().startsWith("ore")) {
+ getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("wire") || name().startsWith("cable")) {
+ getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("dust")) {
+ getTcAspectStack(TC_Aspects.PERDITIO.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crushed")) {
+ getTcAspectStack(TC_Aspects.PERFODIO.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("ingot") || name().startsWith("nugget")) {
+ getTcAspectStack(TC_Aspects.METALLUM.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("armor")) {
+ getTcAspectStack(TC_Aspects.TUTAMEN.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("stone")) {
+ getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("pipe")) {
+ getTcAspectStack(TC_Aspects.ITER.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("gear")) {
+ getTcAspectStack(TC_Aspects.MOTUS.name(), 1).addToAspectList(mAspects);
+ getTcAspectStack(TC_Aspects.MACHINA.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("frame") || name().startsWith("plate")) {
+ getTcAspectStack(TC_Aspects.FABRICO.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("tool")) {
+ getTcAspectStack(TC_Aspects.INSTRUMENTUM.name(), 2).addToAspectList(mAspects);
+ } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) {
+ getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crate")) {
+ getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(mAspects);
+ } else if (name().startsWith("circuit")) {
+ getTcAspectStack("COGNITIO", 1);
+ } else if (name().startsWith("computer")) {
+ getTcAspectStack("COGNITIO", 4).addToAspectList(mAspects);
+ } else if (name().startsWith("battery")) {
+ getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(mAspects);
+ }
+ }
+
+ public static GregtechOrePrefixes getOrePrefix(String aOre) {
+ for (GregtechOrePrefixes tPrefix : values())
+ if (aOre.startsWith(tPrefix.toString())) {
+ return tPrefix;
+ }
+ return null;
+ }
+
+ public static String stripPrefix(String aOre) {
+ for (GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), "");
+ }
+ }
+ return aOre;
+ }
+
+ public static String replacePrefix(String aOre, GregtechOrePrefixes aPrefix) {
+ for (GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
+ }
+ }
+ return "";
+ }
+
+ public static GregtechOrePrefixes getPrefix(String aPrefixName) {
+ return getPrefix(aPrefixName, null);
+ }
+
+ public static GregtechOrePrefixes getPrefix(String aPrefixName, GregtechOrePrefixes aReplacement) {
+ Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
+ if (tObject != null && tObject instanceof GregtechOrePrefixes) return (GregtechOrePrefixes) tObject;
+ return aReplacement;
+ }
+
+ public static Materials getMaterial(String aOre) {
+ return Materials.get(stripPrefix(aOre));
+ }
+
+ public static Materials getMaterial(String aOre, GregtechOrePrefixes aPrefix) {
+ return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static Materials getRealMaterial(String aOre, GregtechOrePrefixes aPrefix) {
+ return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static boolean isInstanceOf(String aName, GregtechOrePrefixes aPrefix) {
+ return aName == null ? false : aName.startsWith(aPrefix.toString());
+ }
+
+ public boolean add(ItemStack aStack) {
+ if (aStack == null) return false;
+ if (!contains(aStack)) mPrefixedItems.add(aStack);
+ while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null);
+ return true;
+ }
+
+
+ public boolean contains(ItemStack aStack) {
+ if (aStack == null) return false;
+ for (ItemStack tStack : mPrefixedItems)
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true;
+ return false;
+ }
+
+ public boolean doGenerateItem(Materials aMaterial) {
+ return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) && !mNotGeneratedItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial));
+ }
+
+ public boolean ignoreMaterials(Materials... aMaterials) {
+ for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial);
+ return true;
+ }
+
+ public boolean isIgnored(GT_Materials aMaterial) {
+ if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true;
+ return mIgnoredMaterials.contains(aMaterial);
+ }
+
+ public boolean addFamiliarPrefix(GregtechOrePrefixes aPrefix) {
+ if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false;
+ return mFamiliarPrefixes.add(aPrefix);
+ }
+
+ public boolean add(Interface_OreRecipeRegistrator aRegistrator) {
+ if (aRegistrator == null) return false;
+ return mOreProcessing.add(aRegistrator);
+ }
+
+ public void processOre(GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if (aMaterial != null && (aMaterial != GT_Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack))
+ for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessing) {
+ if (D2)
+ GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
+ tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
+ }
+ }
+
+ //TODO
+ public void processOre(Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if (aMaterial != null && (aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack))
+ for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessingFake) {
+ if (D2)
+ GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
+ tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
+ }
+ }
+
+ public Object get(Object aMaterial) {
+ if (aMaterial instanceof GT_Materials) return new GregtechItemData(this, (GT_Materials) aMaterial);
+ return name() + aMaterial;
+ }
+
+ public String getDefaultLocalNameForItem(Materials aMaterial) {
+
+
+ // Use Standard Localization
+ return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + mLocalizedMaterialPost;
+ }
public enum GT_Materials implements IColorModulationContainer, ISubTagContainer {
+
+
/**
- * This is the Default Material returned in case no Material has been
- * found or a NullPointer has been inserted at a location where it
- * shouldn't happen.
+ * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen.
* <p/>
- * Mainly for preventing NullPointer Exceptions and providing Default
- * Values.
+ * Mainly for preventing NullPointer Exceptions and providing Default Values.
*
* Unknown Material Components. Dead End Section.
- *
- * Alkalus Range 730-799 & 970-998 (aMetaItemSubID, TextureSet,
- * aToolSpeed, aToolDurability, aToolQuality, aTypes, R, G, B, Alpha,
- * aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp,
- * aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier,
- * aDensityDivider, aColor this(aMetaItemSubID, aIconSet, aToolSpeed,
- * aToolDurability, aToolQuality, true);
+ *
+ * Alkalus Range 730-799 & 970-998
+ * (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, R, G, B, Alpha, aLocalName,
+ * aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor
+ * this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
*
*/
- _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Arrays.asList(Utils.getTcAspectStack(TC_Aspects.VACUOS.name(), 1))),
-
- // Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220,
- // 0, "Lapis", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlue, 2,
- // Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new
- // MaterialStack(Materials.Sodalite, 2), new
- // MaterialStack(Materials.Pyrite, 1), new
- // MaterialStack(Materials.Calcite, 1)),
- // Arrays.asList(getTcAspectStack(TC_Aspects.SENSUS, 1))),
- Pyrotheum(20, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 255, 128, 0, 0, "Pyrotheum", 0, 0, -1, 0, false,
- false, 2, 3, 1, Dyes.dyeYellow, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1)),
- Arrays.asList(Utils.getTcAspectStack("PRAECANTATIO", 2),
- Utils.getTcAspectStack(TC_Aspects.IGNIS, 1))), Cryotheum(21, TextureSet.SET_FLUID, 1.0F, 0, 1,
- 2 | 16 | 32, 102, 178, 255, 0, "Cryotheum", 0, 0, -1, 0, false, false, 2, 3, 1,
- Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Blizz, 1),
- new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Snow, 1),
- new MaterialStack(Materials.Niter, 1)),
- Arrays.asList(Utils.getTcAspectStack("PRAECANTATIO", 2),
- Utils.getTcAspectStack(TC_Aspects.GELUM, 1))),
+ _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS.name(), 1))),
+
+
+ //Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220, 0, "Lapis", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlue, 2, Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new MaterialStack(Materials.Sodalite, 2), new MaterialStack(Materials.Pyrite, 1), new MaterialStack(Materials.Calcite, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.SENSUS, 1))),
+ Pyrotheum(20, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 255, 128, 0, 0, "Pyrotheum", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeYellow, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1)), Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.IGNIS, 1))),
+ Cryotheum(21, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 102, 178, 255, 0, "Cryotheum", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Blizz, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Snow, 1), new MaterialStack(Materials.Niter, 1)), Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.GELUM, 1))),
/**
* Circuitry, Batteries and other Technical things
*/
- Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4), Utils.getTcAspectStack(TC_Aspects.MACHINA, 4))), Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 6), Utils.getTcAspectStack(TC_Aspects.MACHINA, 6))), Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8))),
-
- Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 190, 240, 190, 0, "Superconductor", 0, 0, -1, 0, false,
- false, 1, 1, 1, Dyes.dyeGreen, Arrays.asList(Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8))),
-
- Staballoy(30, TextureSet.SET_ROUGH, 10.0F, 5120, 4, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 66, 0, "Staballoy", 0,
- 0, 1500, 2800, true, false, 1, 3, 1, Dyes.dyeGreen, 2,
- Arrays.asList(new MaterialStack(Materials.Titanium, 1), new MaterialStack(Materials.Uranium, 9)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.METALLUM, 8),
- Utils.getTcAspectStack(TC_Aspects.STRONTIO, 3))), Bedrockium(31, TextureSet.SET_FINE, 8.0F,
- 8196, 3, 1 | 2 | 16 | 32 | 64 | 128, 39, 39, 39, 0, "Bedrockium", 0, 0, -1, 0, false,
- false, 1, 5, 1, Dyes.dyeLightGray, 2,
- Arrays.asList(new MaterialStack(Materials.Carbon, 63),
- new MaterialStack(Materials.Carbon, 56)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.VACUOS, 8),
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN, 3))), BloodSteel(32,
- TextureSet.SET_METALLIC, 11.0F, 768, 4, 1 | 2 | 16 | 32 | 64 | 128, 142,
- 28, 0, 0, "Blood Steel", 0, 0, -1, 0, false, false, 1, 1, 1,
- Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Steel, 3)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.VICTUS, 8),
- Utils.getTcAspectStack(TC_Aspects.IGNIS, 3))), Void(33,
- TextureSet.SET_METALLIC, 6.0F, 1280, 3,
- 1 | 2 | 16 | 32 | 64 | 128, 82, 17, 82, 0, "Void Metal",
- 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlack,
- Arrays.asList(Utils.getTcAspectStack("PRAECANTATIO", 5),
- Utils.getTcAspectStack(TC_Aspects.VACUOS,
- 7))), ConductiveIron(34,
- TextureSet.SET_METALLIC, 5.0F,
- 256, 2, 1 | 2, 164, 109, 100, 0,
- "Conductive Iron", 0, 0, -1, 0,
- false, false, 3, 1, 1,
- Dyes.dyeRed, 2,
- Arrays.asList(new MaterialStack(
- Materials.Iron, 6),
- new MaterialStack(
- Materials.Redstone,
- 2)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.POTENTIA,
- 2),
- Utils.getTcAspectStack(
- TC_Aspects.METALLUM,
- 2))), ElectricalSteel(
- 35,
- TextureSet.SET_METALLIC,
- 7.0F,
- 768, 3,
- 1 | 2 | 64
- | 128,
- 194,
- 194,
- 194, 0,
- "Electrical Steel",
- 0, 0,
- 1811,
- 1000,
- true,
- false,
- 3, 1, 1,
- Dyes.dyeLightGray,
- 2,
- Arrays.asList(
- new MaterialStack(
- Materials.Iron,
- 3),
- new MaterialStack(
- Materials.Coal,
- 2),
- new MaterialStack(
- Materials.Silicon,
- 2)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.MAGNETO,
- 2),
- Utils.getTcAspectStack(
- TC_Aspects.ELECTRUM,
- 5))), EnergeticAlloy(
- 36,
- TextureSet.SET_SHINY,
- 5.0F,
- 512,
- 3,
- 1 | 2 | 64
- | 128,
- 252,
- 152,
- 45,
- 0,
- "Energetic Alloy",
- 0,
- 0,
- -1,
- 0,
- false,
- false,
- 3,
- 1,
- 1,
- Dyes.dyeOrange,
- 2,
- Arrays.asList(
- new MaterialStack(
- Materials.Gold,
- 3),
- new MaterialStack(
- Materials.Glowstone,
- 2),
- new MaterialStack(
- Materials.Redstone,
- 2)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.POTENTIA,
- 4),
- Utils.getTcAspectStack(
- TC_Aspects.LUX,
- 3))), VibrantAlloy(
- 37,
- TextureSet.SET_SHINY,
- 7.0F,
- 1280,
- 4,
- 1 | 2 | 64
- | 128,
- 204,
- 242,
- 142,
- 0,
- "Vibrant Alloy",
- 0,
- 0,
- -1,
- 0,
- false,
- false,
- 3,
- 1,
- 1,
- Dyes.dyeLime,
- 2,
- Arrays.asList(
- new MaterialStack(
- Materials.EnergeticAlloy,
- 1),
- new MaterialStack(
- Materials.EnderPearl,
- 3)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.MACHINA,
- 5),
- Utils.getTcAspectStack(
- TC_Aspects.TELUM,
- 4))), PulsatingIron(
- 38,
- TextureSet.SET_SHINY,
- 5.0F,
- 256,
- 2,
- 1 | 2 | 64
- | 128,
- 50,
- 91,
- 21,
- 0,
- "Pulsating Iron",
- 0,
- 0,
- -1,
- 0,
- false,
- false,
- 3,
- 1,
- 1,
- Dyes.dyeGreen,
- 2,
- Arrays.asList(
- new MaterialStack(
- Materials.Iron,
- 2),
- new MaterialStack(
- Materials.EnderPearl,
- 2)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.ALIENIS,
- 3),
- Utils.getTcAspectStack(
- TC_Aspects.METALLUM,
- 3))), /* TODO */ RedstoneAlloy(
- 39,
- TextureSet.SET_METALLIC,
- 1.0F,
- 256,
- 2,
- 1 | 2 | 16
- | 32
- | 64,
- 178,
- 34,
- 34,
- 0,
- "Redstone Alloy",
- 0,
- 0,
- -1,
- 0,
- false,
- false,
- 3,
- 1,
- 1,
- Dyes.dyeRed,
- 2,
- Arrays.asList(
- new MaterialStack(
- Materials.Iron,
- 2),
- new MaterialStack(
- Materials.Redstone,
- 4))),
-
- // Needs more Use, I think.
- Tantalloy60(40, TextureSet.SET_DULL, 8.0F, 5120, 3, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 166, 0, "Tantalloy-60",
- 0, 0, 3035, 2200, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.METALLUM, 8),
- Utils.getTcAspectStack(TC_Aspects.STRONTIO, 3))), Tantalloy61(41, TextureSet.SET_DULL, 7.0F,
- 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 122, 135, 196, 0, "Tantalloy-61", 0, 0, 3015, 2150,
- true, false, 1, 2, 1, Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Tungsten, 1),
- new MaterialStack(Materials.Tantalum, 9),
- new MaterialStack(Materials.Titanium, 1)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.METALLUM, 8),
- Utils.getTcAspectStack(TC_Aspects.STRONTIO, 3))),
-
- Potin(42, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 201, 151, 129, 0, "Potin", 0, 0,
- 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9),
- new MaterialStack(Materials.Titanium, 1)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.METALLUM, 8),
- Utils.getTcAspectStack(TC_Aspects.STRONTIO, 3))), Inconel792(43, TextureSet.SET_METALLIC, 7.0F,
- 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 108, 240, 118, 0, "Inconel-792", 0, 0, 3015, 2150,
- true, false, 1, 2, 1, Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Tungsten, 1),
- new MaterialStack(Materials.Tantalum, 9),
- new MaterialStack(Materials.Titanium, 1)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.METALLUM, 8),
- Utils.getTcAspectStack(TC_Aspects.STRONTIO, 3))), Inconel690(44,
- TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 118,
- 220, 138, 0, "Inconel-690", 0, 0, 3015, 2150, true, false, 1, 2, 1,
- Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Tungsten, 1),
- new MaterialStack(Materials.Tantalum, 9),
- new MaterialStack(Materials.Titanium, 1)),
- Arrays.asList(Utils.getTcAspectStack(TC_Aspects.METALLUM, 8), Utils
- .getTcAspectStack(TC_Aspects.STRONTIO, 3))), MaragingSteel300(
- 45, TextureSet.SET_METALLIC, 7.0F, 5120, 2,
- 1 | 2 | 16 | 32 | 64 | 128, 150, 150, 150, 0,
- "Maraging Steel 300", 0, 0, 3015, 2150, true, false, 1,
- 2, 1, Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(Materials.Tungsten, 1),
- new MaterialStack(Materials.Tantalum, 9),
- new MaterialStack(Materials.Titanium, 1)),
- Arrays.asList(
- Utils.getTcAspectStack(TC_Aspects.METALLUM, 8),
- Utils.getTcAspectStack(TC_Aspects.STRONTIO,
- 3))), MaragingSteel350(46,
- TextureSet.SET_METALLIC, 7.0F,
- 5120, 2,
- 1 | 2 | 16 | 32 | 64 | 128, 160,
- 160, 160, 0,
- "Maraging Steel 350", 0, 0,
- 3015, 2150, true, false, 1, 2,
- 1, Dyes.dyeLightBlue, 2,
- Arrays.asList(new MaterialStack(
- Materials.Tungsten, 1),
- new MaterialStack(
- Materials.Tantalum,
- 9),
- new MaterialStack(
- Materials.Titanium,
- 1)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.METALLUM,
- 8),
- Utils.getTcAspectStack(
- TC_Aspects.STRONTIO,
- 3))), HastelloyX(
- 47,
- TextureSet.SET_SHINY,
- 7.0F,
- 5120, 2,
- 1 | 2 | 16
- | 32
- | 64
- | 128,
- 255,
- 193, 37,
- 0,
- "Hastelloy-X",
- 0, 0,
- 3015,
- 2150,
- true,
- false,
- 1, 2, 1,
- Dyes.dyeLightBlue,
- 2,
- Arrays.asList(
- new MaterialStack(
- Materials.Tungsten,
- 1),
- new MaterialStack(
- Materials.Tantalum,
- 9),
- new MaterialStack(
- Materials.Titanium,
- 1)),
- Arrays.asList(
- Utils.getTcAspectStack(
- TC_Aspects.METALLUM,
- 8),
- Utils.getTcAspectStack(
- TC_Aspects.STRONTIO,
- 3))),
-
- // Radioactive Materials
- HydrofluoricAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 200, 200, 200, 0, "Hydrofluoric Acid", 0, 0,
- -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))), UraniumHexaFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0,
- 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Hexafluoride", 0, 0, -1, 0, false, false, 2, 3,
- 1, Dyes.dyeLime, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))), UraniumTetraFluoride(-1,
- TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0,
- "Uranium Tetrafluoride", 0, 0, -1, 0, false, false, 2, 3, 1,
- Dyes.dyeLime, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))), ThoriumTetraFluoride(
- -1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 15,
- 120, 15, 0, "Thorium Tetrafluoride", 0, 0, -1, 0, false,
- false, 2, 3, 1, Dyes.dyeGreen, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))),
-
- SulfurousAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 110, 220, 30, 0, "Sulfurous Acid", 0, 0, -1, 0,
- false, false, 2, 3, 1, Dyes.dyeWhite, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), SulfurDioxide(
- -1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 200, 50, 0, "Sulfur Dioxide", 0,
- 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))), HydrogenChloride(-1,
- TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 240, 90, 0,
- "Hydrogen Chloride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite,
- 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))), SulfuricApatite(-1,
- TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105,
- 105, 0, "Sulfuric Apatite Solution", 0, 0, -1, 0, false,
- false, 2, 3, 1, Dyes.dyeWhite, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))),
-
- SulfuricLithium(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Lithium Solution",
- 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1),
- new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))), LithiumHydroxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1,
- 2 | 16 | 32, 0, 105, 105, 0, "Lithium Hydroxide", 0, 0, -1, 0, false, false, 2, 3, 1,
- Dyes.dyeWhite, 2,
- Arrays.asList(new MaterialStack(Materials.Coal, 1),
- new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1),
- new MaterialStack(Materials.Sulfur, 1))),
-
+ Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 4), getTcAspectStack(TC_Aspects.MACHINA, 4))),
+ Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 6), getTcAspectStack(TC_Aspects.MACHINA, 6))),
+ Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8), getTcAspectStack(TC_Aspects.MACHINA, 8))),
+
+ Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 190, 240, 190, 0, "Superconductor", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeGreen, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8))),
+
+ Staballoy(30, TextureSet.SET_ROUGH, 10.0F, 5120, 4, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 66, 0, "Staballoy", 0, 0, 1500, 2800, true, false, 1, 3, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Titanium, 1), new MaterialStack(Materials.Uranium, 9)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Bedrockium(31, TextureSet.SET_FINE, 8.0F, 8196, 3, 1 | 2 | 16 | 32 | 64 | 128, 39, 39, 39, 0, "Bedrockium", 0, 0, -1, 0, false, false, 1, 5, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Materials.Carbon, 63), new MaterialStack(Materials.Carbon, 56)), Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS, 8), getTcAspectStack(TC_Aspects.TUTAMEN, 3))),
+ BloodSteel(32, TextureSet.SET_METALLIC, 11.0F, 768, 4, 1 | 2 | 16 | 32 | 64 | 128, 142, 28, 0, 0, "Blood Steel", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Steel, 3)), Arrays.asList(getTcAspectStack(TC_Aspects.VICTUS, 8), getTcAspectStack(TC_Aspects.IGNIS, 3))),
+ Void(33, TextureSet.SET_METALLIC, 6.0F, 1280, 3, 1 | 2 | 16 | 32 | 64 | 128, 82, 17, 82, 0, "Void Metal", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlack, Arrays.asList(getTcAspectStack("PRAECANTATIO", 5), getTcAspectStack(TC_Aspects.VACUOS, 7))),
+ ConductiveIron(34, TextureSet.SET_METALLIC, 5.0F, 256, 2, 1 | 2, 164, 109, 100, 0, "Conductive Iron", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Iron, 6), new MaterialStack(Materials.Redstone, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 2), getTcAspectStack(TC_Aspects.METALLUM, 2))),
+ ElectricalSteel(35, TextureSet.SET_METALLIC, 7.0F, 768, 3, 1 | 2 | 64 | 128, 194, 194, 194, 0, "Electrical Steel", 0, 0, 1811, 1000, true, false, 3, 1, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Materials.Iron, 3), new MaterialStack(Materials.Coal, 2), new MaterialStack(Materials.Silicon, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.MAGNETO, 2), getTcAspectStack(TC_Aspects.ELECTRUM, 5))),
+ EnergeticAlloy(36, TextureSet.SET_SHINY, 5.0F, 512, 3, 1 | 2 | 64 | 128, 252, 152, 45, 0, "Energetic Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeOrange, 2, Arrays.asList(new MaterialStack(Materials.Gold, 3), new MaterialStack(Materials.Glowstone, 2), new MaterialStack(Materials.Redstone, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 4), getTcAspectStack(TC_Aspects.LUX, 3))),
+ VibrantAlloy(37, TextureSet.SET_SHINY, 7.0F, 1280, 4, 1 | 2 | 64 | 128, 204, 242, 142, 0, "Vibrant Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeLime, 2, Arrays.asList(new MaterialStack(Materials.EnergeticAlloy, 1), new MaterialStack(Materials.EnderPearl, 3)), Arrays.asList(getTcAspectStack(TC_Aspects.MACHINA, 5), getTcAspectStack(TC_Aspects.TELUM, 4))),
+ PulsatingIron(38, TextureSet.SET_SHINY, 5.0F, 256, 2, 1 | 2 | 64 | 128, 50, 91, 21, 0, "Pulsating Iron", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.EnderPearl, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.ALIENIS, 3), getTcAspectStack(TC_Aspects.METALLUM, 3))),
+ /* TODO*/ RedstoneAlloy(39, TextureSet.SET_METALLIC, 1.0F, 256, 2, 1|2|16|32|64, 178,34,34, 0, "Redstone Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.Redstone, 4))),
+
+ //Needs more Use, I think.
+ Tantalloy60(40, TextureSet.SET_DULL, 8.0F, 5120, 3, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 166, 0, "Tantalloy-60", 0, 0, 3035, 2200, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Tantalloy61(41, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 122, 135, 196, 0, "Tantalloy-61", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+
+ Potin(42, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 201,151,129, 0, "Potin", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Inconel792(43, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 108, 240, 118, 0, "Inconel-792", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ Inconel690(44, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 118, 220, 138, 0, "Inconel-690", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ MaragingSteel300(45, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 150, 150, 150, 0, "Maraging Steel 300", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ MaragingSteel350(46, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 160, 160, 160, 0, "Maraging Steel 350", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+ HastelloyX(47, TextureSet.SET_SHINY, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 255, 193, 37, 0, "Hastelloy-X", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))),
+
+
+
+ //Radioactive Materials
+ HydrofluoricAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 200, 200, 200, 0, "Hydrofluoric Acid", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ UraniumHexaFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Hexafluoride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLime, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ UraniumTetraFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Tetrafluoride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLime, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ ThoriumTetraFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 15, 120, 15, 0, "Thorium Tetrafluoride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+
+ SulfurousAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 110, 220, 30, 0, "Sulfurous Acid", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ SulfurDioxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 200, 50, 0, "Sulfur Dioxide", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ HydrogenChloride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 240, 90, 0, "Hydrogen Chloride", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ SulfuricApatite(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Apatite Solution", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+
+ SulfuricLithium(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Lithium Solution", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+ LithiumHydroxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Lithium Hydroxide", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))),
+
;
-
+
+
+
+
/**
* List of all Materials.
*/
- public static final Collection<GT_Materials> VALUES = new HashSet<GT_Materials>(
- Arrays.asList(GT_Materials.values()));
+ public static final Collection<GT_Materials> VALUES = new HashSet<GT_Materials>(Arrays.asList(values()));
+
static {
- /*
- * Primitive.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Basic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Good.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Advanced.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Data.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Elite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Master.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Ultimate.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Superconductor.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- * Infinite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
- */
+ /*Primitive.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Basic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Good.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Advanced.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Data.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Elite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Master.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Ultimate.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Superconductor.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Infinite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);*/
Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
}
- public static volatile int VERSION = 508;
- public static GT_Materials get(final String aMaterialName) {
- final Object tObject = GT_Utility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
- if (tObject != null && tObject instanceof Materials) {
- return (GT_Materials) tObject;
- }
- return _NULL;
- }
- public static GT_Materials getRealMaterial(final String aMaterialName) {
- return GT_Materials.get(aMaterialName).mMaterialInto;
- }
- /**
- * Called in preInit with the Config to set Values.
- *
- * @param aConfiguration
- */
- public static void init(final GT_Config aConfiguration) {
- for (final GT_Materials tMaterial : GT_Materials.VALUES) {
- final String tString = tMaterial.toString().toLowerCase();
- tMaterial.mHeatDamage = (float) aConfiguration.get(ConfigCategories.Materials.heatdamage, tString,
- tMaterial.mHeatDamage);
- if (tMaterial.mBlastFurnaceRequired) {
- tMaterial.mBlastFurnaceRequired = aConfiguration
- .get(ConfigCategories.Materials.blastfurnacerequirements, tString, true);
- }
- if (tMaterial.mBlastFurnaceRequired
- && aConfiguration.get(ConfigCategories.Materials.blastinductionsmelter, tString,
- tMaterial.mBlastFurnaceTemp < 1500)) {
- }
- // GT_ModHandler.ThermalExpansion.addSmelterBlastOre(tMaterial);
- // tMaterial.mHandleMaterial = (tMaterial == Desh ?
- // tMaterial.mHandleMaterial : tMaterial == Diamond || tMaterial
- // == Thaumium ? Wood : tMaterial.contains(SubTag.BURNING) ?
- // Blaze : tMaterial.contains(SubTag.MAGICAL) &&
- // tMaterial.contains(SubTag.CRYSTAL) &&
- // Loader.isModLoaded(MOD_ID_TC) ? Thaumium :
- // tMaterial.getMass() > Element.Tc.getMass() * 2 ?
- // TungstenSteel : tMaterial.getMass() > Element.Tc.getMass() ?
- // Steel : Wood);
- }
- }
+
/**
- * This Array can be changed dynamically by a Tick Handler in order to
- * get a glowing Effect on all GT Meta Items out of this Material.
+ * This Array can be changed dynamically by a Tick Handler in order to get a glowing Effect on all GT Meta Items out of this Material.
*/
- public final short[] mRGBa = new short[] {
- 255, 255, 255, 0
- }, mMoltenRGBa = new short[] {
- 255, 255, 255, 0
- };
- public final TextureSet mIconSet;
- public final int mMetaItemSubID;
- public final boolean mUnificatable;
- public final GT_Materials mMaterialInto;
- public final List<MaterialStack> mMaterialList = new ArrayList<MaterialStack>();
- public final List<GT_Materials> mOreByProducts = new ArrayList<GT_Materials>(),
- mOreReRegistrations = new ArrayList<GT_Materials>();
- public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
- private final ArrayList<ItemStack> mMaterialItems = new ArrayList<ItemStack>();
- private final Collection<SubTag> mSubTags = new HashSet<SubTag>();
- public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
- public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
- public boolean mBlastFurnaceRequired = false;
- public float mToolSpeed = 1.0F, mHeatDamage = 0.0F;
- public String mChemicalFormula = "?", mDefaultLocalName = "null";
- public Dyes mColor = Dyes._NULL;
- public short mMeltingPoint = 0, mBlastFurnaceTemp = 0;
- public int mTypes = 0, mDurability = 16, mFuelPower = 0,
- mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1,
- mSmeltingMultiplier = 1;
- public long mDensity = GT_Values.M;
- public Element mElement = null;
-
- public GT_Materials mDirectSmelting = this, mOreReplacement = this,
- mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this;
-
- public byte mToolQuality = 0;
-
- public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null;
-
+ public final short[] mRGBa = new short[]{255, 255, 255, 0}, mMoltenRGBa = new short[]{255, 255, 255, 0};
+ public final TextureSet mIconSet;
+ public final int mMetaItemSubID;
+ public final boolean mUnificatable;
+ public final GT_Materials mMaterialInto;
+ public final List<MaterialStack> mMaterialList = new ArrayList<MaterialStack>();
+ public final List<GT_Materials> mOreByProducts = new ArrayList<GT_Materials>(), mOreReRegistrations = new ArrayList<GT_Materials>();
+ public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
+ private final ArrayList<ItemStack> mMaterialItems = new ArrayList<ItemStack>();
+ private final Collection<SubTag> mSubTags = new HashSet<SubTag>();
+ public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
+ public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
+ public boolean mBlastFurnaceRequired = false;
+ public float mToolSpeed = 1.0F, mHeatDamage = 0.0F;
+ public String mChemicalFormula = "?", mDefaultLocalName = "null";
+ public Dyes mColor = Dyes._NULL;
+ public short mMeltingPoint = 0, mBlastFurnaceTemp = 0;
+ public int mTypes = 0, mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1;
+ public long mDensity = M;
+ public Element mElement = null;
+ public GT_Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this;
+ public byte mToolQuality = 0;
+ public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null;
/**
- * This Fluid is used as standard Unit for Molten Materials. 1296 is a
- * Molten Block, what means 144 is one Material Unit worth
+ * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one Material Unit worth
*/
- public Fluid mStandardMoltenFluid = null;
-
- private GT_Materials(final GT_Materials aMaterialInto, final boolean aReRegisterIntoThis) {
- this.mUnificatable = false;
- this.mDefaultLocalName = aMaterialInto.mDefaultLocalName;
- this.mMaterialInto = aMaterialInto.mMaterialInto;
- if (aReRegisterIntoThis) {
- this.mMaterialInto.mOreReRegistrations.add(this);
- }
- this.mChemicalFormula = aMaterialInto.mChemicalFormula;
- this.mMetaItemSubID = -1;
- this.mIconSet = TextureSet.SET_NONE;
- }
-
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
- final int aToolDurability, final int aToolQuality, final boolean aUnificatable) {
- this.mUnificatable = aUnificatable;
- this.mMaterialInto = this;
- this.mMetaItemSubID = aMetaItemSubID;
- this.mToolQuality = (byte) aToolQuality;
- this.mDurability = aToolDurability;
- this.mToolSpeed = aToolSpeed;
- this.mIconSet = aIconSet;
+ public Fluid mStandardMoltenFluid = null;
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, boolean aUnificatable) {
+ mUnificatable = aUnificatable;
+ mMaterialInto = this;
+ mMetaItemSubID = aMetaItemSubID;
+ mToolQuality = (byte) aToolQuality;
+ mDurability = aToolDurability;
+ mToolSpeed = aToolSpeed;
+ mIconSet = aIconSet;
if (aMetaItemSubID >= 0) {
if (CORE.sMU_GeneratedMaterials[aMetaItemSubID] == null) {
CORE.sMU_GeneratedMaterials[aMetaItemSubID] = this;
- }
- else {
+ } else {
throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!");
}
}
}
+ private GT_Materials(GT_Materials aMaterialInto, boolean aReRegisterIntoThis) {
+ mUnificatable = false;
+ mDefaultLocalName = aMaterialInto.mDefaultLocalName;
+ mMaterialInto = aMaterialInto.mMaterialInto;
+ if (aReRegisterIntoThis) mMaterialInto.mOreReRegistrations.add(this);
+ mChemicalFormula = aMaterialInto.mChemicalFormula;
+ mMetaItemSubID = -1;
+ mIconSet = TextureSet.SET_NONE;
+ }
+
/**
- * @param aMetaItemSubID
- * the Sub-ID used in my own MetaItems. Range 0-1000. -1 for
- * no Material
- * @param aTypes
- * which kind of Items should be generated. Bitmask as
- * follows: 1 = Dusts of all kinds. 2 = Dusts, Ingots,
- * Plates, Rods/Sticks, Machine Components and other Metal
- * specific things. 4 = Dusts, Gems, Plates, Lenses (if
- * transparent). 8 = Dusts, Impure Dusts, crushed Ores,
- * purified Ores, centrifuged Ores etc. 16 = Cells 32 =
- * Plasma Cells 64 = Tool Heads 128 = Gears
- * @param aR,
- * aG, aB Color of the Material 0-255 each.
- * @param aA
- * transparency of the Material Texture. 0 = fully visible,
- * 255 = Invisible.
- * @param aLocalName
- * The Name used as Default for localization.
- * @param aFuelType
- * Type of Generator to get Energy from this Material.
- * @param aFuelPower
- * EU generated. Will be multiplied by 1000, also
- * additionally multiplied by 2 for Gems.
- * @param aAmplificationValue
- * Amount of UUM amplifier gotten from this.
- * @param aUUMEnergy
- * Amount of EU needed to shape the UUM into this Material.
- * @param aMeltingPoint
- * Used to determine the smelting Costs in Furnii.
- * @param aBlastFurnaceTemp
- * Used to determine the needed Heat capactiy Costs in Blast
- * Furnii.
- * @param aBlastFurnaceRequired
- * If this requires a Blast Furnace.
- * @param aColor
- * Vanilla MC Wool Color which comes the closest to this.
+ * @param aMetaItemSubID the Sub-ID used in my own MetaItems. Range 0-1000. -1 for no Material
+ * @param aTypes which kind of Items should be generated. Bitmask as follows:
+ * 1 = Dusts of all kinds.
+ * 2 = Dusts, Ingots, Plates, Rods/Sticks, Machine Components and other Metal specific things.
+ * 4 = Dusts, Gems, Plates, Lenses (if transparent).
+ * 8 = Dusts, Impure Dusts, crushed Ores, purified Ores, centrifuged Ores etc.
+ * 16 = Cells
+ * 32 = Plasma Cells
+ * 64 = Tool Heads
+ * 128 = Gears
+ * @param aR, aG, aB Color of the Material 0-255 each.
+ * @param aA transparency of the Material Texture. 0 = fully visible, 255 = Invisible.
+ * @param aLocalName The Name used as Default for localization.
+ * @param aFuelType Type of Generator to get Energy from this Material.
+ * @param aFuelPower EU generated. Will be multiplied by 1000, also additionally multiplied by 2 for Gems.
+ * @param aAmplificationValue Amount of UUM amplifier gotten from this.
+ * @param aUUMEnergy Amount of EU needed to shape the UUM into this Material.
+ * @param aMeltingPoint Used to determine the smelting Costs in Furnii.
+ * @param aBlastFurnaceTemp Used to determine the needed Heat capactiy Costs in Blast Furnii.
+ * @param aBlastFurnaceRequired If this requires a Blast Furnace.
+ * @param aColor Vanilla MC Wool Color which comes the closest to this.
*/
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
- final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
- final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
- final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
- final boolean aTransparent, final int aOreValue, final int aDensityMultiplier,
- final int aDensityDivider, final Dyes aColor) {
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
- this.mDefaultLocalName = aLocalName;
- this.mMeltingPoint = (short) aMeltingPoint;
- this.mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
- this.mBlastFurnaceRequired = aBlastFurnaceRequired;
- if (aTransparent) {
- this.add(SubTag.TRANSPARENT);
- }
- this.mFuelPower = aFuelPower;
- this.mFuelType = aFuelType;
- this.mOreValue = aOreValue;
- this.mDensity = GT_Values.M * aDensityMultiplier / aDensityDivider;
- this.mColor = aColor == null ? Dyes._NULL : aColor;
- if (this.mColor != null) {
- this.add(SubTag.HAS_COLOR);
- }
- this.mRGBa[0] = this.mMoltenRGBa[0] = (short) aR;
- this.mRGBa[1] = this.mMoltenRGBa[1] = (short) aG;
- this.mRGBa[2] = this.mMoltenRGBa[2] = (short) aB;
- this.mRGBa[3] = this.mMoltenRGBa[3] = (short) aA;
- this.mTypes = aTypes;
- if ((this.mTypes & 2) != 0) {
- this.add(SubTag.SMELTING_TO_FLUID);
- }
+ mDefaultLocalName = aLocalName;
+ mMeltingPoint = (short) aMeltingPoint;
+ mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
+ mBlastFurnaceRequired = aBlastFurnaceRequired;
+ if (aTransparent) add(SubTag.TRANSPARENT);
+ mFuelPower = aFuelPower;
+ mFuelType = aFuelType;
+ mOreValue = aOreValue;
+ mDensity = (M * aDensityMultiplier) / aDensityDivider;
+ mColor = aColor == null ? Dyes._NULL : aColor;
+ if (mColor != null) add(SubTag.HAS_COLOR);
+ mRGBa[0] = mMoltenRGBa[0] = (short) aR;
+ mRGBa[1] = mMoltenRGBa[1] = (short) aG;
+ mRGBa[2] = mMoltenRGBa[2] = (short) aB;
+ mRGBa[3] = mMoltenRGBa[3] = (short) aA;
+ mTypes = aTypes;
+ if ((mTypes & 2) != 0) add(SubTag.SMELTING_TO_FLUID);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mAspects.addAll(aAspects);
}
/**
- * @param aElement
- * The Element Enum represented by this Material
+ * @param aElement The Element Enum represented by this Material
*/
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
- final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
- final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
- final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
- final boolean aTransparent, final int aOreValue, final int aDensityMultiplier,
- final int aDensityDivider, final Dyes aColor, final Element aElement,
- final List<TC_AspectStack> aAspects) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA,
- aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired,
- aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
- this.mElement = aElement;
- // mElement.mLinkedMaterials.add(this);
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mElement = aElement;
+ //mElement.mLinkedMaterials.add(this);
if (aElement == Element._NULL) {
- this.mChemicalFormula = "Empty";
- }
- else {
- this.mChemicalFormula = aElement.toString();
- this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
+ mChemicalFormula = "Empty";
+ } else {
+ mChemicalFormula = aElement.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
}
- this.mAspects.addAll(aAspects);
+ mAspects.addAll(aAspects);
}
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
- final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
- final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
- final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
- final boolean aTransparent, final int aOreValue, final int aDensityMultiplier,
- final int aDensityDivider, final Dyes aColor, final int aExtraData,
- final List<MaterialStack> aMaterialList) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA,
- aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired,
- aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList,
- null);
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList, null);
}
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
- final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
- final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
- final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
- final boolean aTransparent, final int aOreValue, final int aDensityMultiplier,
- final int aDensityDivider, final Dyes aColor, final int aExtraData,
- final List<MaterialStack> aMaterialList, final List<TC_AspectStack> aAspects) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA,
- aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired,
- aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
- this.mExtraData = aExtraData;
- this.mMaterialList.addAll(aMaterialList);
- this.mChemicalFormula = "";
- for (final MaterialStack tMaterial : this.mMaterialList) {
- this.mChemicalFormula += tMaterial.toString();
- }
- this.mChemicalFormula = this.mChemicalFormula.replaceAll("_", "-");
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mExtraData = aExtraData;
+ mMaterialList.addAll(aMaterialList);
+ mChemicalFormula = "";
+ for (MaterialStack tMaterial : mMaterialList) mChemicalFormula += tMaterial.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
int tAmountOfComponents = 0, tMeltingPoint = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
+ for (MaterialStack tMaterial : mMaterialList) {
tAmountOfComponents += tMaterial.mAmount;
- if (tMaterial.mMaterial.mMeltingPoint > 0) {
+ if (tMaterial.mMaterial.mMeltingPoint > 0)
tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount;
- }
- if (aAspects == null) {
- for (final TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) {
- tAspect.addToAspectList(this.mAspects);
- }
- }
+ if (aAspects == null)
+ for (TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) tAspect.addToAspectList(mAspects);
}
- if (this.mMeltingPoint < 0) {
- this.mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
- }
+ if (mMeltingPoint < 0) mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
tAmountOfComponents *= aDensityMultiplier;
tAmountOfComponents /= aDensityDivider;
- if (aAspects == null) {
- for (final TC_AspectStack tAspect : this.mAspects) {
- tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
- }
- }
- else {
- this.mAspects.addAll(aAspects);
- }
- }
-
- private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed,
- final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG,
- final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower,
- final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired,
- final boolean aTransparent, final int aOreValue, final int aDensityMultiplier,
- final int aDensityDivider, final Dyes aColor, final List<TC_AspectStack> aAspects) {
- this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA,
- aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired,
- aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
- this.mAspects.addAll(aAspects);
+ if (aAspects == null) for (TC_AspectStack tAspect : mAspects)
+ tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
+ else mAspects.addAll(aAspects);
}
- /**
- * Adds an ItemStack to this Material.
- */
- public GT_Materials add(final ItemStack aStack) {
- if (aStack != null && !this.contains(aStack)) {
- this.mMaterialItems.add(aStack);
- }
- return this;
- }
-
- /**
- * Adds a SubTag to this Material
- */
- @Override
- public ISubTagContainer add(final SubTag... aTags) {
- if (aTags != null) {
- for (final SubTag aTag : aTags) {
- if (aTag != null && !this.contains(aTag)) {
- aTag.addContainerToList(this);
- this.mSubTags.add(aTag);
- }
- }
- }
- return this;
+ public static GT_Materials get(String aMaterialName) {
+ Object tObject = GT_Utility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
+ if (tObject != null && tObject instanceof Materials) return (GT_Materials) tObject;
+ return _NULL;
}
- /**
- * Adds a Material to the List of Byproducts when grinding this Ore. Is
- * used for more precise Ore grinding, so that it is possible to choose
- * between certain kinds of Materials.
- */
- public GT_Materials addOreByProduct(final GT_Materials aMaterial) {
- if (!this.mOreByProducts.contains(aMaterial.mMaterialInto)) {
- this.mOreByProducts.add(aMaterial.mMaterialInto);
- }
- return this;
+ public static GT_Materials getRealMaterial(String aMaterialName) {
+ return get(aMaterialName).mMaterialInto;
}
/**
- * Adds multiple Materials to the List of Byproducts when grinding this
- * Ore. Is used for more precise Ore grinding, so that it is possible to
- * choose between certain kinds of Materials.
+ * Called in preInit with the Config to set Values.
+ *
+ * @param aConfiguration
*/
- public GT_Materials addOreByProducts(final GT_Materials... aMaterials) {
- for (final GT_Materials tMaterial : aMaterials) {
- if (tMaterial != null) {
- this.addOreByProduct(tMaterial);
- }
+ public static void init(GT_Config aConfiguration) {
+ for (GT_Materials tMaterial : VALUES) {
+ String tString = tMaterial.toString().toLowerCase();
+ tMaterial.mHeatDamage = (float) aConfiguration.get(ConfigCategories.Materials.heatdamage, tString, tMaterial.mHeatDamage);
+ if (tMaterial.mBlastFurnaceRequired)
+ tMaterial.mBlastFurnaceRequired = aConfiguration.get(ConfigCategories.Materials.blastfurnacerequirements, tString, true);
+ if (tMaterial.mBlastFurnaceRequired && aConfiguration.get(ConfigCategories.Materials.blastinductionsmelter, tString, tMaterial.mBlastFurnaceTemp < 1500)){}
+ //GT_ModHandler.ThermalExpansion.addSmelterBlastOre(tMaterial);
+ //tMaterial.mHandleMaterial = (tMaterial == Desh ? tMaterial.mHandleMaterial : tMaterial == Diamond || tMaterial == Thaumium ? Wood : tMaterial.contains(SubTag.BURNING) ? Blaze : tMaterial.contains(SubTag.MAGICAL) && tMaterial.contains(SubTag.CRYSTAL) && Loader.isModLoaded(MOD_ID_TC) ? Thaumium : tMaterial.getMass() > Element.Tc.getMass() * 2 ? TungstenSteel : tMaterial.getMass() > Element.Tc.getMass() ? Steel : Wood);
}
- return this;
}
- /**
- * This is used to determine if any of the ItemStacks belongs to this
- * Material.
- */
- public boolean contains(final ItemStack... aStacks) {
- if (aStacks == null || aStacks.length <= 0) {
- return false;
- }
- for (final ItemStack tStack : this.mMaterialItems) {
- for (final ItemStack aStack : aStacks) {
- if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) {
- return true;
- }
- }
- }
+ public boolean isRadioactive() {
+ if (mElement != null) return mElement.mHalfLifeSeconds >= 0;
+ for (MaterialStack tMaterial : mMaterialList) if (tMaterial.mMaterial.isRadioactive()) return true;
return false;
}
- /**
- * If this Material has this exact SubTag
- */
- @Override
- public boolean contains(final SubTag aTag) {
- return this.mSubTags.contains(aTag);
- }
-
- public long getDensity() {
- return this.mDensity;
- }
-
- public FluidStack getFluid(final long aAmount) {
- if (this.mFluid == null) {
- return null;
- }
- return new GT_FluidStack(this.mFluid, (int) aAmount);
- }
-
- public FluidStack getGas(final long aAmount) {
- if (this.mGas == null) {
- return null;
- }
- return new GT_FluidStack(this.mGas, (int) aAmount);
- }
-
- public long getMass() {
- if (this.mElement != null) {
- return this.mElement.getMass();
- }
- if (this.mMaterialList.size() <= 0) {
- return Element.Tc.getMass();
- }
+ public long getProtons() {
+ if (mElement != null) return mElement.getProtons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getProtons();
long rAmount = 0, tAmount = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
+ for (MaterialStack tMaterial : mMaterialList) {
tAmount += tMaterial.mAmount;
- rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
- }
- return this.getDensity() * rAmount / (tAmount * GT_Values.M);
- }
-
- public FluidStack getMolten(final long aAmount) {
- if (this.mStandardMoltenFluid == null) {
- return null;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
}
- return new GT_FluidStack(this.mStandardMoltenFluid, (int) aAmount);
+ return (getDensity() * rAmount) / (tAmount * M);
}
public long getNeutrons() {
- if (this.mElement != null) {
- return this.mElement.getNeutrons();
- }
- if (this.mMaterialList.size() <= 0) {
- return Element.Tc.getNeutrons();
- }
+ if (mElement != null) return mElement.getNeutrons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getNeutrons();
long rAmount = 0, tAmount = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
+ for (MaterialStack tMaterial : mMaterialList) {
tAmount += tMaterial.mAmount;
rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons();
}
- return this.getDensity() * rAmount / (tAmount * GT_Values.M);
+ return (getDensity() * rAmount) / (tAmount * M);
}
- public FluidStack getPlasma(final long aAmount) {
- if (this.mPlasma == null) {
- return null;
- }
- return new GT_FluidStack(this.mPlasma, (int) aAmount);
- }
-
- public long getProtons() {
- if (this.mElement != null) {
- return this.mElement.getProtons();
- }
- if (this.mMaterialList.size() <= 0) {
- return Element.Tc.getProtons();
- }
+ public long getMass() {
+ if (mElement != null) return mElement.getMass();
+ if (mMaterialList.size() <= 0) return Element.Tc.getMass();
long rAmount = 0, tAmount = 0;
- for (final MaterialStack tMaterial : this.mMaterialList) {
+ for (MaterialStack tMaterial : mMaterialList) {
tAmount += tMaterial.mAmount;
- rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
}
- return this.getDensity() * rAmount / (tAmount * GT_Values.M);
- }
-
- @Override
- public short[] getRGBA() {
- return this.mRGBa;
+ return (getDensity() * rAmount) / (tAmount * M);
}
- public FluidStack getSolid(final long aAmount) {
- if (this.mSolid == null) {
- return null;
- }
- return new GT_FluidStack(this.mSolid, (int) aAmount);
+ public long getDensity() {
+ return mDensity;
}
public String getToolTip() {
- return this.getToolTip(1, false);
+ return getToolTip(1, false);
}
- public String getToolTip(final boolean aShowQuestionMarks) {
- return this.getToolTip(1, aShowQuestionMarks);
+ public String getToolTip(boolean aShowQuestionMarks) {
+ return getToolTip(1, aShowQuestionMarks);
}
- public String getToolTip(final long aMultiplier) {
- return this.getToolTip(aMultiplier, false);
+ public String getToolTip(long aMultiplier) {
+ return getToolTip(aMultiplier, false);
}
- public String getToolTip(final long aMultiplier, final boolean aShowQuestionMarks) {
- if (!aShowQuestionMarks && this.mChemicalFormula.equals("?")) {
- return "";
- }
- if (aMultiplier >= GT_Values.M * 2 && !this.mMaterialList.isEmpty()) {
- return (this.mElement != null || this.mMaterialList.size() < 2 && this.mMaterialList.get(0).mAmount == 1
- ? this.mChemicalFormula : "(" + this.mChemicalFormula + ")") + aMultiplier;
+ public String getToolTip(long aMultiplier, boolean aShowQuestionMarks) {
+ if (!aShowQuestionMarks && mChemicalFormula.equals("?")) return "";
+ if (aMultiplier >= M * 2 && !mMaterialList.isEmpty()) {
+ return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1)) ? mChemicalFormula : "(" + mChemicalFormula + ")") + aMultiplier;
}
- return this.mChemicalFormula;
+ return mChemicalFormula;
}
- public boolean isRadioactive() {
- if (this.mElement != null) {
- return this.mElement.mHalfLifeSeconds >= 0;
- }
- for (final MaterialStack tMaterial : this.mMaterialList) {
- if (tMaterial.mMaterial.isRadioactive()) {
- return true;
- }
- }
+ /**
+ * Adds an ItemStack to this Material.
+ */
+ public GT_Materials add(ItemStack aStack) {
+ if (aStack != null && !contains(aStack)) mMaterialItems.add(aStack);
+ return this;
+ }
+
+ /**
+ * This is used to determine if any of the ItemStacks belongs to this Material.
+ */
+ public boolean contains(ItemStack... aStacks) {
+ if (aStacks == null || aStacks.length <= 0) return false;
+ for (ItemStack tStack : mMaterialItems)
+ for (ItemStack aStack : aStacks)
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true;
return false;
}
/**
* This is used to determine if an ItemStack belongs to this Material.
*/
- public boolean remove(final ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
+ public boolean remove(ItemStack aStack) {
+ if (aStack == null) return false;
boolean temp = false;
- for (int i = 0; i < this.mMaterialItems.size(); i++) {
- if (GT_Utility.areStacksEqual(aStack, this.mMaterialItems.get(i))) {
- this.mMaterialItems.remove(i--);
+ for (int i = 0; i < mMaterialItems.size(); i++)
+ if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) {
+ mMaterialItems.remove(i--);
temp = true;
}
- }
return temp;
}
/**
- * Removes a SubTag from this Material
+ * Adds a SubTag to this Material
*/
@Override
- public boolean remove(final SubTag aTag) {
- return this.mSubTags.remove(aTag);
+ public ISubTagContainer add(SubTag... aTags) {
+ if (aTags != null) for (SubTag aTag : aTags)
+ if (aTag != null && !contains(aTag)) {
+ aTag.addContainerToList(this);
+ mSubTags.add(aTag);
+ }
+ return this;
}
/**
- * This Material arc smelts always into an instance of aMaterial. Used
- * for Wrought Iron.
+ * If this Material has this exact SubTag
*/
- public GT_Materials setArcSmeltingInto(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
- }
- return this;
+ @Override
+ public boolean contains(SubTag aTag) {
+ return mSubTags.contains(aTag);
}
/**
- * If this Ore gives multiple drops of its Byproduct Material.
+ * Removes a SubTag from this Material
*/
- public GT_Materials setByProductMultiplier(final int aByProductMultiplier) {
- if (aByProductMultiplier > 0) {
- this.mByProductMultiplier = aByProductMultiplier;
- }
+ @Override
+ public boolean remove(SubTag aTag) {
+ return mSubTags.remove(aTag);
+ }
+
+ /**
+ * Sets the Heat Damage for this Material (negative = frost)
+ */
+ public GT_Materials setHeatDamage(float aHeatDamage) {
+ mHeatDamage = aHeatDamage;
return this;
}
/**
- * This Ore should be smolten directly into an Ingot of this Material
- * instead of an Ingot of itself.
+ * Adds a Material to the List of Byproducts when grinding this Ore.
+ * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials.
*/
- public GT_Materials setDirectSmelting(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mDirectSmelting = aMaterial.mMaterialInto.mDirectSmelting;
- }
+ public GT_Materials addOreByProduct(GT_Materials aMaterial) {
+ if (!mOreByProducts.contains(aMaterial.mMaterialInto)) mOreByProducts.add(aMaterial.mMaterialInto);
return this;
}
- public GT_Materials setEnchantmentForArmors(final Enchantment aEnchantment, final int aEnchantmentLevel) {
- this.mEnchantmentArmors = aEnchantment;
- this.mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
+ /**
+ * Adds multiple Materials to the List of Byproducts when grinding this Ore.
+ * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials.
+ */
+ public GT_Materials addOreByProducts(GT_Materials... aMaterials) {
+ for (GT_Materials tMaterial : aMaterials) if (tMaterial != null) addOreByProduct(tMaterial);
return this;
}
- public GT_Materials setEnchantmentForTools(final Enchantment aEnchantment, final int aEnchantmentLevel) {
- this.mEnchantmentTools = aEnchantment;
- this.mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setOreMultiplier(int aOreMultiplier) {
+ if (aOreMultiplier > 0) mOreMultiplier = aOreMultiplier;
return this;
}
/**
- * Sets the Heat Damage for this Material (negative = frost)
+ * If this Ore gives multiple drops of its Byproduct Material.
*/
- public GT_Materials setHeatDamage(final float aHeatDamage) {
- this.mHeatDamage = aHeatDamage;
+ public GT_Materials setByProductMultiplier(int aByProductMultiplier) {
+ if (aByProductMultiplier > 0) mByProductMultiplier = aByProductMultiplier;
return this;
}
/**
- * This Material macerates always into an instance of aMaterial.
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
*/
- public GT_Materials setMaceratingInto(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mMacerateInto = aMaterial.mMaterialInto.mMacerateInto;
- }
+ public GT_Materials setSmeltingMultiplier(int aSmeltingMultiplier) {
+ if (aSmeltingMultiplier > 0) mSmeltingMultiplier = aSmeltingMultiplier;
return this;
}
/**
- * If this Ore gives multiple drops of its Main Material. Lapis Ore for
- * example gives about 6 drops.
+ * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself.
*/
- public GT_Materials setOreMultiplier(final int aOreMultiplier) {
- if (aOreMultiplier > 0) {
- this.mOreMultiplier = aOreMultiplier;
- }
+ public GT_Materials setDirectSmelting(GT_Materials aMaterial) {
+ if (aMaterial != null) mDirectSmelting = aMaterial.mMaterialInto.mDirectSmelting;
return this;
}
@@ -1197,315 +760,80 @@ public enum GregtechOrePrefixes {
* This Material should be the Main Material this Ore gets ground into.
* Example, Chromite giving Chrome or Tungstate giving Tungsten.
*/
- public GT_Materials setOreReplacement(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mOreReplacement = aMaterial.mMaterialInto.mOreReplacement;
- }
+ public GT_Materials setOreReplacement(GT_Materials aMaterial) {
+ if (aMaterial != null) mOreReplacement = aMaterial.mMaterialInto.mOreReplacement;
return this;
}
/**
- * This Material smelts always into an instance of aMaterial. Used for
- * Magnets.
+ * This Material smelts always into an instance of aMaterial. Used for Magnets.
*/
- public GT_Materials setSmeltingInto(final GT_Materials aMaterial) {
- if (aMaterial != null) {
- this.mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
- }
+ public GT_Materials setSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
return this;
}
/**
- * If this Ore gives multiple drops of its Main Material. Lapis Ore for
- * example gives about 6 drops.
+ * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron.
*/
- public GT_Materials setSmeltingMultiplier(final int aSmeltingMultiplier) {
- if (aSmeltingMultiplier > 0) {
- this.mSmeltingMultiplier = aSmeltingMultiplier;
- }
+ public GT_Materials setArcSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
return this;
}
- }
-
- public static volatile int VERSION = 508;
-
- static {
-
- ingotHot.mHeatDamage = 3.0F;
-
- }
- public static Materials getMaterial(final String aOre) {
- return Materials.get(GregtechOrePrefixes.stripPrefix(aOre));
- }
- public static Materials getMaterial(final String aOre, final GregtechOrePrefixes aPrefix) {
- return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
- }
- public static GregtechOrePrefixes getOrePrefix(final String aOre) {
- for (final GregtechOrePrefixes tPrefix : GregtechOrePrefixes.values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return tPrefix;
- }
- }
- return null;
- }
- public static GregtechOrePrefixes getPrefix(final String aPrefixName) {
- return GregtechOrePrefixes.getPrefix(aPrefixName, null);
- }
- public static GregtechOrePrefixes getPrefix(final String aPrefixName, final GregtechOrePrefixes aReplacement) {
- final Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
- if (tObject != null && tObject instanceof GregtechOrePrefixes) {
- return (GregtechOrePrefixes) tObject;
- }
- return aReplacement;
- }
- public static Materials getRealMaterial(final String aOre, final GregtechOrePrefixes aPrefix) {
- return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
- }
- public static boolean isInstanceOf(final String aName, final GregtechOrePrefixes aPrefix) {
- return aName == null ? false : aName.startsWith(aPrefix.toString());
- }
- public static String replacePrefix(final String aOre, final GregtechOrePrefixes aPrefix) {
- for (final GregtechOrePrefixes tPrefix : GregtechOrePrefixes.values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
- }
- }
- return "";
- }
- public static String stripPrefix(final String aOre) {
- for (final GregtechOrePrefixes tPrefix : GregtechOrePrefixes.values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return aOre.replaceFirst(tPrefix.toString(), "");
- }
+ /**
+ * This Material macerates always into an instance of aMaterial.
+ */
+ public GT_Materials setMaceratingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mMacerateInto = aMaterial.mMaterialInto.mMacerateInto;
+ return this;
}
- return aOre;
- }
- public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<ItemStack>();
- public final short mTextureIndex;
- public final String mRegularLocalName, mLocalizedMaterialPre,
- mLocalizedMaterialPost;
- public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable,
- mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks,
- mAllowNormalRecycling, mGenerateDefaultItem;
- public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
- public final Collection<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<GregtechOrePrefixes>();
- /**
- * Used to determine the amount of Material this Prefix contains. Multiply
- * or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to
- * one Ingot. 0 = Null Negative = Undefined Amount
- */
- public final long mMaterialAmount;
-
- private final Collection<Materials> mNotGeneratedItems = new HashSet<Materials>(),
- mIgnoredMaterials = new HashSet<Materials>(), mGeneratedItems = new HashSet<Materials>();
-
- private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<Interface_OreRecipeRegistrator>();
-
- private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessingFake = new ArrayList<Interface_OreRecipeRegistrator>();
- public ItemStack mContainerItem = null;
-
- public ICondition<ISubTagContainer> mCondition = null;
-
- public byte mDefaultStackSize = 64;
-
- public GregtechMaterialStack mSecondaryMaterial = null;
-
- public GregtechOrePrefixes mPrefixInto = this;
-
- public float mHeatDamage = 0.0F; // Negative
-
- // for
- // Frost
- // Damage
- /**
- * Yes this Value can be changed to add Bits for the
- * MetaGenerated-Item-Check.
- */
- public int mMaterialGenerationBits = 0;
-
- private GregtechOrePrefixes(final String aRegularLocalName, final String aLocalizedMaterialPre,
- final String aLocalizedMaterialPost, final boolean aIsUnificatable, final boolean aIsMaterialBased,
- final boolean aIsSelfReferencing, final boolean aIsContainer, final boolean aDontUnificateActively,
- final boolean aIsUsedForBlocks, final boolean aAllowNormalRecycling, final boolean aGenerateDefaultItem,
- final boolean aIsEnchantable, final boolean aIsUsedForOreProcessing, final int aMaterialGenerationBits,
- final long aMaterialAmount, final int aDefaultStackSize, final int aTextureindex) {
- this.mIsUnificatable = aIsUnificatable;
- this.mIsMaterialBased = aIsMaterialBased;
- this.mIsSelfReferencing = aIsSelfReferencing;
- this.mIsContainer = aIsContainer;
- this.mDontUnificateActively = aDontUnificateActively;
- this.mIsUsedForBlocks = aIsUsedForBlocks;
- this.mAllowNormalRecycling = aAllowNormalRecycling;
- this.mGenerateDefaultItem = aGenerateDefaultItem;
- this.mIsEnchantable = aIsEnchantable;
- this.mIsUsedForOreProcessing = aIsUsedForOreProcessing;
- this.mMaterialGenerationBits = aMaterialGenerationBits;
- this.mMaterialAmount = aMaterialAmount;
- this.mRegularLocalName = aRegularLocalName;
- this.mLocalizedMaterialPre = aLocalizedMaterialPre;
- this.mLocalizedMaterialPost = aLocalizedMaterialPost;
- this.mDefaultStackSize = (byte) aDefaultStackSize;
- this.mTextureIndex = (short) aTextureindex;
-
- // TODO - Utilise some form of way to check if it's gt 5.9 if so, use
- // string switch.
- if (this.name().startsWith("ore")) {
- Utils.getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("wire") || this.name().startsWith("cable")) {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("dust")) {
- Utils.getTcAspectStack(TC_Aspects.PERDITIO.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("crushed")) {
- Utils.getTcAspectStack(TC_Aspects.PERFODIO.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("ingot") || this.name().startsWith("nugget")) {
- Utils.getTcAspectStack(TC_Aspects.METALLUM.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("armor")) {
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("stone")) {
- Utils.getTcAspectStack(TC_Aspects.TERRA.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("pipe")) {
- Utils.getTcAspectStack(TC_Aspects.ITER.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("gear")) {
- Utils.getTcAspectStack(TC_Aspects.MOTUS.name(), 1).addToAspectList(this.mAspects);
- Utils.getTcAspectStack(TC_Aspects.MACHINA.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("frame") || this.name().startsWith("plate")) {
- Utils.getTcAspectStack(TC_Aspects.FABRICO.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("tool")) {
- Utils.getTcAspectStack(TC_Aspects.INSTRUMENTUM.name(), 2).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("gem") || this.name().startsWith("crystal") || this.name().startsWith("lens")) {
- Utils.getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("crate")) {
- Utils.getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("circuit")) {
- Utils.getTcAspectStack("COGNITIO", 1);
- }
- else if (this.name().startsWith("computer")) {
- Utils.getTcAspectStack("COGNITIO", 4).addToAspectList(this.mAspects);
- }
- else if (this.name().startsWith("battery")) {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects);
+ public GT_Materials setEnchantmentForTools(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentTools = aEnchantment;
+ mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
+ return this;
}
- }
- public boolean add(final Interface_OreRecipeRegistrator aRegistrator) {
- if (aRegistrator == null) {
- return false;
+ public GT_Materials setEnchantmentForArmors(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentArmors = aEnchantment;
+ mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
+ return this;
}
- return this.mOreProcessing.add(aRegistrator);
- }
- public boolean add(final ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
- if (!this.contains(aStack)) {
- this.mPrefixedItems.add(aStack);
+ public FluidStack getSolid(long aAmount) {
+ if (mSolid == null) return null;
+ return new GT_FluidStack(mSolid, (int) aAmount);
}
- while (this.mPrefixedItems.contains(null)) {
- this.mPrefixedItems.remove(null);
- }
- return true;
- }
- public boolean addFamiliarPrefix(final GregtechOrePrefixes aPrefix) {
- if (aPrefix == null || this.mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) {
- return false;
+ public FluidStack getFluid(long aAmount) {
+ if (mFluid == null) return null;
+ return new GT_FluidStack(mFluid, (int) aAmount);
}
- return this.mFamiliarPrefixes.add(aPrefix);
- }
- public boolean contains(final ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
- for (final ItemStack tStack : this.mPrefixedItems) {
- if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) {
- return true;
- }
+ public FluidStack getGas(long aAmount) {
+ if (mGas == null) return null;
+ return new GT_FluidStack(mGas, (int) aAmount);
}
- return false;
- }
-
- public boolean doGenerateItem(final Materials aMaterial) {
- return aMaterial != null && aMaterial != Materials._NULL
- && ((aMaterial.mTypes & this.mMaterialGenerationBits) != 0 || this.mGeneratedItems.contains(aMaterial))
- && !this.mNotGeneratedItems.contains(aMaterial)
- && (this.mCondition == null || this.mCondition.isTrue(aMaterial));
- }
- public Object get(final Object aMaterial) {
- if (aMaterial instanceof GT_Materials) {
- return new GregtechItemData(this, (GT_Materials) aMaterial);
+ public FluidStack getPlasma(long aAmount) {
+ if (mPlasma == null) return null;
+ return new GT_FluidStack(mPlasma, (int) aAmount);
}
- return this.name() + aMaterial;
- }
-
- public String getDefaultLocalNameForItem(final Materials aMaterial) {
-
- // Use Standard Localization
- return this.mLocalizedMaterialPre + aMaterial.mDefaultLocalName + this.mLocalizedMaterialPost;
- }
- public boolean ignoreMaterials(final Materials... aMaterials) {
- for (final Materials tMaterial : aMaterials) {
- if (tMaterial != null) {
- this.mIgnoredMaterials.add(tMaterial);
- }
+ public FluidStack getMolten(long aAmount) {
+ if (mStandardMoltenFluid == null) return null;
+ return new GT_FluidStack(mStandardMoltenFluid, (int) aAmount);
}
- return true;
- }
- public boolean isIgnored(final GT_Materials aMaterial) {
- if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) {
- return true;
+ @Override
+ public short[] getRGBA() {
+ return mRGBa;
}
- return this.mIgnoredMaterials.contains(aMaterial);
- }
- public void processOre(final GT_Materials aMaterial, final String aOreDictName, final String aModName,
- final ItemStack aStack) {
- if (aMaterial != null && (aMaterial != GT_Materials._NULL || this.mIsSelfReferencing || !this.mIsMaterialBased)
- && GT_Utility.isStackValid(aStack)) {
- for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessing) {
- if (GT_Values.D2) {
- GT_Log.ore.println(
- "Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '"
- + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
- }
- tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
- }
- }
- }
+ public static volatile int VERSION = 508;
- // TODO
- public void processOre(final Materials aMaterial, final String aOreDictName, final String aModName,
- final ItemStack aStack) {
- if (aMaterial != null && (aMaterial != Materials._NULL || this.mIsSelfReferencing || !this.mIsMaterialBased)
- && GT_Utility.isStackValid(aStack)) {
- for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessingFake) {
- if (GT_Values.D2) {
- GT_Log.ore.println(
- "Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '"
- + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
- }
- tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
- }
- }
}
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
index a5fbbbd188..0b8c605e42 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
@@ -4,155 +4,141 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.IIconContainer;
public class GregtechTextureSet {
- public static final GregtechTextureSet SET_NONE = new GregtechTextureSet("NONE"),
- SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"),
- SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"),
- SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"),
- SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"),
- SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"),
- SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"),
- SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"),
- SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"),
- SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"),
- SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"),
- SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"),
- SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"),
- SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"),
- SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL");
+ public static final GregtechTextureSet
+ SET_NONE = new GregtechTextureSet("NONE"), SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"), SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"), SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"), SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"), SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"), SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"), SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"), SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"), SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"), SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"), SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL");
- public final IIconContainer[] mTextures = new IIconContainer[128];
- public final String mSetName;
+ public final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
- public GregtechTextureSet(final String aSetName) {
- this.mSetName = aSetName;
- this.mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/turbineBlade");
- this.mTextures[1] = new Textures.ItemIcons.CustomIcon(
- "materialicons/" + this.mSetName + "/toolHeadSkookumChoocher");
- this.mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- this.mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void");
- }
+ public GregtechTextureSet(String aSetName) {
+ mSetName = aSetName;
+ mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/turbineBlade");
+ mTextures[1] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/toolHeadSkookumChoocher");
+ mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
index 8580fa8900..dca5d7301c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
@@ -9,158 +9,193 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public class GregtechTextures {
- public enum BlockIcons implements Interface_IconContainer, Runnable {
+ public enum BlockIcons implements Interface_IconContainer, Runnable {
VOID,
- LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3, LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6, LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9, LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, LARGECENTRIFUGE_ACTIVE3, LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, LARGECENTRIFUGE_ACTIVE6, LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, LARGECENTRIFUGE_ACTIVE9;
-
- public static class CustomIcon implements Interface_IconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Meta_GT_Proxy.GT_BlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
- }
- }
+ LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3,
+ LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6,
+ LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9,
+ LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, LARGECENTRIFUGE_ACTIVE3,
+ LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, LARGECENTRIFUGE_ACTIVE6,
+ LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, LARGECENTRIFUGE_ACTIVE9;
public static final Interface_IconContainer[]
- CENTRIFUGE = new Interface_IconContainer[] {
- LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3, LARGECENTRIFUGE4, LARGECENTRIFUGE5,
- LARGECENTRIFUGE6, LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9
- }, CENTRIFUGE_ACTIVE = new Interface_IconContainer[] {
- LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, LARGECENTRIFUGE_ACTIVE3, LARGECENTRIFUGE_ACTIVE4,
- LARGECENTRIFUGE_ACTIVE5, LARGECENTRIFUGE_ACTIVE6, LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8,
- LARGECENTRIFUGE_ACTIVE9
+ CENTRIFUGE = new Interface_IconContainer[]{
+ LARGECENTRIFUGE1,
+ LARGECENTRIFUGE2,
+ LARGECENTRIFUGE3,
+ LARGECENTRIFUGE4,
+ LARGECENTRIFUGE5,
+ LARGECENTRIFUGE6,
+ LARGECENTRIFUGE7,
+ LARGECENTRIFUGE8,
+ LARGECENTRIFUGE9
+ },
+ CENTRIFUGE_ACTIVE = new Interface_IconContainer[]{
+ LARGECENTRIFUGE_ACTIVE1,
+ LARGECENTRIFUGE_ACTIVE2,
+ LARGECENTRIFUGE_ACTIVE3,
+ LARGECENTRIFUGE_ACTIVE4,
+ LARGECENTRIFUGE_ACTIVE5,
+ LARGECENTRIFUGE_ACTIVE6,
+ LARGECENTRIFUGE_ACTIVE7,
+ LARGECENTRIFUGE_ACTIVE8,
+ LARGECENTRIFUGE_ACTIVE9
};
- public static Interface_Texture[] GT_CASING_BLOCKS = new Interface_Texture[64];
-
- protected IIcon mIcon;
-
- private BlockIcons() {
- Meta_GT_Proxy.GT_BlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this);
- }
+ public static Interface_Texture[]
+ GT_CASING_BLOCKS = new Interface_Texture[64];
+
+ protected IIcon mIcon;
+
+ private BlockIcons() {
+ Meta_GT_Proxy.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ public static class CustomIcon implements Interface_IconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ Meta_GT_Proxy.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = Meta_GT_Proxy.sBlockIcons.registerIcon(CORE.MODID + ":" + mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
}
-
+
+
public enum ItemIcons implements Interface_IconContainer, Runnable {
- VOID, // The Empty Texture
- RENDERING_ERROR, // The Purple/Black Texture
- SKOOKUMCHOOCHER, // The Skookum Tool Texture
- TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
-
- /*
- * public static final Interface_IconContainer[] DURABILITY_BAR = new
- * Interface_IconContainer[]{ 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 = new Interface_IconContainer[]{
- * 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 Interface_Texture[] ERROR_RENDERING = new
- // Interface_Texture[]{new GregtechRenderedTexture(RENDERING_ERROR)};
-
- public static class CustomIcon implements Interface_IconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Meta_GT_Proxy.GT_ItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
- this.mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName + "_OVERLAY");
- }
- }
-
- protected IIcon mIcon, mOverlay;
-
- private ItemIcons() {
- Meta_GT_Proxy.GT_ItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this);
- this.mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID + ":" + "iconsets/" + this + "_OVERLAY");
- }
- }
-
+ VOID, // The Empty Texture
+ RENDERING_ERROR, //The Purple/Black Texture
+ SKOOKUMCHOOCHER, //The Skookum Tool Texture
+ TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
+
+ /* public static final Interface_IconContainer[]
+ DURABILITY_BAR = new Interface_IconContainer[]{
+ 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 = new Interface_IconContainer[]{
+ 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 Interface_Texture[] ERROR_RENDERING = new Interface_Texture[]{new GregtechRenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private ItemIcons() {
+ Meta_GT_Proxy.GT_ItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + "iconsets/" + this);
+ mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + "iconsets/" + this + "_OVERLAY");
+ }
+
+ public static class CustomIcon implements Interface_IconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ Meta_GT_Proxy.GT_ItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public void run() {
+ mIcon = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + mIconName);
+ mOverlay = Meta_GT_Proxy.sItemIcons.registerIcon(CORE.MODID+ ":" + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
+
}
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
index 2471e84f54..aa0e347ca9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
@@ -1,7 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.enums;
public enum GregtechToolDictNames {
-
- craftingToolSkookumChoocher;
-
+
+ craftingToolSkookumChoocher;
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
index fc9e9ffcbe..12094ad620 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
@@ -1,15 +1,18 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.gui.*;
+import gregtech.api.gui.GT_Container_BasicTank;
+import gregtech.api.gui.GT_Slot_Output;
+import gregtech.api.gui.GT_Slot_Render;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeTank;
+
+import java.util.Iterator;
+
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -18,61 +21,57 @@ import net.minecraft.inventory.Slot;
*/
public class CONTAINER_DeluxeTank extends GT_Container_BasicTank {
- public int mContent = 0;
+ public int mContent = 0;
- public CONTAINER_DeluxeTank(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_DeluxeTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 80, 17));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 1, 80, 53));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 41, 42));
- this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 3, 59, 42));
- }
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 80, 17));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 1, 80, 53));
+ addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 41, 42));
+ addSlotToContainer(new GT_Slot_Render(mTileEntity, 3, 59, 42));
+ }
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- if (((GT_MetaTileEntity_DeluxeTank) this.mTileEntity.getMetaTileEntity()).mFluid != null) {
- this.mContent = ((GT_MetaTileEntity_DeluxeTank) this.mTileEntity.getMetaTileEntity()).mFluid.amount;
- }
- else {
- this.mContent = 0;
- }
- final Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- final ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mContent & 65535);
- var1.sendProgressBarUpdate(this, 101, this.mContent >>> 16);
- }
- }
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
+ if (((GT_MetaTileEntity_DeluxeTank) mTileEntity.getMetaTileEntity()).mFluid != null)
+ mContent = ((GT_MetaTileEntity_DeluxeTank) mTileEntity.getMetaTileEntity()).mFluid.amount;
+ else
+ mContent = 0;
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, mContent & 65535);
+ var1.sendProgressBarUpdate(this, 101, mContent >>> 16);
+ }
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ mContent = mContent & -65536 | par2;
+ break;
+ case 101:
+ mContent = mContent & 65535 | par2 << 16;
+ break;
+ }
+ }
- @Override
- public int getSlotCount() {
- return 2;
- }
+ @Override
+ public int getSlotCount() {
+ return 2;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(final int par1, final int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100:
- this.mContent = this.mContent & -65536 | par2;
- break;
- case 101:
- this.mContent = this.mContent & 65535 | par2 << 16;
- break;
- }
- }
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
index 24a970d360..4083875fdb 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
@@ -11,30 +11,28 @@ import net.minecraft.inventory.Slot;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_IndustrialCentrifuge extends GT_ContainerMetaTile_Machine {
-
- public CONTAINER_IndustrialCentrifuge(final InventoryPlayer aInventoryPlayer,
- final IGregTechTileEntity aTileEntity) {
-
- super(aInventoryPlayer, aTileEntity);
- }
-
- public CONTAINER_IndustrialCentrifuge(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
-
- @Override
- public int getSlotCount() {
- return 1;
- }
+
+ public CONTAINER_IndustrialCentrifuge(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_IndustrialCentrifuge(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 1, 154, 42));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
index 350b4f00f1..0a19c62d0c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
@@ -7,25 +7,25 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
public class CONTAINER_IronBlastFurnace extends GT_ContainerMetaTile_Machine {
- public CONTAINER_IronBlastFurnace(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_IronBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16));
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25));
- this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25));
- }
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16));
+ addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34));
+ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25));
+ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25));
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 2;
- }
-
- @Override
+ @Override
public int getSlotCount() {
- return 4;
- }
+ return 4;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 2;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
index 56906c96f0..1c94298e09 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
@@ -11,27 +11,31 @@ import net.minecraft.entity.player.InventoryPlayer;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine {
+
+ public int mUUA_USED = ((GregtechMetaTileEntity_MassFabricator)this.mTileEntity.getMetaTileEntity()).getAmplifierUsed();
+ public int mUUM_MADE = ((GregtechMetaTileEntity_MassFabricator)this.mTileEntity.getMetaTileEntity()).getMatterProduced();
+
+ public CONTAINER_MatterFab(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- public int mUUA_USED = ((GregtechMetaTileEntity_MassFabricator) this.mTileEntity.getMetaTileEntity())
- .getAmplifierUsed();
- public int mUUM_MADE = ((GregtechMetaTileEntity_MassFabricator) this.mTileEntity.getMetaTileEntity())
- .getMatterProduced();
+ public CONTAINER_MatterFab(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+}
- public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ /*@Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 1, 152, 5));
+ }
- public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
-}
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
-/*
- * @Override public void addSlots(InventoryPlayer aInventoryPlayer) {
- * addSlotToContainer(new Slot(mTileEntity, 1, 152, 5)); }
- *
- * @Override public int getSlotCount() { return 1; }
- *
- * @Override public int getShiftClickSlotCount() { return 0; } }
- */
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
+}*/
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
index ce43c02a69..9e0a7869e5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -10,21 +10,27 @@ import net.minecraft.entity.player.InventoryPlayer;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
- public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
+ public CONTAINER_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
- public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final boolean bindInventory) {
- super(aInventoryPlayer, aTileEntity, bindInventory);
- }
+ public CONTAINER_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
}
-/*
- * @Override public void addSlots(InventoryPlayer aInventoryPlayer) {
- * addSlotToContainer(new Slot(mTileEntity, 1, 152, 5)); }
- *
- * @Override public int getSlotCount() { return 1; }
- *
- * @Override public int getShiftClickSlotCount() { return 0; } }
- */
+ /*@Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 1, 152, 5));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
+}*/
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
index 0ea825c9c4..4a10923760 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
@@ -1,137 +1,123 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.UUID;
-
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaSafeBlock;
+
+import java.util.UUID;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class CONTAINER_SafeBlock extends GT_ContainerMetaTile_Machine {
- // public String UUID =
- // ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
- public UUID ownerUUID = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).ownerUUID;
-
- public String tempPlayer = PlayerCache.lookupPlayerByUUID(this.ownerUUID);
- public boolean blockStatus = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable;
- public CONTAINER_SafeBlock(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+public class CONTAINER_SafeBlock
+extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_SafeBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
+ //public String UUID = ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
+ public UUID ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ public String tempPlayer = PlayerCache.lookupPlayerByUUID(ownerUUID);
+ public boolean blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+
@Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
- this.addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18));
+ addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18));
}
}
- this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 27;
- }
-
- @Override
- public int getSlotCount() {
- return 27;
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
}
@Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
- final int runs = 0;
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ int runs = 0;
if (aSlotIndex < 27) {
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
- final Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
if (tSlot != null) {
if (this.mTileEntity.getMetaTileEntity() == null) {
return null;
}
- if (aSlotIndex == 27) {
-
- /*
- * ((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).bOutput =
- * (!((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).bOutput); if
- * (((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).bOutput) { if (aPlayer
- * != null && aPlayer instanceof EntityPlayerMP &&
- * (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()
- * ).bOutput != false)) {
- *
- * Utils.LOG_INFO(String.valueOf(Sys.is64Bit()));
- * Utils.messagePlayer(aPlayer, "Salmon"); }
- *
- * GT_Utility.sendChatToPlayer(aPlayer,
- * "Emit Energy to Outputside"); } else {
- * GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy"); }
- * return null;
- */
+ if (aSlotIndex == 27) {
+
+
+ /*((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput);
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput) {
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bOutput != false)) {
+
+ Utils.LOG_INFO(String.valueOf(Sys.is64Bit()));
+ Utils.messagePlayer(aPlayer, "Salmon");
+ }
+
+ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ }
+ return null;*/
+
+
+ }
+ if (aSlotIndex == 28) {}
+ /* ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone");
+ }
+ return null;
+ }*/
+ if (aSlotIndex == 29) /*{
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
+ makeIndestructible(aPlayer);
+ }
+ else {
- }
- if (aSlotIndex == 28) {
- }
- /*
- * ((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull =
- * (!((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); if
- * (((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- * GT_Utility.sendChatToPlayer(aPlayer,
- * "Emit Redstone if no Slot is free"); } else {
- * GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone"); }
- * return null; }
- */
- if (aSlotIndex == 29) /*
- * { if (((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).
- * bUnbreakable) { if
- * (((GregtechMetaSafeBlock)
- * this.mTileEntity.getMetaTileEntity()).
- * bUnbreakable) {
- * makeIndestructible(aPlayer); } else {
- *
- * } } else { makeIndestructible(aPlayer); }
- * return null; }
- */
+ }
+ } else {
+ makeIndestructible(aPlayer);
+ }
+ return null;
+ }*/
{
- ((GregtechMetaSafeBlock) this.mTileEntity
- .getMetaTileEntity()).bUnbreakable = !((GregtechMetaSafeBlock) this.mTileEntity
- .getMetaTileEntity()).bUnbreakable;
- this.blockStatus = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable;
- this.ownerUUID = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).ownerUUID;
- // Utils.messagePlayer(aPlayer, "Is the safe locked?
- // "+String.valueOf(((GregtechMetaSafeBlock)
- // this.mTileEntity.getMetaTileEntity()).bUnbreakable).toUpperCase());
- /*
- * if (aPlayer != null && aPlayer instanceof EntityPlayerMP &&
- * (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()
- * ).bUnbreakable != false)) { UnbreakableBlockManager Xasda =
- * new UnbreakableBlockManager();
- * Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity,
- * aPlayer); } else { UnbreakableBlockManager Xasda = new
- * UnbreakableBlockManager();
- * Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity,
- * aPlayer); }
- */
+ ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable);
+ blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+ ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ //Utils.messagePlayer(aPlayer, "Is the safe locked? "+String.valueOf(((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable).toUpperCase());
+ /*if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable != false)) {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }
+ else {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }*/
return null;
}
+
}
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
+ @Override
+ public int getSlotCount() {
+ return 27;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 27;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
index b70efd4930..46c8720651 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
@@ -1,89 +1,80 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySolarGenerator;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-public class CONTAINER_SolarGenerator extends GT_ContainerMetaTile_Machine {
- private final int mSteamCapacity;
- public int mWaterAmount = 0;
- public int mSteamAmount = 0;
- public int mProcessingEnergy = 0;
- public int mTemperature = 2;
+import java.util.Iterator;
- public CONTAINER_SolarGenerator(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final int aSteamCapacity) {
- super(aInventoryPlayer, aTileEntity);
- this.mSteamCapacity = aSteamCapacity;
- }
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- // addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
- // addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
- // addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
- // addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
- }
+public class CONTAINER_SolarGenerator
+ extends GT_ContainerMetaTile_Machine {
+ private final int mSteamCapacity;
+ public int mWaterAmount = 0;
+ public int mSteamAmount = 0;
+ public int mProcessingEnergy = 0;
+ public int mTemperature = 2;
+ public CONTAINER_SolarGenerator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aSteamCapacity) {
+ super(aInventoryPlayer, aTileEntity);
+ this.mSteamCapacity = aSteamCapacity;
+ }
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- this.mTemperature = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mSolarCharge;
- this.mProcessingEnergy = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity
- .getMetaTileEntity()).mProcessingEnergy;
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ //addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
+ //addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
+ //addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
+ //addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
+ }
- this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54
- / (((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).maxProgresstime()
- - 10)));
- this.mEnergy = (int) Math.min(Integer.MAX_VALUE, this.mTileEntity.getStoredEU());
- this.mProcessingEnergy = Math.min(14,
- Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
+ public int getSlotCount() {
+ return 0;
+ }
- final Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- final ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mTemperature);
- var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
- var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
- var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
- }
- }
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ this.mTemperature = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mSolarCharge;
+ this.mProcessingEnergy = ((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
+
+ this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GregtechMetaTileEntitySolarGenerator) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
+ this.mEnergy = (int) Math.min(Integer.MAX_VALUE, mTileEntity.getStoredEU());
+ this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
- @Override
- public int getSlotCount() {
- return 0;
- }
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mTemperature);
+ var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
+ var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
+ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
+ }
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(final int par1, final int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100:
- this.mTemperature = par2;
- break;
- case 101:
- this.mProcessingEnergy = par2;
- break;
- case 102:
- this.mSteamAmount = par2;
- break;
- case 103:
- this.mWaterAmount = par2;
- }
- }
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 100:
+ this.mTemperature = par2;
+ break;
+ case 101:
+ this.mProcessingEnergy = par2;
+ break;
+ case 102:
+ this.mSteamAmount = par2;
+ break;
+ case 103:
+ this.mWaterAmount = par2;
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
index 82710a799e..3feea9d2df 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
@@ -1,95 +1,97 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.util.Iterator;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaBoilerBase;
+
+import java.util.Iterator;
+
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class CONTAINER_SteamCondenser extends GT_ContainerMetaTile_Machine {
- public int mWaterAmount = 0;
-
- public int mSteamAmount = 0;
-
- public int mProcessingEnergy = 0;
-
- public int mTemperature = 2;
-
- private final int mSteamCapacity;
- public long mTickingTime = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).RI;
- public CONTAINER_SteamCondenser(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final int aSteamCapacity) {
- super(aInventoryPlayer, aTileEntity);
- this.mSteamCapacity = aSteamCapacity;
- }
- @Override
- public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
- this.addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
- this.addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
- this.addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
- }
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- this.mTemperature = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mTemperature;
- this.mProcessingEnergy = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
- this.mSteamAmount = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0
- : ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mSteam.amount;
- this.mWaterAmount = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0
- : ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).mFluid.amount;
- this.mTickingTime = ((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).RI;
-
- this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54
- / (((GregtechMetaBoilerBase) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
- this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (this.mSteamCapacity - 100)));
- this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / 15900));
- this.mProcessingEnergy = Math.min(14,
- Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
-
- final Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- final ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 100, this.mTemperature);
- var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
- var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
- var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
- }
- }
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
-
- @Override
- public int getSlotCount() {
- return 4;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(final int par1, final int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100:
- this.mTemperature = par2;
- break;
- case 101:
- this.mProcessingEnergy = par2;
- break;
- case 102:
- this.mSteamAmount = par2;
- break;
- case 103:
- this.mWaterAmount = par2;
- }
- }
+public class CONTAINER_SteamCondenser extends GT_ContainerMetaTile_Machine
+{
+ public CONTAINER_SteamCondenser(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aSteamCapacity)
+ {
+ super(aInventoryPlayer, aTileEntity);
+ this.mSteamCapacity = aSteamCapacity;
+ }
+
+ @Override
+public void addSlots(InventoryPlayer aInventoryPlayer)
+ {
+ addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
+ }
+
+ @Override
+public int getSlotCount()
+ {
+ return 4;
+ }
+
+ @Override
+public int getShiftClickSlotCount()
+ {
+ return 1;
+ }
+
+ public int mWaterAmount = 0;
+ public int mSteamAmount = 0;
+ public int mProcessingEnergy = 0;
+ public int mTemperature = 2;
+ private final int mSteamCapacity;
+ public long mTickingTime = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).RI;
+
+ @Override
+public void detectAndSendChanges()
+ {
+ super.detectAndSendChanges();
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ this.mTemperature = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mTemperature;
+ this.mProcessingEnergy = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
+ this.mSteamAmount = (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mSteam.amount);
+ this.mWaterAmount = (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mFluid.amount);
+ this.mTickingTime = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).RI;
+
+ this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
+ this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (this.mSteamCapacity - 100)));
+ this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / 15900));
+ this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext())
+ {
+ ICrafting var1 = (ICrafting)var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mTemperature);
+ var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
+ var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
+ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
+ }
+ }
+
+ @Override
+@SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2)
+ {
+ super.updateProgressBar(par1, par2);
+ switch (par1)
+ {
+ case 100:
+ this.mTemperature = par2; break;
+ case 101:
+ this.mProcessingEnergy = par2; break;
+ case 102:
+ this.mSteamAmount = par2; break;
+ case 103:
+ this.mWaterAmount = par2;
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java
index e3311119da..758aa55294 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DeluxeTank.java
@@ -1,6 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
@@ -8,31 +8,28 @@ import net.minecraft.util.StatCollector;
public class GUI_DeluxeTank extends GT_GUIContainerMetaTile_Machine {
- private final String mName;
+ private final String mName;
- public GUI_DeluxeTank(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aName) {
- super(new CONTAINER_DeluxeTank(aInventoryPlayer, aTileEntity), GT_Values.RES_PATH_GUI + "BasicTank.png");
- this.mName = aName;
- }
+ public GUI_DeluxeTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_DeluxeTank(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "BasicTank.png");
+ mName = aName;
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
+ fontRendererObj.drawString(mName, 8, 6, 4210752);
+ if (mContainer != null) {
+ fontRendererObj.drawString("Fuel | A | B |", 10, 20, 16448255);
+ //fontRendererObj.drawString(GT_Utility.parseNumberToString(((CONTAINER_DeluxeTank) mContainer).mContent), 10, 30, 16448255);
+ }
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2,
- 4210752);
- this.fontRendererObj.drawString(this.mName, 8, 6, 4210752);
- if (this.mContainer != null) {
- this.fontRendererObj.drawString("Fuel | A | B |", 10, 20, 16448255);
- // fontRendererObj.drawString(GT_Utility.parseNumberToString(((CONTAINER_DeluxeTank)
- // mContainer).mContent), 10, 30, 16448255);
- }
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
index 4dd1a17c91..38726f12d8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
@@ -1,73 +1,65 @@
package gtPlusPlus.xmod.gregtech.api.gui;
+
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.InventoryPlayer;
+
public class GUI_IndustrialCentrifuge extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
- private short counter = 0;
+ String mName = "";
+ private short counter = 0;
- public GUI_IndustrialCentrifuge(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aName, final String aTextureFile) {
- super(new CONTAINER_IndustrialCentrifuge(aInventoryPlayer, aTileEntity),
- CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
+ public GUI_IndustrialCentrifuge(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
+ super(new CONTAINER_IndustrialCentrifuge(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ mName = aName;
}
@Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
- if (this.counter >= 100) {
- this.counter = 0;
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 10, 8, 16448255);
+ if (counter >= 100){
+ counter = 0;
}
else {
- this.counter++;
+ counter++;
}
- if (this.mContainer != null) {
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
- }
- if ((((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- }
+ if (mContainer != null) {
+ if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 1) != 0)
+ fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
+ if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 2) != 0)
+ fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
+ if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 4) != 0)
+ fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
+ if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 8) != 0)
+ fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
+ if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 32) != 0)
+ fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 64) != 0)
+ fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- if (((CONTAINER_IndustrialCentrifuge) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_IndustrialCentrifuge) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
- this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
- this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
- }
- else {
- this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
- /*
- * if (CORE.DEBUG){ fontRendererObj.drawString(
- * "Debug Counter: "+counter, 10, 56, 16448255); }
- */
+ if (((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_IndustrialCentrifuge) mContainer).mActive == 0) {
+ fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
+ fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
+ fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
+ } else {
+ fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ /*if (CORE.DEBUG){
+ fontRendererObj.drawString("Debug Counter: "+counter, 10, 56, 16448255);
+ }*/
}
}
- }
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
index c018ca7807..1ce7bdea68 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
@@ -5,29 +5,26 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_IronBlastFurnace extends GT_GUIContainerMetaTile_Machine {
- public GUI_IronBlastFurnace(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(new CONTAINER_IronBlastFurnace(aInventoryPlayer, aTileEntity),
- CORE.RES_PATH_GUI + "IronBlastFurnace.png");
- }
+public class GUI_IronBlastFurnace
+ extends GT_GUIContainerMetaTile_Machine {
+ public GUI_IronBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new CONTAINER_IronBlastFurnace(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI+"IronBlastFurnace.png");
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null && this.mContainer.mProgressTime > 0) {
- this.drawTexturedModalRect(x + 58, y + 28, 176, 0,
- Math.max(0, Math.min(20,
- (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime * 20
- / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))),
- 11);
- }
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString("Iron Blast Furnace", 8, 4, 4210752);
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString("Iron Blast Furnace", 8, 4, 4210752);
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if ((this.mContainer != null) &&
+ (this.mContainer.mProgressTime > 0)) {
+ drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime * 20 / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))), 11);
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
index 82baddc05c..f7101e5ae4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.gui;
+
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
@@ -10,71 +11,62 @@ import net.minecraft.entity.player.InventoryPlayer;
* <p/>
* The GUI-Container I use for all my Basic Machines
* <p/>
- * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs
- * I needed to produce some dummy-classes which extend this class
+ * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs I needed to produce some dummy-classes which extend this class
*/
public class GUI_MatterFab extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
- int uuaUsed = 0;
- int uumMade = 0;
+ String mName = "";
+ int uuaUsed = 0;
+ int uumMade = 0;
- public GUI_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aName, final String aTextureFile) {
- super(new CONTAINER_MatterFab(aInventoryPlayer, aTileEntity),
- CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
+ public GUI_MatterFab(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
+ super(new CONTAINER_MatterFab(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ mName = aName;
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 10, 8, 16448255);
+
+
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (mContainer != null) {
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 1) != 0)
+ fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 2) != 0)
+ fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 4) != 0)
+ fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 8) != 0)
+ fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 16) != 0)
+ fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 32) != 0)
+ fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ if ((((CONTAINER_MatterFab) mContainer).mDisplayErrorCode & 64) != 0)
+ fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- if (this.mContainer != null) {
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
- }
- if ((((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- }
+ if (((CONTAINER_MatterFab) mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_MatterFab) mContainer).mActive == 0) {
+ fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
+ fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
+ fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
+ } else {
+ uuaUsed = ((CONTAINER_MatterFab) mContainer).mUUA_USED;
+ uumMade = ((CONTAINER_MatterFab) mContainer).mUUM_MADE;
+ fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ fontRendererObj.drawString("UU-Amplifier Used: "+uuaUsed, 10, 24, 16448255);
+ fontRendererObj.drawString("UU-Matter Fabricated: "+uumMade, 10, 32, 16448255);
+ }
+ }
+ }
+ }
- if (((CONTAINER_MatterFab) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_MatterFab) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
- this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
- this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
- }
- else {
- this.uuaUsed = ((CONTAINER_MatterFab) this.mContainer).mUUA_USED;
- this.uumMade = ((CONTAINER_MatterFab) this.mContainer).mUUM_MADE;
- this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
- this.fontRendererObj.drawString("UU-Amplifier Used: " + this.uuaUsed, 10, 24, 16448255);
- this.fontRendererObj.drawString("UU-Matter Fabricated: " + this.uumMade, 10, 32, 16448255);
- }
- }
- }
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
index a3e17e0198..c4114e70e1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -1,5 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.gui;
+
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
@@ -10,65 +11,54 @@ import net.minecraft.entity.player.InventoryPlayer;
* <p/>
* The GUI-Container I use for all my Basic Machines
* <p/>
- * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs
- * I needed to produce some dummy-classes which extend this class
+ * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs I needed to produce some dummy-classes which extend this class
*/
public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
+ String mName = "";
- public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aName, final String aTextureFile) {
- super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity),
- CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
- }
+ public GUI_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
+ super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ mName = aName;
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 10, 8, 16448255);
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
+ if (mContainer != null) {
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 1) != 0)
+ fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 2) != 0)
+ fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 4) != 0)
+ fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 8) != 0)
+ fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 16) != 0)
+ fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 32) != 0)
+ fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 64) != 0)
+ fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- if (this.mContainer != null) {
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
- }
+ if (((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_MultiMachine) mContainer).mActive == 0) {
+ fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
+ fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
+ fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
+ } else {
+ fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ }
+ }
+ }
+ }
- if (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_MultiMachine) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
- this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
- this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
- }
- else {
- this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
- }
- }
- }
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
index f422829798..d5f970870b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
@@ -5,49 +5,45 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_SafeBlock extends GT_GUIContainerMetaTile_Machine {
- // String UUID =
- // ((CONTAINER_SafeBlock)this.mContainer).ownerUUID.toString();
- boolean blockStatus = ((CONTAINER_SafeBlock) this.mContainer).blockStatus;
- // String tempPlayer;
-
- public GUI_SafeBlock(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- super(new CONTAINER_SafeBlock(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "SafeBlock.png");
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- /*
- * String UUID = ((CONTAINER_SafeBlock)this.mContainer).UUID;
- * this.fontRendererObj.drawString("Owner UUID: "+ UUID, 8, 12,
- * 4210752);
- */
-
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.updateVars();
- // this.fontRendererObj.drawString("Owner: "+ tempPlayer, 64, 72,
- // 4210752);
- // this.fontRendererObj.drawString(": "+ UUID.toLowerCase(), 44, 82,
- // 4210752);
- this.fontRendererObj.drawString("Safe Status", 76, 61, 4210752);
- if (this.blockStatus) {
- this.fontRendererObj.drawString("Locked", 88, 73, 4210752);
- }
- else {
- this.fontRendererObj.drawString("Unlocked", 82, 73, 4210752);
- }
- }
-
- private void updateVars() {
- // UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID;
- this.blockStatus = ((CONTAINER_SafeBlock) this.mContainer).blockStatus;
- // tempPlayer = PlayerCache.lookupPlayerByUUID(UUID);
- }
+public class GUI_SafeBlock
+ extends GT_GUIContainerMetaTile_Machine {
+ public GUI_SafeBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new CONTAINER_SafeBlock(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "SafeBlock.png");
+ }
+
+ //String UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID.toString();
+ boolean blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus;
+ //String tempPlayer;
+
+ private void updateVars(){
+ //UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID;
+ blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus;
+ // tempPlayer = PlayerCache.lookupPlayerByUUID(UUID);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ updateVars();
+ //this.fontRendererObj.drawString("Owner: "+ tempPlayer, 64, 72, 4210752);
+ //this.fontRendererObj.drawString(": "+ UUID.toLowerCase(), 44, 82, 4210752);
+ this.fontRendererObj.drawString("Safe Status", 76, 61, 4210752);
+ if (blockStatus){
+ this.fontRendererObj.drawString("Locked", 88, 73, 4210752);
+ }
+ else {
+ this.fontRendererObj.drawString("Unlocked", 82, 73, 4210752);
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ /*String UUID = ((CONTAINER_SafeBlock)this.mContainer).UUID;
+ this.fontRendererObj.drawString("Owner UUID: "+ UUID, 8, 12, 4210752);*/
+
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
index 3acc299ce1..7c185ebb94 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
@@ -4,41 +4,38 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_SolarGenerator extends GT_GUIContainerMetaTile_Machine {
- public GUI_SolarGenerator(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aTextureName, final int aSteamCapacity) {
- super(new CONTAINER_SolarGenerator(aInventoryPlayer, aTileEntity, aSteamCapacity),
- "gregtech:textures/gui/" + aTextureName);
- }
+public class GUI_SolarGenerator
+ extends GT_GUIContainerMetaTile_Machine {
+ public GUI_SolarGenerator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName, int aSteamCapacity) {
+ super(new CONTAINER_SolarGenerator(aInventoryPlayer, aTileEntity, aSteamCapacity), "gregtech:textures/gui/" + aTextureName);
+ }
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null) {
- int tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 70, y + 25 + 54 - tScale, 194, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SolarGenerator) this.mContainer).mEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 83, y + 25 + 54 - tScale, 204, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SolarGenerator) this.mContainer).mTemperature;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 96, y + 25 + 54 - tScale, 214, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 117, y + 44 + 14 - tScale, 177, 14 - tScale, 15, tScale + 1);
- }
- }
- }
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString("Solar Generator", 8, 4, 4210752);
+ }
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString("Solar Generator", 8, 4, 4210752);
- }
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null) {
+ int tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 70, y + 25 + 54 - tScale, 194, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SolarGenerator) this.mContainer).mEnergy;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 83, y + 25 + 54 - tScale, 204, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SolarGenerator) this.mContainer).mTemperature;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 96, y + 25 + 54 - tScale, 214, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SolarGenerator) this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 117, y + 44 + 14 - tScale, 177, 14 - tScale, 15, tScale + 1);
+ }
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
index 91fdad5742..9c4e14f0dc 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
@@ -5,48 +5,51 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.InventoryPlayer;
-public class GUI_SteamCondenser extends GT_GUIContainerMetaTile_Machine {
+public class GUI_SteamCondenser extends GT_GUIContainerMetaTile_Machine
+{
long tickTime = 0;
-
- public GUI_SteamCondenser(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final String aTextureName, final int aSteamCapacity) {
- super(new CONTAINER_SteamCondenser(aInventoryPlayer, aTileEntity, aSteamCapacity),
- CORE.RES_PATH_GUI + aTextureName);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null) {
-
- int tScale = ((CONTAINER_SteamCondenser) this.mContainer).mSteamAmount;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 70, y + 25 + 54 - tScale, 194, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SteamCondenser) this.mContainer).mWaterAmount;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 83, y + 25 + 54 - tScale, 204, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SteamCondenser) this.mContainer).mTemperature;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 96, y + 25 + 54 - tScale, 214, 54 - tScale, 10, tScale);
- }
- tScale = ((CONTAINER_SteamCondenser) this.mContainer).mProcessingEnergy;
- if (tScale > 0) {
- this.drawTexturedModalRect(x + 115, y + 44 + 2/* - tScale */, 177, 14 - tScale, 15, 1 + tScale);
- }
- }
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
- if (CORE.DEBUG) {
- this.tickTime = ((CONTAINER_SteamCondenser) this.mContainer).mTickingTime;
- this.fontRendererObj.drawString("Tick Time: " + this.tickTime, 8, 12, 4210752);
- }
- }
+
+ public GUI_SteamCondenser(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName, int aSteamCapacity)
+ {
+ super(new CONTAINER_SteamCondenser(aInventoryPlayer, aTileEntity, aSteamCapacity), CORE.RES_PATH_GUI + aTextureName);
+ }
+
+ @Override
+protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
+ if (CORE.DEBUG){
+ tickTime = ((CONTAINER_SteamCondenser)this.mContainer).mTickingTime;
+ this.fontRendererObj.drawString("Tick Time: "+tickTime, 8, 12, 4210752);
+ }
+ }
+
+ @Override
+protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null)
+ {
+
+ int tScale = ((CONTAINER_SteamCondenser)this.mContainer).mSteamAmount;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 70, y + 25 + 54 - tScale, 194, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser)this.mContainer).mWaterAmount;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 83, y + 25 + 54 - tScale, 204, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser)this.mContainer).mTemperature;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 96, y + 25 + 54 - tScale, 214, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser)this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 115, y + 44 + 2/* - tScale*/, 177, 14 - tScale, 15, 1+tScale);
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
index 6503ba0a42..3c29b34e27 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
@@ -5,35 +5,20 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public interface GregtechItemContainer {
- public ItemStack get(long aAmount, Object... aReplacements);
-
- public ItemStack getAlmostBroken(long aAmount, Object... aReplacements);
-
- public Block getBlock();
-
public Item getItem();
-
- public ItemStack getUndamaged(long aAmount, Object... aReplacements);
-
- public ItemStack getWildcard(long aAmount, Object... aReplacements);
-
- public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
-
- public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements);
-
- public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
-
- public boolean hasBeenSet();
-
+ public Block getBlock();
public boolean isStackEqual(Object aStack);
-
public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT);
-
- public GregtechItemContainer registerOre(Object... aOreNames);
-
- public GregtechItemContainer registerWildcardAsOre(Object... aOreNames);
-
+ public ItemStack get(long aAmount, Object... aReplacements);
+ public ItemStack getWildcard(long aAmount, Object... aReplacements);
+ public ItemStack getUndamaged(long aAmount, Object... aReplacements);
+ public ItemStack getAlmostBroken(long aAmount, Object... aReplacements);
+ public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements);
public GregtechItemContainer set(Item aItem);
-
public GregtechItemContainer set(ItemStack aStack);
+ public GregtechItemContainer registerOre(Object... aOreNames);
+ public GregtechItemContainer registerWildcardAsOre(Object... aOreNames);
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
+ public boolean hasBeenSet();
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 472808f9b2..62b3aa9bcc 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -5,133 +5,90 @@ import net.minecraftforge.fluids.FluidStack;
public interface IGregtech_RecipeAdder {
/**
- * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
+ * Adds a Coke Oven Recipe
*
- * @param aInput
- * = ItemStack[] (not null, and respects StackSize)
- * @param aFluidOutput
- * = Output of the UU-Matter (not null, and respects StackSize)
- * @param aChances
- * = Output Change (can be == 0)
- * @param aDuration
- * = Duration (must be >= 0)
- * @param aEUt
- * = EU needed for heating up (must be >= 0)
+ * @param aInput1 = first Input (not null, and respects StackSize)
+ * @param aInputb = second Input (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be null, and respects StackSize)
+ * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
+ //public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
+ public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
+
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+
/**
- * Adds a Coke Oven Recipe
+ * Adds a Matter Fabricator Recipe
*
- * @param aInput1
- * = first Input (not null, and respects StackSize)
- * @param aInputb
- * = second Input (can be null, and respects StackSize)
- * @param aFluidOutput
- * = Output of the Creosote (not null, and respects StackSize)
- * @param aFluidInput
- * = fluid Input (can be null, and respects StackSize)
- * @param aOutput
- * = Output of the Coal/coke (can be null, and respects
- * StackSize)
- * @param aDuration
- * = Duration (must be >= 0)
- * @param aEUt
- * = EU needed for heating up (must be >= 0)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- // public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs,
- // ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs,
- // FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
- public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput,
- FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
+ public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
/**
- * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
+ * Adds a Matter Fabricator Recipe
*
- * @param aInput
- * = Input itemstack (not null, and respects StackSize)
- * @param aFluidInput
- * = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aOutputItems
- * = Itemstack[] (not null, and respects StackSize)
- * @param aDuration
- * = Duration (must be >= 0)
- * @param aEUt
- * = EU needed for heating up (must be >= 0)
+ * @param aItemInput = ItemStack Input, can be null I assume.
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
+ public boolean addMatterFabricatorRecipe(ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+
- public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration,
- int aEUt);
- /*
- * public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack
- * aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
- */
- /*
- * public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB,
- * ItemStack[] aOutputItems, int aDuration, int aEUt); public boolean
- * addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack
- * aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration,
- * int aEUt);
- */
/**
* Adds a Recipe for the Dehydrator. (up to 9 Outputs)
*
- * @param aInput
- * = ItemStack[] (not null, and respects StackSize)
- * @param aFluidInput
- * = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aFluidOutput
- * = Output of the UU-Matter (not null, and respects StackSize)
- * @param aOutputItems
- * = ItemStack[] (not null, and respects StackSize)
- * @param aChances
- * = Output Change (can be == 0)
- * @param aDuration
- * = Duration (must be >= 0)
- * @param aEUt
- * = EU needed for heating up (must be >= 0)
+ * @param aInput = Input itemstack (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aOutputItems = Itemstack[] (not null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput,
- ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt);
- public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+ public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ /*public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);*/
+ /*public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt);*/
/**
- * Adds a Matter Fabricator Recipe
+ * Adds a Recipe for the Dehydrator. (up to 9 Outputs)
*
- * @param aFluidOutput
- * = Output of the UU-Matter (not null, and respects StackSize)
- * @param aFluidInput
- * = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aDuration
- * = Duration (must be >= 0)
- * @param aEUt
- * = EU needed for heating up (must be >= 0)
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aOutputItems = ItemStack[] (not null, and respects StackSize)
+ * @param aChances = Output Change (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt);
+
/**
- * Adds a Matter Fabricator Recipe
+ * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs)
*
- * @param aItemInput
- * = ItemStack Input, can be null I assume.
- * @param aFluidInput
- * = fluid Input (can be UU_Amp or null, and respects StackSize)
- * @param aFluidOutput
- * = Output of the UU-Matter (not null, and respects StackSize)
- * @param aDuration
- * = Duration (must be >= 0)
- * @param aEUt
- * = EU needed for heating up (must be >= 0)
+ * @param aInput = ItemStack[] (not null, and respects StackSize)
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aChances = Output Change (can be == 0)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
* @return true if the Recipe got added, otherwise false.
*/
- public boolean addMatterFabricatorRecipe(ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput,
- int aDuration, int aEUt);
+ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
index b6c36483af..8e1715caf5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
@@ -4,18 +4,18 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
public interface Interface_IconContainer {
- /**
- * @return A regular Icon.
- */
- public IIcon getIcon();
+ /**
+ * @return A regular Icon.
+ */
+ public IIcon getIcon();
- /**
- * @return Icon of the Overlay (or null if there is no Icon)
- */
- public IIcon getOverlayIcon();
+ /**
+ * @return Icon of the Overlay (or null if there is no Icon)
+ */
+ public IIcon getOverlayIcon();
- /**
- * @return the Default Texture File for this Icon.
- */
- public ResourceLocation getTextureFile();
+ /**
+ * @return the Default Texture File for this Icon.
+ */
+ public ResourceLocation getTextureFile();
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
index 31a97604e7..03f7b1bd1e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
@@ -1,9 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
-import java.util.List;
-
import gregtech.api.enums.SubTag;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
+
+import java.util.List;
+
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -14,31 +15,27 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface Interface_ItemBehaviour<E extends Item> {
- public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+ public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
- public List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
+ public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
- public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX,
- double aY, double aZ);
+ public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
- public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld,
- EntityLivingBase aEntity, float aSpeed);
+ public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
- public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack);
+ public List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
- public boolean isItemStackUsable(E aItem, ItemStack aStack);
+ public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
- public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+ public boolean isItemStackUsable(E aItem, ItemStack aStack);
- public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
+ public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
- public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ,
- int aSide, float hitX, float hitY, float hitZ);
+ public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
- public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ,
- int aSide, float hitX, float hitY, float hitZ);
+ public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack);
- public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ);
- public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
index 99348d1900..d4e37ee476 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
@@ -6,21 +6,14 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import net.minecraft.item.ItemStack;
public interface Interface_OreRecipeRegistrator {
- /**
- * Contains a Code Fragment, used in the OrePrefix to register Recipes.
- * Better than using a switch/case, like I did before.
- *
- * @param aPrefix
- * always != null
- * @param aMaterial
- * always != null, and can be == _NULL if the Prefix is Self
- * Referencing or not Material based!
- * @param aStack
- * always != null
- */
- public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName,
- ItemStack aStack);
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
- public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName,
- ItemStack copyAmount);
+ public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack copyAmount);
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
index 8a06d5ae7a..ed276ad3f9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
@@ -5,18 +5,12 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import net.minecraft.item.ItemStack;
public interface Interface_OreRecipeRegistrator_GT {
- /**
- * Contains a Code Fragment, used in the OrePrefix to register Recipes.
- * Better than using a switch/case, like I did before.
- *
- * @param aPrefix
- * always != null
- * @param aMaterial
- * always != null, and can be == _NULL if the Prefix is Self
- * Referencing or not Material based!
- * @param aStack
- * always != null
- */
- public void registerOre(OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName,
- ItemStack aStack);
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
index f0845eb751..76c5113186 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
@@ -4,17 +4,17 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
public interface Interface_Texture {
- public boolean isValidTexture();
+ public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
- public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+ public boolean isValidTexture();
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
index 41e9d7f640..26b8dc1d3d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
@@ -1,11 +1,12 @@
package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
-import java.util.List;
-
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.IToolStats;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -18,193 +19,144 @@ import net.minecraftforge.event.world.BlockEvent;
/**
* The Stats for GT Tools. Not including any Material Modifiers.
* <p/>
- * And this is supposed to not have any ItemStack Parameters as these are
- * generic Stats.
+ * And this is supposed to not have any ItemStack Parameters as these are generic Stats.
*/
-public interface Interface_ToolStats extends IToolStats {
+public interface Interface_ToolStats extends IToolStats{
/**
- * @return If this Tool can be used for blocking Damage like a Sword.
+ * Called when aPlayer crafts this Tool
*/
- @Override
- public boolean canBlock();
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
/**
- * This lets you modify the Drop List, when this type of Tool has been used.
- *
- * @return the Amount of modified Items.
+ * Called when this gets added to a Tool Item
*/
- @Override
- public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX,
- int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
+ public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
/**
- * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is
- * normal punch.
+ * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
*/
- @Override
- public float getBaseDamage();
+ public int getToolDamagePerBlockBreak();
/**
- * @return Basic Quality of the Tool, 0 is normal. If increased, it will
- * increase the general quality of all Tools of this Type.
- * Decreasing is also possible.
+ * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
*/
- @Override
- public int getBaseQuality();
-
- @Override
- public String getBreakingSound();
+ public int getToolDamagePerDropConversion();
/**
- * @return Returns a broken Version of the Item.
+ * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal.
*/
- @Override
- public ItemStack getBrokenItem(ItemStack aStack);
-
- @Override
- public String getCraftingSound();
-
- @Override
- public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+ public int getToolDamagePerContainerCraft();
- @Override
- public int[] getEnchantmentLevels(ItemStack aStack);
+ /**
+ * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
+ */
+ public int getToolDamagePerEntityAttack();
- @Override
- public Enchantment[] getEnchantments(ItemStack aStack);
+ /**
+ * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible.
+ */
+ public int getBaseQuality();
- @Override
- public String getEntityHitSound();
+ /**
+ * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
+ */
+ public float getBaseDamage();
/**
- * @return This gets the Hurt Resistance time for Entities getting hit.
- * (always does 1 as minimum)
+ * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
*/
- @Override
public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
- @Override
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
-
/**
- * @return the Damage actually done to the Mob.
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
*/
- @Override
- public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack,
- EntityPlayer aPlayer);
+ public float getSpeedMultiplier();
/**
- * @return This is a multiplier for the Tool Speed. 1.0F = no special
- * Durability.
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
*/
- @Override
public float getMaxDurabilityMultiplier();
- @Override
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+
public String getMiningSound();
- /**
- * @return the Damage actually done to the Mob.
- */
- @Override
- public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack,
- EntityPlayer aPlayer);
+ public String getCraftingSound();
- @Override
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+ public String getEntityHitSound();
+
+ public String getBreakingSound();
+
+ public Enchantment[] getEnchantments(ItemStack aStack);
+
+ public int[] getEnchantmentLevels(ItemStack aStack);
/**
- * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
+ * @return If this Tool can be used for blocking Damage like a Sword.
*/
- @Override
- public float getSpeedMultiplier();
+ public boolean canBlock();
/**
- * @return Damage the Tool receives when breaking a Block. 100 is one Damage
- * Point (or 100 EU).
+ * @return If this Tool can be used as an RC Crowbar.
*/
- @Override
- public int getToolDamagePerBlockBreak();
+ public boolean isCrowbar();
/**
- * @return Damage the Tool receives when being used as Container Item. 100
- * is one use, however it is usually 8 times more than normal.
+ * @return If this Tool can be used as an BC Wrench.
*/
- @Override
- public int getToolDamagePerContainerCraft();
+ public boolean isWrench();
/**
- * @return Damage the Tool receives when converting the drops of a Block.
- * 100 is one Damage Point (or 100 EU).
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
*/
- @Override
- public int getToolDamagePerDropConversion();
+ public boolean isWeapon();
/**
- * @return Damage the Tool receives when being used as Weapon, 200 is the
- * normal Value, 100 for actual Weapons.
+ * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something
*/
- @Override
- public int getToolDamagePerEntityAttack();
+ public boolean isRangedWeapon();
/**
- * @return If this Tool can be used as an RC Crowbar.
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
*/
- @Override
- public boolean isCrowbar();
+ public boolean isMiningTool();
/**
- * aBlock.getHarvestTool(aMetaData) can return the following Values for
- * example. "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw",
- * "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop",
- * "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch"
+ * aBlock.getHarvestTool(aMetaData) can return the following Values for example.
+ * "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch"
*
- * @return If this is a minable Block. Tool Quality checks (like Diamond
- * Tier or something) are separate from this check.
+ * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check.
*/
- @Override
public boolean isMinableBlock(Block aBlock, byte aMetaData);
/**
- * @return If this Tool can be used as Weapon i.e. if that is the main
- * purpose.
+ * This lets you modify the Drop List, when this type of Tool has been used.
+ *
+ * @return the Amount of modified Items.
*/
- @Override
- public boolean isMiningTool();
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
/**
- * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless
- * you have a Blade attached to your Bow/Gun or something
+ * @return Returns a broken Version of the Item.
*/
- @Override
- public boolean isRangedWeapon();
+ public ItemStack getBrokenItem(ItemStack aStack);
/**
- * @return If this Tool can be used as Weapon i.e. if that is the main
- * purpose.
+ * @return the Damage actually done to the Mob.
*/
- @Override
- public boolean isWeapon();
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
/**
- * @return If this Tool can be used as an BC Wrench.
+ * @return the Damage actually done to the Mob.
*/
- public boolean isWrench();
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
- /**
- * Called when this gets added to a Tool Item
- */
- public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+
/**
* Called when this gets added to a Tool Item
*/
- @Override
public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID);
-
- /**
- * Called when aPlayer crafts this Tool
- */
- @Override
- public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
index 91af8e3297..1c135a7f92 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
@@ -1,19 +1,22 @@
package gtPlusPlus.xmod.gregtech.api.items;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.SubTag;
import gregtech.api.interfaces.IProjectileItem;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+
import net.minecraft.block.BlockDispenser;
import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.dispenser.*;
+import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
+import net.minecraft.dispenser.BehaviorProjectileDispense;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.dispenser.IPosition;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
@@ -23,173 +26,161 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/**
- * Extended by most Items, also used as a fallback Item, to prevent the
- * accidental deletion when Errors occur.
+ * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur.
*/
public class Gregtech_Generic_Item extends Item implements IProjectileItem {
- public static class GT_Item_Dispense extends BehaviorProjectileDispense {
- @Override
- public ItemStack dispenseStack(final IBlockSource aSource, final ItemStack aStack) {
- return ((Gregtech_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
- }
-
- @Override
- protected IProjectile getProjectileEntity(final World aWorld, final IPosition aPosition) {
- return null;
- }
- }
- private final String mName, mTooltip;
-
- protected IIcon mIcon;
-
- public Gregtech_Generic_Item(final String aUnlocalized, final String aEnglish, final String aEnglishTooltip) {
- this(aUnlocalized, aEnglish, aEnglishTooltip, true);
- }
-
- public Gregtech_Generic_Item(final String aUnlocalized, final String aEnglish, final String aEnglishTooltip,
- final boolean aWriteToolTipIntoLangFile) {
- super();
- this.mName = aUnlocalized;
- GT_LanguageManager.addStringLocalization(this.mName + ".name", aEnglish);
- if (GT_Utility.isStringValid(aEnglishTooltip)) {
- GT_LanguageManager.addStringLocalization(this.mTooltip = this.mName + ".tooltip_main", aEnglishTooltip,
- aWriteToolTipIntoLangFile);
- }
- else {
- this.mTooltip = null;
- }
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerItem(this, this.mName, CORE.MODID);
- BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
- }
-
- protected void addAdditionalToolTips(final List aList, final ItemStack aStack) {
- //
- }
-
- @Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList,
- final boolean aF3_H) {
- if (this.getMaxDamage() > 0 && !this.getHasSubtypes()) {
- aList.add(aStack.getMaxDamage() - this.getDamage(aStack) + " / " + aStack.getMaxDamage());
- }
- if (this.mTooltip != null) {
- aList.add(GT_LanguageManager.getTranslation(this.mTooltip));
- }
- if (GT_ModHandler.isElectricItem(aStack)) {
- aList.add("Tier: " + this.getTier(aStack));
- }
- this.addAdditionalToolTips(aList, aStack);
- }
-
- @Override
- public boolean doesSneakBypassUse(final World aWorld, final int aX, final int aY, final int aZ,
- final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")) {
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")) {
+ private final String mName, mTooltip;
+ protected IIcon mIcon;
+
+ public Gregtech_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip) {
+ this(aUnlocalized, aEnglish, aEnglishTooltip, true);
+ }
+
+ public Gregtech_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, boolean aWriteToolTipIntoLangFile) {
+ super();
+ mName = aUnlocalized;
+ GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish);
+ if (GT_Utility.isStringValid(aEnglishTooltip))
+ GT_LanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
+ else mTooltip = null;
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerItem(this, mName, CORE.MODID);
+ BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
+ }
+
+ @Override
+ public final Item setUnlocalizedName(String aName) {
+ return this;
+ }
+
+ @Override
+ public final String getUnlocalizedName() {
+ return mName;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack aStack) {
+ return getHasSubtypes() ? mName + "." + getDamage(aStack) : mName;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aIconRegister) {
+ mIcon = aIconRegister.registerIcon(CORE.MODID+":"+mName);
+ }
+
+ @Override
+ public boolean doesSneakBypassUse(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int par1) {
+ return mIcon;
+ }
+
+ public int getTier(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ if (getMaxDamage() > 0 && !getHasSubtypes())
+ aList.add((aStack.getMaxDamage() - getDamage(aStack)) + " / " + aStack.getMaxDamage());
+ if (mTooltip != null) aList.add(GT_LanguageManager.getTranslation(mTooltip));
+ if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack));
+ addAdditionalToolTips(aList, aStack);
+ }
+
+ protected void addAdditionalToolTips(List aList, ItemStack aStack) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ isItemStackUsable(aStack);
+ }
+
+ public boolean isItemStackUsable(ItemStack aStack) {
+ return true;
+ }
+
+ public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
+ EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
+ IPosition iposition = BlockDispenser.func_149939_a(aSource);
+ ItemStack itemstack1 = aStack.splitStack(1);
+ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
+ return aStack;
+ }
+
+ @Override
+ 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) {
+ return null;
+ }
+
+ @Override
+ public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public boolean hasContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack) != null;
+ }
+
+ public static class GT_Item_Dispense extends BehaviorProjectileDispense {
+ @Override
+ public ItemStack dispenseStack(IBlockSource aSource, ItemStack aStack) {
+ return ((Gregtech_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
+ }
+
+ @Override
+ protected IProjectile getProjectileEntity(World aWorld, IPosition aPosition) {
+ return null;
+ }
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
HEX_OxFFFFFF = 0xace600;
}
- else if (stack.getDisplayName().contains("UV")) {
+ else if (stack.getDisplayName().contains("UV")){
HEX_OxFFFFFF = 0xffff00;
}
- else if (stack.getDisplayName().contains("MAX")) {
+ else if (stack.getDisplayName().contains("MAX")){
HEX_OxFFFFFF = 0xff0000;
}
- else if (stack.getDisplayName().contains("Sodium")) {
+ else if (stack.getDisplayName().contains("Sodium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
}
- else if (stack.getDisplayName().contains("Cadmium")) {
+ else if (stack.getDisplayName().contains("Cadmium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
}
- else if (stack.getDisplayName().contains("Lithium")) {
+ else if (stack.getDisplayName().contains("Lithium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
}
else {
HEX_OxFFFFFF = 0xffffff;
- }
+ }
return HEX_OxFFFFFF;
}
-
- @Override
- public ItemStack getContainerItem(final ItemStack aStack) {
- return null;
- }
-
- @Override
- public IIcon getIconFromDamage(final int par1) {
- return this.mIcon;
- }
-
- @Override
- public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld,
- final double aX, final double aY, final double aZ) {
- return null;
- }
-
- @Override
- public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld,
- final EntityLivingBase aEntity, final float aSpeed) {
- return null;
- }
-
- public int getTier(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public final String getUnlocalizedName() {
- return this.mName;
- }
-
- @Override
- public String getUnlocalizedName(final ItemStack aStack) {
- return this.getHasSubtypes() ? this.mName + "." + this.getDamage(aStack) : this.mName;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack aStack) {
- return this.getContainerItem(aStack) != null;
- }
-
- @Override
- public boolean hasProjectile(final SubTag aProjectileType, final ItemStack aStack) {
- return false;
- }
-
- public boolean isItemStackUsable(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- this.isItemStackUsable(aStack);
- }
-
- public ItemStack onDispense(final IBlockSource aSource, final ItemStack aStack) {
- final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
- final IPosition iposition = BlockDispenser.func_149939_a(aSource);
- final ItemStack itemstack1 = aStack.splitStack(1);
- BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
- return aStack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister aIconRegister) {
- this.mIcon = aIconRegister.registerIcon(CORE.MODID + ":" + this.mName);
- }
-
- @Override
- public final Item setUnlocalizedName(final String aName) {
- return this;
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
index 1161badfdc..484cc19ea7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
@@ -1,376 +1,323 @@
package gtPlusPlus.xmod.gregtech.api.items;
-import java.util.*;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
+import static gregtech.api.enums.GT_Values.D1;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.SubTag;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
-import gregtech.api.interfaces.*;
+import gregtech.api.interfaces.IFoodStat;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.IItemContainer;
import gregtech.api.objects.ItemData;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.List;
+
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base {
- /**
- * 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.
- * <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as
- * Key if you want to get a specific Item.
- */
- public static final HashMap<String, Gregtech_MetaItem> sInstances = new HashMap<String, Gregtech_MetaItem>();
+ /**
+ * 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.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final HashMap<String, Gregtech_MetaItem> sInstances = new HashMap<String, Gregtech_MetaItem>();
/* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- public final short mOffset, mItemAmount;
- public final BitSet mEnabledItems;
- public final BitSet mVisibleItems;
- public final IIcon[][] mIconList;
+ public final short mOffset, mItemAmount;
+ public final BitSet mEnabledItems;
+ public final BitSet mVisibleItems;
+ public final IIcon[][] mIconList;
- public final HashMap<Short, IFoodStat> mFoodStats = new HashMap<Short, IFoodStat>();
- public final HashMap<Short, Long[]> mElectricStats = new HashMap<Short, Long[]>();
- public final HashMap<Short, Long[]> mFluidContainerStats = new HashMap<Short, Long[]>();
- public final HashMap<Short, Short> mBurnValues = new HashMap<Short, Short>();
+ public final HashMap<Short, IFoodStat> mFoodStats = new HashMap<Short, IFoodStat>();
+ public final HashMap<Short, Long[]> mElectricStats = new HashMap<Short, Long[]>();
+ public final HashMap<Short, Long[]> mFluidContainerStats = new HashMap<Short, Long[]>();
+ public final HashMap<Short, Short> mBurnValues = new HashMap<Short, Short>();
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized
- * The Unlocalized Name of this Item.
- */
- public Gregtech_MetaItem(final String aUnlocalized, final short aOffset, final short aItemAmount) {
- super(aUnlocalized);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- this.mEnabledItems = new BitSet(aItemAmount);
- this.mVisibleItems = new BitSet(aItemAmount);
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaItem(String aUnlocalized, short aOffset, short aItemAmount) {
+ super(aUnlocalized);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ mEnabledItems = new BitSet(aItemAmount);
+ mVisibleItems = new BitSet(aItemAmount);
- this.mOffset = (short) Math.min(32766, aOffset);
- this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
- this.mIconList = new IIcon[aItemAmount][1];
+ mOffset = (short) Math.min(32766, aOffset);
+ mItemAmount = (short) Math.min(aItemAmount, 32766 - mOffset);
+ mIconList = new IIcon[aItemAmount][1];
- Gregtech_MetaItem.sInstances.put(this.getUnlocalizedName(), this);
- }
+ sInstances.put(getUnlocalizedName(), this);
+ }
- /**
- * This adds a Custom Item to the ending Range.
- *
- * @param aID
- * The Id of the assigned Item [0 - mItemAmount] (The MetaData
- * gets auto-shifted by +mOffset)
- * @param aEnglish
- * The Default Localized Name of the created Item
- * @param aToolTip
- * The Default ToolTip of the created Item, you can also insert
- * null for having no ToolTip
- * @param aFoodBehavior
- * The Food Value of this Item. Can be null aswell. Just a
- * convenience thing.
- * @param aRandomData
- * The OreDict Names you want to give the Item. Also used for TC
- * Aspects and some other things.
- * @return An ItemStack containing the newly created Item.
- */
- public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
- if (aToolTip == null) {
- aToolTip = "";
- }
- if (aID >= 0 && aID < this.mItemAmount) {
- final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
- this.mEnabledItems.set(aID);
- this.mVisibleItems.set(aID);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
- final List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
- // Important Stuff to do first
- for (final Object tRandomData : aRandomData) {
- if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.INVISIBLE) {
- this.mVisibleItems.set(aID, false);
- continue;
- }
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- continue;
- }
- }
- }
- // now check for the rest
- for (final Object tRandomData : aRandomData) {
- if (tRandomData != null) {
- boolean tUseOreDict = true;
-
- if (tRandomData instanceof Interface_ItemBehaviour) {
- this.addItemBehavior(this.mOffset + aID,
- (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) tRandomData);
- tUseOreDict = false;
- }
- if (tRandomData instanceof IItemContainer) {
- ((IItemContainer) tRandomData).set(rStack);
- tUseOreDict = false;
- }
- if (tRandomData instanceof SubTag) {
- continue;
- }
- if (tRandomData instanceof TC_AspectStack) {
- ((TC_AspectStack) tRandomData).addToAspectList(tAspects);
- continue;
- }
- if (tRandomData instanceof ItemData) {
- if (GT_Utility.isStringValid(tRandomData)) {
- GT_OreDictUnificator.registerOre(tRandomData, rStack);
- }
- else {
- GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData);
- }
- continue;
- }
- if (tUseOreDict) {
- GT_OreDictUnificator.registerOre(tRandomData, rStack);
- continue;
- }
- }
- }
- if (GregTech_API.sThaumcraftCompat != null) {
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
- }
- return rStack;
- }
- return null;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")) {
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")) {
- HEX_OxFFFFFF = 0xace600;
- }
- else if (stack.getDisplayName().contains("UV")) {
- HEX_OxFFFFFF = 0xffff00;
- }
- else if (stack.getDisplayName().contains("MAX")) {
- HEX_OxFFFFFF = 0xff0000;
- }
- else {
- HEX_OxFFFFFF = 0xffffff;
- }
- return HEX_OxFFFFFF;
- }
+ /**
+ * This adds a Custom Item to the ending Range.
+ *
+ * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset)
+ * @param aEnglish The Default Localized Name of the created Item
+ * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
+ * @param aFoodBehavior The Food Value of this Item. Can be null aswell. Just a convenience thing.
+ * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things.
+ * @return An ItemStack containing the newly created Item.
+ */
+ public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) {
+ if (aToolTip == null) aToolTip = "";
+ if (aID >= 0 && aID < mItemAmount) {
+ ItemStack rStack = new ItemStack(this, 1, mOffset + aID);
+ mEnabledItems.set(aID);
+ mVisibleItems.set(aID);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip);
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ // Important Stuff to do first
+ for (Object tRandomData : aRandomData)
+ if (tRandomData instanceof SubTag) {
+ if (tRandomData == SubTag.INVISIBLE) {
+ mVisibleItems.set(aID, false);
+ continue;
+ }
+ if (tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
+ continue;
+ }
+ }
+ // now check for the rest
+ for (Object tRandomData : aRandomData)
+ if (tRandomData != null) {
+ boolean tUseOreDict = true;
+
+ if (tRandomData instanceof Interface_ItemBehaviour) {
+ addItemBehavior(mOffset + aID, (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) tRandomData);
+ tUseOreDict = false;
+ }
+ if (tRandomData instanceof IItemContainer) {
+ ((IItemContainer) tRandomData).set(rStack);
+ tUseOreDict = false;
+ }
+ if (tRandomData instanceof SubTag) {
+ continue;
+ }
+ if (tRandomData instanceof TC_AspectStack) {
+ ((TC_AspectStack) tRandomData).addToAspectList(tAspects);
+ continue;
+ }
+ if (tRandomData instanceof ItemData) {
+ if (GT_Utility.isStringValid(tRandomData))
+ GT_OreDictUnificator.registerOre(tRandomData, rStack);
+ else GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData);
+ continue;
+ }
+ if (tUseOreDict) {
+ GT_OreDictUnificator.registerOre(tRandomData, rStack);
+ continue;
+ }
+ }
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
+ return rStack;
+ }
+ return null;
+ }
- @Override
- public final Long[] getElectricStats(final ItemStack aStack) {
- return this.mElectricStats.get((short) aStack.getItemDamage());
- }
+ /**
+ * Sets the Furnace Burn Value for the Item.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aValue 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem setBurnValue(int aMetaValue, int aValue) {
+ if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length() || aValue < 0) return this;
+ if (aValue == 0) mBurnValues.remove((short) aMetaValue);
+ else mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue);
+ return this;
+ }
- @Override
- public final Long[] getFluidContainerStats(final ItemStack aStack) {
- return this.mFluidContainerStats.get((short) aStack.getItemDamage());
- }
+ /**
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior)
+ * @param aTransferLimit Transfer Limit.
+ * @param aTier The electric Tier.
+ * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0).
+ * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this)
+ * Use -2 if you want to make this Battery dischargeable.
+ * Use -3 if you want to make this Battery charge/discharge-able.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem 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});
+ if (aMetaValue >= mOffset && aUseAnimations)
+ mIconList[aMetaValue - mOffset] = Arrays.copyOf(mIconList[aMetaValue - mOffset], Math.max(9, mIconList[aMetaValue - mOffset].length));
+ }
+ return this;
+ }
- /**
- * @return the Icon the Material is going to be rendered with.
- */
- public IIconContainer getIconContainer(final int aMetaData) {
- return null;
- }
+ /**
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior)
+ * @param aTransferLimit Transfer Limit.
+ * @param aTier The electric Tier.
+ * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0).
+ * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this)
+ * Use -2 if you want to make this Battery dischargeable.
+ * Use -3 if you want to make this Battery charge/discharge-able.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem 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)});
+ return this;
+ }
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
+ /**
+ * @return if this MetaGenerated Item should use my Default Renderer System.
+ */
+ public boolean useStandardMetaItemRenderer() {
+ return true;
+ }
- @Override
- public int getItemEnchantability() {
- return 0;
- }
+ /**
+ * @return the Color Modulation the Material is going to be rendered with.
+ */
+ public short[] getRGBa(ItemStack aStack) {
+ return Materials._NULL.getRGBA();
+ }
+ /**
+ * @return the Icon the Material is going to be rendered with.
+ */
+ public IIconContainer getIconContainer(int aMetaData) {
+ return null;
+ }
+
/* ---------- INTERNAL OVERRIDES ---------- */
- @Override
- public EnumAction getItemUseAction(final ItemStack aStack) {
- return EnumAction.none;
- }
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
- @Override
- public int getMaxItemUseDuration(final ItemStack aStack) {
- return this.mFoodStats.get((short) this.getDamage(aStack)) == null ? 0 : 32;
- }
+ @Override
+ public int getMaxItemUseDuration(ItemStack aStack) {
+ return mFoodStats.get((short) getDamage(aStack)) == null ? 0 : 32;
+ }
- /**
- * @return the Color Modulation the Material is going to be rendered with.
- */
- public short[] getRGBa(final ItemStack aStack) {
- return Materials._NULL.getRGBA();
- }
+ @Override
+ public EnumAction getItemUseAction(ItemStack aStack) {
+ return EnumAction.none;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
- if (this.mVisibleItems.get(i) || GT_Values.D1 && this.mEnabledItems.get(i)) {
- final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
- if (tStats != null && tStats[3] < 0) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.setCharge(tStack, Math.abs(tStats[0]));
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- if (tStats == null || tStats[3] != -2) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- }
- }
+ @Override
+ public final ItemStack onEaten(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IFoodStat tStat = mFoodStats.get((short) getDamage(aStack));
+ if (tStat != null) {
+
+ }
+ return aStack;
+ }
- @Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0, j = mEnabledItems.length(); i < j; i++)
+ if (mVisibleItems.get(i) || (D1 && mEnabledItems.get(i))) {
+ Long[] tStats = mElectricStats.get((short) (mOffset + i));
+ if (tStats != null && tStats[3] < 0) {
+ ItemStack tStack = new ItemStack(this, 1, mOffset + i);
+ setCharge(tStack, Math.abs(tStats[0]));
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ if (tStats == null || tStats[3] != -2) {
+ ItemStack tStack = new ItemStack(this, 1, mOffset + i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ }
- @Override
- public final ItemStack onEaten(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IFoodStat tStat = this.mFoodStats.get((short) this.getDamage(aStack));
- if (tStat != null) {
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(IIconRegister aIconRegister) {
+ for (short i = 0, j = (short) mEnabledItems.length(); i < j; i++)
+ if (mEnabledItems.get(i)) {
+ for (byte k = 1; k < mIconList[i].length; k++) {
+ mIconList[i][k] = aIconRegister.registerIcon(CORE.MODID+":"+getUnlocalizedName() + "/" + i + "/" + k);
+ }
+ mIconList[i][0] = aIconRegister.registerIcon(CORE.MODID+":"+getUnlocalizedName() + "/" + i);
+ }
+ }
- }
- return aStack;
- }
+ @Override
+ public final Long[] getElectricStats(ItemStack aStack) {
+ return mElectricStats.get((short) aStack.getItemDamage());
+ }
- @Override
- public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
+ @Override
+ public final Long[] getFluidContainerStats(ItemStack aStack) {
+ return mFluidContainerStats.get((short) aStack.getItemDamage());
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(final IIconRegister aIconRegister) {
- for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
- if (this.mEnabledItems.get(i)) {
- for (byte k = 1; k < this.mIconList[i].length; k++) {
- this.mIconList[i][k] = aIconRegister
- .registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i + "/" + k);
- }
- this.mIconList[i][0] = aIconRegister
- .registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i);
- }
- }
- }
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
- /**
- * Sets the Furnace Burn Value for the Item.
- *
- * @param aMetaValue
- * the Meta Value of the Item you want to set it to. [0 - 32765]
- * @param aValue
- * 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5
- * EU)
- * @return the Item itself for convenience in constructing.
- */
- public final Gregtech_MetaItem setBurnValue(final int aMetaValue, final int aValue) {
- if (aMetaValue < 0 || aMetaValue >= this.mOffset + this.mEnabledItems.length() || aValue < 0) {
- return this;
- }
- if (aValue == 0) {
- this.mBurnValues.remove((short) aMetaValue);
- }
- else {
- this.mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue);
- }
- return this;
- }
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
- /**
- * @param aMetaValue
- * the Meta Value of the Item you want to set it to. [0 - 32765]
- * @param aMaxCharge
- * Maximum Charge. (if this is == 0 it will remove the Electric
- * Behavior)
- * @param aTransferLimit
- * Transfer Limit.
- * @param aTier
- * The electric Tier.
- * @param aSpecialData
- * If this Item has a Fixed Charge, like a SingleUse Battery (if
- * > 0). Use -1 if you want to make this Battery chargeable (the
- * use and canUse Functions will still discharge if you just use
- * this) Use -2 if you want to make this Battery dischargeable.
- * Use -3 if you want to make this Battery charge/discharge-able.
- * @return the Item itself for convenience in constructing.
- */
- public final Gregtech_MetaItem setElectricStats(final int aMetaValue, final long aMaxCharge,
- final long aTransferLimit, final long aTier, final long aSpecialData, final boolean aUseAnimations) {
- if (aMetaValue < 0 || aMetaValue >= this.mOffset + this.mEnabledItems.length()) {
- return this;
- }
- if (aMaxCharge == 0) {
- this.mElectricStats.remove((short) aMetaValue);
- }
- else {
- this.mElectricStats.put((short) aMetaValue, new Long[] {
- aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData
- });
- if (aMetaValue >= this.mOffset && aUseAnimations) {
- this.mIconList[aMetaValue - this.mOffset] = Arrays.copyOf(this.mIconList[aMetaValue - this.mOffset],
- Math.max(9, this.mIconList[aMetaValue - this.mOffset].length));
- }
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
+ HEX_OxFFFFFF = 0xace600;
}
- return this;
- }
-
- /**
- * @param aMetaValue
- * the Meta Value of the Item you want to set it to. [0 - 32765]
- * @param aMaxCharge
- * Maximum Charge. (if this is == 0 it will remove the Electric
- * Behavior)
- * @param aTransferLimit
- * Transfer Limit.
- * @param aTier
- * The electric Tier.
- * @param aSpecialData
- * If this Item has a Fixed Charge, like a SingleUse Battery (if
- * > 0). Use -1 if you want to make this Battery chargeable (the
- * use and canUse Functions will still discharge if you just use
- * this) Use -2 if you want to make this Battery dischargeable.
- * Use -3 if you want to make this Battery charge/discharge-able.
- * @return the Item itself for convenience in constructing.
- */
- public final Gregtech_MetaItem setFluidContainerStats(final int aMetaValue, final long aCapacity,
- final long aStacksize) {
- if (aMetaValue < 0 || aMetaValue >= this.mOffset + this.mEnabledItems.length()) {
- return this;
+ else if (stack.getDisplayName().contains("UV")){
+ HEX_OxFFFFFF = 0xffff00;
}
- if (aCapacity < 0) {
- this.mElectricStats.remove((short) aMetaValue);
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
}
else {
- this.mFluidContainerStats.put((short) aMetaValue, new Long[] {
- aCapacity, Math.max(1, aStacksize)
- });
- }
- return this;
- }
-
- /**
- * @return if this MetaGenerated Item should use my Default Renderer System.
- */
- public boolean useStandardMetaItemRenderer() {
- return true;
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
index cc0fa5cd5d..5f0e677d9b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
@@ -1,13 +1,23 @@
package gtPlusPlus.xmod.gregtech.api.items;
-import java.util.*;
-
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.SubTag;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
-import ic2.api.item.*;
+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.HashMap;
+import java.util.List;
+
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -22,705 +32,528 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
-public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item
- implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> mItemBehaviors = new HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized
- * The Unlocalized Name of this Item.
- * @param aGeneratedPrefixList
- * The OreDict Prefixes you want to have generated.
- */
- public Gregtech_MetaItem_Base(final String aUnlocalized) {
- super(aUnlocalized, "Generated Item", null, false);
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- }
-
- @Override
- public final void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList,
- final boolean aF3_H) {
- final String tKey = this.getUnlocalizedName(aStack) + ".tooltip",
- tString = GT_LanguageManager.getTranslation(tKey);
- if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) {
- aList.add(tString);
- }
-
- Long[] tStats = this.getElectricStats(aStack);
- if (tStats != null) {
- if (tStats[3] > 0) {
- aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: "
- + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY);
- }
- else {
- final long tCharge = this.getRealCharge(aStack);
- if (tStats[3] == -2 && tCharge <= 0) {
- aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly."
- + EnumChatFormatting.GRAY);
- }
- else {
- aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / "
- + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: "
- + GT_Values.V[(int) (tStats[2] >= 0
- ? tStats[2] < GT_Values.V.length ? tStats[2] : GT_Values.V.length - 1 : 1)]
- + EnumChatFormatting.GRAY);
- }
- }
- }
-
- tStats = this.getFluidContainerStats(aStack);
- if (tStats != null && tStats[0] > 0) {
- final FluidStack tFluid = this.getFluidContent(aStack);
- aList.add(EnumChatFormatting.BLUE
- + (tFluid == null ? "No Fluids Contained" : GT_Utility.getFluidName(tFluid, true))
- + EnumChatFormatting.GRAY);
- aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? 0 : tFluid.amount) + "L / " + tStats[0] + "L")
- + EnumChatFormatting.GRAY);
- }
-
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
- }
- }
-
- this.addAdditionalToolTips(aList, aStack);
- }
-
- /**
- * Adds a special Item Behaviour to the Item.
- * <p/>
- * Note: the boolean Behaviours sometimes won't be executed if another
- * boolean Behaviour returned true before.
- *
- * @param aMetaValue
- * the Meta Value of the Item you want to add it to. [0 - 32765]
- * @param aBehavior
- * the Click Behavior you want to add.
- * @return the Item itself for convenience in constructing.
- */
- public final Gregtech_MetaItem_Base addItemBehavior(final int aMetaValue,
- final Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) {
- if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) {
- return this;
- }
- ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>(1);
- this.mItemBehaviors.put((short) aMetaValue, tList);
- }
- tList.add(aBehavior);
- return this;
- }
-
- @Override
- public final boolean canProvideEnergy(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return false;
- }
- return tStats[3] > 0 || aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3);
- }
-
- @Override
- public final boolean canUse(final ItemStack aStack, final double aAmount) {
- return this.getRealCharge(aStack) >= aAmount;
- }
-
- @Override
- public final double charge(final ItemStack aStack, final double aCharge, final int aTier,
- final boolean aIgnoreTransferLimit, final boolean aSimulate) {
- final Long[] tStats = this.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;
- }
- final long tChargeBefore = this.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 (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
- return tNewCharge - tChargeBefore;
- }
-
- @Override
- public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
- if (aPlayer == null || aPlayer.worldObj.isRemote) {
- return;
- }
- for (int i = 1; i < 5; i++) {
- final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= this.getTier(aStack)) {
- final double tCharge = ElectricItem.manager.discharge(tArmor,
- this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true),
- Integer.MAX_VALUE, true, true, false);
- if (tCharge > 0) {
- this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
- if (tContainer != null) {
- tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
- }
-
- @Override
- public final double discharge(final ItemStack aStack, final double aCharge, final int aTier,
- final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier) {
- return 0;
- }
- if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
- return 0;
- }
- if (tStats[3] > 0) {
- if (aCharge < tStats[3] || aStack.stackSize < 1) {
- return 0;
- }
- if (!aSimulate) {
- aStack.stackSize--;
- }
- return tStats[3];
- }
- final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math.max(0,
- tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
- return tChargeBefore - tNewCharge;
- }
-
- @Override
- public FluidStack drain(final ItemStack aStack, final int maxDrain, final boolean doDrain) {
- if (aStack == null || aStack.stackSize != 1) {
- return null;
- }
-
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
- if (tFluid != null && maxDrain >= tFluid.amount) {
- final ItemStack tStack = GT_Utility.getContainerItem(aStack, false);
- if (tStack == null) {
- aStack.stackSize = 0;
- return tFluid;
- }
- aStack.setItemDamage(tStack.getItemDamage());
- aStack.func_150996_a(tStack.getItem());
- return tFluid;
- }
-
- final Long[] tStats = this.getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0) {
- return null;
- }
-
- tFluid = this.getFluidContent(aStack);
- if (tFluid == null) {
- return null;
- }
-
- int used = maxDrain;
- if (tFluid.amount < used) {
- used = tFluid.amount;
- }
- if (doDrain) {
- tFluid.amount -= used;
- this.setFluidContent(aStack, tFluid);
- }
-
- final FluidStack drained = tFluid.copy();
- drained.amount = used;
- return drained;
- }
-
- @Override
- public int fill(final ItemStack aStack, final FluidStack aFluid, final boolean doFill) {
- if (aStack == null || aStack.stackSize != 1) {
- return 0;
- }
-
- final ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false);
- if (tStack != null) {
- aStack.setItemDamage(tStack.getItemDamage());
- aStack.func_150996_a(tStack.getItem());
- return GT_Utility.getFluidForFilledItem(tStack, false).amount;
- }
-
- final Long[] tStats = this.getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0
- || aFluid.amount <= 0) {
- return 0;
- }
-
- FluidStack tFluid = this.getFluidContent(aStack);
-
- if (tFluid == null || tFluid.getFluid().getID() <= 0) {
- if (aFluid.amount <= tStats[0]) {
- if (doFill) {
- this.setFluidContent(aStack, aFluid);
- }
- return aFluid.amount;
- }
- if (doFill) {
- tFluid = aFluid.copy();
- tFluid.amount = (int) (long) tStats[0];
- this.setFluidContent(aStack, tFluid);
- }
- return (int) (long) tStats[0];
- }
-
- if (!tFluid.isFluidEqual(aFluid)) {
- return 0;
- }
-
- final int space = (int) (long) tStats[0] - tFluid.amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- tFluid.amount += aFluid.amount;
- this.setFluidContent(aStack, tFluid);
- }
- return aFluid.amount;
- }
- if (doFill) {
- tFluid.amount = (int) (long) tStats[0];
- this.setFluidContent(aStack, tFluid);
- }
- return space;
- }
-
- @Override
- public int getCapacity(final ItemStack aStack) {
- final Long[] tStats = this.getFluidContainerStats(aStack);
- return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
- }
-
- @Override
- public final double getCharge(final ItemStack aStack) {
- return this.getRealCharge(aStack);
- }
-
- @Override
- public final Item getChargedItem(final ItemStack itemStack) {
- return this;
- }
-
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")) {
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")) {
+public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> mItemBehaviors = new HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
+ */
+ public Gregtech_MetaItem_Base(String aUnlocalized) {
+ super(aUnlocalized, "Generated Item", null, false);
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ }
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * Note: the boolean Behaviours sometimes won't be executed if another boolean Behaviour returned true before.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to add it to. [0 - 32765]
+ * @param aBehavior the Click Behavior you want to add.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem_Base addItemBehavior(int aMetaValue, Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) {
+ if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this;
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>(1);
+ mItemBehaviors.put((short) aMetaValue, tList);
+ }
+ tList.add(aBehavior);
+ return this;
+ }
+
+ public abstract Long[] getElectricStats(ItemStack aStack);
+
+ public abstract Long[] getFluidContainerStats(ItemStack aStack);
+
+ @Override
+ public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> 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<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ if (!tBehavior.isItemStackUsable(this, aStack)) return false;
+ return super.isItemStackUsable(aStack);
+ }
+
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ 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<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ 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;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return 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) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ 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;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return aStack;
+ }
+
+ @Override
+ public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey);
+ if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
+
+ Long[]
+ tStats = getElectricStats(aStack);
+ if (tStats != null) {
+ if (tStats[3] > 0) {
+ aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY);
+ } else {
+ long tCharge = getRealCharge(aStack);
+ if (tStats[3] == -2 && tCharge <= 0) {
+ aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY);
+ } else {
+ aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+
+ tStats = getFluidContainerStats(aStack);
+ if (tStats != null && tStats[0] > 0) {
+ FluidStack tFluid = getFluidContent(aStack);
+ aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? "No Fluids Contained" : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY);
+ aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? 0 : tFluid.amount) + "L / " + tStats[0] + "L") + EnumChatFormatting.GRAY);
+ }
+
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+
+ addAdditionalToolTips(aList, aStack);
+ }
+
+ @Override
+ public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
+ }
+
+ @Override
+ public final boolean canProvideEnergy(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return false;
+ return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3));
+ }
+
+ @Override
+ public final double getMaxCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final double getTransferLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ 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;
+ 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 (!aSimulate) setCharge(aStack, tNewCharge);
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ 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;
+ if (tStats[3] > 0) {
+ if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
+ 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)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return tChargeBefore - tNewCharge;
+ }
+
+ @Override
+ public final double getCharge(ItemStack aStack) {
+ return getRealCharge(aStack);
+ }
+
+ @Override
+ public final boolean canUse(ItemStack aStack, double aAmount) {
+ return getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) {
+ chargeFromArmor(aStack, aPlayer);
+ if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true;
+ double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (tTransfer == aAmount) {
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
+ if (aPlayer == null || aPlayer.worldObj.isRemote) return;
+ for (int i = 1; i < 5; i++) {
+ ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ 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);
+ if (tCharge > 0) {
+ charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public final long getRealCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ if (tStats[3] > 0) return (int) (long) tStats[3];
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(ItemStack aStack, long aCharge) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[3] > 0) return false;
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ tNBT.removeTag("GT.ItemCharge");
+ aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
+ if (aCharge > 0) {
+ aStack.setItemDamage(getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ return true;
+ }
+
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public short getEmptyMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ @Override
+ public FluidStack getFluid(ItemStack aStack) {
+ return getFluidContent(aStack);
+ }
+
+ @Override
+ public int getCapacity(ItemStack aStack) {
+ Long[] tStats = getFluidContainerStats(aStack);
+ return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
+ }
+
+ @Override
+ public int fill(ItemStack aStack, FluidStack aFluid, boolean doFill) {
+ if (aStack == null || aStack.stackSize != 1) return 0;
+
+ ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false);
+ if (tStack != null) {
+ aStack.setItemDamage(tStack.getItemDamage());
+ aStack.func_150996_a(tStack.getItem());
+ return GT_Utility.getFluidForFilledItem(tStack, false).amount;
+ }
+
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0)
+ return 0;
+
+ FluidStack tFluid = getFluidContent(aStack);
+
+ if (tFluid == null || tFluid.getFluid().getID() <= 0) {
+ if (aFluid.amount <= tStats[0]) {
+ if (doFill) {
+ setFluidContent(aStack, aFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid = aFluid.copy();
+ tFluid.amount = (int) (long) tStats[0];
+ setFluidContent(aStack, tFluid);
+ }
+ return (int) (long) tStats[0];
+ }
+
+ if (!tFluid.isFluidEqual(aFluid)) return 0;
+
+ int space = (int) (long) tStats[0] - tFluid.amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ tFluid.amount += aFluid.amount;
+ setFluidContent(aStack, tFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid.amount = (int) (long) tStats[0];
+ setFluidContent(aStack, tFluid);
+ }
+ return space;
+ }
+
+ @Override
+ public FluidStack drain(ItemStack aStack, int maxDrain, boolean doDrain) {
+ if (aStack == null || aStack.stackSize != 1) return null;
+
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
+ if (tFluid != null && maxDrain >= tFluid.amount) {
+ ItemStack tStack = GT_Utility.getContainerItem(aStack, false);
+ if (tStack == null) {
+ aStack.stackSize = 0;
+ return tFluid;
+ }
+ aStack.setItemDamage(tStack.getItemDamage());
+ aStack.func_150996_a(tStack.getItem());
+ return tFluid;
+ }
+
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0) return null;
+
+ tFluid = getFluidContent(aStack);
+ if (tFluid == null) return null;
+
+ int used = maxDrain;
+ if (tFluid.amount < used) used = tFluid.amount;
+ if (doDrain) {
+ tFluid.amount -= used;
+ setFluidContent(aStack, tFluid);
+ }
+
+ FluidStack drained = tFluid.copy();
+ drained.amount = used;
+ return drained;
+ }
+
+ public FluidStack getFluidContent(ItemStack aStack) {
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0) return GT_Utility.getFluidForFilledItem(aStack, false);
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
+ }
+
+ public void setFluidContent(ItemStack aStack, FluidStack aFluid) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ else tNBT.removeTag("GT.FluidContent");
+ if (aFluid != null && aFluid.amount > 0)
+ tNBT.setTag("GT.FluidContent", aFluid.writeToNBT(new NBTTagCompound()));
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats != null && (tStats[3] == -1 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1;
+ tStats = getFluidContainerStats(aStack);
+ if (tStats != null) return (int) (long) tStats[1];
+ return 64;
+ }
+
+ @Override
+ public final Item getChargedItem(ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final Item getEmptyItem(ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final int getTier(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
+ }
+
+ @Override
+ public final String getToolTip(ItemStack aStack) {
+ return null;
+ } // This has its own ToolTip Handler, no need to let the IC2 Handler screw us up at this Point
+
+ @Override
+ public final IElectricItemManager getManager(ItemStack aStack) {
+ return this;
+ } // We are our own Manager
+
+ @Override
+ public final boolean getShareTag() {
+ return true;
+ } // just to be sure.
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
HEX_OxFFFFFF = 0xace600;
}
- else if (stack.getDisplayName().contains("UV")) {
+ else if (stack.getDisplayName().contains("UV")){
HEX_OxFFFFFF = 0xffff00;
}
- else if (stack.getDisplayName().contains("MAX")) {
+ else if (stack.getDisplayName().contains("MAX")){
HEX_OxFFFFFF = 0xff0000;
}
- else if (stack.getDisplayName().contains("Sodium")) {
+ else if (stack.getDisplayName().contains("Sodium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
}
- else if (stack.getDisplayName().contains("Cadmium")) {
+ else if (stack.getDisplayName().contains("Cadmium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
}
- else if (stack.getDisplayName().contains("Lithium")) {
+ else if (stack.getDisplayName().contains("Lithium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
}
else {
HEX_OxFFFFFF = 0xffffff;
- }
+ }
return HEX_OxFFFFFF;
}
-
- public abstract Long[] getElectricStats(ItemStack aStack);
-
- @Override
- public final Item getEmptyItem(final ItemStack itemStack) {
- return this;
- }
-
- public short getEmptyMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- @Override
- public FluidStack getFluid(final ItemStack aStack) {
- return this.getFluidContent(aStack);
- }
-
- public abstract Long[] getFluidContainerStats(ItemStack aStack);
-
- public FluidStack getFluidContent(final ItemStack aStack) {
- final Long[] tStats = this.getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0) {
- return GT_Utility.getFluidForFilledItem(aStack, false);
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
- }
-
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemStackLimit(final ItemStack aStack) {
- Long[] tStats = this.getElectricStats(aStack);
- if (tStats != null && (tStats[3] == -1 || tStats[3] == -3) && this.getRealCharge(aStack) > 0) {
- return 1;
- }
- tStats = this.getFluidContainerStats(aStack);
- if (tStats != null) {
- return (int) (long) tStats[1];
- }
- return 64;
- }
-
- @Override
- public final IElectricItemManager getManager(final ItemStack aStack) {
- return this;
- } // We are our own Manager
-
- @Override
- public final double getMaxCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.abs(tStats[0]);
- }
-
- @Override
- public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld,
- final double aX, final double aY, final double aZ) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- final 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(final SubTag aProjectileType, final ItemStack aStack, final World aWorld,
- final EntityLivingBase aEntity, final float aSpeed) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- final EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity,
- aSpeed);
- if (rArrow != null) {
- return rArrow;
- }
- }
- }
- return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed);
- }
-
- public final long getRealCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- if (tStats[3] > 0) {
- return (int) (long) tStats[3];
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
- }
-
- @Override
- public final boolean getShareTag() {
- return true;
- } // just to be sure.
-
- @Override
- public final int getTier(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
- }
-
- @Override
- public final String getToolTip(final ItemStack aStack) {
- return null;
- } // This has its own ToolTip Handler, no need to let the IC2 Handler screw
- // us up at this Point
-
- @Override
- public final double getTransferLimit(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.max(tStats[1], tStats[3]);
- }
-
- @Override
- public boolean hasProjectile(final SubTag aProjectileType, final ItemStack aStack) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- if (tBehavior.hasProjectile(this, aProjectileType, aStack)) {
- return true;
- }
- }
- }
- return super.hasProjectile(aProjectileType, aStack);
- }
-
- @Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean isItemStackUsable(final ItemStack aStack) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- if (!tBehavior.isItemStackUsable(this, aStack)) {
- return false;
- }
- }
- }
- return super.isItemStackUsable(aStack);
- }
-
- @Override
- public ItemStack onDispense(final IBlockSource aSource, final ItemStack aStack) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- if (tBehavior.canDispense(this, aSource, aStack)) {
- return tBehavior.onDispense(this, aSource, aStack);
- }
- }
- }
- return super.onDispense(aSource, aStack);
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- try {
- aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
- }
- catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return aStack;
- }
-
- @Override
- public boolean onItemUse(final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX,
- final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- try {
- 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;
- }
- }
- catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean onItemUseFirst(final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX,
- final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- try {
- 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;
- }
- }
- catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- this.use(aStack, 0, aPlayer);
- this.isItemStackUsable(aStack);
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- try {
- if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- }
- return true;
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- return false;
- }
- }
- catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- return false;
- }
-
- @Override
- public void onUpdate(final ItemStack aStack, final World aWorld, final Entity aPlayer, final int aTimer,
- final boolean aIsInHand) {
- final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors
- .get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
- tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
- }
- }
- }
-
- public final boolean setCharge(final ItemStack aStack, long aCharge) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null || tStats[3] > 0) {
- return false;
- }
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
- tNBT.removeTag("GT.ItemCharge");
- aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
- if (aCharge > 0) {
- aStack.setItemDamage(this.getChargedMetaData(aStack));
- tNBT.setLong("GT.ItemCharge", aCharge);
- }
- else {
- aStack.setItemDamage(this.getEmptyMetaData(aStack));
- }
- if (tNBT.hasNoTags()) {
- aStack.setTagCompound(null);
- }
- else {
- aStack.setTagCompound(tNBT);
- }
- this.isItemStackUsable(aStack);
- return true;
- }
-
- public void setFluidContent(final ItemStack aStack, final FluidStack aFluid) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
- else {
- tNBT.removeTag("GT.FluidContent");
- }
- if (aFluid != null && aFluid.amount > 0) {
- tNBT.setTag("GT.FluidContent", aFluid.writeToNBT(new NBTTagCompound()));
- }
- if (tNBT.hasNoTags()) {
- aStack.setTagCompound(null);
- }
- else {
- aStack.setTagCompound(tNBT);
- }
- this.isItemStackUsable(aStack);
- }
-
- @Override
- public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
- this.chargeFromArmor(aStack, aPlayer);
- if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
- return true;
- }
- final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
- if (tTransfer == aAmount) {
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return true;
- }
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return false;
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
index eae20c695e..5cd8aa0700 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
@@ -1,261 +1,217 @@
package gtPlusPlus.xmod.gregtech.api.items;
-import java.util.Arrays;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
+
+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 cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/**
* @author Gregorius Techneticies
* <p/>
* One Item for everything!
* <p/>
- * This brilliant Item Class is used for automatically generating all
- * possible variations of Material Items, like Dusts, Ingots, Gems,
- * Plates and similar. It saves me a ton of work, when adding Items,
- * because I always have to make a new Item SubType for each OreDict
- * Prefix, when adding a new Material.
+ * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar.
+ * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material.
* <p/>
- * As you can see, up to 32766 Items can be generated using this Class.
- * And the last 766 Items can be custom defined, just to save space and
- * MetaData.
+ * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData.
* <p/>
- * These Items can also have special RightClick abilities, electric
- * Charge or even be set to become a Food alike Item.
+ * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item.
*/
public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem {
- protected final OrePrefixes[] mGeneratedPrefixList;
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized
- * The Unlocalized Name of this Item.
- * @param aGeneratedPrefixList
- * The OreDict Prefixes you want to have generated.
- */
- public Gregtech_MetaItem_X32(final String aUnlocalized, final OrePrefixes... aGeneratedPrefixList) {
- super(aUnlocalized, (short) 32000, (short) 766);
- this.mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
-
- for (int i = 0; i < 32000; i++) {
- final OrePrefixes tPrefix = this.mGeneratedPrefixList[i / 1000];
- if (tPrefix == null) {
- continue;
- }
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
- if (tMaterial == null) {
- continue;
- }
- if (this.doesMaterialAllowGeneration(tPrefix, tMaterial)) {
- final ItemStack tStack = new ItemStack(this, 1, i);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name",
- this.getDefaultLocalization(tPrefix, tMaterial, i));
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip",
- tMaterial.getToolTip(tPrefix.mMaterialAmount / GT_Values.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) && (tMaterial == Materials.Lead
- || tMaterial == Materials.Tin || tMaterial == Materials.SolderingAlloy)) {
- GregTech_API.sSolderingMetalList.add(tStack);
- }
- }
- }
- }
+ protected final OrePrefixes[] mGeneratedPrefixList;
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
+ */
+ public Gregtech_MetaItem_X32(String aUnlocalized, OrePrefixes... aGeneratedPrefixList) {
+ super(aUnlocalized, (short) 32000, (short) 766);
+ mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
+
+ for (int i = 0; i < 32000; i++) {
+ OrePrefixes tPrefix = mGeneratedPrefixList[i / 1000];
+ if (tPrefix == null) continue;
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
+ if (tMaterial == null) continue;
+ if (doesMaterialAllowGeneration(tPrefix, tMaterial)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", getDefaultLocalization(tPrefix, tMaterial, i));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / GT_Values.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) && (tMaterial == Materials.Lead || tMaterial == Materials.Tin || tMaterial == Materials.SolderingAlloy)) {
+ GregTech_API.sSolderingMetalList.add(tStack);
+ }
+ }
+ }
+ }
/* ---------- OVERRIDEABLE FUNCTIONS ---------- */
- /**
- * @param aPrefix
- * this can be null, you have to return false in that case
- * @param aMaterial
- * this can be null, you have to return false in that case
- * @return if this Item should be generated and visible.
- */
- public boolean doesMaterialAllowGeneration(final OrePrefixes aPrefix, final 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:
- // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return
- // false;
- return aPrefix != null && aMaterial != null && aPrefix.doGenerateItem(aMaterial);
- }
-
- /**
- * @param aPrefix
- * always != null
- * @param aMaterial
- * always != null
- * @param aDoShowAllItems
- * this is the Configuration Setting of the User, if he wants to
- * see all the Stuff like Tiny Dusts or Crushed Ores as well.
- * @return if this Item should be visible in NEI or Creative
- */
- public boolean doesShowInCreative(final OrePrefixes aPrefix, final Materials aMaterial,
- final boolean aDoShowAllItems) {
- return true;
- }
-
+ /**
+ * @return the Color Modulation the Material is going to be rendered with.
+ */
+ @Override
+ public short[] getRGBa(ItemStack aStack) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[getDamage(aStack) % 1000];
+ return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
+ }
+
+ /**
+ * @param aPrefix this can be null, you have to return false in that case
+ * @param aMaterial this can be null, you have to return false in that case
+ * @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:
+ // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
+ return aPrefix != null && aMaterial != null && aPrefix.doGenerateItem(aMaterial);
+ }
+
/* ---------- OVERRIDEABLE FUNCTIONS ---------- */
- @Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("LuV")) {
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")) {
+ /**
+ * @param aPrefix the OreDict Prefix
+ * @param aMaterial the Material
+ * @param aMetaData a Index from [0 - 31999]
+ * @return the Localized Name when default LangFiles are used.
+ */
+ public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
+ return aPrefix.getDefaultLocalNameForItem(aMaterial);
+ }
+
+ /**
+ * @param aMetaData a Index from [0 - 31999]
+ * @param aMaterial the Material
+ * @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;
+ }
+
+ /**
+ * @param aPrefix always != null
+ * @param aMaterial always != null
+ * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well.
+ * @return if this Item should be visible in NEI or Creative
+ */
+ public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
+ return true;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0) {
+ Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
+ if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
+ OrePrefixes aPrefix = mGeneratedPrefixList[aDamage / 1000];
+ if (aPrefix != null) return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public final IIconContainer getIconContainer(int aMetaData) {
+ return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32000; i++)
+ if (doesMaterialAllowGeneration(mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000]) && doesShowInCreative(mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000], GregTech_API.sDoShowAllItemsInCreative)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ super.getSubItems(var1, aCreativeTab, aList);
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ if (aMetaData < 0) return null;
+ if (aMetaData < 32000) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
+ if (tMaterial == null) return null;
+ IIconContainer tIcon = getIconContainer(aMetaData, tMaterial);
+ if (tIcon != null) return tIcon.getIcon();
+ return null;
+ }
+ return aMetaData - 32000 < mIconList.length ? mIconList[aMetaData - 32000][0] : null;
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ int tDamage = getDamage(aStack);
+ if (tDamage < 32000 && mGeneratedPrefixList[tDamage / 1000] != null)
+ return Math.min(super.getItemStackLimit(aStack), mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
+ return super.getItemStackLimit(aStack);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
HEX_OxFFFFFF = 0xffe600;
}
- else if (stack.getDisplayName().contains("UV")) {
+ else if (stack.getDisplayName().contains("UV")){
HEX_OxFFFFFF = 0xffb300;
}
- else if (stack.getDisplayName().contains("MAX")) {
- HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251),
- MathUtils.randInt(220, 250));
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
}
- else if (stack.getDisplayName().contains("Sodium")) {
+ else if (stack.getDisplayName().contains("Sodium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(90, 90, 255);
}
- else if (stack.getDisplayName().contains("Cadmium")) {
+ else if (stack.getDisplayName().contains("Cadmium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 150, 80);
}
- else if (stack.getDisplayName().contains("Lithium")) {
+ else if (stack.getDisplayName().contains("Lithium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
}
- else if (stack.getDisplayName().contains("Wrought")) {
+ else if (stack.getDisplayName().contains("Wrought")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
}
- else if (stack.getDisplayName().contains("Bronze")) {
+ else if (stack.getDisplayName().contains("Bronze")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 128, 0);
}
- else if (stack.getDisplayName().contains("Brass")) {
+ else if (stack.getDisplayName().contains("Brass")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(255, 180, 0);
}
- else if (stack.getDisplayName().contains("Invar")) {
+ else if (stack.getDisplayName().contains("Invar")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(180, 180, 120);
}
else {
HEX_OxFFFFFF = 0xffffff;
- }
+ }
return HEX_OxFFFFFF;
}
-
- @Override
- public ItemStack getContainerItem(final ItemStack aStack) {
- final int aDamage = aStack.getItemDamage();
- if (aDamage < 32000 && aDamage >= 0) {
- final Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
- if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
- final OrePrefixes aPrefix = this.mGeneratedPrefixList[aDamage / 1000];
- if (aPrefix != null) {
- return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
- }
- }
- }
- return null;
- }
-
- /**
- * @param aPrefix
- * the OreDict Prefix
- * @param aMaterial
- * the Material
- * @param aMetaData
- * a Index from [0 - 31999]
- * @return the Localized Name when default LangFiles are used.
- */
- public String getDefaultLocalization(final OrePrefixes aPrefix, final Materials aMaterial, final int aMetaData) {
- return aPrefix.getDefaultLocalNameForItem(aMaterial);
- }
-
- /* ---------- INTERNAL OVERRIDES ---------- */
-
- @Override
- public final IIconContainer getIconContainer(final int aMetaData) {
- return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null
- : this.getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
- }
-
- /**
- * @param aMetaData
- * a Index from [0 - 31999]
- * @param aMaterial
- * the Material
- * @return an Icon Container for the Item Display.
- */
- public final IIconContainer getIconContainer(final int aMetaData, final Materials aMaterial) {
- return this.mGeneratedPrefixList[aMetaData / 1000] != null
- && this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0
- ? aMaterial.mIconSet.mTextures[this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex]
- : null;
- }
-
- @Override
- public final IIcon getIconFromDamage(final int aMetaData) {
- if (aMetaData < 0) {
- return null;
- }
- if (aMetaData < 32000) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
- if (tMaterial == null) {
- return null;
- }
- final IIconContainer tIcon = this.getIconContainer(aMetaData, tMaterial);
- if (tIcon != null) {
- return tIcon.getIcon();
- }
- return null;
- }
- return aMetaData - 32000 < this.mIconList.length ? this.mIconList[aMetaData - 32000][0] : null;
- }
-
- @Override
- public int getItemStackLimit(final ItemStack aStack) {
- final int tDamage = this.getDamage(aStack);
- if (tDamage < 32000 && this.mGeneratedPrefixList[tDamage / 1000] != null) {
- return Math.min(super.getItemStackLimit(aStack),
- this.mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
- }
- return super.getItemStackLimit(aStack);
- }
-
- /**
- * @return the Color Modulation the Material is going to be rendered with.
- */
- @Override
- public short[] getRGBa(final ItemStack aStack) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[this.getDamage(aStack) % 1000];
- return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0; i < 32000; i++) {
- if (this.doesMaterialAllowGeneration(this.mGeneratedPrefixList[i / 1000],
- GregTech_API.sGeneratedMaterials[i % 1000])
- && this.doesShowInCreative(this.mGeneratedPrefixList[i / 1000],
- GregTech_API.sGeneratedMaterials[i % 1000], GregTech_API.sDoShowAllItemsInCreative)) {
- final ItemStack tStack = new ItemStack(this, 1, i);
- this.isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- super.getSubItems(var1, aCreativeTab, aList);
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
index ae034433c1..7f2042e05d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
@@ -1,12 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.items;
-import java.util.*;
-import java.util.Map.Entry;
-
-import buildcraft.api.tools.IToolWrench;
-import cpw.mods.fml.common.Optional;
+import static gregtech.api.enums.GT_Values.MOD_ID_RC;
import gregtech.api.enchants.Enchantment_Radioactivity;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.IDamagableItem;
import gregtech.api.interfaces.IToolStats;
@@ -15,11 +10,19 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
import mods.railcraft.api.core.items.IToolCrowbar;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.entity.*;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -31,336 +34,293 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.Optional;
/**
- * 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(16,
- * 1, Materials.Bismuth, Materials.Bismuth, null);
+ * 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(16, 1, Materials.Bismuth, Materials.Bismuth, null);
*/
-@Optional.InterfaceList(value = {
- @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = GT_Values.MOD_ID_RC),
- @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft")
-})
-public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool
- implements IDamagableItem, IToolCrowbar, IToolWrench {
+@Optional.InterfaceList(value = {@Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft")})
+public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool implements IDamagableItem, IToolCrowbar, IToolWrench {
/**
- * 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.
+ * 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.
* <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as
- * Key if you want to get a specific Item.
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
*/
- public static final HashMap<String, Gregtech_MetaTool> sInstances = new HashMap<String, Gregtech_MetaTool>();
+ public static final HashMap<String, Gregtech_MetaTool> sInstances = new HashMap<String, Gregtech_MetaTool>();
/* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- public final HashMap<Short, IToolStats> mToolStats = new HashMap<Short, IToolStats>();
+ public final HashMap<Short, IToolStats> mToolStats = new HashMap<Short, IToolStats>();
/**
* Creates the Item using these Parameters.
*
- * @param aUnlocalized
- * The Unlocalized Name of this Item.
+ * @param aUnlocalized The Unlocalized Name of this Item.
*/
- public Gregtech_MetaTool(final String aUnlocalized) {
+ public Gregtech_MetaTool(String aUnlocalized) {
super(aUnlocalized);
GT_ModHandler.registerBoxableItemToToolBox(this);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setMaxStackSize(1);
- Gregtech_MetaTool.sInstances.put(this.getUnlocalizedName(), this);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setMaxStackSize(1);
+ sInstances.put(getUnlocalizedName(), this);
}
+ /**
+ * Called by the Block Harvesting Event within the GT_Proxy
+ */
@Override
- public void addAdditionalToolTips(final List aList, final ItemStack aStack) {
- final long tMaxDamage = GT_MetaGenerated_Tool.getToolMaxDamage(aStack);
- final Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1;
- if (tStats != null) {
- final String name = aStack.getUnlocalizedName();
- if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172")
- || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) {
- aList.add(tOffset + 0,
- EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN
- + (tMaxDamage - GT_MetaGenerated_Tool.getToolDamage(aStack)) + " / " + tMaxDamage
- + EnumChatFormatting.GRAY);
- aList.add(tOffset + 1,
- EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl "
- + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE
- + (50.0F + 10.0F * this.getToolCombatDamage(aStack)) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 1000)
- + EnumChatFormatting.GRAY + "L/sec");
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): "
- + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 25)
- + EnumChatFormatting.GRAY + "EU/t");
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): "
- + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 1000)
- + EnumChatFormatting.GRAY + "EU/t");
+ public void onHarvestBlockEvent(ArrayList<ItemStack> 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());
+ }
- }
- else {
- aList.add(tOffset + 0,
- EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN
- + (tMaxDamage - GT_MetaGenerated_Tool.getToolDamage(aStack)) + " / " + tMaxDamage
- + EnumChatFormatting.GRAY);
- aList.add(tOffset + 1,
- EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl "
- + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE
- + this.getToolCombatDamage(aStack) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed)
- + EnumChatFormatting.GRAY);
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null || !isItemStackUsable(aStack)) return true;
+ 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);
+ 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;
+ 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);
+ 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);
+ aPlayer.motionX *= 0.6D;
+ aPlayer.motionZ *= 0.6D;
+ aPlayer.setSprinting(false);
+ }
+ if (tCriticalHit) aPlayer.onCriticalHit(aEntity);
+ if (tMagicDamage > 0.0F) aPlayer.onEnchantmentCritical(aEntity);
+ if (tDamage >= 18.0F) aPlayer.triggerAchievement(AchievementList.overkill);
+ aPlayer.setLastAttacker(aEntity);
+ if (aEntity instanceof EntityLivingBase)
+ EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
+ 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));
+ aPlayer.addExhaustion(0.3F);
+ doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
}
}
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
}
- public void addAdditionalToolTips(final List aList, final ItemStack aStack, final EntityPlayer aPlayer) {
- final long tMaxDamage = GT_MetaGenerated_Tool.getToolMaxDamage(aStack);
- final Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1;
- if (tStats != null) {
- final String name = aStack.getUnlocalizedName();
- if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172")
- || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) {
- aList.add(tOffset + 0,
- EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN
- + (tMaxDamage - GT_MetaGenerated_Tool.getToolDamage(aStack)) + " / " + tMaxDamage
- + EnumChatFormatting.GRAY);
- aList.add(tOffset + 1,
- EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl "
- + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE
- + (50.0F + 10.0F * this.getToolCombatDamage(aStack)) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 1000)
- + EnumChatFormatting.GRAY + "L/sec");
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): "
- + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 50)
- + EnumChatFormatting.GRAY + "EU/t");
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): "
- + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 1000)
- + EnumChatFormatting.GRAY + "EU/t");
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000);
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
- }
- else {
- aList.add(tOffset + 0,
- EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN
- + (tMaxDamage - GT_MetaGenerated_Tool.getToolDamage(aStack)) + " / " + tMaxDamage
- + EnumChatFormatting.GRAY);
- aList.add(tOffset + 1,
- EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl "
- + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE
- + this.getToolCombatDamage(aStack) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 3,
- EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE
- + Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier()
- * GT_MetaGenerated_Tool.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");
- final long tWorldTime = aPlayer.getEntityWorld().getWorldTime();
- if (aNBT.hasKey("HeatTime")) {
- final 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);
- }
- }
+
+ public void addAdditionalToolTips(List aList, ItemStack aStack) {
+ long tMaxDamage = getToolMaxDamage(aStack);
+ Materials tMaterial = getPrimaryMaterial(aStack);
+ IToolStats tStats = getToolStats(aStack);
+ int tOffset = getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ String name = aStack.getUnlocalizedName();
+ if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172") || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "L/sec");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 25) + EnumChatFormatting.GRAY + "EU/t");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "EU/t");
+
+ } else {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + getToolCombatDamage(aStack) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) + EnumChatFormatting.GRAY);
}
}
}
+
+ public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ long tMaxDamage = getToolMaxDamage(aStack);
+ Materials tMaterial = getPrimaryMaterial(aStack);
+ IToolStats tStats = getToolStats(aStack);
+ int tOffset = getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ String name = aStack.getUnlocalizedName();
+ if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172") || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "L/sec");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) + EnumChatFormatting.GRAY + "EU/t");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "EU/t");
+
+ } else {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + getToolCombatDamage(aStack) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + 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);
+ }
+ }
+ }
+ }
+ }
@Override
- public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
+ public Long[] getFluidContainerStats(ItemStack aStack) {
+ return null;
}
@Override
- public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
+ public Long[] getElectricStats(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ 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")};
}
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
+ return null;
}
@Override
- public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY,
- final int aZ) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
+ public float getToolCombatDamage(ItemStack aStack) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return 0;
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
}
@Override
- public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) {
- // System.out.println("canWrench");
- if (player == null) {
- return false;
- }
- if (player.getCurrentEquippedItem() == null) {
- return false;
- }
- if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
- return false;
- }
- final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- return tStats != null && tStats.isWrench();
+ public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) {
+ 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;
}
@Override
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) (aStack.getItemDamage() - aStack.getItemDamage() % 2);
+ 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()));
+ return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
}
- private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) {
- if (!this.isItemStackUsable(aStack)) {
- return null;
- }
+ private ItemStack getContainerItem(ItemStack aStack, boolean playSound) {
+ if (!isItemStackUsable(aStack)) return null;
aStack = GT_Utility.copyAmount(1, aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return null;
- }
- this.doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return null;
+ doDamage(aStack, tStats.getToolDamagePerContainerCraft());
aStack = aStack.stackSize > 0 ? aStack : null;
if (playSound) {
- // String sound = (aStack == null) ? tStats.getBreakingSound() :
- // tStats.getCraftingSound();
- // GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ //String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ //GT_Utility.doSoundAtClient(sound, 1, 1.0F);
}
return aStack;
}
@Override
- public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) {
- if (!this.isItemStackUsable(aStack)) {
- return 0.0F;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null || Math.max(0, this.getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData)) {
- return 0.0F;
- }
- return tStats.isMinableBlock(aBlock, (byte) aMetaData)
- ? Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed)
- : 0.0F;
+ public Interface_ToolStats getToolStats(ItemStack aStack) {
+ isItemStackUsable(aStack);
+ return getToolStatsInternal(aStack);
+ }
+
+ private Interface_ToolStats getToolStatsInternal(ItemStack aStack) {
+ return (Interface_ToolStats) (aStack == null ? null : mToolStats.get((short) aStack.getItemDamage()));
}
@Override
- public Long[] getElectricStats(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- 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 null;
+ public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
}
@Override
- public short getEmptyMetaData(final ItemStack aStack) {
- final NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT.removeTag("ench");
- }
- return (short) (aStack.getItemDamage() + 1 - aStack.getItemDamage() % 2);
+ public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
}
@Override
- public Long[] getFluidContainerStats(final ItemStack aStack) {
- return null;
+ public boolean canWrench(EntityPlayer player, int x, int y, int z) {
+ //System.out.println("canWrench");
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats != null && tStats.isWrench();
}
@Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
+ 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 int getItemEnchantability() {
- return 0;
+ public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
}
@Override
- public float getToolCombatDamage(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return tStats.getBaseDamage() + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality;
+ public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
}
@Override
- public Interface_ToolStats getToolStats(final ItemStack aStack) {
- this.isItemStackUsable(aStack);
- return this.getToolStatsInternal(aStack);
+ public boolean canBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
}
- private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) {
- return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage()));
+ @Override
+ public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
}
@Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer);
+ super.onCreated(aStack, aWorld, aPlayer);
}
@Override
@@ -369,238 +329,88 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool
}
@Override
- public boolean isItemStackUsable(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStatsInternal(aStack);
+ public boolean isItemStackUsable(ItemStack aStack) {
+ IToolStats tStats = getToolStatsInternal(aStack);
if (aStack.getItemDamage() % 2 == 1 || tStats == null) {
- final NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT.removeTag("ench");
- }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
return false;
}
- final Materials aMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack);
- final HashMap<Integer, Integer> tMap = new HashMap<Integer, Integer>(),
- tResult = new HashMap<Integer, Integer>();
+ Materials aMaterial = getPrimaryMaterial(aStack);
+ HashMap<Integer, Integer> tMap = new HashMap<Integer, Integer>(), tResult = new HashMap<Integer, Integer>();
if (aMaterial.mEnchantmentTools != null) {
tMap.put(aMaterial.mEnchantmentTools.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- if (aMaterial.mEnchantmentTools == Enchantment.fortune) {
+ if (aMaterial.mEnchantmentTools == Enchantment.fortune)
tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
- if (aMaterial.mEnchantmentTools == Enchantment.knockback) {
+ if (aMaterial.mEnchantmentTools == Enchantment.knockback)
tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
- if (aMaterial.mEnchantmentTools == Enchantment.fireAspect) {
+ if (aMaterial.mEnchantmentTools == Enchantment.fireAspect)
tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
}
- final Enchantment[] tEnchants = tStats.getEnchantments(aStack);
- final int[] tLevels = tStats.getEnchantmentLevels(aStack);
- for (int i = 0; i < tEnchants.length; i++) {
+ Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++)
if (tLevels[i] > 0) {
- final 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]));
+ 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]));
}
- }
- for (final Entry<Integer, Integer> tEntry : tMap.entrySet()) {
- if (tEntry.getKey() == 33 || tEntry.getKey() == 20 && tEntry.getValue() > 2
- || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId) {
+ for (Entry<Integer, Integer> tEntry : tMap.entrySet()) {
+ if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)
tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- else {
+ else
switch (Enchantment.enchantmentsList[tEntry.getKey()].type) {
- case weapon:
- if (tStats.isWeapon()) {
- tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- break;
- case all:
- tResult.put(tEntry.getKey(), tEntry.getValue());
- break;
- case armor:
- case armor_feet:
- case armor_head:
- case armor_legs:
- case armor_torso:
- break;
- case bow:
- if (tStats.isRangedWeapon()) {
- tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- break;
- case breakable:
- break;
- case fishing_rod:
- break;
- case digger:
- if (tStats.isMiningTool()) {
- tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- break;
+ case weapon:
+ if (tStats.isWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case all:
+ tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case armor:
+ case armor_feet:
+ case armor_head:
+ case armor_legs:
+ case armor_torso:
+ break;
+ case bow:
+ if (tStats.isRangedWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case breakable:
+ break;
+ case fishing_rod:
+ break;
+ case digger:
+ if (tStats.isMiningTool()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
}
- }
}
EnchantmentHelper.setEnchantments(tResult, aStack);
return true;
}
@Override
- public boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX,
- final int aY, final int aZ, final EntityLivingBase aPlayer) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return false;
- }
- GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
- this.doDamage(aStack,
- (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
- return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
- }
-
- @Override
- public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
}
@Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null && aPlayer != null) {
- tStats.onToolCrafted(aStack, aPlayer);
- }
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- /**
- * Called by the Block Harvesting Event within the GT_Proxy
- */
- @Override
- public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack,
- final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ,
- final byte aMetaData, final int aFortune, final boolean aSilkTouch,
- final BlockEvent.HarvestDropsEvent aEvent) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (this.isItemStackUsable(aStack) && this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F) {
- this.doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData,
- aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
- }
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null && tStats.canBlock()) {
- aPlayer.setItemInUse(aStack, 72000);
- }
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
- @Override
- public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null || !this.isItemStackUsable(aStack)) {
- return true;
- }
- GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F);
- if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) {
- return true;
- }
- if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) {
- final float tMagicDamage = tStats
- .getMagicDamageAgainstEntity(
- aEntity instanceof EntityLivingBase ? EnchantmentHelper
- .getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F,
- aEntity, aStack, aPlayer);
- float tDamage = tStats.getNormalDamageAgainstEntity(
- (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue()
- + this.getToolCombatDamage(aStack),
- aEntity, aStack, aPlayer);
- if (tDamage + tMagicDamage > 0.0F) {
- final 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);
- }
- final 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);
- aPlayer.motionX *= 0.6D;
- aPlayer.motionZ *= 0.6D;
- aPlayer.setSprinting(false);
- }
- if (tCriticalHit) {
- aPlayer.onCriticalHit(aEntity);
- }
- if (tMagicDamage > 0.0F) {
- aPlayer.onEnchantmentCritical(aEntity);
- }
- if (tDamage >= 18.0F) {
- aPlayer.triggerAchievement(AchievementList.overkill);
- }
- aPlayer.setLastAttacker(aEntity);
- if (aEntity instanceof EntityLivingBase) {
- EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
- }
- 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));
- aPlayer.addExhaustion(0.3F);
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- }
- return true;
+ public short getEmptyMetaData(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return (short) (aStack.getItemDamage() + 1 - (aStack.getItemDamage() % 2));
}
@Override
- public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
+ public int getItemEnchantability() {
+ return 0;
}
@Override
- public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
}
@Override
- public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) {
- if (player == null) {
- return;
- }
- if (player.getCurrentEquippedItem() == null) {
- return;
- }
- final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- if (tStats != null) {
- this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
- }
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java
index d47c5fe0fc..d1158c08c2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java
@@ -1,20 +1,28 @@
package gtPlusPlus.xmod.gregtech.api.items.tools;
-import java.util.*;
-import java.util.Map.Entry;
-
import gregtech.api.GregTech_API;
import gregtech.api.enchants.Enchantment_Radioactivity;
import gregtech.api.enums.Materials;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.interfaces.IToolStats;
import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.entity.*;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -27,318 +35,328 @@ import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
/**
- * 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(16,
- * 1, Materials.Bismuth, Materials.Bismuth, null);
+ * 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(16, 1, Materials.Bismuth, Materials.Bismuth, null);
*/
public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool {
/**
- * 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.
+ * 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.
* <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as
- * Key if you want to get a specific Item.
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
*/
- public static final HashMap<String, GT_MetaGenTool> sInstances = new HashMap<String, GT_MetaGenTool>();
+ public static final HashMap<String, GT_MetaGenTool> sInstances = new HashMap<String, GT_MetaGenTool>();
/* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- public static final Materials getPrimaryMaterialEx(final ItemStack aStack) {
+ public final HashMap<Short, IToolStats> mToolStats = new HashMap<Short, IToolStats>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public GT_MetaGenTool(String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ setCreativeTab(GregTech_API.TAB_GREGTECH);
+ setMaxStackSize(1);
+ sInstances.put(getUnlocalizedName(), this);
+ }
+
+ /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
+
+ public static final Materials getPrimaryMaterialEx(ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) {
- return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial"));
- }
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial"));
}
return Materials._NULL;
}
- public static final Materials getSecondaryMaterialEx(final ItemStack aStack) {
+ public static final Materials getSecondaryMaterialEx(ItemStack aStack) {
NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) {
aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) {
- return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial"));
- }
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial"));
}
return Materials._NULL;
}
- /*
- * ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE
- * ----------
- */
-
- public final HashMap<Short, IToolStats> mToolStats = new HashMap<Short, IToolStats>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized
- * The Unlocalized Name of this Item.
- */
- public GT_MetaGenTool(final String aUnlocalized) {
- super(aUnlocalized);
- GT_ModHandler.registerBoxableItemToToolBox(this);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- this.setMaxStackSize(1);
- GT_MetaGenTool.sInstances.put(this.getUnlocalizedName(), this);
- }
-
/**
* This adds a Custom Item to the ending Range.
*
- * @param aID
- * The Id of the assigned Tool Class [0 - 32765] (only even
- * Numbers allowed! Uneven ID's are empty electric Items)
- * @param aEnglish
- * The Default Localized Name of the created Item
- * @param aToolTip
- * The Default ToolTip of the created Item, you can also insert
- * null for having no ToolTip
- * @param aToolStats
- * The Food Value of this Item. Can be null as well.
- * @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.
+ * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items)
+ * @param aEnglish The Default Localized Name of the created Item
+ * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
+ * @param aToolStats The Food Value of this Item. Can be null as well.
+ * @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 addToolEx(final int aID, final String aEnglish, String aToolTip, final IToolStats aToolStats,
- final Object... aOreDictNamesAndAspects) {
- if (aToolTip == null) {
- aToolTip = "";
- }
+ public final ItemStack addToolEx(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(this.getUnlocalizedName() + "." + aID + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + (aID + 1) + ".name",
- aEnglish + " (Empty)");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + (aID + 1) + ".tooltip",
- "You need to recharge it");
- this.mToolStats.put((short) aID, aToolStats);
- this.mToolStats.put((short) (aID + 1), aToolStats);
+ 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");
+ mToolStats.put((short) aID, aToolStats);
+ mToolStats.put((short) (aID + 1), aToolStats);
aToolStats.onStatsAddedToTool(this, aID);
- final ItemStack rStack = new ItemStack(this, 1, aID);
- final List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
- for (final Object tOreDictNameOrAspect : aOreDictNamesAndAspects) {
- if (tOreDictNameOrAspect instanceof TC_AspectStack) {
+ ItemStack rStack = new ItemStack(this, 1, aID);
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) {
+ if (tOreDictNameOrAspect instanceof TC_AspectStack)
((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects);
- }
- else {
+ else
GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
- }
}
- if (GregTech_API.sThaumcraftCompat != null) {
+ if (GregTech_API.sThaumcraftCompat != null)
GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
- }
return rStack;
}
return null;
}
- @Override
- public boolean canBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
+ /**
+ * This Function gets an ItemStack Version of this Tool
+ *
+ * @param aToolID the ID of the Tool Class
+ * @param aAmount Amount of Items (well normally you only need 1)
+ * @param aPrimaryMaterial Primary Material of this Tool
+ * @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 getToolWithStatsEx(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.toString());
+ tToolNBT.setLong("MaxDamage", 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
+ }
+ if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.toString());
+
+ if (aElectricArray != null) {
+ tToolNBT.setBoolean("Electric", true);
+ tToolNBT.setLong("MaxCharge", aElectricArray[0]);
+ tToolNBT.setLong("Voltage", aElectricArray[1]);
+ tToolNBT.setLong("Tier", aElectricArray[2]);
+ tToolNBT.setLong("SpecialData", aElectricArray[3]);
+ }
+
+ tMainNBT.setTag("GT.ToolStats", tToolNBT);
+ rStack.setTagCompound(tMainNBT);
}
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
+ isItemStackUsable(rStack);
+ return rStack;
+ }
+
+ /**
+ * Called by the Block Harvesting Event within the GT_Proxy
+ */
+ public void onHarvestBlockEvent(ArrayList<ItemStack> 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());
}
@Override
- public boolean canLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null || !isItemStackUsable(aStack)) return true;
+ 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);
+ 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;
+ 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);
+ 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);
+ aPlayer.motionX *= 0.6D;
+ aPlayer.motionZ *= 0.6D;
+ aPlayer.setSprinting(false);
+ }
+ if (tCriticalHit) aPlayer.onCriticalHit(aEntity);
+ if (tMagicDamage > 0.0F) aPlayer.onEnchantmentCritical(aEntity);
+ if (tDamage >= 18.0F) aPlayer.triggerAchievement(AchievementList.overkill);
+ aPlayer.setLastAttacker(aEntity);
+ if (aEntity instanceof EntityLivingBase)
+ EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
+ 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));
+ aPlayer.addExhaustion(0.3F);
+ doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
}
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
}
- public boolean canUse(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z) {
- return this.canWrench(player, x, y, z);
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000);
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
}
+
@Override
- public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY,
- final int aZ) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
+ public Long[] getFluidContainerStats(ItemStack aStack) {
+ return null;
}
- public boolean canWrench(final EntityPlayer player, final int x, final int y, final int z) {
- System.out.println("canWrench");
- if (player == null) {
- return false;
- }
- if (player.getCurrentEquippedItem() == null) {
- return false;
- }
- if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
- return false;
+ @Override
+ public Long[] getElectricStats(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ 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")};
}
- final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- return tStats != null && tStats.isWrench();
+ return null;
+ }
+
+ public float getToolCombatDamage(ItemStack aStack) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return 0;
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
}
@Override
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) (aStack.getItemDamage() - aStack.getItemDamage() % 2);
+ public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) {
+ 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;
}
- private ItemStack getContainerItem(ItemStack aStack, final boolean playSound) {
- if (!this.isItemStackUsable(aStack)) {
- return null;
- }
+ @Override
+ 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()));
+ return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
+ }
+
+ private ItemStack getContainerItem(ItemStack aStack, boolean playSound) {
+ if (!isItemStackUsable(aStack)) return null;
aStack = GT_Utility.copyAmount(1, aStack);
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return null;
- }
- this.doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return null;
+ doDamage(aStack, tStats.getToolDamagePerContainerCraft());
aStack = aStack.stackSize > 0 ? aStack : null;
if (playSound) {
- // String sound = (aStack == null) ? tStats.getBreakingSound() :
- // tStats.getCraftingSound();
- // GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ //String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ //GT_Utility.doSoundAtClient(sound, 1, 1.0F);
}
return aStack;
}
- @Override
- public float getDigSpeed(final ItemStack aStack, final Block aBlock, final int aMetaData) {
- if (!this.isItemStackUsable(aStack)) {
- return 0.0F;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null || Math.max(0, this.getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData)) {
- return 0.0F;
- }
- return tStats.isMinableBlock(aBlock, (byte) aMetaData)
- ? Math.max(Float.MIN_NORMAL,
- tStats.getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed)
- : 0.0F;
+ public Interface_ToolStats getToolStats(ItemStack aStack) {
+ isItemStackUsable(aStack);
+ return getToolStatsInternal(aStack);
}
- @Override
- public Long[] getElectricStats(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- 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 null;
+ private Interface_ToolStats getToolStatsInternal(ItemStack aStack) {
+ return (Interface_ToolStats) (aStack == null ? null : mToolStats.get((short) aStack.getItemDamage()));
}
@Override
- public short getEmptyMetaData(final ItemStack aStack) {
- final NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT.removeTag("ench");
- }
- return (short) (aStack.getItemDamage() + 1 - aStack.getItemDamage() % 2);
+ 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;
}
@Override
- public Long[] getFluidContainerStats(final ItemStack aStack) {
- return null;
+ public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
}
@Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
+ public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
}
- @Override
- public int getItemEnchantability() {
- return 0;
+ public boolean canWrench(EntityPlayer player, int x, int y, int z) {
+ System.out.println("canWrench");
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats != null && tStats.isWrench();
}
- @Override
- public float getSaplingModifier(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer,
- final int aX, final int aY, final int aZ) {
- final IToolStats tStats = this.getToolStats(aStack);
- return tStats != null && tStats.isGrafter() ? Math.min(100.0F, (1 + this.getHarvestLevel(aStack, "")) * 20.0F)
- : 0.0F;
+ 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 float getToolCombatDamage(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return tStats.getBaseDamage() + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality;
+ public boolean canUse(ItemStack stack, EntityPlayer player, int x, int y, int z){
+ return canWrench(player, x, y, z);
}
- @Override
- public Interface_ToolStats getToolStats(final ItemStack aStack) {
- this.isItemStackUsable(aStack);
- return this.getToolStatsInternal(aStack);
+ public void used(ItemStack stack, EntityPlayer player, int x, int y, int z){
+ wrenchUsed(player, x, y, z);
}
- private Interface_ToolStats getToolStatsInternal(final ItemStack aStack) {
- return (Interface_ToolStats) (aStack == null ? null : this.mToolStats.get((short) aStack.getItemDamage()));
+ public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats.isWrench();
}
- /**
- * This Function gets an ItemStack Version of this Tool
- *
- * @param aToolID
- * the ID of the Tool Class
- * @param aAmount
- * Amount of Items (well normally you only need 1)
- * @param aPrimaryMaterial
- * Primary Material of this Tool
- * @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 getToolWithStatsEx(final int aToolID, final int aAmount, final Materials aPrimaryMaterial,
- final Materials aSecondaryMaterial, final long[] aElectricArray) {
- final ItemStack rStack = new ItemStack(this, aAmount, aToolID);
- final IToolStats tToolStats = this.getToolStats(rStack);
- if (tToolStats != null) {
- final NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound();
- if (aPrimaryMaterial != null) {
- tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.toString());
- tToolNBT.setLong("MaxDamage",
- 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
- }
- if (aSecondaryMaterial != null) {
- tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.toString());
- }
+ @Override
+ public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
- if (aElectricArray != null) {
- tToolNBT.setBoolean("Electric", true);
- tToolNBT.setLong("MaxCharge", aElectricArray[0]);
- tToolNBT.setLong("Voltage", aElectricArray[1]);
- tToolNBT.setLong("Tier", aElectricArray[2]);
- tToolNBT.setLong("SpecialData", aElectricArray[3]);
- }
+ @Override
+ public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
- tMainNBT.setTag("GT.ToolStats", tToolNBT);
- rStack.setTagCompound(tMainNBT);
- }
- this.isItemStackUsable(rStack);
- return rStack;
+ @Override
+ public boolean canBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
}
@Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
+ public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer);
+ super.onCreated(aStack, aWorld, aPlayer);
}
@Override
@@ -347,255 +365,88 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool {
}
@Override
- public boolean isItemStackUsable(final ItemStack aStack) {
- final IToolStats tStats = this.getToolStatsInternal(aStack);
+ public boolean isItemStackUsable(ItemStack aStack) {
+ IToolStats tStats = getToolStatsInternal(aStack);
if (aStack.getItemDamage() % 2 == 1 || tStats == null) {
- final NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT.removeTag("ench");
- }
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
return false;
}
- final Materials aMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack);
- final HashMap<Integer, Integer> tMap = new HashMap<Integer, Integer>(),
- tResult = new HashMap<Integer, Integer>();
+ Materials aMaterial = getPrimaryMaterial(aStack);
+ HashMap<Integer, Integer> tMap = new HashMap<Integer, Integer>(), tResult = new HashMap<Integer, Integer>();
if (aMaterial.mEnchantmentTools != null) {
tMap.put(aMaterial.mEnchantmentTools.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- if (aMaterial.mEnchantmentTools == Enchantment.fortune) {
+ if (aMaterial.mEnchantmentTools == Enchantment.fortune)
tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
- if (aMaterial.mEnchantmentTools == Enchantment.knockback) {
+ if (aMaterial.mEnchantmentTools == Enchantment.knockback)
tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
- if (aMaterial.mEnchantmentTools == Enchantment.fireAspect) {
+ if (aMaterial.mEnchantmentTools == Enchantment.fireAspect)
tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
}
- final Enchantment[] tEnchants = tStats.getEnchantments(aStack);
- final int[] tLevels = tStats.getEnchantmentLevels(aStack);
- for (int i = 0; i < tEnchants.length; i++) {
+ Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++)
if (tLevels[i] > 0) {
- final 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]));
+ 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]));
}
- }
- for (final Entry<Integer, Integer> tEntry : tMap.entrySet()) {
- if (tEntry.getKey() == 33 || tEntry.getKey() == 20 && tEntry.getValue() > 2
- || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId) {
+ for (Entry<Integer, Integer> tEntry : tMap.entrySet()) {
+ if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)
tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- else {
+ else
switch (Enchantment.enchantmentsList[tEntry.getKey()].type) {
- case weapon:
- if (tStats.isWeapon()) {
- tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- break;
- case all:
- tResult.put(tEntry.getKey(), tEntry.getValue());
- break;
- case armor:
- case armor_feet:
- case armor_head:
- case armor_legs:
- case armor_torso:
- break;
- case bow:
- if (tStats.isRangedWeapon()) {
- tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- break;
- case breakable:
- break;
- case fishing_rod:
- break;
- case digger:
- if (tStats.isMiningTool()) {
- tResult.put(tEntry.getKey(), tEntry.getValue());
- }
- break;
+ case weapon:
+ if (tStats.isWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case all:
+ tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case armor:
+ case armor_feet:
+ case armor_head:
+ case armor_legs:
+ case armor_torso:
+ break;
+ case bow:
+ if (tStats.isRangedWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case breakable:
+ break;
+ case fishing_rod:
+ break;
+ case digger:
+ if (tStats.isMiningTool()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
}
- }
}
EnchantmentHelper.setEnchantments(tResult, aStack);
return true;
}
@Override
- public boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX,
- final int aY, final int aZ, final EntityLivingBase aPlayer) {
- if (!this.isItemStackUsable(aStack)) {
- return false;
- }
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null) {
- return false;
- }
- GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
- this.doDamage(aStack,
- (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
- return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
}
@Override
- public void onBoost(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null && aPlayer != null) {
- tStats.onToolCrafted(aStack, aPlayer);
- }
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- /**
- * Called by the Block Harvesting Event within the GT_Proxy
- */
- @Override
- public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack,
- final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ,
- final byte aMetaData, final int aFortune, final boolean aSilkTouch,
- final BlockEvent.HarvestDropsEvent aEvent) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (this.isItemStackUsable(aStack) && this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F) {
- this.doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData,
- aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
- }
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null && tStats.canBlock()) {
- aPlayer.setItemInUse(aStack, 72000);
- }
- return super.onItemRightClick(aStack, aWorld, aPlayer);
+ public short getEmptyMetaData(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return (short) (aStack.getItemDamage() + 1 - (aStack.getItemDamage() % 2));
}
@Override
- public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats == null || !this.isItemStackUsable(aStack)) {
- return true;
- }
- GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F);
- if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) {
- return true;
- }
- if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) {
- final float tMagicDamage = tStats
- .getMagicDamageAgainstEntity(
- aEntity instanceof EntityLivingBase ? EnchantmentHelper
- .getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F,
- aEntity, aStack, aPlayer);
- float tDamage = tStats.getNormalDamageAgainstEntity(
- (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue()
- + this.getToolCombatDamage(aStack),
- aEntity, aStack, aPlayer);
- if (tDamage + tMagicDamage > 0.0F) {
- final 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);
- }
- final 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);
- aPlayer.motionX *= 0.6D;
- aPlayer.motionZ *= 0.6D;
- aPlayer.setSprinting(false);
- }
- if (tCriticalHit) {
- aPlayer.onCriticalHit(aEntity);
- }
- if (tMagicDamage > 0.0F) {
- aPlayer.onEnchantmentCritical(aEntity);
- }
- if (tDamage >= 18.0F) {
- aPlayer.triggerAchievement(AchievementList.overkill);
- }
- aPlayer.setLastAttacker(aEntity);
- if (aEntity instanceof EntityLivingBase) {
- EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
- }
- 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));
- aPlayer.addExhaustion(0.3F);
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- }
- return true;
+ public int getItemEnchantability() {
+ return 0;
}
@Override
- public void onLink(final EntityPlayer aPlayer, final ItemStack aStack, final EntityMinecart cart) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
}
@Override
- public void onWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) {
- final IToolStats tStats = this.getToolStats(aStack);
- if (tStats != null) {
- this.doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
-
- public boolean shouldHideFacades(final ItemStack stack, final EntityPlayer player) {
- if (player == null) {
- return false;
- }
- if (player.getCurrentEquippedItem() == null) {
- return false;
- }
- if (!this.isItemStackUsable(player.getCurrentEquippedItem())) {
- return false;
- }
- final Interface_ToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- return tStats.isWrench();
- }
-
- public void used(final ItemStack stack, final EntityPlayer player, final int x, final int y, final int z) {
- this.wrenchUsed(player, x, y, z);
- }
-
- public void wrenchUsed(final EntityPlayer player, final int x, final int y, final int z) {
- if (player == null) {
- return;
- }
- if (player.getCurrentEquippedItem() == null) {
- return;
- }
- final IToolStats tStats = this.getToolStats(player.getCurrentEquippedItem());
- if (tStats != null) {
- this.doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
- }
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
index fba7bdd0b6..ed663188d9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
@@ -1,12 +1,15 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
-import java.util.List;
-
import gregtech.api.enums.SubTag;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
+
+import java.util.List;
+
import net.minecraft.block.BlockDispenser;
-import net.minecraft.dispenser.*;
+import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.dispenser.IPosition;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -16,78 +19,66 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_Base> {
- @Override
- public boolean canDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) {
- return false;
- }
+ @Override
+ public boolean onLeftClickEntity(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ return false;
+ }
- @Override
- public List<String> getAdditionalToolTips(final Gregtech_MetaItem_Base aItem, final List<String> aList,
- final ItemStack aStack) {
- return aList;
- }
+ @Override
+ public boolean onItemUse(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ return false;
+ }
- @Override
- public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType,
- final ItemStack aStack, final World aWorld, final double aX, final double aY, final double aZ) {
- return null;
- }
+ @Override
+ public boolean onItemUseFirst(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ return false;
+ }
- @Override
- public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType,
- final ItemStack aStack, final World aWorld, final EntityLivingBase aEntity, final float aSpeed) {
- return null;
- }
+ @Override
+ public ItemStack onItemRightClick(Gregtech_MetaItem_Base aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return aStack;
+ }
- @Override
- public boolean hasProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType,
- final ItemStack aStack) {
- return false;
- }
+ @Override
+ public List<String> getAdditionalToolTips(Gregtech_MetaItem_Base aItem, List<String> aList, ItemStack aStack) {
+ return aList;
+ }
- @Override
- public boolean isItemStackUsable(final Gregtech_MetaItem_Base aItem, final ItemStack aStack) {
- return true;
- }
+ @Override
+ public void onUpdate(Gregtech_MetaItem_Base aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
+ }
- @Override
- public ItemStack onDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource,
- final ItemStack aStack) {
- final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
- final IPosition iposition = BlockDispenser.func_149939_a(aSource);
- final ItemStack itemstack1 = aStack.splitStack(1);
- BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
- return aStack;
- }
+ @Override
+ public boolean isItemStackUsable(Gregtech_MetaItem_Base aItem, ItemStack aStack) {
+ return true;
+ }
- @Override
- public ItemStack onItemRightClick(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld,
- final EntityPlayer aPlayer) {
- return aStack;
- }
+ @Override
+ public boolean canDispense(Gregtech_MetaItem_Base aItem, IBlockSource aSource, ItemStack aStack) {
+ return false;
+ }
- @Override
- public boolean onItemUse(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final EntityPlayer aPlayer,
- final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX,
- final float hitY, final float hitZ) {
- return false;
- }
+ @Override
+ public ItemStack onDispense(Gregtech_MetaItem_Base aItem, IBlockSource aSource, ItemStack aStack) {
+ EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
+ IPosition iposition = BlockDispenser.func_149939_a(aSource);
+ ItemStack itemstack1 = aStack.splitStack(1);
+ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
+ return aStack;
+ }
- @Override
- public boolean onItemUseFirst(final Gregtech_MetaItem_Base aItem, final ItemStack aStack,
- final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide,
- final float hitX, final float hitY, final float hitZ) {
- return false;
- }
+ @Override
+ public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack) {
+ return false;
+ }
- @Override
- public boolean onLeftClickEntity(final Gregtech_MetaItem_Base aItem, final ItemStack aStack,
- final EntityPlayer aPlayer, final Entity aEntity) {
- return false;
- }
+ @Override
+ public EntityArrow getProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ return null;
+ }
- @Override
- public void onUpdate(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld,
- final Entity aPlayer, final int aTimer, final boolean aIsInHand) {
- }
+ @Override
+ public EntityArrow getProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ return null;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
index 5f01b2e44d..c59b4fe37f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
@@ -1,16 +1,20 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
-import java.util.List;
-import java.util.Random;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.ItemData;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
+
+import java.util.List;
+import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -20,117 +24,104 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidBlock;
-public class ToolType_HardHammer extends ToolType_Base {
- private final int mVanillaCosts;
- private final int mEUCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting",
- "Usable for Prospecting");
+public class ToolType_HardHammer
+ extends ToolType_Base {
+ private final int mVanillaCosts;
+ private final int mEUCosts;
+ private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting");
+
+ public ToolType_HardHammer(int aVanillaCosts, int aEUCosts) {
+ this.mVanillaCosts = aVanillaCosts;
+ this.mEUCosts = aEUCosts;
+ }
- public ToolType_HardHammer(final int aVanillaCosts, final int aEUCosts) {
- this.mVanillaCosts = aVanillaCosts;
- this.mEUCosts = aEUCosts;
- }
+ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float 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);
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList,
- final ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer,
- final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX,
- final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
+ ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ return true;
+ }
+ if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))) {
+ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ int tX = aX;
+ int tY = aY;
+ int tZ = aZ;
+ int tMetaID = 0;
+ int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0;
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
- if (tAssotiation != null && tAssotiation.mPrefix.toString().startsWith("ore")) {
- GT_Utility.sendChatToPlayer(aPlayer,
- "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY,
- aZ);
- return true;
- }
- if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) {
- if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX,
- aY, aZ);
- int tX = aX;
- int tY = aY;
- int tZ = aZ;
- int tMetaID = 0;
- final int tQuality = aItem instanceof GT_MetaGenerated_Tool
- ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0;
+ int i = 0;
+ for (int j = 6 + tQuality; i < j; i++) {
+ tX -= ForgeDirection.getOrientation(aSide).offsetX;
+ tY -= ForgeDirection.getOrientation(aSide).offsetY;
+ tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
- int i = 0;
- for (final int j = 6 + tQuality; i < j; i++) {
- tX -= ForgeDirection.getOrientation(aSide).offsetX;
- tY -= ForgeDirection.getOrientation(aSide).offsetY;
- tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
+ Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock.");
+ break;
+ }
+ if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock.");
+ break;
+ }
+ if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Rock.");
+ break;
+ }
+ if (tBlock != aBlock) {
+ if (i >= 4) {
+ break;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Rock.");
+ break;
+ }
+ }
+ Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
+ i = 0;
+ for (int j = 9 + 2 * tQuality; i < j; i++) {
+ tX = aX - 4 - tQuality + tRandom.nextInt(j);
+ tY = aY - 4 - tQuality + tRandom.nextInt(j);
+ tZ = aZ - 4 - tQuality + tRandom.nextInt(j);
+ Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock instanceof GT_Block_Ores)) {
+ TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
+ if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ } else {
+ tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
+ tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
+ }
+ return true;
+ }
+ return false;
+ }
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock.");
- break;
- }
- if (tBlock == Blocks.water || tBlock == Blocks.flowing_water || tBlock instanceof IFluidBlock) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock.");
- break;
- }
- if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Rock.");
- break;
- }
- if (tBlock != aBlock) {
- if (i >= 4) {
- break;
- }
- GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Rock.");
- break;
- }
- }
- final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
- i = 0;
- for (final int j = 9 + 2 * tQuality; i < j; i++) {
- tX = aX - 4 - tQuality + tRandom.nextInt(j);
- tY = aY - 4 - tQuality + tRandom.nextInt(j);
- tZ = aZ - 4 - tQuality + tRandom.nextInt(j);
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if (tBlock instanceof GT_Block_Ores) {
- final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
- if (tTileEntity instanceof GT_TileEntity_Ores) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData
- % 1000];
- if (tMaterial != null && tMaterial != Materials._NULL) {
- GT_Utility.sendChatToPlayer(aPlayer,
- "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- }
- else {
- tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
- tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if (tAssotiation != null && tAssotiation.mPrefix.toString().startsWith("ore")) {
- GT_Utility.sendChatToPlayer(aPlayer,
- "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- }
- GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
- }
- return true;
- }
- return false;
- }
+ public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
+ aList.add(this.mTooltip);
+ return aList;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
index 72bd33a596..9eb44d91d6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
@@ -1,13 +1,16 @@
package gtPlusPlus.xmod.gregtech.api.items.types;
-import java.util.Arrays;
-import java.util.List;
-
import gregtech.api.GregTech_API;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
import ic2.api.tile.IWrenchable;
+
+import java.util.Arrays;
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,165 +20,130 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-public class ToolType_Wrench extends ToolType_Base {
- private final int mCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench",
- "Rotates Blocks on Rightclick");
+public class ToolType_Wrench
+ extends ToolType_Base {
+ private final int mCosts;
+ private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick");
- public ToolType_Wrench(final int aCosts) {
- this.mCosts = aCosts;
- }
+ public ToolType_Wrench(int aCosts) {
+ this.mCosts = aCosts;
+ }
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList,
- final ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
+ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float 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 aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
+ TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ try {
+ if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) {
+ if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ ((IWrenchable) aTileEntity).setFacing((short) aTargetSide);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
+ int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) {
+ ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
+ for (ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
+ if (tOutput == null) {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack));
+ } else {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput));
+ tOutput = null;
+ }
+ }
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ return true;
+ }
+ } catch (Throwable e) {
+ }
+ if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (aMeta == aTargetSide) {
+ if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
+ aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
+ aWorld.setBlockToAir(aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ } else {
+ if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) {
+ if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) {
+ if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ if (aBlock == Blocks.hopper) {
+ if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return true;
+ }
+ }
+ if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) &&
+ ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) &&
+ (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) {
+ if (!aPlayer.capabilities.isCreativeMode) {
+ ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
+ }
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ);
+ }
+ return false;
+ }
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer,
- final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX,
- final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- final byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
- final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- try {
- if (aTileEntity != null && aTileEntity instanceof IWrenchable) {
- if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
- if (aPlayer.capabilities.isCreativeMode
- || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)) {
- ((IWrenchable) aTileEntity).setFacing(aTargetSide);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F,
- -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
- final int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
- if (aPlayer.capabilities.isCreativeMode
- || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts)) {
- ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
- for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
- if (tOutput == null) {
- aWorld.spawnEntityInWorld(
- new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack));
- }
- else {
- aWorld.spawnEntityInWorld(
- new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput));
- tOutput = null;
- }
- }
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F,
- -1.0F, aX, aY, aZ);
- }
- return true;
- }
- return true;
- }
- }
- catch (final Throwable e) {
- }
- if (aBlock == Blocks.log || aBlock == Blocks.log2 || aBlock == Blocks.hay_block) {
- if (aPlayer.capabilities.isCreativeMode || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F,
- aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.powered_repeater || aBlock == Blocks.unpowered_repeater) {
- if (aPlayer.capabilities.isCreativeMode || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F,
- aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.powered_comparator || aBlock == Blocks.unpowered_comparator) {
- if (aPlayer.capabilities.isCreativeMode || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F,
- aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.crafting_table || aBlock == Blocks.bookshelf) {
- if (aPlayer.capabilities.isCreativeMode || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)) {
- aWorld.spawnEntityInWorld(
- new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F,
- aX, aY, aZ);
- }
- return true;
- }
- if (aMeta == aTargetSide) {
- if (aBlock == Blocks.pumpkin || aBlock == Blocks.lit_pumpkin || aBlock == Blocks.piston
- || aBlock == Blocks.sticky_piston || aBlock == Blocks.dispenser || aBlock == Blocks.dropper
- || aBlock == Blocks.furnace || aBlock == Blocks.lit_furnace || aBlock == Blocks.chest
- || aBlock == Blocks.trapped_chest || aBlock == Blocks.ender_chest || aBlock == Blocks.hopper) {
- if (aPlayer.capabilities.isCreativeMode
- || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)) {
- aWorld.spawnEntityInWorld(
- new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
- aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F,
- -1.0F, aX, aY, aZ);
- }
- return true;
- }
- }
- else {
- if (aBlock == Blocks.piston || aBlock == Blocks.sticky_piston || aBlock == Blocks.dispenser
- || aBlock == Blocks.dropper) {
- if (aMeta < 6 && (aPlayer.capabilities.isCreativeMode
- || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F,
- -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.pumpkin || aBlock == Blocks.lit_pumpkin || aBlock == Blocks.furnace
- || aBlock == Blocks.lit_furnace || aBlock == Blocks.chest || aBlock == Blocks.ender_chest
- || aBlock == Blocks.trapped_chest) {
- if (aTargetSide > 1 && (aPlayer.capabilities.isCreativeMode
- || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F,
- -1.0F, aX, aY, aZ);
- }
- return true;
- }
- if (aBlock == Blocks.hopper) {
- if (aTargetSide != 1 && (aPlayer.capabilities.isCreativeMode
- || ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F,
- -1.0F, aX, aY, aZ);
- }
- return true;
- }
- }
- if (Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ))
- .contains(ForgeDirection.getOrientation(aTargetSide))
- && (aPlayer.capabilities.isCreativeMode || !GT_ModHandler.isElectricItem(aStack)
- || GT_ModHandler.canUseElectricItem(aStack, this.mCosts))
- && aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide))) {
- if (!aPlayer.capabilities.isCreativeMode) {
- ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
- }
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX,
- aY, aZ);
- }
- return false;
- }
+ public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
+ aList.add(this.mTooltip);
+ return aList;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
index 800f6cf875..2effc58f9a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
@@ -16,303 +16,207 @@ import net.minecraftforge.fluids.FluidStack;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my generic Tanks. Filling and emptying
- * behavior have to be implemented manually
+ * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually
*/
public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_BasicTank {
- public FluidStack mFluid;
- public FluidStack mFluid2;
+ public FluidStack mFluid;
+ public FluidStack mFluid2;
/**
- * @param aInvSlotCount
- * should be 3
+ * @param aInvSlotCount should be 3
*/
- public GT_MetaTileEntity_DeluxeTank(final int aID, final String aName, final String aNameRegional, final int aTier,
- final int aInvSlotCount, final String aDescription, final ITexture... aTextures) {
+ public GT_MetaTileEntity_DeluxeTank(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_DeluxeTank(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_DeluxeTank(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == this.getOutputSlot();
+ public boolean isSimpleMachine() {
+ return false;
}
@Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == this.getInputSlot();
+ public boolean isValidSlot(int aIndex) {
+ return aIndex != getStackDisplaySlot();
}
@Override
- public abstract boolean canTankBeEmptied();
-
- @Override
- public abstract boolean canTankBeFilled();
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ if (mFluid2 != null) aNBT.setTag("mFluid2", mFluid2.writeToNBT(new NBTTagCompound()));
+ }
@Override
- public abstract boolean displaysItemStack();
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ mFluid2 = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid2"));
+ }
@Override
- public abstract boolean displaysStackSize();
+ public abstract boolean doesFillContainers();
@Override
public abstract boolean doesEmptyContainers();
@Override
- public abstract boolean doesFillContainers();
+ public abstract boolean canTankBeFilled();
@Override
- public FluidStack drain(final int maxDrain, final boolean doDrain) {
- if (this.getDrainableStack() == null || !this.canTankBeEmptied()) {
- return null;
- }
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- this.getBaseMetaTileEntity().markDirty();
- return null;
- }
-
- int used = maxDrain;
- if (this.getDrainableStack().amount < used) {
- used = this.getDrainableStack().amount;
- }
-
- if (doDrain) {
- this.getDrainableStack().amount -= used;
- this.getBaseMetaTileEntity().markDirty();
- }
-
- final FluidStack drained = this.getDrainableStack().copy();
- drained.amount = used;
-
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- this.getBaseMetaTileEntity().markDirty();
- }
-
- return drained;
- }
+ public abstract boolean canTankBeEmptied();
@Override
- public int fill(final FluidStack aFluid, final boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !this.canTankBeFilled()
- || !this.isFluidInputAllowed(aFluid)) {
- return 0;
- }
-
- if (this.getFillableStack() == null || this.getFillableStack().getFluid().getID() <= 0) {
- if (aFluid.amount <= this.getCapacity()) {
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getBaseMetaTileEntity().markDirty();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getFillableStack().amount = this.getCapacity();
- this.getBaseMetaTileEntity().markDirty();
- }
- return this.getCapacity();
- }
-
- if (!this.getFillableStack().isFluidEqual(aFluid)) {
- return 0;
- }
-
- final int space = this.getCapacity() - this.getFillableStack().amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- this.getFillableStack().amount += aFluid.amount;
- this.getBaseMetaTileEntity().markDirty();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.getFillableStack().amount = this.getCapacity();
- }
- return space;
- }
+ public abstract boolean displaysItemStack();
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
+ public abstract boolean displaysStackSize();
@Override
- public FluidStack getDisplayedFluid() {
- return this.getDrainableStack();
+ public int getInputSlot() {
+ return 0;
}
@Override
- public FluidStack getDrainableStack() {
- return this.getDrainableStackEx(1);
- }
-
- public FluidStack getDrainableStackEx(final int stackID) {
- if (stackID <= 1) {
- return this.mFluid;
- }
- return this.mFluid2;
+ public int getOutputSlot() {
+ return 1;
}
@Override
- public FluidStack getFillableStack() {
- return this.getFillableStackEx(1);
+ public int getStackDisplaySlot() {
+ return 2;
}
- public FluidStack getFillableStackEx(final int stackID) {
- if (stackID <= 1) {
- return this.mFluid;
- }
- return this.mFluid2;
+ public int getStackDisplaySlot2() {
+ return 3;
}
@Override
- public FluidStack getFluid() {
- return this.getDrainableStack();
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return true;
}
@Override
- public int getFluidAmount() {
- return this.getDrainableStack() != null ? this.getDrainableStack().amount : 0;
+ public boolean isFluidChangingAllowed() {
+ return true;
}
@Override
- public int getInputSlot() {
- return 0;
+ public FluidStack getFillableStack() {
+ return getFillableStackEx(1);
}
- @Override
- public int getOutputSlot() {
- return 1;
+ public FluidStack getFillableStackEx(int stackID) {
+ if (stackID <= 1){
+ return mFluid;
+ }
+ return mFluid2;
}
@Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity);
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ mFluid = aFluid;
+ return mFluid;
}
-
- @Override
- public int getStackDisplaySlot() {
- return 2;
+
+ public FluidStack setFillableStack2(FluidStack aFluid) {
+ mFluid2 = aFluid;
+ return mFluid2;
}
- public int getStackDisplaySlot2() {
- return 3;
+ @Override
+ public FluidStack getDrainableStack() {
+ return getDrainableStackEx(1);
}
- @Override
- public boolean isFluidChangingAllowed() {
- return true;
+ public FluidStack getDrainableStackEx(int stackID) {
+ if (stackID <= 1){
+ return mFluid;
+ }
+ return mFluid2;
}
@Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return true;
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ mFluid = aFluid;
+ return mFluid;
}
@Override
- public boolean isSimpleMachine() {
- return false;
+ public FluidStack getDisplayedFluid() {
+ return getDrainableStack();
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex != this.getStackDisplaySlot();
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- this.mFluid2 = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid2"));
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_DeluxeTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
}
@Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
- if (this.isFluidChangingAllowed() && this.getFillableStack() != null
- && this.getFillableStack().amount <= 0) {
- this.setFillableStack(null);
- }
-
- if (this.displaysItemStack() && this.getStackDisplaySlot() >= 0
- && this.getStackDisplaySlot() < this.mInventory.length) {
- if (this.getDisplayedFluid() == null) {
- if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot()], true, true)) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- }
- }
- else {
- this.mInventory[this.getStackDisplaySlot()] = GT_Utility
- .getFluidDisplayStack(this.getDisplayedFluid(), this.displaysStackSize());
+ if (isFluidChangingAllowed() && getFillableStack() != null && getFillableStack().amount <= 0)
+ setFillableStack(null);
+
+ if (displaysItemStack() && getStackDisplaySlot() >= 0 && getStackDisplaySlot() < mInventory.length) {
+ if (getDisplayedFluid() == null) {
+ if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true))
+ mInventory[getStackDisplaySlot()] = null;
+ } else {
+ mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize());
}
}
- if (this.displaysItemStack() && this.getStackDisplaySlot2() >= 0
- && this.getStackDisplaySlot2() < this.mInventory.length) {
- if (this.getDrainableStackEx(2) == null) {
- if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot2()], true, true)) {
- this.mInventory[this.getStackDisplaySlot2()] = null;
- }
- }
- else {
- this.mInventory[this.getStackDisplaySlot2()] = GT_Utility
- .getFluidDisplayStack(this.getDrainableStackEx(2), this.displaysStackSize());
+ if (displaysItemStack() && getStackDisplaySlot2() >= 0 && getStackDisplaySlot2() < mInventory.length) {
+ if (getDrainableStackEx(2) == null) {
+ if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot2()], true, true))
+ mInventory[getStackDisplaySlot2()] = null;
+ } else {
+ mInventory[getStackDisplaySlot2()] = GT_Utility.getFluidDisplayStack(getDrainableStackEx(2), displaysStackSize());
}
}
- if (this.doesEmptyContainers()) {
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true);
- if (tFluid != null && this.isFluidInputAllowed(tFluid)) {
-
- if (tFluid.isFluidEqual(this.getDrainableStackEx(1)) || this.getDrainableStackEx(1) == null) {
- if (this.getFillableStackEx(1) == null) {
- if (this.isFluidInputAllowed(tFluid) && tFluid.amount <= this.getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(),
- GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.setFillableStack(tFluid.copy());
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ if (doesEmptyContainers()) {
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true);
+ if (tFluid != null && isFluidInputAllowed(tFluid)) {
+
+ if (tFluid.isFluidEqual(getDrainableStackEx(1)) || getDrainableStackEx(1) == null){
+ if (getFillableStackEx(1) == null) {
+ if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ setFillableStack(tFluid.copy());
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
- }
- else {
- if (tFluid.isFluidEqual(this.getFillableStack())
- && tFluid.amount + this.getFillableStack().amount <= this.getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(),
- GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.getFillableStack().amount += tFluid.amount;
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ } else {
+ if (tFluid.isFluidEqual(getFillableStack()) && tFluid.amount + getFillableStack().amount <= getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ getFillableStack().amount += tFluid.amount;
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
}
}
- else if (tFluid.isFluidEqual(this.getDrainableStackEx(2)) || this.getDrainableStackEx(2) == null) {
- if (this.getFillableStackEx(2) == null) {
- if (this.isFluidInputAllowed(tFluid) && tFluid.amount <= this.getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(),
- GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.setFillableStack2(tFluid.copy());
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ else if (tFluid.isFluidEqual(getDrainableStackEx(2)) || (getDrainableStackEx(2) == null)){
+ if (getFillableStackEx(2) == null) {
+ if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ setFillableStack2(tFluid.copy());
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
- }
- else {
- if (tFluid.isFluidEqual(this.getFillableStackEx(2))
- && tFluid.amount + this.getFillableStackEx(2).amount <= this.getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(),
- GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.getFillableStackEx(2).amount += tFluid.amount;
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ } else {
+ if (tFluid.isFluidEqual(getFillableStackEx(2)) && tFluid.amount + getFillableStackEx(2).amount <= getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ getFillableStackEx(2).amount += tFluid.amount;
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
}
@@ -323,47 +227,101 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas
}
}
- if (this.doesFillContainers()) {
- final ItemStack tOutput = GT_Utility.fillFluidContainer(this.getDrainableStack(),
- this.mInventory[this.getInputSlot()], false, true);
- if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tOutput, 1)) {
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- if (tFluid != null) {
- this.getDrainableStack().amount -= tFluid.amount;
- }
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- }
+ if (doesFillContainers()) {
+ 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);
+ if (tFluid != null) getDrainableStack().amount -= tFluid.amount;
+ if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) setDrainableStack(null);
}
}
}
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- if (this.mFluid != null) {
- aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
+ public FluidStack getFluid() {
+ return getDrainableStack();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return getDrainableStack() != null ? getDrainableStack().amount : 0;
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ 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()) {
+ if (doFill) {
+ setFillableStack(aFluid.copy());
+ getBaseMetaTileEntity().markDirty();
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ setFillableStack(aFluid.copy());
+ getFillableStack().amount = getCapacity();
+ getBaseMetaTileEntity().markDirty();
+ }
+ return getCapacity();
}
- if (this.mFluid2 != null) {
- aNBT.setTag("mFluid2", this.mFluid2.writeToNBT(new NBTTagCompound()));
+
+ if (!getFillableStack().isFluidEqual(aFluid))
+ return 0;
+
+ int space = getCapacity() - getFillableStack().amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ getFillableStack().amount += aFluid.amount;
+ getBaseMetaTileEntity().markDirty();
+ }
+ return aFluid.amount;
}
+ if (doFill)
+ getFillableStack().amount = getCapacity();
+ return space;
}
@Override
- public FluidStack setDrainableStack(final FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ if (getDrainableStack() == null || !canTankBeEmptied()) return null;
+ if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) {
+ setDrainableStack(null);
+ getBaseMetaTileEntity().markDirty();
+ return null;
+ }
+
+ int used = maxDrain;
+ if (getDrainableStack().amount < used)
+ used = getDrainableStack().amount;
+
+ if (doDrain) {
+ getDrainableStack().amount -= used;
+ getBaseMetaTileEntity().markDirty();
+ }
+
+ FluidStack drained = getDrainableStack().copy();
+ drained.amount = used;
+
+ if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) {
+ setDrainableStack(null);
+ getBaseMetaTileEntity().markDirty();
+ }
+
+ return drained;
}
@Override
- public FluidStack setFillableStack(final FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == getOutputSlot();
}
- public FluidStack setFillableStack2(final FluidStack aFluid) {
- this.mFluid2 = aFluid;
- return this.mFluid2;
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == getInputSlot();
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
index 4836ee0e42..dcecc3ff34 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
@@ -18,165 +18,148 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-public class GregtechMetaCondensor extends GregtechMetaBoilerBase {
+public class GregtechMetaCondensor extends GregtechMetaBoilerBase{
- public GregtechMetaCondensor(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]);
- }
-
- public GregtechMetaCondensor(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- @Override
- public final int fill(final FluidStack aFluid, final boolean doFill) {
- if (Utils.isIC2Steam(aFluid) && this.mProcessingEnergy < 50) {
- final int tFilledAmount = Math.min(50, aFluid.amount);
- if (doFill) {
- this.mProcessingEnergy += tFilledAmount;
- }
- return tFilledAmount;
- }
- return super.fill(aFluid, doFill);
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, CORE.GT_Tooltip
- };
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, 32000);
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[5][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT,
- Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa))
- };
- rTextures[1][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT,
- Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)
- };
- rTextures[2][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT,
- Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)
- };
- rTextures[3][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT,
- Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER)
- };
- rTextures[4][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT,
- Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE)
- };
- }
- return rTextures;
- }
-
- @Override
- public int maxProgresstime() {
- return 1000;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- this.RI = MathUtils.randLong(5L, 30L);
- if (aBaseMetaTileEntity.isServerSide() && aTick > 20L) {
- if (this.mTemperature <= 5) {
- this.mTemperature = 5;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 10) {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; this.mSteam != null && i < 6; i = (byte) (i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing()) {
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null) {
- final FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i),
- Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null) {
- final int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(),
- tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity
- .drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
- }
- }
- if (aTick % 10L == 0L) {
- if (this.mTemperature > 5) {
- if (this.mFluid == null || !GT_ModHandler.isWater(this.mFluid) || this.mFluid.amount <= 0) {
- this.mHadNoWater = true;
- }
- else {
- if (this.mHadNoWater) {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
- }
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(30L);
- }
- else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 30;
- }
- else {
- this.mSteam = GT_ModHandler.getSteam(30L);
- }
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if (this.mSteam != null && this.mSteam.amount > 32000) {
- this.sendSound((byte) 1);
- this.mSteam.amount = 24000;
- }
- /*
- * if ((this.mProcessingEnergy <= 0) &&
- * (aBaseMetaTileEntity.isAllowedToWork()) &&
- * (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- * OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_))))) {
- * this.mProcessingEnergy += 1000;
- * aBaseMetaTileEntity.decrStackSize(2, 1);
- * aBaseMetaTileEntity.addStackToSlot(3,
- * GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty,
- * 1L)); }
- */
- if (this.mTemperature < 1000 && this.mProcessingEnergy > 0 && aTick % this.RI == 0L) {
- this.mProcessingEnergy -= 40;
- this.mTemperature += 2;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ public GregtechMetaCondensor(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]);
+ }
+
+ public GregtechMetaCondensor(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, CORE.GT_Tooltip};
}
- }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[5][17][];
+ for (byte i = -1; i < 16; i++){
+ rTextures[0][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa))};
+ rTextures[1][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
+ rTextures[2][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
+ rTextures[3][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER) };
+ rTextures[4][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE) };
+ }
+ return rTextures;
+ }
+
+ public int maxProgresstime()
+ {
+ return 1000;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new CONTAINER_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, 32000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GUI_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ this.RI = MathUtils.randLong(5L, 30L);
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
+ {
+ if (this.mTemperature <= 5)
+ {
+ this.mTemperature = 5;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 10)
+ {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing())
+ {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null)
+ {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null)
+ {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 5)
+ {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
+ {
+ this.mHadNoWater = true;
+ }
+ else
+ {
+ if (this.mHadNoWater)
+ {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(30L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 30;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(30L);
+ }
+ }
+ }
+ else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000))
+ {
+ sendSound((byte)1);
+ this.mSteam.amount = 24000;
+ }
+ /*if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_)))))
+ {
+ this.mProcessingEnergy += 1000;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
+ }*/
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % RI == 0L))
+ {
+ this.mProcessingEnergy -= 40;
+ this.mTemperature += 2;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
+
+ public final int fill(FluidStack aFluid, boolean doFill)
+ {
+ if ((Utils.isIC2Steam(aFluid)) && (this.mProcessingEnergy < 50))
+ {
+ int tFilledAmount = Math.min(50, aFluid.amount);
+ if (doFill) {
+ this.mProcessingEnergy += tFilledAmount;
+ }
+ return tFilledAmount;
+ }
+ return super.fill(aFluid, doFill);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
index 9236d091fc..4f4f3f931f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
@@ -1,6 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_1by1;
import gregtech.api.gui.GT_GUIContainer_1by1;
@@ -30,92 +30,113 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
* setCreativeTab(GregTech_API.TAB_GREGTECH); }
*/
- public boolean mCharge = false, mDecharge = false;
- public int mBatteryCount = 1, mChargeableCount = 1;
+ public boolean mCharge = false, mDecharge = false;
+ public int mBatteryCount = 1, mChargeableCount = 1;
- private long count = 0;
-
- private long mStored = 0;
-
- private long mMax = 0;
-
- /*
- * MACHINE_STEEL_SIDE
- */
-
- public GregtechMetaEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier,
- final String aDescription, final int aSlotCount) {
+ public GregtechMetaEnergyBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
}
- public GregtechMetaEnergyBuffer(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures, final int aSlotCount) {
+ public GregtechMetaEnergyBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
@Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return false;
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return false;
- }
-
- @Override
- public void closeInventory() {
- }
-
- @Override
- public int dechargerSlotCount() {
- return this.mDecharge ? this.mInventory.length : 0;
- }
-
- @Override
- public int dechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- return null;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- return null;
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
- };
+ public String[] getDescription() {
+ return new String[] {mDescription, CORE.GT_Tooltip};
}
/*
- * @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[] { new GT_RenderedTexture(
- * Textures.BlockIcons.MACHINE_HEATPROOFCASING) }; rTextures[1][i + 1] = new
- * ITexture[] { new GT_RenderedTexture(
- * Textures.BlockIcons.MACHINE_HEATPROOFCASING), mInventory.length > 4 ?
- * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] :
- * Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; } return rTextures; }
+ * MACHINE_STEEL_SIDE
*/
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = getFront(i);
+ rTextures[1][i + 1] = getBack(i);
+ rTextures[2][i + 1] = getBottom(i);
+ rTextures[3][i + 1] = getTop(i);
+ rTextures[4][i + 1] = getSides(i);
+ rTextures[5][i + 1] = getFrontActive(i);
+ rTextures[6][i + 1] = getBackActive(i);
+ rTextures[7][i + 1] = getBottomActive(i);
+ rTextures[8][i + 1] = getTopActive(i);
+ rTextures[9][i + 1] = getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @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[] getFront(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
+ }
+
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
+ }
+
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)};
+ }
+
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
+ }
+
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
+ }
+
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
+ }
+
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)};
+ }
+
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)};
+ }
+
+ /*@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[] { new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_HEATPROOFCASING) };
+ rTextures[1][i + 1] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_HEATPROOFCASING),
+ mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ }
+ return rTextures;
+ }*/
/*
* @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) {
@@ -139,226 +160,174 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
* } return rTextures; }
*/
- /*
- * @Override public ITexture[] getTexture(IGregTechTileEntity
- * aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean
- * aActive, boolean aRedstone) { return mTextures[aSide == aFacing ? 1 :
- * 0][aColorIndex+1]; }
- */
-
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
- };
- }
+ /*@Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[aSide == aFacing ? 1 : 0][aColorIndex+1];
+ }*/
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
- };
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaEnergyBuffer(mName, mTier, mDescription, mTextures, mInventory.length);
}
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
- };
- }
+ @Override public boolean isSimpleMachine() {return false;}
+ @Override public boolean isElectric() {return true;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return true;}
+ @Override public boolean isEnetInput() {return true;}
+ @Override public boolean isEnetOutput() {return true;}
+ @Override public boolean isInputFacing(byte aSide) {return aSide!=getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isTeleporterCompatible() {return false;}
+ @Override public long getMinimumStoredEU() {return V[mTier]*2;}
+ @Override public long maxEUStore() {return V[mTier]*250000;}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
+ public long maxEUInput() {
+ return V[mTier];
}
@Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, CORE.GT_Tooltip
- };
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
+ public long maxEUOutput() {
+ return V[mTier];
}
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
+ @Override
+ public long maxAmperesIn() {
+ return mChargeableCount * 4;
}
@Override
- public String[] getInfoData() {
- this.count++;
- if (this.mMax == 0 || this.count % 20 == 0) {
- final long[] tmp = this.getStoredEnergy();
- this.mStored = tmp[0];
- this.mMax = tmp[1];
- }
-
- return new String[] {
- this.getLocalName(), GT_Utility.formatNumbers(this.mStored) + " EU /",
- GT_Utility.formatNumbers(this.mMax) + " EU"
- };
+ public long maxAmperesOut() {
+ return mChargeableCount * 4;
}
+ @Override public int rechargerSlotStartIndex() {return 0;}
+ @Override public int dechargerSlotStartIndex() {return 0;}
+ @Override public int rechargerSlotCount() {return mCharge?mInventory.length:0;}
+ @Override public int dechargerSlotCount() {return mDecharge?mInventory.length:0;}
+ @Override public int getProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyStored();}
+ @Override public int maxProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyCapacity();}
+ @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
@Override
- public String getInventoryName() {
- return null;
+ public void saveNBTData(NBTTagCompound aNBT) {
+ //
}
@Override
- public int getInventoryStackLimit() {
- return 0;
+ public void loadNBTData(NBTTagCompound aNBT) {
+ //
}
@Override
- public long getMinimumStoredEU() {
- return GT_Values.V[this.mTier] * 2;
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ Utils.LOG_WARNING("Right Click on MTE by Player");
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ //aBaseMetaTileEntity.openGUI(aPlayer);
+
+ Utils.LOG_WARNING("MTE is Client-side");
+ showEnergy(aPlayer.getEntityWorld(), aPlayer);
+ return true;
}
- @Override
- public int getProgresstime() {
- return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
+ private void showEnergy(World worldIn, EntityPlayer playerIn){
+ long tempStorage = getStoredEnergy()[0];
+ final double c = ((double) tempStorage / maxEUStore()) * 100;
+ final double roundOff = Math.round(c * 100.00) / 100.00;
+ PlayerUtils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff+"%)");
+
}
+ //Utils.LOG_WARNING("Begin Show Energy");
+ /*
+ *
+ //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" C: "+c);
+ Utils.LOG_INFO("getProgressTime: "+getProgresstime());
+ Utils.LOG_INFO("maxProgressTime: "+maxProgresstime());
+ Utils.LOG_INFO("getMinimumStoredEU: "+getMinimumStoredEU());
+ Utils.LOG_INFO("maxEUStore: "+maxEUStore());*/
+ /*final long d = (tempStorage * 100L) / maxEUStore();
+ Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" D: "+d);
+ final double roundOff2 = Math.round(d * 100.00) / 100.00;
+ Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff2+"%)");
+ Utils.LOG_WARNING("Making new instance of Guihandler");
+ GuiHandler block = new GuiHandler();
+ Utils.LOG_WARNING("Guihandler.toString(): "+block.toString());
+ block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);*/
+
@Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
}
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
- };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange)
- };
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
}
@Override
- public int getSizeInventory() {
- return 0;
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+
}
@Override
- public ItemStack getStackInSlot(final int p_70301_1_) {
- return null;
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
@Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- return null;
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
- public long[] getStoredEnergy() {
- long tScale = this.getBaseMetaTileEntity().getEUCapacity();
- long tStored = this.getBaseMetaTileEntity().getStoredEU();
- if (this.mInventory != null) {
- for (final ItemStack aStack : this.mInventory) {
+ public long[] getStoredEnergy(){
+ long tScale = getBaseMetaTileEntity().getEUCapacity();
+ long tStored = getBaseMetaTileEntity().getStoredEU();
+ if (mInventory != null) {
+ for (ItemStack aStack : mInventory) {
if (GT_ModHandler.isElectricItem(aStack)) {
if (aStack.getItem() instanceof GT_MetaBase_Item) {
- final Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack);
+ Long[] stats = ((GT_MetaBase_Item) aStack.getItem())
+ .getElectricStats(aStack);
if (stats != null) {
tScale = tScale + stats[0];
- tStored = tStored + ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
+ tStored = tStored
+ + ((GT_MetaBase_Item) aStack.getItem())
+ .getRealCharge(aStack);
}
- }
- else if (aStack.getItem() instanceof IElectricItem) {
- tStored = tStored + (long) ic2.api.item.ElectricItem.manager.getCharge(aStack);
- tScale = tScale + (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack);
+ } else if (aStack.getItem() instanceof IElectricItem) {
+ tStored = tStored
+ + (long) ic2.api.item.ElectricItem.manager
+ .getCharge(aStack);
+ tScale = tScale
+ + (long) ((IElectricItem) aStack.getItem())
+ .getMaxCharge(aStack);
}
}
}
}
- return new long[] {
- tStored, tScale
- };
+ return new long[] { tStored, tScale };
}
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
+ private long count=0;
+ private long mStored=0;
+ private long mMax=0;
@Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
+ public String[] getInfoData() {
+ count++;
+ if(mMax==0||count%20==0){
+ long[] tmp = getStoredEnergy();
+ mStored=tmp[0];
+ mMax=tmp[1];
}
- return rTextures;
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)
- };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1],
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo)
- };
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isElectric() {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
+ return new String[] {
+ getLocalName(),
+ GT_Utility.formatNumbers(mStored)+" EU /",
+ GT_Utility.formatNumbers(mMax)+" EU"};
}
@Override
@@ -367,95 +336,62 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
}
@Override
- public boolean isInputFacing(final byte aSide) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
+ return null;
}
@Override
- public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) {
+ public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
return false;
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
- @Override
- public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) {
+ public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
return false;
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- //
- }
-
- @Override
- public long maxAmperesIn() {
- return this.mChargeableCount * 4;
+ public int getSizeInventory() {
+ return 0;
}
@Override
- public long maxAmperesOut() {
- return this.mChargeableCount * 4;
+ public ItemStack getStackInSlot(int p_70301_1_) {
+ return null;
}
@Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
+ return null;
}
@Override
- public long maxEUOutput() {
- return GT_Values.V[this.mTier];
+ public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ return null;
}
@Override
- public long maxEUStore() {
- return GT_Values.V[this.mTier] * 250000;
+ public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
}
@Override
- public int maxProgresstime() {
- return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
+ public String getInventoryName() {
+ return null;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures,
- this.mInventory.length);
+ public boolean hasCustomInventoryName() {
+ return false;
}
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
-
+ public int getInventoryStackLimit() {
+ return 0;
}
@Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- Utils.LOG_WARNING("Right Click on MTE by Player");
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- // aBaseMetaTileEntity.openGUI(aPlayer);
- }
-
- Utils.LOG_WARNING("MTE is Client-side");
- this.showEnergy(aPlayer.getEntityWorld(), aPlayer);
- return true;
+ public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ return false;
}
@Override
@@ -463,51 +399,12 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
}
@Override
- public int rechargerSlotCount() {
- return this.mCharge ? this.mInventory.length : 0;
- }
-
- @Override
- public int rechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- //
+ public void closeInventory() {
}
@Override
- public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {
- }
-
- private void showEnergy(final World worldIn, final EntityPlayer playerIn) {
- final long tempStorage = this.getStoredEnergy()[0];
- final double c = (double) tempStorage / this.maxEUStore() * 100;
- final double roundOff = Math.round(c * 100.00) / 100.00;
- PlayerUtils.messagePlayer(playerIn,
- "Energy: " + tempStorage + " EU at " + GT_Values.V[this.mTier] + "v (" + roundOff + "%)");
-
+ public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
+ return false;
}
- // Utils.LOG_WARNING("Begin Show Energy");
- /*
- *
- * //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "
- * +maxEUStore()+" C: "+c); Utils.LOG_INFO("getProgressTime: "
- * +getProgresstime()); Utils.LOG_INFO("maxProgressTime: "
- * +maxProgresstime()); Utils.LOG_INFO("getMinimumStoredEU: "
- * +getMinimumStoredEU()); Utils.LOG_INFO("maxEUStore: "+maxEUStore());
- */
- /*
- * final long d = (tempStorage * 100L) / maxEUStore(); Utils.LOG_INFO(
- * "getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+
- * " D: "+d); final double roundOff2 = Math.round(d * 100.00) / 100.00;
- * Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "
- * +V[mTier]+"v ("+roundOff2+"%)"); Utils.LOG_WARNING(
- * "Making new instance of Guihandler"); GuiHandler block = new
- * GuiHandler(); Utils.LOG_WARNING("Guihandler.toString(): "
- * +block.toString()); block.getClientGuiElement(1, playerIn, worldIn, (int)
- * playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);
- */
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
index 61141417ae..9fe37dd2dc 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
@@ -1,11 +1,10 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map.Entry;
-
+import static gregtech.api.enums.GT_Values.D1;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
@@ -17,6 +16,11 @@ import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
@@ -25,452 +29,357 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
public class GregtechMetaPipeEntityFluid extends MetaPipeEntity {
- public final float mThickNess;
- public final GT_Materials mMaterial;
- public final int mCapacity, mHeatResistance;
- public final boolean mGasProof;
- public FluidStack mFluid;
- public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
-
- public GregtechMetaPipeEntityFluid(final int aID, final String aName, final String aNameRegional,
- final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance,
- final boolean aGasProof) {
+ public final float mThickNess;
+ public final GT_Materials mMaterial;
+ public final int mCapacity, mHeatResistance;
+ public final boolean mGasProof;
+ public FluidStack mFluid;
+ public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
+
+ public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
super(aID, aName, aNameRegional, 0);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mCapacity = aCapacity;
- this.mGasProof = aGasProof;
- this.mHeatResistance = aHeatResistance;
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
}
- public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial,
- final int aCapacity, final int aHeatResistance, final boolean aGasProof) {
+ public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
super(aName, 0);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mCapacity = aCapacity;
- this.mGasProof = aGasProof;
- this.mHeatResistance = aHeatResistance;
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
}
@Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public void doSound(final byte aIndex, final double aX, final double aY, final double aZ) {
- super.doSound(aIndex, aX, aY, aZ);
- if (aIndex == 9) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
- for (byte i = 0; i < 6; i++) {
- for (int l = 0; l < 2; ++l) {
- this.getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + Math.random(),
- aY - 0.5 + Math.random(), aZ - 0.5 + Math.random(),
- ForgeDirection.getOrientation(i).offsetX / 5.0,
- ForgeDirection.getOrientation(i).offsetY / 5.0,
- ForgeDirection.getOrientation(i).offsetZ / 5.0);
- }
- }
- }
- }
-
- @Override
- public final FluidStack drain(final int maxDrain, final boolean doDrain) {
- if (this.mFluid == null) {
- return null;
- }
- if (this.mFluid.amount <= 0) {
- this.mFluid = null;
- return null;
- }
-
- int used = maxDrain;
- if (this.mFluid.amount < used) {
- used = this.mFluid.amount;
- }
-
- if (doDrain) {
- this.mFluid.amount -= used;
- }
-
- final FluidStack drained = this.mFluid.copy();
- drained.amount = used;
-
- if (this.mFluid.amount <= 0) {
- this.mFluid = null;
- }
-
- return drained;
- }
-
- @Override
- public final int fill_default(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0) {
- return 0;
- }
-
- if (this.mFluid == null || this.mFluid.getFluid().getID() <= 0) {
- if (aFluid.amount <= this.getCapacity()) {
- if (doFill) {
- this.mFluid = aFluid.copy();
- this.mLastReceivedFrom |= 1 << aSide.ordinal();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.mFluid = aFluid.copy();
- this.mLastReceivedFrom |= 1 << aSide.ordinal();
- this.mFluid.amount = this.getCapacity();
- }
- return this.getCapacity();
- }
-
- if (!this.mFluid.isFluidEqual(aFluid)) {
- return 0;
- }
-
- final int space = this.getCapacity() - this.mFluid.amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- this.mFluid.amount += aFluid.amount;
- this.mLastReceivedFrom |= 1 << aSide.ordinal();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.mFluid.amount = this.getCapacity();
- this.mLastReceivedFrom |= 1 << aSide.ordinal();
- }
- return space;
- }
-
- @Override
- public final int getCapacity() {
- return this.mCapacity * 20;
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D,
- aZ + 0.875D);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- EnumChatFormatting.BLUE + "Fluid Capacity: " + this.mCapacity * 20 + "L/sec" + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: " + this.mHeatResistance + " K" + EnumChatFormatting.GRAY,
- EnumChatFormatting.DARK_GREEN + "Gas Proof: " + this.mGasProof + EnumChatFormatting.GRAY,
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public final FluidStack getFluid() {
- return this.mFluid;
- }
-
- @Override
- public final int getFluidAmount() {
- return this.mFluid != null ? this.mFluid.amount : 0;
- }
-
- @Override
- public int getProgresstime() {
- return this.getFluidAmount();
+ public byte getTileEntityBaseType() {
+ return mMaterial == null ? 4 : (byte) ((mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
}
@Override
- public int getTankPressure() {
- return (this.mFluid == null ? 0 : this.mFluid.amount) - this.getCapacity() / 2;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntityFluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof);
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide,
- final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- final short[] colours = Dyes.getModulation(aColorIndex, this.mMaterial.mRGBa);
+ short[] colours = Dyes.getModulation(aColorIndex, mMaterial.mRGBa);
if (aConnected) {
- final float tThickNess = this.getThickNess();
- if (tThickNess < 0.37F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex],
- colours)
- };
- }
- if (tThickNess < 0.49F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex],
- colours)
- };
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.37F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], colours)};
}
- if (tThickNess < 0.74F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex],
- colours)
- };
+ if (tThickNess < 0.49F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], colours)};
}
- if (tThickNess < 0.99F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex],
- colours)
- };
+ if (tThickNess < 0.74F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], colours)};
}
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex],
- colours)
- };
+ if (tThickNess < 0.99F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], colours)};
+ }
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], colours)};
}
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], colours)
- };
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], colours)};
}
@Override
- public float getThickNess() {
- return this.mThickNess;
+ public boolean isSimpleMachine() {
+ return true;
}
@Override
- public byte getTileEntityBaseType() {
- return this.mMaterial == null ? 4
- : (byte) ((this.mMaterial.contains(SubTag.WOOD) ? 12 : 4)
- + Math.max(0, Math.min(3, this.mMaterial.mToolQuality)));
+ public boolean isFacingValid(byte aFacing) {
+ return false;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
+ public boolean isValidSlot(int aIndex) {
return false;
}
@Override
- public boolean isSimpleMachine() {
- return true;
+ public final boolean renderInside(byte aSide) {
+ return false;
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return false;
+ public int getProgresstime() {
+ return getFluidAmount();
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- this.mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
+ public int maxProgresstime() {
+ return getCapacity();
}
@Override
- public int maxProgresstime() {
- return this.getCapacity();
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntityFluid(this.mName, this.mThickNess, this.mMaterial, this.mCapacity,
- this.mHeatResistance, this.mGasProof);
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
}
@Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity aEntity) {
- if (this.mFluid != null && (((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0
- && aEntity instanceof EntityLivingBase) {
- final int tTemperature = this.mFluid.getFluid().getTemperature(this.mFluid);
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mFluid != null && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
+ int tTemperature = mFluid.getFluid().getTemperature(mFluid);
if (tTemperature > 320) {
GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F);
- }
- else if (tTemperature < 260) {
+ } else if (tTemperature < 260) {
GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
}
}
}
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) {
- this.mLastReceivedFrom &= 63;
- if (this.mLastReceivedFrom == 63) {
- this.mLastReceivedFrom = 0;
+ mLastReceivedFrom &= 63;
+ if (mLastReceivedFrom == 63) {
+ mLastReceivedFrom = 0;
}
- if (this.mFluid != null && this.mFluid.amount > 0) {
- final int tTemperature = this.mFluid.getFluid().getTemperature(this.mFluid);
- if (tTemperature > this.mHeatResistance) {
+ if (mFluid != null && mFluid.amount > 0) {
+ int tTemperature = mFluid.getFluid().getTemperature(mFluid);
+ if (tTemperature > mHeatResistance) {
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
aBaseMetaTileEntity.setToFire();
return;
}
aBaseMetaTileEntity.setOnFire();
}
- if (!this.mGasProof && this.mFluid.getFluid().isGaseous(this.mFluid)) {
- this.mFluid.amount -= 5;
- this.sendSound((byte) 9);
+ if (!mGasProof && mFluid.getFluid().isGaseous(mFluid)) {
+ mFluid.amount -= 5;
+ sendSound((byte) 9);
if (tTemperature > 320) {
try {
- for (final EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) this
- .getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(this.getBaseMetaTileEntity().getXCoord() - 2,
- this.getBaseMetaTileEntity().getYCoord() - 2,
- this.getBaseMetaTileEntity().getZCoord() - 2,
- this.getBaseMetaTileEntity().getXCoord() + 3,
- this.getBaseMetaTileEntity().getYCoord() + 3,
- this.getBaseMetaTileEntity().getZCoord() + 3))) {
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) 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) {
+ if (D1) e.printStackTrace(GT_Log.err);
}
- catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- else if (tTemperature < 260) {
+ } else if (tTemperature < 260) {
try {
- for (final EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) this
- .getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(this.getBaseMetaTileEntity().getXCoord() - 2,
- this.getBaseMetaTileEntity().getYCoord() - 2,
- this.getBaseMetaTileEntity().getZCoord() - 2,
- this.getBaseMetaTileEntity().getXCoord() + 3,
- this.getBaseMetaTileEntity().getYCoord() + 3,
- this.getBaseMetaTileEntity().getZCoord() + 3))) {
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) 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) {
+ if (D1) e.printStackTrace(GT_Log.err);
}
- catch (final Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- if (this.mFluid.amount <= 0) {
- this.mFluid = null;
}
+ if (mFluid.amount <= 0) mFluid = null;
}
}
- if (this.mLastReceivedFrom == this.oLastReceivedFrom) {
- final HashMap<IFluidHandler, ForgeDirection> tTanks = new HashMap<IFluidHandler, ForgeDirection>();
+ if (mLastReceivedFrom == oLastReceivedFrom) {
+ HashMap<IFluidHandler, ForgeDirection> tTanks = new HashMap<IFluidHandler, ForgeDirection>();
- this.mConnections = 0;
+ mConnections = 0;
for (byte tSide = 0, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
tSide = (byte) ((j + i) % 6);
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide);
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide);
if (tTileEntity != null) {
if (tTileEntity instanceof IGregTechTileEntity) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
- final byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
+ byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
if (tColor >= 0 && (tColor & 15) != (aBaseMetaTileEntity.getColorization() & 15)) {
continue;
}
}
}
- final FluidTankInfo[] tInfo = tTileEntity
- .getTankInfo(ForgeDirection.getOrientation(tSide).getOpposite());
+ FluidTankInfo[] tInfo = tTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide).getOpposite());
if (tInfo != null && tInfo.length > 0) {
- if (tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity)
- .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(tSide))
- .alwaysLookConnected(GT_Utility.getOppositeSide(tSide),
- ((ICoverable) tTileEntity)
- .getCoverIDAtSide(GT_Utility.getOppositeSide(tSide)),
- ((ICoverable) tTileEntity).getCoverDataAtSide(
- GT_Utility.getOppositeSide(tSide)),
- (ICoverable) tTileEntity)) {
- this.mConnections |= 1 << tSide;
+ if (tTileEntity instanceof ICoverable && ((ICoverable) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(tSide)).alwaysLookConnected(GT_Utility.getOppositeSide(tSide), ((ICoverable) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(tSide)), ((ICoverable) tTileEntity))) {
+ mConnections |= (1 << tSide);
}
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide,
- aBaseMetaTileEntity.getCoverIDAtSide(tSide),
- aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
- this.mConnections |= 1 << tSide;
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
+ mConnections |= (1 << tSide);
}
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidOut(tSide,
- aBaseMetaTileEntity.getCoverIDAtSide(tSide),
- aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
- this.mConnections |= 1 << tSide;
- if ((1 << tSide & this.mLastReceivedFrom) == 0) {
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).letsFluidOut(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), null, aBaseMetaTileEntity)) {
+ mConnections |= (1 << tSide);
+ if (((1 << tSide) & mLastReceivedFrom) == 0)
tTanks.put(tTileEntity, ForgeDirection.getOrientation(tSide).getOpposite());
- }
}
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide,
- aBaseMetaTileEntity.getCoverIDAtSide(tSide),
- aBaseMetaTileEntity.getCoverDataAtSide(tSide), aBaseMetaTileEntity)) {
- this.mConnections |= 1 << tSide;
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(tSide).alwaysLookConnected(tSide, aBaseMetaTileEntity.getCoverIDAtSide(tSide), aBaseMetaTileEntity.getCoverDataAtSide(tSide), aBaseMetaTileEntity)) {
+ mConnections |= (1 << tSide);
}
}
}
}
- if (this.mFluid != null && this.mFluid.amount > 0) {
- int tAmount = Math.max(1, Math.min(this.mCapacity * 10, this.mFluid.amount / 2)),
- tSuccessfulTankAmount = 0;
+ if (mFluid != null && mFluid.amount > 0) {
+ int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluid.amount / 2)), tSuccessfulTankAmount = 0;
- for (final Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet()) {
- if (tEntry.getKey().fill(tEntry.getValue(), this.drain(tAmount, false), false) > 0) {
+ for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet())
+ if (tEntry.getKey().fill(tEntry.getValue(), drain(tAmount, false), false) > 0)
tSuccessfulTankAmount++;
- }
- }
if (tSuccessfulTankAmount > 0) {
if (tAmount >= tSuccessfulTankAmount) {
tAmount /= tSuccessfulTankAmount;
- for (final Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
- if (this.mFluid == null || this.mFluid.amount <= 0) {
- break;
- }
- final int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(),
- this.drain(tAmount, false), false);
- if (tFilledAmount > 0) {
- tTileEntity.getKey().fill(tTileEntity.getValue(), this.drain(tFilledAmount, true),
- true);
- }
+ for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
+ if (mFluid == null || mFluid.amount <= 0) break;
+ int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
+ if (tFilledAmount > 0)
+ tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
}
- }
- else {
- for (final Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
- if (this.mFluid == null || this.mFluid.amount <= 0) {
- break;
- }
- final int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(),
- this.drain(this.mFluid.amount, false), false);
- if (tFilledAmount > 0) {
- tTileEntity.getKey().fill(tTileEntity.getValue(), this.drain(tFilledAmount, true),
- true);
- }
+ } else {
+ for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
+ if (mFluid == null || mFluid.amount <= 0) break;
+ int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(mFluid.amount, false), false);
+ if (tFilledAmount > 0)
+ tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
}
}
}
}
- this.mLastReceivedFrom = 0;
+ mLastReceivedFrom = 0;
}
- this.oLastReceivedFrom = this.mLastReceivedFrom;
+ oLastReceivedFrom = mLastReceivedFrom;
+ }
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ super.doSound(aIndex, aX, aY, aZ);
+ if (aIndex == 9) {
+ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
+ for (byte i = 0; i < 6; i++)
+ for (int l = 0; l < 2; ++l)
+ getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + Math.random(), aY - 0.5 + Math.random(), aZ - 0.5 + Math.random(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
}
}
@Override
- public final boolean renderInside(final byte aSide) {
+ public final int getCapacity() {
+ return mCapacity * 20;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- if (this.mFluid != null) {
- aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
+ public final FluidStack getFluid() {
+ return mFluid;
+ }
+
+ @Override
+ public final int getFluidAmount() {
+ return mFluid != null ? mFluid.amount : 0;
+ }
+
+ @Override
+ public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+
+ if (mFluid == null || mFluid.getFluid().getID() <= 0) {
+ if (aFluid.amount <= getCapacity()) {
+ if (doFill) {
+ mFluid = aFluid.copy();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ mFluid = aFluid.copy();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ mFluid.amount = getCapacity();
+ }
+ return getCapacity();
+ }
+
+ if (!mFluid.isFluidEqual(aFluid)) return 0;
+
+ int space = getCapacity() - mFluid.amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ mFluid.amount += aFluid.amount;
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ mFluid.amount = getCapacity();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return space;
+ }
+
+ @Override
+ public final FluidStack drain(int maxDrain, boolean doDrain) {
+ if (mFluid == null) return null;
+ if (mFluid.amount <= 0) {
+ mFluid = null;
+ return null;
+ }
+
+ int used = maxDrain;
+ if (mFluid.amount < used)
+ used = mFluid.amount;
+
+ if (doDrain) {
+ mFluid.amount -= used;
+ }
+
+ FluidStack drained = mFluid.copy();
+ drained.amount = used;
+
+ if (mFluid.amount <= 0) {
+ mFluid = null;
}
- aNBT.setByte("mLastReceivedFrom", this.mLastReceivedFrom);
+
+ return drained;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return (mFluid == null ? 0 : mFluid.amount) - (getCapacity() / 2);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Fluid Capacity: " + (mCapacity * 20) + "L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: " + mHeatResistance + " K" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (mGasProof) + EnumChatFormatting.GRAY,
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public float getThickNess() {
+ return mThickNess;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
index c699077b58..587996a5c6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
@@ -1,21 +1,27 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import cofh.api.energy.IEnergyReceiver;
+import static gregtech.api.enums.GT_Values.VN;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
-import gregtech.api.interfaces.tileentity.*;
+import gregtech.api.interfaces.tileentity.IColoredTileEntity;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import ic2.api.energy.tile.IEnergySink;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.tileentity.TileEntity;
@@ -23,362 +29,208 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.api.energy.IEnergyReceiver;
public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implements IMetaTileEntityCable {
- public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
+ public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
- public final float mThickNess;
- public final Materials mMaterial;
- public final long mCableLossPerMeter, mAmperage, mVoltage;
- public final boolean mInsulated, mCanShock;
- public long mRestRF;
+ public final float mThickNess;
+ public final Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public long mRestRF;
- public GregtechMetaPipeEntity_Cable(final int aID, final String aName, final String aNameRegional,
- final float aThickNess, final Materials aMaterial, final long aCableLossPerMeter, final long aAmperage,
- final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
+ public GregtechMetaPipeEntity_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, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = aCableLossPerMeter;
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
}
- public GregtechMetaPipeEntity_Cable(final String aName, final float aThickNess, final Materials aMaterial,
- final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated,
- final boolean aCanShock) {
+ public GregtechMetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aName, 0, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = aCableLossPerMeter;
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- if (!this.mCanShock) {
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
- return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D,
- aZ + 0.875D);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Max Voltage: " + EnumChatFormatting.GREEN + this.mVoltage + " ("
- + GT_Values.VN[GT_Utility.getTier(this.mVoltage)] + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: " + EnumChatFormatting.RED + this.mCableLossPerMeter + EnumChatFormatting.GRAY
- + " EU-Volt",
- CORE.GT_Tooltip
- };
+ public byte getTileEntityBaseType() {
+ return (byte)(mInsulated?9:8);
}
- // @Override public final boolean renderInside(byte aSide) {return false;}
@Override
- public int getProgresstime() {
- return (int) this.mTransferredAmperage * 64;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide,
- final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
- if (!this.mInsulated) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa)
- };
- }
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ if (!mInsulated) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa)};
if (aConnected) {
- final float tThickNess = this.getThickNess();
- if (tThickNess < 0.37F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.49F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.74F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.99F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.37F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.49F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.74F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.99F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
- return new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
-
- @Override
- public float getThickNess() {
- return this.mThickNess;
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
@Override
- public byte getTileEntityBaseType() {
- return (byte) (this.mInsulated ? 9 : 8);
- }
-
- @Override
- public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide,
- this.getBaseMetaTileEntity().getCoverIDAtSide(aSide),
- this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), this.getBaseMetaTileEntity())) {
- return 0;
- }
- return this.transferElectricity(aSide, aVoltage, aAmperage,
- new ArrayList<TileEntity>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mCanShock && (((BaseMetaPipeEntity)getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) GT_Utility.applyElectricityDamage((EntityLivingBase)aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public int maxProgresstime() {
- return (int) this.mAmperage * 64;
- }
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ return AxisAlignedBB.getBoundingBox(aX+0.125D, aY+0.125D, aZ+0.125D, aX+0.875D, aY+0.875D, aZ+0.875D);
+ }
+
+ @Override public boolean isSimpleMachine() {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return false;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ // @Override public final boolean renderInside(byte aSide) {return false;}
+ @Override public int getProgresstime() {return (int)mTransferredAmperage*64;}
+ @Override public int maxProgresstime() {return (int)mAmperage*64;}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntity_Cable(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter,
- this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) return 0;
+ return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity)getBaseMetaTileEntity())));
}
@Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity aEntity) {
- if (this.mCanShock && (((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0
- && aEntity instanceof EntityLivingBase) {
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, this.mTransferredVoltageLast20,
- this.mTransferredAmperageLast20);
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ long rUsedAmperes = 0;
+ aVoltage -= mCableLossPerMeter;
+ if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) if (i != aSide && (mConnections & (1<<i)) != 0 && getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, getBaseMetaTileEntity().getCoverIDAtSide(i), getBaseMetaTileEntity().getCoverDataAtSide(i), getBaseMetaTileEntity())) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(i);
+ if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
+ aAlreadyPassedTileEntityList.add(tTileEntity);
+ if (tTileEntity instanceof IEnergyConnected) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IEnergyConnected)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue;
+ }
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity))) {
+ if (((IGregTechTileEntity)tTileEntity).getTimer() > 50) rUsedAmperes += ((IMetaTileEntityCable)((IGregTechTileEntity)tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes, aAlreadyPassedTileEntityList);
+ } else {
+ rUsedAmperes += ((IEnergyConnected)tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes);
+ }
+ // } else if (tTileEntity instanceof IEnergySink) {
+ // ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ // if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ // if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
+ // }
+ } else if (tTileEntity instanceof IEnergySink) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ if (((IEnergySink)tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink)tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) rUsedAmperes++;
+ }
+ } else if(GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver){
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
+ if(((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, true)==rfOut){
+ ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, false); rUsedAmperes++;
+ }else if(((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, true)>0){
+ if(mRestRF==0){
+ int RFtrans = ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, (int) rfOut, false);rUsedAmperes++;
+ mRestRF = rfOut - RFtrans;
+ }else{
+ int RFtrans = ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, (int) mRestRF, false);
+ mRestRF = mRestRF - RFtrans;
+ }
+ }
+ if(GregTech_API.mRFExplosions && ((IEnergyReceiver)tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600){
+ if(rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
+ }
+ }
+ }
+ }
+ mTransferredAmperage += rUsedAmperes;
+ mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
+ mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
+ if (aVoltage > mVoltage || mTransferredAmperage > mAmperage) {
+ getBaseMetaTileEntity().setToFire();
+ return aAmperage;
}
+ return rUsedAmperes;
}
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
- this.mTransferredAmperage = 0;
+ mTransferredAmperage = 0;
if (aTick % 20 == 0) {
- this.mTransferredVoltageLast20 = 0;
- this.mTransferredAmperageLast20 = 0;
- this.mConnections = 0;
+ mTransferredVoltageLast20 = 0;
+ mTransferredAmperageLast20 = 0;
+ mConnections = 0;
for (byte i = 0, j = 0; i < 6; i++) {
j = GT_Utility.getOppositeSide(i);
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)) {
- final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
if (tTileEntity instanceof IColoredTileEntity) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
- final byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
- continue;
- }
+ byte tColor = ((IColoredTileEntity)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
}
}
- if (tTileEntity instanceof IEnergyConnected
- && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j)
- || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IEnergyConnected && (((IEnergyConnected)tTileEntity).inputEnergyFrom(j) || ((IEnergyConnected)tTileEntity).outputsEnergyTo(j))) {
+ mConnections |= (1<<i);
continue;
}
- if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable) {
- if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable) {
+ if (((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity)) || ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity)) || ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity))) {
+ mConnections |= (1<<i);
continue;
}
}
- if (tTileEntity instanceof IEnergySink && ((IEnergySink) tTileEntity).acceptsEnergyFrom(
- (TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
- this.mConnections |= 1 << i;
- continue;
- }
- if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver
- && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IEnergySink && ((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
continue;
}
+ if(GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver)tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))){
+ mConnections |= (1<<i);
+ continue;
+ }
/*
- * if (tTileEntity instanceof IEnergyEmitter &&
- * ((IEnergyEmitter)tTileEntity).emitsEnergyTo((
- * TileEntity)aBaseMetaTileEntity,
- * ForgeDirection.getOrientation(j))) { mConnections |=
- * (1<<i); continue; }
- */
+ if (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
+ continue;
+ }*/
}
}
}
}
}
+
@Override
- public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage,
- final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- long rUsedAmperes = 0;
- aVoltage -= this.mCableLossPerMeter;
- if (aVoltage > 0) {
- for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) {
- if (i != aSide && (this.mConnections & 1 << i) != 0
- && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i,
- this.getBaseMetaTileEntity().getCoverIDAtSide(i),
- this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
- if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
- aAlreadyPassedTileEntityList.add(tTileEntity);
- if (tTileEntity instanceof IEnergyConnected) {
- if (this.getBaseMetaTileEntity().getColorization() >= 0) {
- final byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != this.getBaseMetaTileEntity().getColorization()) {
- continue;
- }
- }
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable
- && ((IGregTechTileEntity) tTileEntity)
- .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i))
- .letsEnergyIn(GT_Utility.getOppositeSide(i),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverIDAtSide(GT_Utility.getOppositeSide(i)),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverDataAtSide(GT_Utility.getOppositeSide(i)),
- (IGregTechTileEntity) tTileEntity)) {
- if (((IGregTechTileEntity) tTileEntity).getTimer() > 50) {
- rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i),
- aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
- }
- }
- else {
- rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(
- GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
- }
- // } else if (tTileEntity instanceof IEnergySink) {
- // ForgeDirection tDirection =
- // ForgeDirection.getOrientation(i).getOpposite();
- // if
- // (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(),
- // tDirection)) {
- // if
- // (((IEnergySink)tTileEntity).demandedEnergyUnits()
- // > 0 &&
- // ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection,
- // aVoltage) < aVoltage) rUsedAmperes++;
- // }
- }
- else if (tTileEntity instanceof IEnergySink) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(),
- tDirection)) {
- if (((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity)
- .injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) {
- rUsedAmperes++;
- }
- }
- }
- else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- final int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
- if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
- ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
- rUsedAmperes++;
- }
- else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
- if (this.mRestRF == 0) {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut,
- false);
- rUsedAmperes++;
- this.mRestRF = rfOut - RFtrans;
- }
- else {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection,
- (int) this.mRestRF, false);
- this.mRestRF = this.mRestRF - RFtrans;
- }
- }
- if (GregTech_API.mRFExplosions
- && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
- if (rfOut > 32 * GregTech_API.mEUtoRF / 100) {
- this.doExplosion(rfOut);
- }
- }
- }
- }
- }
- }
- }
- this.mTransferredAmperage += rUsedAmperes;
- this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
- this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
- if (aVoltage > this.mVoltage || this.mTransferredAmperage > this.mAmperage) {
- this.getBaseMetaTileEntity().setToFire();
- return aAmperage;
- }
- return rUsedAmperes;
+ public String[] getDescription() {
+ return new String[] {
+ "Max Voltage: " + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: " + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: " + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + " EU-Volt",
+ CORE.GT_Tooltip
+ };
+ }
+
+
+ @Override
+ public float getThickNess() {
+ return mThickNess;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
index 77fcdd7af1..7f903576c2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
@@ -1,15 +1,16 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import cofh.api.energy.IEnergyReceiver;
+import static gregtech.api.enums.GT_Values.VN;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
-import gregtech.api.interfaces.tileentity.*;
+import gregtech.api.interfaces.tileentity.IColoredTileEntity;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
@@ -17,6 +18,10 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaPipeEntityBase_Cable;
import ic2.api.energy.tile.IEnergySink;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.tileentity.TileEntity;
@@ -24,364 +29,211 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.api.energy.IEnergyReceiver;
-public class GregtechMetaPipeEntity_SuperConductor extends GregtechMetaPipeEntityBase_Cable
- implements IMetaTileEntityCable {
- public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,
- mTransferredVoltageLast20 = 0;
+public class GregtechMetaPipeEntity_SuperConductor extends GregtechMetaPipeEntityBase_Cable implements IMetaTileEntityCable {
+ public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
- public final float mThickNess;
- public final GT_Materials mMaterial;
- public final long mCableLossPerMeter, mAmperage, mVoltage;
- public final boolean mInsulated, mCanShock;
- public long mRestRF;
+ public final float mThickNess;
+ public final GT_Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public long mRestRF;
- public GregtechMetaPipeEntity_SuperConductor(final int aID, final String aName, final String aNameRegional,
- final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage,
- final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
+ public GregtechMetaPipeEntity_SuperConductor(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aID, aName, aNameRegional, 0, aMaterial, 0, aAmperage, aVoltage, aInsulated, aCanShock);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = 0;
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = 0;
}
- public GregtechMetaPipeEntity_SuperConductor(final String aName, final float aThickNess,
- final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, final long aVoltage,
- final boolean aInsulated, final boolean aCanShock) {
+ public GregtechMetaPipeEntity_SuperConductor(String aName, float aThickNess, GT_Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aName, 0, aMaterial, 0, aAmperage, aVoltage, aInsulated, aCanShock);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = 0;
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = 0;
}
@Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- if (!this.mCanShock) {
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
- return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D,
- aZ + 0.875D);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Max Voltage: " + EnumChatFormatting.GREEN + this.mVoltage + " ("
- + GT_Values.VN[GT_Utility.getTier(this.mVoltage)] + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: " + EnumChatFormatting.RED + this.mCableLossPerMeter + EnumChatFormatting.GRAY
- + " EU-Volt",
- CORE.GT_Tooltip, " ", "This Wire is Lossless.", "Please, adhere to cooling directions."
- };
+ public byte getTileEntityBaseType() {
+ return (byte)(mInsulated?9:8);
}
- // @Override public final boolean renderInside(byte aSide) {return false;}
@Override
- public int getProgresstime() {
- return (int) this.mTransferredAmperage * 64;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntity_SuperConductor(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide,
- final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
- if (!this.mInsulated) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa)
- };
- }
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ if (!mInsulated) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa)};
if (aConnected) {
- final float tThickNess = this.getThickNess();
- if (tThickNess < 0.37F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.49F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.74F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.99F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.37F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.49F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.74F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.99F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
- return new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
-
- @Override
- public float getThickNess() {
- return this.mThickNess;
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
@Override
- public byte getTileEntityBaseType() {
- return (byte) (this.mInsulated ? 9 : 8);
- }
-
- @Override
- public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide,
- this.getBaseMetaTileEntity().getCoverIDAtSide(aSide),
- this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), this.getBaseMetaTileEntity())) {
- return 0;
- }
- return this.transferElectricity(aSide, aVoltage, aAmperage,
- new ArrayList<TileEntity>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mCanShock && (((BaseMetaPipeEntity)getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) GT_Utility.applyElectricityDamage((EntityLivingBase)aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public int maxProgresstime() {
- return (int) this.mAmperage * 64;
- }
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ return AxisAlignedBB.getBoundingBox(aX+0.125D, aY+0.125D, aZ+0.125D, aX+0.875D, aY+0.875D, aZ+0.875D);
+ }
+
+ @Override public boolean isSimpleMachine() {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return false;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ // @Override public final boolean renderInside(byte aSide) {return false;}
+ @Override public int getProgresstime() {return (int)mTransferredAmperage*64;}
+ @Override public int maxProgresstime() {return (int)mAmperage*64;}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntity_SuperConductor(this.mName, this.mThickNess, this.mMaterial,
- this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) return 0;
+ return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity)getBaseMetaTileEntity())));
}
@Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity aEntity) {
- if (this.mCanShock && (((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0
- && aEntity instanceof EntityLivingBase) {
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, this.mTransferredVoltageLast20,
- this.mTransferredAmperageLast20);
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ long rUsedAmperes = 0;
+ aVoltage -= mCableLossPerMeter;
+ if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) if (i != aSide && (mConnections & (1<<i)) != 0 && getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, getBaseMetaTileEntity().getCoverIDAtSide(i), getBaseMetaTileEntity().getCoverDataAtSide(i), getBaseMetaTileEntity())) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(i);
+ if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
+ aAlreadyPassedTileEntityList.add(tTileEntity);
+ if (tTileEntity instanceof IEnergyConnected) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IEnergyConnected)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue;
+ }
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity))) {
+ if (((IGregTechTileEntity)tTileEntity).getTimer() > 50) rUsedAmperes += ((IMetaTileEntityCable)((IGregTechTileEntity)tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes, aAlreadyPassedTileEntityList);
+ } else {
+ rUsedAmperes += ((IEnergyConnected)tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes);
+ }
+ // } else if (tTileEntity instanceof IEnergySink) {
+ // ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ // if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ // if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
+ // }
+ } else if (tTileEntity instanceof IEnergySink) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ if (((IEnergySink)tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink)tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) rUsedAmperes++;
+ }
+ } else if(GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver){
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
+ if(((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, true)==rfOut){
+ ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, false); rUsedAmperes++;
+ }else if(((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, true)>0){
+ if(mRestRF==0){
+ int RFtrans = ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, (int) rfOut, false);rUsedAmperes++;
+ mRestRF = rfOut - RFtrans;
+ }else{
+ int RFtrans = ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, (int) mRestRF, false);
+ mRestRF = mRestRF - RFtrans;
+ }
+ }
+ if(GregTech_API.mRFExplosions && ((IEnergyReceiver)tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600){
+ if(rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
+ }
+ }
+ }
+ }
+ mTransferredAmperage += rUsedAmperes;
+ mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
+ mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
+ if (aVoltage > mVoltage || mTransferredAmperage > mAmperage) {
+ getBaseMetaTileEntity().setToFire();
+ return aAmperage;
}
+ return rUsedAmperes;
}
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
- this.mTransferredAmperage = 0;
+ mTransferredAmperage = 0;
if (aTick % 20 == 0) {
- this.mTransferredVoltageLast20 = 0;
- this.mTransferredAmperageLast20 = 0;
- this.mConnections = 0;
+ mTransferredVoltageLast20 = 0;
+ mTransferredAmperageLast20 = 0;
+ mConnections = 0;
for (byte i = 0, j = 0; i < 6; i++) {
j = GT_Utility.getOppositeSide(i);
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)) {
- final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
if (tTileEntity instanceof IColoredTileEntity) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
- final byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
- continue;
- }
+ byte tColor = ((IColoredTileEntity)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
}
}
- if (tTileEntity instanceof IEnergyConnected
- && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j)
- || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IEnergyConnected && (((IEnergyConnected)tTileEntity).inputEnergyFrom(j) || ((IEnergyConnected)tTileEntity).outputsEnergyTo(j))) {
+ mConnections |= (1<<i);
continue;
}
- if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable) {
- if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable) {
+ if (((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity)) || ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity)) || ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity))) {
+ mConnections |= (1<<i);
continue;
}
}
- if (tTileEntity instanceof IEnergySink && ((IEnergySink) tTileEntity).acceptsEnergyFrom(
- (TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
- this.mConnections |= 1 << i;
- continue;
- }
- if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver
- && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IEnergySink && ((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
continue;
}
+ if(GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver)tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))){
+ mConnections |= (1<<i);
+ continue;
+ }
/*
- * if (tTileEntity instanceof IEnergyEmitter &&
- * ((IEnergyEmitter)tTileEntity).emitsEnergyTo((
- * TileEntity)aBaseMetaTileEntity,
- * ForgeDirection.getOrientation(j))) { mConnections |=
- * (1<<i); continue; }
- */
+ if (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
+ continue;
+ }*/
}
}
}
}
}
+
@Override
- public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage,
- final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- long rUsedAmperes = 0;
- aVoltage -= this.mCableLossPerMeter;
- if (aVoltage > 0) {
- for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) {
- if (i != aSide && (this.mConnections & 1 << i) != 0
- && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i,
- this.getBaseMetaTileEntity().getCoverIDAtSide(i),
- this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
- if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
- aAlreadyPassedTileEntityList.add(tTileEntity);
- if (tTileEntity instanceof IEnergyConnected) {
- if (this.getBaseMetaTileEntity().getColorization() >= 0) {
- final byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != this.getBaseMetaTileEntity().getColorization()) {
- continue;
- }
- }
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable
- && ((IGregTechTileEntity) tTileEntity)
- .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i))
- .letsEnergyIn(GT_Utility.getOppositeSide(i),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverIDAtSide(GT_Utility.getOppositeSide(i)),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverDataAtSide(GT_Utility.getOppositeSide(i)),
- (IGregTechTileEntity) tTileEntity)) {
- if (((IGregTechTileEntity) tTileEntity).getTimer() > 50) {
- rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i),
- aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
- }
- }
- else {
- rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(
- GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
- }
- // } else if (tTileEntity instanceof IEnergySink) {
- // ForgeDirection tDirection =
- // ForgeDirection.getOrientation(i).getOpposite();
- // if
- // (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(),
- // tDirection)) {
- // if
- // (((IEnergySink)tTileEntity).demandedEnergyUnits()
- // > 0 &&
- // ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection,
- // aVoltage) < aVoltage) rUsedAmperes++;
- // }
- }
- else if (tTileEntity instanceof IEnergySink) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(),
- tDirection)) {
- if (((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity)
- .injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) {
- rUsedAmperes++;
- }
- }
- }
- else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- final int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
- if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
- ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
- rUsedAmperes++;
- }
- else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
- if (this.mRestRF == 0) {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut,
- false);
- rUsedAmperes++;
- this.mRestRF = rfOut - RFtrans;
- }
- else {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection,
- (int) this.mRestRF, false);
- this.mRestRF = this.mRestRF - RFtrans;
- }
- }
- if (GregTech_API.mRFExplosions
- && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
- if (rfOut > 32 * GregTech_API.mEUtoRF / 100) {
- this.doExplosion(rfOut);
- }
- }
- }
- }
- }
- }
- }
- this.mTransferredAmperage += rUsedAmperes;
- this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
- this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
- if (aVoltage > this.mVoltage || this.mTransferredAmperage > this.mAmperage) {
- this.getBaseMetaTileEntity().setToFire();
- return aAmperage;
- }
- return rUsedAmperes;
+ public String[] getDescription() {
+ return new String[] {
+ "Max Voltage: " + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: " + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: " + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + " EU-Volt",
+ CORE.GT_Tooltip,
+ " ",
+ "This Wire is Lossless.",
+ "Please, adhere to cooling directions."
+ };
+ }
+
+
+ @Override
+ public float getThickNess() {
+ return mThickNess;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
index 24aeb872ed..c574087020 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
@@ -12,73 +12,65 @@ import gtPlusPlus.xmod.gregtech.api.gui.GUI_SafeBlock;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase;
import net.minecraft.entity.player.InventoryPlayer;
-public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase {
-
- public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier) {
- super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers.");
- }
-
- public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier,
- final int aInvSlotCount, final String aDescription) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GregtechMetaSafeBlock(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+public class GregtechMetaSafeBlock
+ extends GregtechMetaSafeBlockBase {
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, CORE.GT_Tooltip};
}
+
+ public GregtechMetaSafeBlock(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers.");
+ }
- protected void fillStacksIntoFirstSlots() {
- for (int i = 0; i < this.mInventory.length - 1; i++) {
- for (int j = i + 1; j < this.mInventory.length - 1; j++) {
- if (this.mInventory[j] != null && (this.mInventory[i] == null
- || GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) {
- GT_Utility.moveStackFromSlotAToSlotB(this.getBaseMetaTileEntity(), this.getBaseMetaTileEntity(), j,
- i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
- }
- }
- }
+ public GregtechMetaSafeBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
- }
+ public GregtechMetaSafeBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, CORE.GT_Tooltip
- };
- }
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaSafeBlock(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
- @Override
+ @Override
public ITexture getOverlayIcon() {
- return new GT_RenderedTexture(Textures.BlockIcons.VOID);
- }
+ return new GT_RenderedTexture(Textures.BlockIcons.VOID);
+ }
- /*
- * @Override protected void moveItems(IGregTechTileEntity
- * aBaseMetaTileEntity, long aTimer) { fillStacksIntoFirstSlots();
- * super.moveItems(aBaseMetaTileEntity, aTimer); fillStacksIntoFirstSlots();
- * }
- */
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < this.mInventory.length - 1;
+ }
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
- }
+ /*@Override
+ protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ fillStacksIntoFirstSlots();
+ super.moveItems(aBaseMetaTileEntity, aTimer);
+ fillStacksIntoFirstSlots();
+ }*/
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < this.mInventory.length - 1;
- }
+ protected void fillStacksIntoFirstSlots() {
+ for (int i = 0; i < this.mInventory.length - 1; i++) {
+ for (int j = i + 1; j < this.mInventory.length - 1; j++) {
+ if ((this.mInventory[j] != null) && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) {
+ GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ }
+ }
+ }
+ }
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaSafeBlock(this.mName, this.mTier, this.mInventory.length, this.mDescription,
- this.mTextures);
- }
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java
index 6e195a8e87..15cbf92516 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import java.util.Collection;
-
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,341 +9,289 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless.GregtechMetaTileEntityLosslessBasicTank;
+
+import java.util.Collection;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public abstract class GregtechMetaSuperConductorNodeBase extends GregtechMetaTileEntityLosslessBasicTank {
- public GregtechMetaSuperConductorNodeBase(final int aID, final String aName, final String aNameRegional,
- final int aTier, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GregtechMetaSuperConductorNodeBase(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0
- || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public int consumedFluidPerOperation(final FluidStack aLiquid) {
- return 1;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- @Override
- public int getCapacity() {
- return 16000;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, "Cooling Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip
- };
- }
-
- public abstract int getEfficiency();
-
- public ItemStack getEmptyContainer(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || this.getRecipes() == null) {
- return null;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null,
- aStack);
- if (tFuel != null) {
- return GT_Utility.copy(tFuel.getOutput(0));
- }
- return GT_Utility.getContainerItem(aStack, true);
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public int getFuelValue(final FluidStack aLiquid) {
- if (aLiquid == null || this.getRecipes() == null) {
- return 0;
- }
- FluidStack tLiquid;
- final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- for (final GT_Recipe tFuel : tRecipeList) {
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) {
- if (aLiquid.isFluidEqual(tLiquid)) {
- return 0;
- }
- }
- }
- }
- // return (int) (((long) tFuel.mSpecialValue * getEfficiency() *
- // consumedFluidPerOperation(tLiquid)) / 100);
- return 0;
- }
-
- public int getFuelValue(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || this.getRecipes() == null) {
- return 0;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null,
- aStack);
- if (tFuel != null) {
- return 0;
- }
- // return (int) ((tFuel.mSpecialValue * 1000L * getEfficiency()) / 100);
- return 0;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return GT_Values.V[this.mTier] * 16 * this.mInventory.length;
- }
-
- public abstract GT_Recipe_Map getRecipes();
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return this.getFuelValue(aFluid) > 0;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public long maxAmperesIn() {
- return 16;
- }
-
- @Override
- public long maxAmperesOut() {
- return 16;
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUStore() {
- return GT_Values.V[this.mTier] * 64;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (this.getEUVar() == this.maxEUStore() || this.mFluid == null) {
- aBaseMetaTileEntity.disableWorking();
- }
- else {
- aBaseMetaTileEntity.enableWorking();
- }
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) {
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- }
- else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- }
- else {
- final int tFuelValue = this.getFuelValue(this.mFluid),
- tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if (tConsumed > 0 && this.mFluid.amount > tConsumed) {
- final long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, this.maxEUOutput() * 20
- + this.getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored());
- if (tFluidAmountToUse > 0 /*
- * && aBaseMetaTileEntity.
- * increaseStoredEnergyUnits(
- * tFluidAmountToUse *
- * tFuelValue, true)
- */) {
- this.mFluid.amount -= tFluidAmountToUse * tConsumed;
- }
- }
- }
- if (this.mInventory[this.getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20
- + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
- final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue >= 0) {
- final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- // aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue,
- // true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
+ public GregtechMetaSuperConductorNodeBase(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GregtechMetaSuperConductorNodeBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = getFront(i);
+ rTextures[1][i + 1] = getBack(i);
+ rTextures[2][i + 1] = getBottom(i);
+ rTextures[3][i + 1] = getTop(i);
+ rTextures[4][i + 1] = getSides(i);
+ rTextures[5][i + 1] = getFrontActive(i);
+ rTextures[6][i + 1] = getBackActive(i);
+ rTextures[7][i + 1] = getBottomActive(i);
+ rTextures[8][i + 1] = getTopActive(i);
+ rTextures[9][i + 1] = getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @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];
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription, "Cooling Efficiency: " + getEfficiency() + "%", CORE.GT_Tooltip};
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ 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]};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ 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]};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 16 * mInventory.length;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 64;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 16;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 16;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return getFuelValue(aFluid) > 0;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (getEUVar() == maxEUStore() || mFluid == null){
+ aBaseMetaTileEntity.disableWorking();
+ }
+ else {
+ aBaseMetaTileEntity.enableWorking();
+ }
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) {
+ if (mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) {
+ mInventory[getStackDisplaySlot()] = null;
+ } else {
+ if (mInventory[getStackDisplaySlot()] == null)
+ mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ int tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
+ if (tConsumed > 0 && mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()));
+ if (tFluidAmountToUse > 0 /*&& aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)*/)
+ mFluid.amount -= tFluidAmountToUse * tConsumed;
+ }
+ }
+ if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) && GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) == null) {
+ int tFuelValue = getFuelValue(mInventory[getInputSlot()]);
+ if (tFuelValue >= 0) {
+ ItemStack tEmptyContainer = getEmptyContainer(mInventory[getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
+ //aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide())
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ }
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null || getRecipes() == null) return 0;
+ FluidStack tLiquid;
+ Collection<GT_Recipe> tRecipeList = getRecipes().mRecipeList;
+ if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList)
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null)
+ if (aLiquid.isFluidEqual(tLiquid))
+ return 0;
+ //return (int) (((long) tFuel.mSpecialValue * getEfficiency() * consumedFluidPerOperation(tLiquid)) / 100);
+ return 0;
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null)
+ return 0;
+ //return (int) ((tFuel.mSpecialValue * 1000L * getEfficiency()) / 100);
+ return 0;
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return null;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return GT_Utility.copy(tFuel.getOutput(0));
+ return GT_Utility.getContainerItem(aStack, true);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack) > 0 || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 16000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
index 7bcd29dad0..e9947464be 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
@@ -1,17 +1,17 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import cofh.api.energy.IEnergyReceiver;
+import static gregtech.api.enums.GT_Values.VN;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
-import gregtech.api.interfaces.tileentity.*;
+import gregtech.api.interfaces.tileentity.IColoredTileEntity;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.api.objects.GT_RenderedTexture;
@@ -21,6 +21,11 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import ic2.api.energy.tile.IEnergySink;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
@@ -30,301 +35,269 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.api.energy.IEnergyReceiver;
public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
- public final float mThickNess;
- public final GT_Materials mMaterial;
- public final long mCableLossPerMeter, mAmperage, mVoltage;
- public final boolean mInsulated, mCanShock;
- public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,
- mTransferredVoltageLast20 = 0;
- public long mRestRF;
- public short mOverheat;
- public final int mWireHeatingTicks;
+ public final float mThickNess;
+ public final GT_Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
+ public long mRestRF;
+ public short mOverheat;
+ public final int mWireHeatingTicks;
- public GregtechMetaPipeEntityBase_Cable(final int aID, final String aName, final String aNameRegional,
- final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage,
- final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
+ public GregtechMetaPipeEntityBase_Cable(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aID, aName, aNameRegional, 0);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = aCableLossPerMeter;
- this.mWireHeatingTicks = this.getGT5Var();
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ mWireHeatingTicks = getGT5Var();
}
- public GregtechMetaPipeEntityBase_Cable(final String aName, final float aThickNess, final GT_Materials aMaterial,
- final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated,
- final boolean aCanShock) {
+ public GregtechMetaPipeEntityBase_Cable(String aName, float aThickNess, GT_Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aName, 0);
- this.mThickNess = aThickNess;
- this.mMaterial = aMaterial;
- this.mAmperage = aAmperage;
- this.mVoltage = aVoltage;
- this.mInsulated = aInsulated;
- this.mCanShock = aCanShock;
- this.mCableLossPerMeter = aCableLossPerMeter;
- this.mWireHeatingTicks = this.getGT5Var();
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ mWireHeatingTicks = getGT5Var();
}
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- if (!this.mCanShock) {
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
- return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D,
- aZ + 0.875D);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Max Voltage: " + EnumChatFormatting.GREEN + this.mVoltage + " ("
- + GT_Values.VN[GT_Utility.getTier(this.mVoltage)] + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: " + EnumChatFormatting.RED + this.mCableLossPerMeter + EnumChatFormatting.GRAY
- + " EU-Volt"
- };
- }
-
- private int getGT5Var() {
- final Class<? extends GT_Proxy> clazz = GT_Mod.gregtechproxy.getClass();
- final String lookingForValue = "mWireHeatingTicks";
+
+ private int getGT5Var(){
+ Class<? extends GT_Proxy> clazz = GT_Mod.gregtechproxy.getClass();
+ String lookingForValue = "mWireHeatingTicks";
int temp = 4;
Field field;
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- try {
- field = clazz.getClass().getField(lookingForValue);
- final Class<?> clazzType = field.getType();
- if (clazzType.toString().equals("int")) {
- temp = field.getInt(clazz);
- }
- else {
- temp = 4;
- }
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ try {
+ field = clazz.getClass().getField(lookingForValue);
+ Class<?> clazzType = field.getType();
+ if (clazzType.toString().equals("int")){
+ temp = (field.getInt(clazz));
}
- catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
- // Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES
- // - PLEASE REPORT THIS.");
- Utils.LOG_WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
- Utils.LOG_ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ else {
temp = 4;
}
+ } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
+ //Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ Utils.LOG_WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ Utils.LOG_ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ temp = 4;
+ }
}
return temp;
}
@Override
- public int getProgresstime() {
- return (int) this.mTransferredAmperage * 64;
+ public byte getTileEntityBaseType() {
+ return (byte) (mInsulated ? 9 : 8);
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide,
- final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
- if (!this.mInsulated) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa)
- };
- }
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntityBase_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) {
+ if (!mInsulated)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa)};
if (aConnected) {
- final float tThickNess = this.getThickNess();
- if (tThickNess < 0.37F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.49F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.74F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- if (tThickNess < 0.99F) {
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
- }
- return new ITexture[] {
- new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
- this.mMaterial.mRGBa),
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.37F)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.49F)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.74F)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.99F)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
- return new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
- Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))
- };
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
@Override
- public float getThickNess() {
- return this.mThickNess;
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase)
+ GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
}
@Override
- public byte getTileEntityBaseType() {
- return (byte) (this.mInsulated ? 9 : 8);
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D);
}
@Override
- public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide,
- this.getBaseMetaTileEntity().getCoverIDAtSide(aSide),
- this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), this.getBaseMetaTileEntity())) {
- return 0;
- }
- return this.transferElectricity(aSide, aVoltage, aAmperage,
- new ArrayList<TileEntity>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
+ public boolean isSimpleMachine() {
+ return true;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
+ public boolean isFacingValid(byte aFacing) {
return false;
}
@Override
- public boolean isSimpleMachine() {
+ public boolean isValidSlot(int aIndex) {
return true;
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return true;
+ public final boolean renderInside(byte aSide) {
+ return false;
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- //
+ public int getProgresstime() {
+ return (int) mTransferredAmperage * 64;
}
@Override
public int maxProgresstime() {
- return (int) this.mAmperage * 64;
+ return (int) mAmperage * 64;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntityBase_Cable(this.mName, this.mThickNess, this.mMaterial,
- this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()))
+ return 0;
+ return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity) getBaseMetaTileEntity())));
}
@Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity aEntity) {
- if (this.mCanShock && (((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0
- && aEntity instanceof EntityLivingBase) {
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, this.mTransferredVoltageLast20,
- this.mTransferredAmperageLast20);
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ long rUsedAmperes = 0;
+ aVoltage -= mCableLossPerMeter;
+ if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++)
+ if (i != aSide && (mConnections & (1 << i)) != 0 && getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, getBaseMetaTileEntity().getCoverIDAtSide(i), getBaseMetaTileEntity().getCoverDataAtSide(i), getBaseMetaTileEntity())) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(i);
+ if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
+ aAlreadyPassedTileEntityList.add(tTileEntity);
+ if (tTileEntity instanceof IEnergyConnected) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue;
+ }
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity))) {
+ if (((IGregTechTileEntity) tTileEntity).getTimer() > 50)
+ rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
+ } else {
+ rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
+ }
+ // } else if (tTileEntity instanceof IEnergySink) {
+ // ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ // if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ // if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
+ // }
+ } else if (tTileEntity instanceof IEnergySink) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) getBaseMetaTileEntity(), tDirection)) {
+ if (((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage)
+ rUsedAmperes++;
+ }
+ } else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
+ if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
+ ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
+ rUsedAmperes++;
+ } else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
+ if (mRestRF == 0) {
+ int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) rfOut, false);
+ rUsedAmperes++;
+ mRestRF = rfOut - RFtrans;
+ } else {
+ int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) mRestRF, false);
+ mRestRF = mRestRF - RFtrans;
+ }
+ }
+ if (GregTech_API.mRFExplosions && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
+ if (rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
+ }
+ }
+ }
+ }
+
+
+ mTransferredAmperage += rUsedAmperes;
+ mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
+ mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
+
+
+ if (aVoltage > mVoltage || mTransferredAmperage > mAmperage){
+ //GT 5.09
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if(mOverheat>mWireHeatingTicks * 100){
+ getBaseMetaTileEntity().setToFire();
+ }
+ else{
+ mOverheat +=100;
+ }
+ return aAmperage;
+ }
+ //GT 5.08
+ else {
+ getBaseMetaTileEntity().setToFire();
+ return aAmperage;
+ }
}
+
+ return rUsedAmperes;
}
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
- this.mTransferredAmperage = 0;
- if (this.mOverheat > 0) {
- this.mOverheat--;
- }
+ mTransferredAmperage = 0;
+ if(mOverheat>0)mOverheat--;
if (aTick % 20 == 0) {
- this.mTransferredVoltageLast20 = 0;
- this.mTransferredAmperageLast20 = 0;
- this.mConnections = 0;
+ mTransferredVoltageLast20 = 0;
+ mTransferredAmperageLast20 = 0;
+ mConnections = 0;
for (byte i = 0, j = 0; i < 6; i++) {
j = GT_Utility.getOppositeSide(i);
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)
- || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i,
- aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
- aBaseMetaTileEntity)) {
- final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
if (tTileEntity instanceof IColoredTileEntity) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
- final byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
- continue;
- }
+ byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
}
}
- if (tTileEntity instanceof IEnergyConnected
- && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j)
- || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IEnergyConnected && (((IEnergyConnected) tTileEntity).inputEnergyFrom(j) || ((IEnergyConnected) tTileEntity).outputsEnergyTo(j))) {
+ mConnections |= (1 << i);
continue;
}
- if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable) {
- if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)
- || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j,
- ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j),
- ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j),
- (IGregTechTileEntity) tTileEntity)) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable) {
+ if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity))) {
+ mConnections |= (1 << i);
continue;
}
}
- if (tTileEntity instanceof IEnergySink && ((IEnergySink) tTileEntity).acceptsEnergyFrom(
- (TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
- this.mConnections |= 1 << i;
+ if (tTileEntity instanceof IEnergySink && ((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1 << i);
continue;
}
- if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver
- && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
- this.mConnections |= 1 << i;
+ if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) {
+ mConnections |= (1 << i);
continue;
}
/*
- * if (tTileEntity instanceof IEnergyEmitter &&
- * ((IEnergyEmitter)tTileEntity).emitsEnergyTo((
- * TileEntity)aBaseMetaTileEntity,
- * ForgeDirection.getOrientation(j))) { mConnections |=
- * (1<<i); continue; }
- */
+ if (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
+ continue;
+ }*/
}
}
}
@@ -332,134 +305,36 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
}
@Override
- public final boolean renderInside(final byte aSide) {
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- //
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
@Override
- public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage,
- final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- long rUsedAmperes = 0;
- aVoltage -= this.mCableLossPerMeter;
- if (aVoltage > 0) {
- for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) {
- if (i != aSide && (this.mConnections & 1 << i) != 0
- && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i,
- this.getBaseMetaTileEntity().getCoverIDAtSide(i),
- this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
- if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
- aAlreadyPassedTileEntityList.add(tTileEntity);
- if (tTileEntity instanceof IEnergyConnected) {
- if (this.getBaseMetaTileEntity().getColorization() >= 0) {
- final byte tColor = ((IEnergyConnected) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != this.getBaseMetaTileEntity().getColorization()) {
- continue;
- }
- }
- if (tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity() instanceof IMetaTileEntityCable
- && ((IGregTechTileEntity) tTileEntity)
- .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i))
- .letsEnergyIn(GT_Utility.getOppositeSide(i),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverIDAtSide(GT_Utility.getOppositeSide(i)),
- ((IGregTechTileEntity) tTileEntity)
- .getCoverDataAtSide(GT_Utility.getOppositeSide(i)),
- (IGregTechTileEntity) tTileEntity)) {
- if (((IGregTechTileEntity) tTileEntity).getTimer() > 50) {
- rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity)
- .getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i),
- aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
- }
- }
- else {
- rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(
- GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
- }
- // } else if (tTileEntity instanceof IEnergySink) {
- // ForgeDirection tDirection =
- // ForgeDirection.getOrientation(i).getOpposite();
- // if
- // (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(),
- // tDirection)) {
- // if
- // (((IEnergySink)tTileEntity).demandedEnergyUnits()
- // > 0 &&
- // ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection,
- // aVoltage) < aVoltage) rUsedAmperes++;
- // }
- }
- else if (tTileEntity instanceof IEnergySink) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(),
- tDirection)) {
- if (((IEnergySink) tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink) tTileEntity)
- .injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) {
- rUsedAmperes++;
- }
- }
- }
- else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
- final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- final int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
- if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
- ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
- rUsedAmperes++;
- }
- else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
- if (this.mRestRF == 0) {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut,
- false);
- rUsedAmperes++;
- this.mRestRF = rfOut - RFtrans;
- }
- else {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection,
- (int) this.mRestRF, false);
- this.mRestRF = this.mRestRF - RFtrans;
- }
- }
- if (GregTech_API.mRFExplosions
- && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
- if (rfOut > 32 * GregTech_API.mEUtoRF / 100) {
- this.doExplosion(rfOut);
- }
- }
- }
- }
- }
- }
- }
+ public String[] getDescription() {
+ return new String[]{
+ "Max Voltage: " + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: " + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: " + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + " EU-Volt"
+ };
+ }
- this.mTransferredAmperage += rUsedAmperes;
- this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
- this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
+ @Override
+ public float getThickNess() {
+ return mThickNess;
+ }
- if (aVoltage > this.mVoltage || this.mTransferredAmperage > this.mAmperage) {
- // GT 5.09
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- if (this.mOverheat > this.mWireHeatingTicks * 100) {
- this.getBaseMetaTileEntity().setToFire();
- }
- else {
- this.mOverheat += 100;
- }
- return aAmperage;
- }
- // GT 5.08
- else {
- this.getBaseMetaTileEntity().setToFire();
- return aAmperage;
- }
- }
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ //
+ }
- return rUsedAmperes;
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ //
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
index 45c298d769..cd91d05970 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
@@ -1,6 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.GT;
import gregtech.api.interfaces.ITexture;
import gregtech.api.metatileentity.MetaTileEntity;
import gtPlusPlus.core.lib.CORE;
@@ -9,70 +9,59 @@ public abstract class GregtechMetaTileEntity extends MetaTileEntity {
/**
* Value between [0 - 9] to describe the Tier of this Machine.
*/
- public final byte mTier;
-
+ public final byte mTier;
+
/**
* A simple Description.
*/
- public final String mDescription;
-
+ public final String mDescription;
+
/**
* Contains all Textures used by this Block.
*/
- public final ITexture[][][] mTextures;
-
- public GregtechMetaTileEntity(final int aID, final String aName, final String aNameRegional, final int aTier,
- final int aInvSlotCount, final String aDescription, final ITexture... aTextures) {
+ public final ITexture[][][] mTextures;
+
+ public GregtechMetaTileEntity(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aInvSlotCount);
- this.mTier = (byte) Math.max(0, Math.min(aTier, 9));
- this.mDescription = aDescription;
-
+ mTier = (byte)Math.max(0, Math.min(aTier, 9));
+ mDescription = aDescription;
+
// must always be the last call!
- if (GT_Values.GT.isClientSide()) {
- this.mTextures = this.getTextureSet(aTextures);
- }
- else {
- this.mTextures = null;
- }
+ if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null;
}
-
- public GregtechMetaTileEntity(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
+
+ public GregtechMetaTileEntity(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
- this.mTier = (byte) aTier;
- this.mDescription = aDescription;
- this.mTextures = aTextures;
-
+ mTier = (byte)aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+
}
-
+
@Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, CORE.GT_Tooltip
- };
+ public byte getTileEntityBaseType() {
+ return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4)));
}
-
- @Override
+
+ @Override
public long getInputTier() {
- return this.mTier;
- }
-
- @Override
+ return mTier;
+ }
+
+ @Override
public long getOutputTier() {
- return this.mTier;
+ return mTier;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, CORE.GT_Tooltip};
}
-
+
/**
- * Used Client Side to get a Texture Set for this Block. Called after
- * setting the Tier and the Description so that those two are accessible.
- *
- * @param aTextures
- * is the optional Array you can give to the Constructor.
+ * Used Client Side to get a Texture Set for this Block.
+ * Called after setting the Tier and the Description so that those two are accessible.
+ * @param aTextures is the optional Array you can give to the Constructor.
*/
public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
-
- @Override
- public byte getTileEntityBaseType() {
- return (byte) Math.min(3, this.mTier <= 0 ? 0 : 1 + (this.mTier - 1) / 4);
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 7a2397cf02..a6121f783d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -1,22 +1,37 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
-import java.util.ArrayList;
-
+import static gregtech.api.enums.GT_Values.V;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.*;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.core.util.array.Pair;
import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
+
+import java.util.ArrayList;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -25,1022 +40,832 @@ import net.minecraftforge.fluids.FluidStack;
public abstract class GregtechMeta_MultiBlockBase extends MetaTileEntity {
- public static boolean disableMaintenance;
- public static boolean isValidMetaTileEntity(final MetaTileEntity aMetaTileEntity) {
- return aMetaTileEntity.getBaseMetaTileEntity() != null
- && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity
- && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
- }
- public boolean mMachine = false, mWrench = false,
- mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = true, mCrowbar = false,
- mRunningOnLoad = false;
- public int mPollution = 0, mProgresstime = 0,
- mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, mUpdate = 0, mStartUpCheck = 100, mRuntime = 0,
- mEfficiency = 0;
- public ItemStack[] mOutputItems = null;
- public FluidStack[] mOutputFluids = null;
- public ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Input>();
- public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Output>();
- public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<GT_MetaTileEntity_Hatch_InputBus>();
- public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<GT_MetaTileEntity_Hatch_OutputBus>();
- public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch_Dynamo>();
- public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<GT_MetaTileEntity_Hatch_Muffler>();
- public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch_Energy>();
-
- public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<GT_MetaTileEntity_Hatch_Maintenance>();
-
- public GregtechMeta_MultiBlockBase(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 2);
- GregtechMeta_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "MultiBlockMachines.disableMaintenance", false);
- }
-
- public GregtechMeta_MultiBlockBase(final String aName) {
- super(aName, 2);
- GregtechMeta_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "MultiBlockMachines.disableMaintenance", false);
- }
-
- /**
- * Called whenever the Machine aborted a Process, useful for Sound Effects
- */
- public void abortProcess() {
- //
- }
-
- public boolean addDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addEnergyInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addEnergyOutput(final long aEU) {
- if (aEU <= 0) {
- return true;
- }
- for (final GT_MetaTileEntity_Hatch_Dynamo tHatch : this.mDynamoHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private void addFluidOutputs(final FluidStack[] mOutputFluids2) {
- for (int i = 0; i < mOutputFluids2.length; i++) {
- if (this.mOutputHatches.size() > i && this.mOutputHatches.get(i) != null && mOutputFluids2[i] != null
- && GregtechMeta_MultiBlockBase.isValidMetaTileEntity(this.mOutputHatches.get(i))) {
- this.mOutputHatches.get(i).fill(mOutputFluids2[i], true);
- }
- }
-
- }
-
- public boolean addInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addMaintenanceToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addMufflerToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addOutput(final FluidStack aLiquid) {
- if (aLiquid == null) {
- return false;
- }
- final FluidStack tLiquid = aLiquid.copy();
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)
- ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
- final int tAmount = tHatch.fill(tLiquid, false);
- if (tAmount >= tLiquid.amount) {
- return tHatch.fill(tLiquid, true) >= tLiquid.amount;
- }
- else if (tAmount > 0) {
- tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
- }
- }
- }
- return false;
- }
-
- public boolean addOutput(ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- aStack = GT_Utility.copy(aStack);
- // FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
- // if (aLiquid == null) {
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
- if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) {
- return true;
- }
- }
- }
- }
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
- if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) {
- return true;
- }
- }
- }
- // }else {
- // for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
- // if (isValidMetaTileEntity(tHatch) &&
- // GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids())
- // {
- // int tAmount = tHatch.fill(aLiquid, false);
- // if (tAmount >= aLiquid.amount) {
- // return tHatch.fill(aLiquid, true) >= aLiquid.amount;
- // }
- // }
- // }
- // }
- return false;
- }
-
- public boolean addOutputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
- }
- return false;
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- /**
- * Checks the Machine. You have to assign the MetaTileEntities for the
- * Hatches here.
- */
- public abstract boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
-
- /**
- * Checks the Recipe
- */
- public abstract boolean checkRecipe(ItemStack aStack);
-
- public boolean depleteInput(final FluidStack aLiquid) {
- if (aLiquid == null) {
- return false;
- }
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- FluidStack tLiquid = tHatch.getFluid();
- if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) {
- tLiquid = tHatch.drain(aLiquid.amount, false);
- if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
- tLiquid = tHatch.drain(aLiquid.amount, true);
- return tLiquid != null && tLiquid.amount >= aLiquid.amount;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Checks if this is a Correct Machine Part for this kind of Machine
- * (Turbine Rotor for example)
- */
- // public abstract boolean isCorrectMachinePart(ItemStack aStack);
-
- public boolean depleteInput(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- final FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
- if (aLiquid != null) {
- return this.depleteInput(aLiquid);
- }
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
- tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
- return true;
- }
- }
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
- tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- public boolean doRandomMaintenanceDamage() {
- if (this.getRepairStatus() == 0) {
- this.stopMachine();
- return false;
- }
- if (this.mRuntime++ > 1000) {
- this.mRuntime = 0;
- if (this.getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
- switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
- case 0:
- this.mWrench = false;
- break;
- case 1:
- this.mScrewdriver = false;
- break;
- case 2:
- this.mSoftHammer = false;
- break;
- case 3:
- this.mHardHammer = false;
- break;
- case 4:
- this.mSolderingTool = true;
- break;
- case 5:
- this.mCrowbar = false;
- break;
- }
- }
- if (this.mInventory[1] != null && this.getBaseMetaTileEntity().getRandomNumber(2) == 0
- && !this.mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
- if (this.mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
- final NBTTagCompound tNBT = this.mInventory[1].getTagCompound();
- if (tNBT != null) {
- NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
- if (!tNBT.getBoolean("mDis")) {
- tNBT2 = new NBTTagCompound();
- final Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[1]);
- final ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
- final int i = this.mInventory[1].getItemDamage();
- if (i == 170) {
- ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- else if (i == 172) {
- ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- else if (i == 174) {
- ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- else if (i == 176) {
- ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- tNBT.setTag("GT.CraftingComponents", tNBT2);
- tNBT.setBoolean("mDis", true);
- this.mInventory[1].setTagCompound(tNBT);
-
- }
- }
-
- ((GT_MetaGenerated_Tool) this.mInventory[1].getItem()).doDamage(this.mInventory[1],
- (long) Math.min(this.mEUt / 5, Math.pow(this.mEUt, 0.7)));
- if (this.mInventory[1].stackSize == 0) {
- this.mInventory[1] = null;
- }
- }
- }
- }
- return true;
- }
-
- public boolean drainEnergyInput(final long aEU) {
- if (aEU <= 0) {
- return true;
- }
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Called whenever the Machine successfully finished a Process, useful for
- * Sound Effects
- */
- public void endProcess() {
- //
- }
-
- /**
- * Gets the damage to the ItemStack, usually 0 or 1.
- */
- // public abstract int getDamageToComponent(ItemStack aStack);
-
- public void explodeMultiblock() {
- this.mInventory[1] = null;
- for (final MetaTileEntity tTileEntity : this.mInputBusses) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputBusses) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mInputHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mDynamoHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mMufflerHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mEnergyHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- this.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
-
- /**
- * If it explodes when the Component has to be replaced.
- */
- public abstract boolean explodesOnComponentBreak(ItemStack aStack);
-
- /**
- * Gets the Amount of possibly outputted Items for loading the Output Stack
- * Array from NBT. This should be the largest Amount that can ever happen
- * legitimately.
- */
- public abstract int getAmountOfOutputs();
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "MultiblockDisplay.png");
- }
-
- public int getIdealStatus() {
- return 6;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- "Progress:", this.mProgresstime / 20 + "secs", this.mMaxProgresstime / 20 + "secs", "Efficiency:",
- this.mEfficiency / 100.0F + "%", "Problems:", "" + (this.getIdealStatus() - this.getRepairStatus())
- };
- }
-
- /**
- * Gets the maximum Efficiency that spare Part can get (0 - 10000)
- */
- public abstract int getMaxEfficiency(ItemStack aStack);
-
- public long getMaxInputVoltage() {
- long rVoltage = 0;
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
- }
- }
- return rVoltage;
- }
-
- /**
- * Gets the pollution this Device outputs to a Muffler per tick (10000 = one
- * Pullution Block)
- */
- public abstract int getPollutionPerTick(ItemStack aStack);
-
- @Override
- public int getProgresstime() {
- return this.mProgresstime;
- }
-
- public GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- public int getRepairStatus() {
- return (this.mWrench ? 1 : 0) + (this.mScrewdriver ? 1 : 0) + (this.mSoftHammer ? 1 : 0)
- + (this.mHardHammer ? 1 : 0) + (this.mSolderingTool ? 1 : 0) + (this.mCrowbar ? 1 : 0);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public ArrayList<FluidStack> getStoredFluids() {
- final ArrayList<FluidStack> rList = new ArrayList<FluidStack>();
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
- rList.add(tHatch.getFillableStack());
- }
- }
- return rList;
- }
-
- public ArrayList<ItemStack> getStoredInputs() {
- final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)
- && tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- }
- return rList;
- }
-
- public ArrayList<ItemStack> getStoredOutputs() {
- final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
- }
- }
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- return rList;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 2;
- }
-
- public int getValidOutputSlots(final GT_Recipe.GT_Recipe_Map sRecipeMap, final ItemStack[] sInputs) {
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- final GT_Recipe tRecipe = sRecipeMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null,
- sInputs);
- final ArrayList<Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer>> rList = new ArrayList<Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer>>();
- int tTotalHatches = 0;
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
+ public static boolean disableMaintenance;
+ public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = true, mCrowbar = false, mRunningOnLoad = false;
+ public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, mUpdate = 0, mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0;
+ public ItemStack[] mOutputItems = null;
+ public FluidStack[] mOutputFluids = null;
+ public ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Input>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Output>();
+ public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<GT_MetaTileEntity_Hatch_InputBus>();
+ public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<GT_MetaTileEntity_Hatch_OutputBus>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch_Dynamo>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<GT_MetaTileEntity_Hatch_Muffler>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch_Energy>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<GT_MetaTileEntity_Hatch_Maintenance>();
+
+ public GregtechMeta_MultiBlockBase(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public GregtechMeta_MultiBlockBase(String aName) {
+ super(aName, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) {
+ return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex > 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ return aProgress;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mEUt", mEUt);
+ aNBT.setInteger("mProgresstime", mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiency", mEfficiency);
+ aNBT.setInteger("mPollution", mPollution);
+ aNBT.setInteger("mRuntime", mRuntime);
+
+ if (mOutputItems != null) for (int i = 0; i < mOutputItems.length; i++)
+ if (mOutputItems[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputItems[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem" + i, tNBT);
+ }
+ if (mOutputFluids != null) for (int i = 0; i < mOutputFluids.length; i++)
+ if (mOutputFluids[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputFluids[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputFluids" + i, tNBT);
+ }
+
+ aNBT.setBoolean("mWrench", mWrench);
+ aNBT.setBoolean("mScrewdriver", mScrewdriver);
+ aNBT.setBoolean("mSoftHammer", mSoftHammer);
+ aNBT.setBoolean("mHardHammer", mHardHammer);
+ aNBT.setBoolean("mSolderingTool", mSolderingTool);
+ aNBT.setBoolean("mCrowbar", mCrowbar);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mEUt = aNBT.getInteger("mEUt");
+ mProgresstime = aNBT.getInteger("mProgresstime");
+ mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ if (mMaxProgresstime > 0) mRunningOnLoad = true;
+ mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ mEfficiency = aNBT.getInteger("mEfficiency");
+ mPollution = aNBT.getInteger("mPollution");
+ mRuntime = aNBT.getInteger("mRuntime");
+ mOutputItems = new ItemStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
+ mOutputFluids = new FluidStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputFluids.length; i++)
+ mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
+ mWrench = aNBT.getBoolean("mWrench");
+ mScrewdriver = aNBT.getBoolean("mScrewdriver");
+ mSoftHammer = aNBT.getBoolean("mSoftHammer");
+ mHardHammer = aNBT.getBoolean("mHardHammer");
+ mSolderingTool = aNBT.getBoolean("mSolderingTool");
+ mCrowbar = aNBT.getBoolean("mCrowbar");
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png");
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 2;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (mEfficiency < 0) mEfficiency = 0;
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ mInputHatches.clear();
+ mInputBusses.clear();
+ mOutputHatches.clear();
+ mOutputBusses.clear();
+ mDynamoHatches.clear();
+ mEnergyHatches.clear();
+ mMufflerHatches.clear();
+ mMaintenanceHatches.clear();
+ mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
+ }
+ if (mStartUpCheck < 0) {
+ if (mMachine) {
+ for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (!this.disableMaintenance) {
+ if (tHatch.mWrench) mWrench = true;
+ if (tHatch.mScrewdriver) mScrewdriver = true;
+ if (tHatch.mSoftHammer) mSoftHammer = true;
+ if (tHatch.mHardHammer) mHardHammer = true;
+ if (tHatch.mSolderingTool) mSolderingTool = true;
+ if (tHatch.mCrowbar) mCrowbar = true;
+ } else {
+ mWrench = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mHardHammer = true;
+ mSolderingTool = true;
+ mCrowbar = true;
+ }
+
+ tHatch.mWrench = false;
+ tHatch.mScrewdriver = false;
+ tHatch.mSoftHammer = false;
+ tHatch.mHardHammer = false;
+ tHatch.mSolderingTool = true;
+ tHatch.mCrowbar = false;
+ }
+ }
+ if (getRepairStatus() > 0) {
+ if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {
+ if (onRunningTick(mInventory[1])) {
+ if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) {
+ stopMachine();
+ }
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputItems != null) for (ItemStack tStack : mOutputItems)
+ if (tStack != null) {
+ try {
+ GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack);
+ } catch (Exception e) {
+ }
+ addOutput(tStack);
+ }
+ if (mOutputFluids != null && mOutputFluids.length == 1) {
+ for (FluidStack tStack : mOutputFluids)
+ if (tStack != null) {
+ addOutput(tStack);
+ }
+ } else if (mOutputFluids != null && mOutputFluids.length > 1) {
+ addFluidOutputs(mOutputFluids);
+ }
+ mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
+ mOutputItems = null;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipe(mInventory[1]);
+ if (mOutputFluids != null && mOutputFluids.length > 0) {
+ if (mOutputFluids.length > 1) {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "oilplant");
+ }
+ }
+ }
+ }
+ } else {
+ if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe(mInventory[1]);
+ }
+ if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ stopMachine();
+ }
+ } else {
+ stopMachine();
+ }
+ }
+ aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean polluteEnvironment(int aPollutionLevel) {
+ mPollution += aPollutionLevel;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (mPollution >= 10000) {
+ if (tHatch.polluteEnvironment()) {
+ mPollution -= 10000;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ return mPollution < 10000;
+ }
+
+ /**
+ * Called every tick the Machine runs
+ */
+ public boolean onRunningTick(ItemStack aStack) {
+ if (mEUt > 0) {
+ addEnergyOutput(((long) mEUt * mEfficiency) / 10000);
+ return true;
+ }
+ if (mEUt < 0) {
+ if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ stopMachine();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Checks if this is a Correct Machine Part for this kind of Machine (Turbine Rotor for example)
+ */
+ //public abstract boolean isCorrectMachinePart(ItemStack aStack);
+
+ /**
+ * Checks the Recipe
+ */
+ public abstract boolean checkRecipe(ItemStack aStack);
+
+ /**
+ * Checks the Machine. You have to assign the MetaTileEntities for the Hatches here.
+ */
+ public abstract boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
+
+ /**
+ * Gets the maximum Efficiency that spare Part can get (0 - 10000)
+ */
+ public abstract int getMaxEfficiency(ItemStack aStack);
+
+ /**
+ * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block)
+ */
+ public abstract int getPollutionPerTick(ItemStack aStack);
+
+ /**
+ * Gets the damage to the ItemStack, usually 0 or 1.
+ */
+ //public abstract int getDamageToComponent(ItemStack aStack);
+
+ /**
+ * Gets the Amount of possibly outputted Items for loading the Output Stack Array from NBT.
+ * This should be the largest Amount that can ever happen legitimately.
+ */
+ public abstract int getAmountOfOutputs();
+
+ /**
+ * If it explodes when the Component has to be replaced.
+ */
+ public abstract boolean explodesOnComponentBreak(ItemStack aStack);
+
+ public void stopMachine() {
+ mOutputItems = null;
+ mEUt = 0;
+ mEfficiency = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ getBaseMetaTileEntity().disableWorking();
+ }
+
+ public int getRepairStatus() {
+ return (mWrench ? 1 : 0) + (mScrewdriver ? 1 : 0) + (mSoftHammer ? 1 : 0) + (mHardHammer ? 1 : 0) + (mSolderingTool ? 1 : 0) + (mCrowbar ? 1 : 0);
+ }
+
+ public int getIdealStatus() {
+ return 6;
+ }
+
+ public boolean doRandomMaintenanceDamage() {
+ if (getRepairStatus() == 0) {
+ stopMachine();
+ return false;
+ }
+ if (mRuntime++ > 1000) {
+ mRuntime = 0;
+ if (getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
+ switch (getBaseMetaTileEntity().getRandomNumber(6)) {
+ case 0:
+ mWrench = false;
+ break;
+ case 1:
+ mScrewdriver = false;
+ break;
+ case 2:
+ mSoftHammer = false;
+ break;
+ case 3:
+ mHardHammer = false;
+ break;
+ case 4:
+ mSolderingTool = true;
+ break;
+ case 5:
+ mCrowbar = false;
+ break;
+ }
+ }
+ if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 && !mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
+ if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
+ NBTTagCompound tNBT = mInventory[1].getTagCompound();
+ if (tNBT != null) {
+ NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (!tNBT.getBoolean("mDis")) {
+ tNBT2 = new NBTTagCompound();
+ Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[1]);
+ ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
+ int i = mInventory[1].getItemDamage();
+ if (i == 170) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 172) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 174) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 176) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ }
+ tNBT.setTag("GT.CraftingComponents", tNBT2);
+ tNBT.setBoolean("mDis", true);
+ mInventory[1].setTagCompound(tNBT);
+
+ }
+ }
+
+ ((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage(mInventory[1], (long) Math.min(mEUt / 5, Math.pow(mEUt, 0.7)));
+ if (mInventory[1].stackSize == 0) mInventory[1] = null;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void explodeMultiblock() {
+ mInventory[1] = null;
+ for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) return true;
+ for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public long getMaxInputVoltage() {
+ long rVoltage = 0;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ return rVoltage;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ if (aEU <= 0) return true;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true;
+ }
+ return false;
+ }
+
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ FluidStack tLiquid = aLiquid.copy();
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
+ int tAmount = tHatch.fill(tLiquid, false);
+ if (tAmount >= tLiquid.amount) {
+ return tHatch.fill(tLiquid, true) >= tLiquid.amount;
+ } else if (tAmount > 0) {
+ tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
+ }
+ }
+ }
+ return false;
+ }
+
+ private void addFluidOutputs(FluidStack[] mOutputFluids2) {
+ for (int i = 0; i < mOutputFluids2.length; i++) {
+ if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) {
+ mOutputHatches.get(i).fill(mOutputFluids2[i], true);
+ }
+ }
+
+ }
+
+ public boolean depleteInput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ FluidStack tLiquid = tHatch.getFluid();
+ if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) {
+ tLiquid = tHatch.drain(aLiquid.amount, false);
+ if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
+ tLiquid = tHatch.drain(aLiquid.amount, true);
+ return tLiquid != null && tLiquid.amount >= aLiquid.amount;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean addOutput(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ aStack = GT_Utility.copy(aStack);
+// FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+// if (aLiquid == null) {
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) return true;
+ }
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) return true;
+ }
+ }
+// }else {
+// for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+// if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids()) {
+// int tAmount = tHatch.fill(aLiquid, false);
+// if (tAmount >= aLiquid.amount) {
+// return tHatch.fill(aLiquid, true) >= aLiquid.amount;
+// }
+// }
+// }
+// }
+ return false;
+ }
+
+ public boolean depleteInput(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+ if (aLiquid != null) return depleteInput(aLiquid);
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ return true;
+ }
+ }
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public ArrayList<ItemStack> getStoredOutputs() {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ ArrayList<FluidStack> rList = new ArrayList<FluidStack>();
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
+ rList.add(tHatch.getFillableStack());
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<ItemStack> getStoredInputs() {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ public void updateSlots() {
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ }
+
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch)
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
+ return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
+ return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
+ return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
+ return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy)
+ return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo)
+ return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
+ return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
+ return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ return false;
+ }
+
+ public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{"Progress:", (mProgresstime / 20) + "secs", (mMaxProgresstime / 20) + "secs", "Efficiency:", (mEfficiency / 100.0F) + "%", "Problems:", "" + (getIdealStatus() - getRepairStatus())};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ /**
+ * Called whenever the Machine successfully started a Process, useful for Sound Effects
+ */
+ public void startProcess() {
+ //
+ }
+
+ /**
+ * Called whenever the Machine successfully finished a Process, useful for Sound Effects
+ */
+ public void endProcess() {
+ //
+ }
+
+ /**
+ * Called whenever the Machine aborted a Process, useful for Sound Effects
+ */
+ public void abortProcess() {
+ //
+ }
+
+ public int getValidOutputSlots(GT_Recipe.GT_Recipe_Map sRecipeMap, ItemStack[] sInputs){
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ GT_Recipe tRecipe = sRecipeMap.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, sInputs);
+ ArrayList<Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer>> rList = new ArrayList<Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer>>();
+ int tTotalHatches=0;
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
int hatchUsedSlotCount = 0;
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ if (isValidMetaTileEntity(tHatch)) {
tTotalHatches++;
- for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) {
- hatchUsedSlotCount++;
- }
+ for (int i=0; i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null){hatchUsedSlotCount++;}
}
rList.add(new Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer>(tHatch, hatchUsedSlotCount));
}
}
- final boolean[] mValidOutputSlots = new boolean[tTotalHatches];
- int arrayPos = 0;
- for (final Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer> IE : rList) {
- final GT_MetaTileEntity_Hatch_OutputBus vTE = IE.getKey();
- final int vUsedSlots = IE.getValue();
- if (vUsedSlots == 0) {
- mValidOutputSlots[arrayPos] = true;
- }
- else if (vUsedSlots < vTE.getSizeInventory()) {
- final int outputItemCount = tRecipe.mOutputs.length;
- if (vUsedSlots < vTE.getSizeInventory() - outputItemCount) {
- mValidOutputSlots[arrayPos] = true;
- }
- else if (vUsedSlots >= vTE.getSizeInventory() - outputItemCount) {
- if (vUsedSlots > vTE.getSizeInventory() - outputItemCount) {
- if (arrayPos == tTotalHatches) {
- return 0;
- }
- /* Change to Hatch total */ }
- }
- }
- // Hatch is full
- if (vUsedSlots == vTE.getSizeInventory()) {
+ boolean[] mValidOutputSlots = new boolean[tTotalHatches];
+ int arrayPos=0;
+ for (Pair<GT_MetaTileEntity_Hatch_OutputBus, Integer> IE : rList) {
+ GT_MetaTileEntity_Hatch_OutputBus vTE = IE.getKey();
+ int vUsedSlots = IE.getValue();
+ if (vUsedSlots == 0){mValidOutputSlots[arrayPos] = true;}
+ else if (vUsedSlots < vTE.getSizeInventory()){
+ int outputItemCount = tRecipe.mOutputs.length;
+ if (vUsedSlots < vTE.getSizeInventory()-outputItemCount){mValidOutputSlots[arrayPos] = true;}
+ else if (vUsedSlots >= vTE.getSizeInventory()-outputItemCount){
+ if (vUsedSlots > vTE.getSizeInventory()-outputItemCount){if (arrayPos == tTotalHatches){return 0;} /*Change to Hatch total*/ }
+ }
+ }
+ //Hatch is full
+ if (vUsedSlots == vTE.getSizeInventory()){
mValidOutputSlots[arrayPos] = false;
- if (arrayPos == tTotalHatches) {
- return 0;
- } // Change to Hatch Total
+ if (arrayPos == tTotalHatches){return 0;} // Change to Hatch Total
}
arrayPos++;
}
int tValidOutputSlots = 0;
- for (int cr = 0; cr < mValidOutputSlots.length; cr++) {
- if (mValidOutputSlots[cr]) {
- tValidOutputSlots++;
- }
- }
- if (tValidOutputSlots >= 1) {
- return tValidOutputSlots;
- }
- return 0;
- }
-
- @Override
- public int increaseProgress(final int aProgress) {
- return aProgress;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex > 0;
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mEUt = aNBT.getInteger("mEUt");
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- if (this.mMaxProgresstime > 0) {
- this.mRunningOnLoad = true;
- }
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiency = aNBT.getInteger("mEfficiency");
- this.mPollution = aNBT.getInteger("mPollution");
- this.mRuntime = aNBT.getInteger("mRuntime");
- this.mOutputItems = new ItemStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputItems.length; i++) {
- this.mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
- }
- this.mOutputFluids = new FluidStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- this.mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
- }
- this.mWrench = aNBT.getBoolean("mWrench");
- this.mScrewdriver = aNBT.getBoolean("mScrewdriver");
- this.mSoftHammer = aNBT.getBoolean("mSoftHammer");
- this.mHardHammer = aNBT.getBoolean("mHardHammer");
- this.mSolderingTool = aNBT.getBoolean("mSolderingTool");
- this.mCrowbar = aNBT.getBoolean("mCrowbar");
- }
-
- @Override
- public int maxProgresstime() {
- return this.mMaxProgresstime;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- this.mUpdate = 50;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mEfficiency < 0) {
- this.mEfficiency = 0;
- }
- if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) {
- this.mInputHatches.clear();
- this.mInputBusses.clear();
- this.mOutputHatches.clear();
- this.mOutputBusses.clear();
- this.mDynamoHatches.clear();
- this.mEnergyHatches.clear();
- this.mMufflerHatches.clear();
- this.mMaintenanceHatches.clear();
- this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]);
- }
- if (this.mStartUpCheck < 0) {
- if (this.mMachine) {
- for (final GT_MetaTileEntity_Hatch_Maintenance tHatch : this.mMaintenanceHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (!GregtechMeta_MultiBlockBase.disableMaintenance) {
- if (tHatch.mWrench) {
- this.mWrench = true;
- }
- if (tHatch.mScrewdriver) {
- this.mScrewdriver = true;
- }
- if (tHatch.mSoftHammer) {
- this.mSoftHammer = true;
- }
- if (tHatch.mHardHammer) {
- this.mHardHammer = true;
- }
- if (tHatch.mSolderingTool) {
- this.mSolderingTool = true;
- }
- if (tHatch.mCrowbar) {
- this.mCrowbar = true;
- }
- }
- else {
- this.mWrench = true;
- this.mScrewdriver = true;
- this.mSoftHammer = true;
- this.mHardHammer = true;
- this.mSolderingTool = true;
- this.mCrowbar = true;
- }
-
- tHatch.mWrench = false;
- tHatch.mScrewdriver = false;
- tHatch.mSoftHammer = false;
- tHatch.mHardHammer = false;
- tHatch.mSolderingTool = true;
- tHatch.mCrowbar = false;
- }
- }
- if (this.getRepairStatus() > 0) {
- if (this.mMaxProgresstime > 0 && this.doRandomMaintenanceDamage()) {
- if (this.onRunningTick(this.mInventory[1])) {
- if (!this.polluteEnvironment(this.getPollutionPerTick(this.mInventory[1]))) {
- this.stopMachine();
- }
- if (this.mMaxProgresstime > 0 && ++this.mProgresstime >= this.mMaxProgresstime) {
- if (this.mOutputItems != null) {
- for (final ItemStack tStack : this.mOutputItems) {
- if (tStack != null) {
- try {
- GT_Mod.achievements.issueAchivementHatch(
- aBaseMetaTileEntity.getWorld().getPlayerEntityByName(
- aBaseMetaTileEntity.getOwnerName()),
- tStack);
- }
- catch (final Exception e) {
- }
- this.addOutput(tStack);
- }
- }
- }
- if (this.mOutputFluids != null && this.mOutputFluids.length == 1) {
- for (final FluidStack tStack : this.mOutputFluids) {
- if (tStack != null) {
- this.addOutput(tStack);
- }
- }
- }
- else if (this.mOutputFluids != null && this.mOutputFluids.length > 1) {
- this.addFluidOutputs(this.mOutputFluids);
- }
- this.mEfficiency = Math.max(0,
- Math.min(this.mEfficiency + this.mEfficiencyIncrease,
- this.getMaxEfficiency(this.mInventory[1])
- - (this.getIdealStatus() - this.getRepairStatus()) * 1000));
- this.mOutputItems = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mEfficiencyIncrease = 0;
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe(this.mInventory[1]);
- }
- if (this.mOutputFluids != null && this.mOutputFluids.length > 0) {
- if (this.mOutputFluids.length > 1) {
- GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
- "oilplant");
- }
- }
- }
- }
- }
- else {
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified()) {
-
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe(this.mInventory[1]);
- }
- if (this.mMaxProgresstime <= 0) {
- this.mEfficiency = Math.max(0, this.mEfficiency - 1000);
- }
- }
- }
- }
- else {
- this.stopMachine();
- }
- }
- else {
- this.stopMachine();
- }
- }
- aBaseMetaTileEntity
- .setErrorDisplayID(aBaseMetaTileEntity.getErrorDisplayID() & ~127 | (this.mWrench ? 0 : 1)
- | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8)
- | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64));
- aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0);
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- /**
- * Called every tick the Machine runs
- */
- public boolean onRunningTick(final ItemStack aStack) {
- if (this.mEUt > 0) {
- this.addEnergyOutput((long) this.mEUt * this.mEfficiency / 10000);
- return true;
- }
- if (this.mEUt < 0) {
- if (!this.drainEnergyInput((long) -this.mEUt * 10000 / Math.max(1000, this.mEfficiency))) {
- this.stopMachine();
- return false;
- }
- }
- return true;
- }
-
- public boolean polluteEnvironment(final int aPollutionLevel) {
- this.mPollution += aPollutionLevel;
- for (final GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (this.mPollution >= 10000) {
- if (tHatch.polluteEnvironment()) {
- this.mPollution -= 10000;
- }
- }
- else {
- break;
- }
- }
- }
- return this.mPollution < 10000;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mEUt", this.mEUt);
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
- aNBT.setInteger("mEfficiency", this.mEfficiency);
- aNBT.setInteger("mPollution", this.mPollution);
- aNBT.setInteger("mRuntime", this.mRuntime);
-
- if (this.mOutputItems != null) {
- for (int i = 0; i < this.mOutputItems.length; i++) {
- if (this.mOutputItems[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItems[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputItem" + i, tNBT);
- }
- }
- }
- if (this.mOutputFluids != null) {
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- if (this.mOutputFluids[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputFluids[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputFluids" + i, tNBT);
- }
- }
- }
-
- aNBT.setBoolean("mWrench", this.mWrench);
- aNBT.setBoolean("mScrewdriver", this.mScrewdriver);
- aNBT.setBoolean("mSoftHammer", this.mSoftHammer);
- aNBT.setBoolean("mHardHammer", this.mHardHammer);
- aNBT.setBoolean("mSolderingTool", this.mSolderingTool);
- aNBT.setBoolean("mCrowbar", this.mCrowbar);
- }
-
- /**
- * Called whenever the Machine successfully started a Process, useful for
- * Sound Effects
- */
- public void startProcess() {
- //
- }
-
- public void stopMachine() {
- this.mOutputItems = null;
- this.mEUt = 0;
- this.mEfficiency = 0;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mEfficiencyIncrease = 0;
- this.getBaseMetaTileEntity().disableWorking();
- }
-
- public void updateSlots() {
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- }
-
+ for (int cr=0;cr<mValidOutputSlots.length;cr++){if (mValidOutputSlots[cr]){tValidOutputSlots++;}}
+ if (tValidOutputSlots >= 1) {return tValidOutputSlots;}
+ return 0;
+ }
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java
index b359ff1e83..49f9fb1344 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
-import java.util.Collection;
-
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,6 +10,9 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeTank;
+
+import java.util.Collection;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -21,492 +22,386 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_
private boolean useFuel = false;
- public GregtechDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional,
- final int aTier, final String aDescription, final ITexture... aTextures) {
+ public GregtechDoubleFuelGeneratorBase(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 4, aDescription, aTextures);
}
- public GregtechDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GregtechDoubleFuelGeneratorBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 4, aDescription, aTextures);
}
@Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0
- || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = getFront(i);
+ rTextures[1][i + 1] = getBack(i);
+ rTextures[2][i + 1] = getBottom(i);
+ rTextures[3][i + 1] = getTop(i);
+ rTextures[4][i + 1] = getSides(i);
+ rTextures[5][i + 1] = getFrontActive(i);
+ rTextures[6][i + 1] = getBackActive(i);
+ rTextures[7][i + 1] = getBottomActive(i);
+ rTextures[8][i + 1] = getTopActive(i);
+ rTextures[9][i + 1] = getSidesActive(i);
+ }
+ return rTextures;
}
@Override
- public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
+ 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 public boolean onRightclick(IGregTechTileEntity
- * aBaseMetaTileEntity, EntityPlayer aPlayer) { if
- * (aBaseMetaTileEntity.isClientSide()) return true;
- * aBaseMetaTileEntity.openGUI(aPlayer); return true; }
- */
-
- public int consumedFluidPerOperation(final FluidStack aLiquid) {
- return 1;
- }
@Override
- public boolean displaysItemStack() {
- return true;
+ public String[] getDescription() {
+ return new String[]{mDescription, "Fuel Efficiency: " + getEfficiency() + "%", CORE.GT_Tooltip};
}
- @Override
- public boolean displaysStackSize() {
- return false;
- }
- @Override
- public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
+ /* @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }*/
@Override
- public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()){
+ Utils.LOG_WARNING("Entity is Client side, simply returning true");
+ return true;
+ }
+ Utils.LOG_WARNING("Entity is not Client side, opening entity Container and by extension, it's GUI, then returning true");
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
- @Override
- public int getCapacity() {
- return 32000;
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip
- };
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
- public abstract int getEfficiency();
-
- public ItemStack getEmptyContainer(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || this.getRecipes() == null) {
- return null;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null,
- aStack);
- if (tFuel != null) {
- return GT_Utility.copy(tFuel.getOutput(0));
- }
- return GT_Utility.getContainerItem(aStack, true);
+ public ITexture[] getFrontActive(byte aColor) {
+ return getFront(aColor);
}
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
+ public ITexture[] getBackActive(byte aColor) {
+ return getBack(aColor);
}
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
+ public ITexture[] getBottomActive(byte aColor) {
+ return getBottom(aColor);
}
- public int getFuelValue(final FluidStack aLiquid) {
- if (aLiquid == null || this.getRecipes() == null) {
- return 0;
- }
- FluidStack tLiquid;
- final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- for (final GT_Recipe tFuel : tRecipeList) {
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) {
- if (aLiquid.isFluidEqual(tLiquid)) {
- return (int) ((long) tFuel.mSpecialValue * this.getEfficiency()
- * this.consumedFluidPerOperation(tLiquid) / 100);
- }
- }
- }
- }
- return 0;
+ public ITexture[] getTopActive(byte aColor) {
+ return getTop(aColor);
}
- public int getFuelValue(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || this.getRecipes() == null) {
- return 0;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null,
- aStack);
- if (tFuel != null) {
- return (int) (tFuel.mSpecialValue * 1000L * this.getEfficiency() / 100);
- }
- return 0;
+ public ITexture[] getSidesActive(byte aColor) {
+ return getSides(aColor);
}
@Override
- public long getMinimumStoredEU() {
- return 512;
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
}
- public abstract GT_Recipe_Map getRecipes();
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
}
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
}
@Override
- public int getTankPressure() {
- return -100;
+ public boolean isEnetOutput() {
+ return true;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
+ public boolean isOutputFacing(byte aSide) {
+ return true;
}
@Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
}
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
+ @Override
+ public long maxEUOutput() {
+ return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier] : 0;
}
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
+ @Override
+ public long maxEUStore() {
+ return Math.max(getEUVar(), V[mTier] * 115 + getMinimumStoredEU());
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
+ public boolean doesFillContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
}
@Override
- public boolean isEnetOutput() {
- return true;
+ public boolean doesEmptyContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
}
@Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
+ public boolean canTankBeFilled() {
+ return getBaseMetaTileEntity().isAllowedToWork();
}
@Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return this.getFuelValue(aFluid) > 0;
+ public boolean canTankBeEmptied() {
+ return getBaseMetaTileEntity().isAllowedToWork();
}
@Override
- public boolean isOutputFacing(final byte aSide) {
+ public boolean displaysItemStack() {
return true;
}
@Override
- public boolean isSimpleMachine() {
+ public boolean displaysStackSize() {
return false;
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0;
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return getFuelValue(aFluid) > 0;
}
-
+
@Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 115 + this.getMinimumStoredEU());
- }
+ public long getMinimumStoredEU() {
+ return 512;
+ }
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) {
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- }
- else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ if (mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) {
+ mInventory[getStackDisplaySlot()] = null;
+ } else {
+ if (mInventory[getStackDisplaySlot()] == null)
+ mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
}
- }
- else {
- if (this.mFluid != null && this.mFluid2 != null) {
- final int tFuelValue = this.getFuelValue(this.mFluid),
- tConsumed = this.consumedFluidPerOperation(this.mFluid);
- final int tFuelValue2 = this.getFuelValue(this.mFluid2),
- tConsumed2 = this.consumedFluidPerOperation(this.mFluid2);
- if (tFuelValue > 0 && tConsumed > 0
- && this.mFluid.amount > tConsumed/*
- * && (tFuelValue2
- * > 0 &&
- * tConsumed2 >
- * 0 && mFluid2.
- * amount >
- * tConsumed2)
- */) {
-
- Utils.LOG_WARNING("tFuelValue: " + tFuelValue);
- Utils.LOG_WARNING("tConsumed: " + tConsumed);
- Utils.LOG_WARNING("mFluid.name: " + this.mFluid.getFluid().getName());
- Utils.LOG_WARNING("mFluid.amount: " + this.mFluid.amount);
- Utils.LOG_WARNING("mFluid.amount > tConsumed: " + (this.mFluid.amount > tConsumed));
+ } else {
+ if (mFluid != null && mFluid2 != null){
+ int tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
+ int tFuelValue2 = getFuelValue(mFluid2), tConsumed2 = consumedFluidPerOperation(mFluid2);
+ if ((tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed)/* && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)*/) {
+
+ Utils.LOG_WARNING("tFuelValue: "+tFuelValue);
+ Utils.LOG_WARNING("tConsumed: "+tConsumed);
+ Utils.LOG_WARNING("mFluid.name: "+mFluid.getFluid().getName());
+ Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount);
+ Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed));
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING("tFuelValue2: " + tFuelValue2);
- Utils.LOG_WARNING("tConsumed2: " + tConsumed2);
- Utils.LOG_WARNING("mFluid2.name: " + this.mFluid2.getFluid().getName());
- Utils.LOG_WARNING("mFluid2.amount: " + this.mFluid2.amount);
- Utils.LOG_WARNING("mFluid2.amount > tConsumed2: " + (this.mFluid2.amount > tConsumed2));
- long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed,
- (this.maxEUOutput() * 30 + this.getMinimumStoredEU()
- - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- long tFluidAmountToUse2 = Math.min(this.mFluid2.amount / tConsumed2,
- (this.maxEUOutput() * 30 + this.getMinimumStoredEU()
- - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2);
-
- if (tFluidAmountToUse <= 0) {
- /*
- * if ((mFluid.amount / tConsumed) ==
- * getCapacity()){ tFluidAmountToUse = 1; }
- */
-
- if (aBaseMetaTileEntity.getUniversalEnergyStored() <= aBaseMetaTileEntity.getEUCapacity()
- - aBaseMetaTileEntity.getUniversalEnergyStored()) {
+ Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2);
+ Utils.LOG_WARNING("tConsumed2: "+tConsumed2);
+ Utils.LOG_WARNING("mFluid2.name: "+mFluid2.getFluid().getName());
+ Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount);
+ Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2));
+ long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
+ long tFluidAmountToUse2 = Math.min(mFluid2.amount / tConsumed2, (maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2);
+
+ if (tFluidAmountToUse <= 0){
+ /*if ((mFluid.amount / tConsumed) == getCapacity()){
+ tFluidAmountToUse = 1;
+ }*/
+
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity()-aBaseMetaTileEntity.getUniversalEnergyStored())){
tFluidAmountToUse = 1;
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING("tFluidAmountToUse - Updated: " + tFluidAmountToUse);
+ Utils.LOG_WARNING("tFluidAmountToUse - Updated: "+tFluidAmountToUse);
Utils.LOG_WARNING("=========================================================");
}
}
-
- if (tFluidAmountToUse2 <= 0) {
- /*
- * if ((mFluid2.amount / tConsumed) ==
- * getCapacity()){ tFluidAmountToUse2 = 1; }
- */
- if (aBaseMetaTileEntity.getUniversalEnergyStored() <= aBaseMetaTileEntity.getEUCapacity()
- - aBaseMetaTileEntity.getUniversalEnergyStored()) {
+
+ if (tFluidAmountToUse2 <= 0){
+ /*if ((mFluid2.amount / tConsumed) == getCapacity()){
+ tFluidAmountToUse2 = 1;
+ }*/
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity()-aBaseMetaTileEntity.getUniversalEnergyStored())){
tFluidAmountToUse2 = 1;
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING("tFluidAmountToUse2 - Updated: " + tFluidAmountToUse2);
+ Utils.LOG_WARNING("tFluidAmountToUse2 - Updated: "+tFluidAmountToUse2);
Utils.LOG_WARNING("=========================================================");
}
}
-
+
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING("tFluidAmountToUse: " + tFluidAmountToUse);
+ Utils.LOG_WARNING("tFluidAmountToUse: "+tFluidAmountToUse);
Utils.LOG_WARNING("=========================================================");
- /*
- * Utils.LOG_WARNING("mFluid.amount / tConsumed: "
- * +("fluidAmount:"+mFluid.amount)+(" tConsumed:"
- * +tConsumed)+" | "+(mFluid.amount / tConsumed));
- * Utils.LOG_WARNING(
- * "maxEUOutput() * 20 + getMinimumStoredEU(): "
- * +(maxEUOutput() * 30 + getMinimumStoredEU()));
- * Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
- * Utils.LOG_WARNING("maxEUOutput() * 20: "
- * +(maxEUOutput() * 30)); Utils.LOG_WARNING(
- * "getMinimumStoredEU(): "+(getMinimumStoredEU()));
- * Utils.LOG_WARNING(
- * "aBaseMetaTileEntity.getUniversalEnergyStored(): "
- * +(aBaseMetaTileEntity.getUniversalEnergyStored()));
- * Utils.LOG_WARNING(
- * "(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "
- * +((maxEUOutput() * 30 + getMinimumStoredEU() -
- * aBaseMetaTileEntity.getUniversalEnergyStored())));
- * Utils.LOG_WARNING("tFuelValue: "+(tFuelValue));
- * Utils.LOG_WARNING(
- * "(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): "
- * +((maxEUOutput() * 30 + getMinimumStoredEU() -
- * aBaseMetaTileEntity.getUniversalEnergyStored()) /
- * tFuelValue));
- */
-
+ /*Utils.LOG_WARNING("mFluid.amount / tConsumed: "+("fluidAmount:"+mFluid.amount)+(" tConsumed:"+tConsumed)+" | "+(mFluid.amount / tConsumed));
+ Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU()));
+ Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
+ Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30));
+ Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU()));
+ Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored()));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored())));
+ Utils.LOG_WARNING("tFuelValue: "+(tFuelValue));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue));
+ */
+
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING("tFluidAmountToUse2: " + tFluidAmountToUse2);
+ Utils.LOG_WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2);
Utils.LOG_WARNING("=========================================================");
- /*
- * Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "
- * +("fluidAmount2:"+mFluid2.amount)+(" tConsumed2:"
- * +tConsumed2)+" | "+(mFluid2.amount / tConsumed2));
- * Utils.LOG_WARNING(
- * "maxEUOutput() * 20 + getMinimumStoredEU(): "
- * +(maxEUOutput() * 30 + getMinimumStoredEU()));
- * Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
- * Utils.LOG_WARNING("maxEUOutput() * 20: "
- * +(maxEUOutput() * 30)); Utils.LOG_WARNING(
- * "getMinimumStoredEU(): "+(getMinimumStoredEU()));
- * Utils.LOG_WARNING(
- * "aBaseMetaTileEntity.getUniversalEnergyStored(): "
- * +(aBaseMetaTileEntity.getUniversalEnergyStored()));
- * Utils.LOG_WARNING(
- * "(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "
- * +((maxEUOutput() * 30 + getMinimumStoredEU() -
- * aBaseMetaTileEntity.getUniversalEnergyStored())));
- * Utils.LOG_WARNING("tFuelValue2: "+(tFuelValue2));
- * Utils.LOG_WARNING(
- * "(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2): "
- * +((maxEUOutput() * 30 + getMinimumStoredEU() -
- * aBaseMetaTileEntity.getUniversalEnergyStored()) /
- * tFuelValue2));
- */
- if (tFluidAmountToUse > 0
- && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)
- && tFluidAmountToUse2 > 0 && aBaseMetaTileEntity
- .increaseStoredEnergyUnits(tFluidAmountToUse2 * tFuelValue2, true)) {
-
- Utils.LOG_WARNING("tFuelValue: " + tFuelValue);
- Utils.LOG_WARNING("tConsumed: " + tConsumed);
- Utils.LOG_WARNING("mFluid.name: " + this.mFluid.getFluid().getName());
- Utils.LOG_WARNING("mFluid.amount: " + this.mFluid.amount);
- Utils.LOG_WARNING("mFluid.amount > tConsumed: " + (this.mFluid.amount > tConsumed));
+ /*Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "+("fluidAmount2:"+mFluid2.amount)+(" tConsumed2:"+tConsumed2)+" | "+(mFluid2.amount / tConsumed2));
+ Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU()));
+ Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput());
+ Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30));
+ Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU()));
+ Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored()));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored())));
+ Utils.LOG_WARNING("tFuelValue2: "+(tFuelValue2));
+ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2));
+ */
+ if ((tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) && (tFluidAmountToUse2 > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse2 * tFuelValue2, true))){
+
+ Utils.LOG_WARNING("tFuelValue: "+tFuelValue);
+ Utils.LOG_WARNING("tConsumed: "+tConsumed);
+ Utils.LOG_WARNING("mFluid.name: "+mFluid.getFluid().getName());
+ Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount);
+ Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed));
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING("tFuelValue2: " + tFuelValue2);
- Utils.LOG_WARNING("tConsumed2: " + tConsumed2);
- Utils.LOG_WARNING("mFluid2.name: " + this.mFluid2.getFluid().getName());
- Utils.LOG_WARNING("mFluid2.amount: " + this.mFluid2.amount);
- Utils.LOG_WARNING("mFluid2.amount > tConsumed2: " + (this.mFluid2.amount > tConsumed2));
+ Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2);
+ Utils.LOG_WARNING("tConsumed2: "+tConsumed2);
+ Utils.LOG_WARNING("mFluid2.name: "+mFluid2.getFluid().getName());
+ Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount);
+ Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2));
- if (this.useFuel) {
- this.mFluid.amount -= tFluidAmountToUse * tConsumed;
- this.mFluid2.amount -= tFluidAmountToUse2 * tConsumed2;
- this.useFuel = false;
+ if (useFuel){
+ mFluid.amount -= tFluidAmountToUse * tConsumed;
+ mFluid2.amount -= tFluidAmountToUse2 * tConsumed2;
+ useFuel = false;
}
else {
- this.useFuel = true;
+ useFuel = true;
}
}
else {
Utils.LOG_WARNING("=========================================================");
- Utils.LOG_WARNING(
- "Either tFluidAmountToUse1 <= 0, power cannot be increased of tFluidAmountToUse2 <= 0");
- Utils.LOG_WARNING("tFluidAmountToUse1: " + tFluidAmountToUse);
- Utils.LOG_WARNING("tFluidAmountToUse2: " + tFluidAmountToUse2);
+ Utils.LOG_WARNING("Either tFluidAmountToUse1 <= 0, power cannot be increased of tFluidAmountToUse2 <= 0");
+ Utils.LOG_WARNING("tFluidAmountToUse1: "+tFluidAmountToUse);
+ Utils.LOG_WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2);
}
}
else {
- /*
- * Utils.LOG_WARNING(
- * "(tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)"
- * ); Utils.LOG_WARNING("tFuelValue: "+tFuelValue);
- * Utils.LOG_WARNING("tConsumed: "+tConsumed);
- * Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount);
- * Utils.LOG_WARNING("mFluid.amount > tConsumed: "
- * +(mFluid.amount > tConsumed));
- *
- * Utils.LOG_WARNING(
- * "========================================================="
- * );
- *
- * Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2);
- * Utils.LOG_WARNING("tConsumed2: "+tConsumed2);
- * Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount);
- * Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "
- * +(mFluid2.amount > tConsumed2));
- */
+ /*Utils.LOG_WARNING("(tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)");
+ Utils.LOG_WARNING("tFuelValue: "+tFuelValue);
+ Utils.LOG_WARNING("tConsumed: "+tConsumed);
+ Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount);
+ Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed));
+
+ Utils.LOG_WARNING("=========================================================");
+
+ Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2);
+ Utils.LOG_WARNING("tConsumed2: "+tConsumed2);
+ Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount);
+ Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2)); */
}
- }
+ }
else {
Utils.LOG_WARNING("One mFluid is null");
- if (this.mFluid != null) {
+ if (mFluid != null)
Utils.LOG_WARNING("mFluid1 is not null");
- }
- if (this.mFluid2 != null) {
+ if (mFluid2 != null)
Utils.LOG_WARNING("mFluid2 is not null");
- }
}
}
- if (this.mInventory[this.getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20
- + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
- final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) && GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) == null) {
+ int tFuelValue = getFuelValue(mInventory[getInputSlot()]);
if (tFuelValue > 0) {
- final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ ItemStack tEmptyContainer = getEmptyContainer(mInventory[getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
}
}
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
+ if (aBaseMetaTileEntity.isServerSide())
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ }
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null || getRecipes() == null) return 0;
+ FluidStack tLiquid;
+ Collection<GT_Recipe> tRecipeList = getRecipes().mRecipeList;
+ if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList)
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null)
+ if (aLiquid.isFluidEqual(tLiquid))
+ return (int) (((long) tFuel.mSpecialValue * getEfficiency() * consumedFluidPerOperation(tLiquid)) / 100);
+ return 0;
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return (int) ((tFuel.mSpecialValue * 1000L * getEfficiency()) / 100);
+ return 0;
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return null;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return GT_Utility.copy(tFuel.getOutput(0));
+ return GT_Utility.getContainerItem(aStack, true);
}
@Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- Utils.LOG_WARNING("Entity is Client side, simply returning true");
- return true;
- }
- Utils.LOG_WARNING(
- "Entity is not Client side, opening entity Container and by extension, it's GUI, then returning true");
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack) > 0 || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
index 8e7679f770..ac27c32360 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
@@ -7,7 +7,9 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@@ -17,319 +19,310 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank {
- public int mTemperature = 20;
- public int mProcessingEnergy = 0;
- public int mLossTimer = 0;
- public FluidStack mSteam = null;
- public boolean mHadNoWater = false;
- public long RI = MathUtils.randLong(5L, 30L);
-
- public GregtechMetaBoilerBase(final int aID, final String aName, final String aNameRegional,
- final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
- }
-
- public GregtechMetaBoilerBase(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCover) {
- return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == 1 || aIndex == 3;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == 2;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return true;
- }
-
- @Override
- public boolean doesFillContainers() {
- return true;
- }
-
- @Override
- public void doSound(final byte aIndex, final double aX, final double aY, final double aZ) {
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ);
- for (int l = 0; l < 8; l++) {
- this.getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + Math.random(), aY,
- aZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- @Override
- public int getCapacity() {
- return 16000;
- }
-
- @Override
- public FluidStack getDrainableStack() {
- return this.mSteam;
- }
-
- @Override
- public int getProgresstime() {
- return this.mTemperature;
- }
-
- @Override
- public int getTankPressure() {
- return 100;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- ITexture[] tmp = this.mTextures[aSide >= 2 ? aSide != aFacing ? 2 : (byte) (aActive ? 4 : 3)
- : aSide][aColorIndex + 1];
- // mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
- if (aSide != aFacing && tmp.length == 2) {
- tmp = new ITexture[] {
- tmp[0]
- };
- }
- return tmp;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isElectric() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return GT_ModHandler.isWater(aFluid);
- }
-
- @Override
- public boolean isPneumatic() {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isSteampowered() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mLossTimer = aNBT.getInteger("mLossTimer");
- this.mTemperature = aNBT.getInteger("mTemperature");
- this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy");
- this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam"));
- }
-
- @Override
- public int maxProgresstime() {
- return 500;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aTick > 20L) {
- if (this.mTemperature <= 20) {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 40) {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; this.mSteam != null && i < 6; i = (byte) (i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing()) {
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null) {
- final FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i),
- Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null) {
- final int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(),
- tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity
- .drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
- }
- }
- if (aTick % 10L == 0L) {
- if (this.mTemperature > 100) {
- if (this.mFluid == null || !GT_ModHandler.isWater(this.mFluid) || this.mFluid.amount <= 0) {
- this.mHadNoWater = true;
- }
- else {
- if (this.mHadNoWater) {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
- }
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(150L);
- }
- else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 150;
- }
- else {
- this.mSteam = GT_ModHandler.getSteam(150L);
- }
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if (this.mSteam != null && this.mSteam.amount > 32000) {
- this.sendSound((byte) 1);
- this.mSteam.amount = 24000;
- }
- if (this.mProcessingEnergy <= 0 && aBaseMetaTileEntity.isAllowedToWork() && this.mInventory[2] != null) {
- if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.dust.get(Materials.Coal))
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.dustImpure.get(Materials.Coal))
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.crushed.get(Materials.Coal))) {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3,
- GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.gem.get(Materials.Charcoal))) {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3,
- GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) {
- this.mProcessingEnergy += 640;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3,
- GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.gem.get(Materials.Lignite))
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.dust.get(Materials.Lignite))
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.dustImpure.get(Materials.Lignite))
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2],
- OrePrefixes.crushed.get(Materials.Lignite))) {
- this.mProcessingEnergy += 40;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3,
- GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
- }
- }
- if (this.mTemperature < 1000 && this.mProcessingEnergy > 0 && aTick % 12L == 0L) {
- this.mProcessingEnergy -= 2;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- if (aPlayer != null) {
- if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1))) {
- this.fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true);
- aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket);
- }
- else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- }
- }
- return true;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mLossTimer", this.mLossTimer);
- aNBT.setInteger("mTemperature", this.mTemperature);
- aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy);
- if (this.mSteam != null) {
- try {
- aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound()));
- }
- catch (final Throwable e) {
- }
- }
- }
-
- @Override
- public FluidStack setDrainableStack(final FluidStack aFluid) {
- this.mSteam = aFluid;
- return this.mSteam;
- }
+public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank
+{
+ public int mTemperature = 20;
+ public int mProcessingEnergy = 0;
+ public int mLossTimer = 0;
+ public FluidStack mSteam = null;
+ public boolean mHadNoWater = false;
+ public long RI = MathUtils.randLong(5L, 30L);
+
+ public GregtechMetaBoilerBase(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures)
+ {
+ super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
+ }
+
+ public GregtechMetaBoilerBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, 4, aDescription, aTextures);
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte)(aActive ? 4 : 3)) : aSide][aColorIndex + 1];
+ //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
+ if(aSide!=aFacing&&tmp.length==2){
+ tmp = new ITexture[]{tmp[0]};
+ }
+ return tmp;
+ }
+
+ public boolean isElectric()
+ {
+ return false;
+ }
+
+ public boolean isPneumatic()
+ {
+ return false;
+ }
+
+ public boolean isSteampowered()
+ {
+ return false;
+ }
+
+ public boolean isSimpleMachine()
+ {
+ return false;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex)
+ {
+ return true;
+ }
+
+ public int getProgresstime()
+ {
+ return this.mTemperature;
+ }
+
+ public int maxProgresstime()
+ {
+ return 500;
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer)
+ {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ if (aPlayer != null) {
+ if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1)))
+ {
+ fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true);
+ aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket);
+ }
+ else
+ {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ }
+ }
+ return true;
+ }
+
+ public boolean doesFillContainers()
+ {
+ return true;
+ }
+
+ public boolean doesEmptyContainers()
+ {
+ return true;
+ }
+
+ public boolean canTankBeFilled()
+ {
+ return true;
+ }
+
+ public boolean canTankBeEmptied()
+ {
+ return true;
+ }
+
+ public boolean displaysItemStack()
+ {
+ return false;
+ }
+
+ public boolean displaysStackSize()
+ {
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid)
+ {
+ return GT_ModHandler.isWater(aFluid);
+ }
+
+ public FluidStack getDrainableStack()
+ {
+ return this.mSteam;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid)
+ {
+ this.mSteam = aFluid;return this.mSteam;
+ }
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover)
+ {
+ return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mLossTimer", this.mLossTimer);
+ aNBT.setInteger("mTemperature", this.mTemperature);
+ aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy);
+ if (this.mSteam != null) {
+ try
+ {
+ aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound()));
+ }
+ catch (Throwable e) {}
+ }
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ super.loadNBTData(aNBT);
+ this.mLossTimer = aNBT.getInteger("mLossTimer");
+ this.mTemperature = aNBT.getInteger("mTemperature");
+ this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy");
+ this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam"));
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
+ {
+ if (this.mTemperature <= 20)
+ {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 40)
+ {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing())
+ {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null)
+ {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null)
+ {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 100)
+ {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
+ {
+ this.mHadNoWater = true;
+ }
+ else
+ {
+ if (this.mHadNoWater)
+ {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ }
+ else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000))
+ {
+ sendSound((byte)1);
+ this.mSteam.amount = 24000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (this.mInventory[2] != null)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
+ {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal)))
+ {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
+ {
+ this.mProcessingEnergy += 640;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ }
+ else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
+ {
+ this.mProcessingEnergy += 40;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
+ {
+ this.mProcessingEnergy -= 2;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (aIndex == 1) || (aIndex == 3);
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return aIndex == 2;
+ }
+
+ public void doSound(byte aIndex, double aX, double aY, double aZ)
+ {
+ if (aIndex == 1)
+ {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ);
+ for (int l = 0; l < 8; l++) {
+ getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + Math.random(), aY, aZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ public int getCapacity()
+ {
+ return 16000;
+ }
+
+ public int getTankPressure()
+ {
+ return 100;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
index 85ee75a4e4..e43b7db9aa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
@@ -1,6 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -9,183 +9,140 @@ import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_BasicTank {
-
- public static int sEnergyPerTick = 16;
- public int mEfficiency;
- public int mProcessingEnergy = 0;
- public int mSolarCharge = 20;
- public int mLossTimer = 0;
-
- public GregtechMetaSolarGenerator(final int aID, final String aName, final String aNameRegional, final int aTier,
- final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GregtechMetaSolarGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return false;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return false;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, "Efficiency: " + this.getEfficiency() + "%"
- };
- }
-
- public abstract int getEfficiency();
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0;
- }
-
- @Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 40 + this.getMinimumStoredEU());
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+
+ public int mEfficiency;
+ public int mProcessingEnergy = 0;
+ public int mSolarCharge = 20;
+ public int mLossTimer = 0;
+ public static int sEnergyPerTick = 16;
+
+ public GregtechMetaSolarGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GregtechMetaSolarGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = getFront(i);
+ rTextures[1][i + 1] = getBack(i);
+ rTextures[2][i + 1] = getBottom(i);
+ rTextures[3][i + 1] = getTop(i);
+ rTextures[4][i + 1] = getSides(i);
+ rTextures[5][i + 1] = getFrontActive(i);
+ rTextures[6][i + 1] = getBackActive(i);
+ rTextures[7][i + 1] = getBottomActive(i);
+ rTextures[8][i + 1] = getTopActive(i);
+ rTextures[9][i + 1] = getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @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];
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription, "Efficiency: " + getEfficiency() + "%"};
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ 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]};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ 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]};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier] : 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(getEUVar(), V[mTier] * 40 + getMinimumStoredEU());
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick > 20L
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput()
- + aBaseMetaTileEntity.getEUCapacity()) {
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
if (this.mSolarCharge <= 20) {
this.mSolarCharge = 20;
@@ -198,42 +155,57 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic
if (aTick % 25L == 0L) {
if (this.mSolarCharge > 100) {
- if (this.mProcessingEnergy > 0 && aBaseMetaTileEntity.isAllowedToWork() && aTick % 256L == 0L
- && !aBaseMetaTileEntity.getWorld().isThundering() && aBaseMetaTileEntity
- .getUniversalEnergyStored() < this.maxEUOutput() * 20 + this.getMinimumStoredEU()) {
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits(
- GregtechMetaSolarGenerator.sEnergyPerTick * this.getEfficiency() / 10, false);
+ if ((this.mProcessingEnergy > 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering() && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()))) {
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerTick * getEfficiency() / 10, false);
}
}
- }
+ }
- if (this.mSolarCharge < 500 && this.mProcessingEnergy > 0 && aTick % 12L == 0L) {
+ if ((this.mSolarCharge < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) {
this.mProcessingEnergy -= 1;
this.mSolarCharge += 1;
}
- if (this.mProcessingEnergy <= 0 && aBaseMetaTileEntity.isAllowedToWork() && aTick % 256L == 0L
- && !aBaseMetaTileEntity.getWorld().isThundering()) {
- final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining()
- && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
- this.mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4
- || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0
- : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
+ mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
}
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
+ if (aBaseMetaTileEntity.isServerSide()){
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
}
}
}
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
+ public abstract int getEfficiency();
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
index 69baf01df3..ce4042148e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
-import java.util.Collection;
-
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,311 +9,265 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
+
+import java.util.Collection;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank {
-
+
private boolean useFuel = false;
-
- public GregtechRocketFuelGeneratorBase(final int aID, final String aName, final String aNameRegional,
- final int aTier, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GregtechRocketFuelGeneratorBase(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0
- || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public int consumedFluidPerOperation(final FluidStack aLiquid) {
- return 1;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- @Override
- public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getBackActive(final byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getBottomActive(final byte aColor) {
- return this.getBottom(aColor);
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip
- };
- }
-
- public abstract int getEfficiency();
-
- public ItemStack getEmptyContainer(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || this.getRecipes() == null) {
- return null;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null,
- aStack);
- if (tFuel != null) {
- return GT_Utility.copy(tFuel.getOutput(0));
- }
- return GT_Utility.getContainerItem(aStack, true);
- }
-
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getFrontActive(final byte aColor) {
- return this.getFront(aColor);
- }
-
- public int getFuelValue(final FluidStack aLiquid) {
- if (aLiquid == null || this.getRecipes() == null) {
- return 0;
- }
- FluidStack tLiquid;
- final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- for (final GT_Recipe tFuel : tRecipeList) {
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) {
- if (aLiquid.isFluidEqual(tLiquid)) {
- return (int) ((long) tFuel.mSpecialValue * this.getEfficiency()
- * this.consumedFluidPerOperation(tLiquid) / 100);
- }
- }
- }
- }
- return 0;
- }
-
- public int getFuelValue(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || this.getRecipes() == null) {
- return 0;
- }
- final GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null,
- aStack);
- if (tFuel != null) {
- return (int) (tFuel.mSpecialValue * 1000L * this.getEfficiency() / 100);
- }
- return 0;
- }
-
- public abstract GT_Recipe_Map getRecipes();
-
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getSidesActive(final byte aColor) {
- return this.getSides(aColor);
- }
-
- @Override
- public int getTankPressure() {
- return -100;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
- : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
- + 1];
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[10][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = this.getFront(i);
- rTextures[1][i + 1] = this.getBack(i);
- rTextures[2][i + 1] = this.getBottom(i);
- rTextures[3][i + 1] = this.getTop(i);
- rTextures[4][i + 1] = this.getSides(i);
- rTextures[5][i + 1] = this.getFrontActive(i);
- rTextures[6][i + 1] = this.getBackActive(i);
- rTextures[7][i + 1] = this.getBottomActive(i);
- rTextures[8][i + 1] = this.getTopActive(i);
- rTextures[9][i + 1] = this.getSidesActive(i);
- }
- return rTextures;
- }
-
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]
- };
- }
-
- public ITexture[] getTopActive(final byte aColor) {
- return this.getTop(aColor);
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aSide) {
- return aSide > 1;
- }
-
- @Override
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return this.getFuelValue(aFluid) > 0;
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < 2;
- }
-
- @Override
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0;
- }
-
- @Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 80 + this.getMinimumStoredEU());
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) {
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- }
- else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- }
- else {
- final int tFuelValue = this.getFuelValue(this.mFluid),
- tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
- final long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (this.maxEUOutput() * 20
- + this.getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- if (tFluidAmountToUse > 0
- && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
- if (this.useFuel) {
- this.mFluid.amount -= tFluidAmountToUse * tConsumed;
- this.useFuel = false;
- }
- else {
- this.useFuel = true;
- }
- }
- }
- }
- if (this.mInventory[this.getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20
- + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
- final int tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue > 0) {
- final ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
+
+ public GregtechRocketFuelGeneratorBase(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GregtechRocketFuelGeneratorBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = getFront(i);
+ rTextures[1][i + 1] = getBack(i);
+ rTextures[2][i + 1] = getBottom(i);
+ rTextures[3][i + 1] = getTop(i);
+ rTextures[4][i + 1] = getSides(i);
+ rTextures[5][i + 1] = getFrontActive(i);
+ rTextures[6][i + 1] = getBackActive(i);
+ rTextures[7][i + 1] = getBottomActive(i);
+ rTextures[8][i + 1] = getTopActive(i);
+ rTextures[9][i + 1] = getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @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];
+ }
+
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription, "Fuel Efficiency: " + getEfficiency() + "%", CORE.GT_Tooltip};
+ }
+
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ 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]};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ 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]};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier] : 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(getEUVar(), V[mTier] * 80 + getMinimumStoredEU());
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return getFuelValue(aFluid) > 0;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) {
+ if (mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) {
+ mInventory[getStackDisplaySlot()] = null;
+ } else {
+ if (mInventory[getStackDisplaySlot()] == null)
+ mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ int tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
+ if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
+ if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){
+ if (useFuel){
+ mFluid.amount -= tFluidAmountToUse * tConsumed;
+ useFuel = false;
+ }
+ else {
+ useFuel = true;
+ }
+ }
+ }
+ }
+ if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) && GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) == null) {
+ int tFuelValue = getFuelValue(mInventory[getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = getEmptyContainer(mInventory[getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide())
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ }
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null || getRecipes() == null) return 0;
+ FluidStack tLiquid;
+ Collection<GT_Recipe> tRecipeList = getRecipes().mRecipeList;
+ if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList)
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null)
+ if (aLiquid.isFluidEqual(tLiquid))
+ return (int) (((long) tFuel.mSpecialValue * getEfficiency() * consumedFluidPerOperation(tLiquid)) / 100);
+ return 0;
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return (int) ((tFuel.mSpecialValue * 1000L * getEfficiency()) / 100);
+ return 0;
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return null;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return GT_Utility.copy(tFuel.getOutput(0));
+ return GT_Utility.getContainerItem(aStack, true);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack) > 0 || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java
index dd45655477..e9ac788e7b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java
@@ -1,10 +1,11 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
-import java.util.*;
-
+import static gregtech.api.enums.GT_Values.NW;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IEnergyConnected;
@@ -13,8 +14,17 @@ import gregtech.api.metatileentity.BaseTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.net.GT_Packet_TileEntity;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_CoverBehavior;
+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 ic2.api.Direction;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockFire;
import net.minecraft.entity.Entity;
@@ -30,7 +40,9 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -38,2371 +50,1808 @@ import net.minecraftforge.fluids.*;
* This is the main TileEntity for EVERYTHING.
*/
public class GregtechBaseMetaTileEntityLossless extends BaseTileEntity implements IGregTechTileEntity {
- private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[] {
- GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior,
- GregTech_API.sNoBehavior, GregTech_API.sNoBehavior
- };
- protected MetaTileEntity mMetaTileEntity;
- protected long mStoredEnergy = 0, mStoredSteam = 0;
- protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0;
- protected boolean mReleaseEnergy = false;
- protected int[] mAverageEUInput = new int[] {
- 0, 0, 0, 0, 0
- }, mAverageEUOutput = new int[] {
- 0, 0, 0, 0, 0
- };
- private final boolean[] mActiveEUInputs = new boolean[] {
- false, false, false, false, false, false
- }, mActiveEUOutputs = new boolean[] {
- false, false, false, false, false, false
- };
- private byte[] mSidedRedstone = new byte[] {
- 15, 15, 15, 15, 15, 15
- };
- private int[] mCoverSides = new int[] {
- 0, 0, 0, 0, 0, 0
- }, mCoverData = new int[] {
- 0, 0, 0, 0, 0, 0
- };
- private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING];
- private boolean mHasEnoughEnergy = true, mRunningThroughTick = false,
- mInputDisabled = false, mOutputDisabled = false, mMuffler = false, mLockUpgrade = false, mActive = false,
- mRedstone = false, mWorkUpdate = false, mSteamConverter = false, mInventoryChanged = false, mWorks = true,
- mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false, oRedstone = false;
- private byte mColor = 0, oColor = 0, mStrongRedstone = 0,
- oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, 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 short mID = 0;
- private long mTickTimer = 0, oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE;
- private String mOwnerName = "";
- private NBTTagCompound mRecipeStuff = new NBTTagCompound();
-
- public GregtechBaseMetaTileEntityLossless() {
- }
-
- public boolean acceptsEnergyFrom(final TileEntity aReceiver, final Direction aDirection) {
- return this.inputEnergyFrom((byte) aDirection.toSideValue());
- }
-
- public boolean acceptsEnergyFrom(final TileEntity aEmitter, final ForgeDirection aDirection) {
- return this.inputEnergyFrom((byte) aDirection.ordinal());
- }
-
- @Override
- public boolean acceptsRotationalEnergy(final byte aSide) {
- if (!this.canAccessData() || this.getCoverIDAtSide(aSide) != 0) {
- return false;
- }
- return this.mMetaTileEntity.acceptsRotationalEnergy(aSide);
- }
-
- @Override
- public void addCollisionBoxesToList(final World aWorld, final int aX, final int aY, final int aZ,
- final AxisAlignedBB inputAABB, final List<AxisAlignedBB> outputAABB, final Entity collider) {
- this.mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- }
-
- public int addEnergy(final int aEnergy) {
- if (!this.canAccessData()) {
- return 0;
- }
- if (aEnergy > 0) {
- this.increaseStoredEnergyUnits(aEnergy, true);
- }
- else {
- this.decreaseStoredEU(-aEnergy, true);
- }
- return (int) Math.min(Integer.MAX_VALUE, this.mMetaTileEntity.getEUVar());
- }
-
- @Override
- public boolean addMufflerUpgrade() {
- if (this.isMufflerUpgradable()) {
- return this.mMuffler = true;
- }
- return false;
- }
-
- @Override
- public boolean addStackToSlot(final int aIndex, ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return true;
- }
- if (aIndex < 0 || aIndex >= this.getSizeInventory()) {
- return false;
- }
- final ItemStack tStack = this.getStackInSlot(aIndex);
- if (GT_Utility.isStackInvalid(tStack)) {
- this.setInventorySlotContents(aIndex, aStack);
- return true;
- }
- aStack = GT_OreDictUnificator.get(aStack);
- if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math
- .min(aStack.getMaxStackSize(), this.getInventoryStackLimit())) {
- tStack.stackSize += aStack.stackSize;
- return true;
- }
- return false;
- }
-
- @Override
- public boolean addStackToSlot(final int aIndex, final ItemStack aStack, final int aAmount) {
- return this.addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack));
- }
-
- @Override
- public boolean addSteamEngineUpgrade() {
- if (this.isSteamEngineUpgradable()) {
- this.issueBlockUpdate();
- this.mSteamConverter = true;
- return true;
- }
- return false;
- }
-
- protected boolean canAccessData() {
- return !this.isDead && this.hasValidMetaTileEntity();
- }
-
- @Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- if (this.mTickTimer > 5 && this.canAccessData() && (this.mRunningThroughTick || !this.mOutputDisabled)
- && (aSide == ForgeDirection.UNKNOWN || this.mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(),
- this.getCoverIDAtSide((byte) aSide.ordinal()),
- this.getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))) {
- return this.mMetaTileEntity.canDrain(aSide, aFluid);
- }
- return false;
- }
-
- /**
- * Can pull aStack out of Slot from Side
- */
- @Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- return this.canAccessData() && (this.mRunningThroughTick || !this.mOutputDisabled)
- && this.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- this.getCoverIDAtSide((byte) aSide), this.getCoverDataAtSide((byte) aSide), aIndex, this)
- && this.mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
- }
-
- @Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- if (this.mTickTimer > 5 && this.canAccessData() && (this.mRunningThroughTick || !this.mInputDisabled)
- && (aSide == ForgeDirection.UNKNOWN || this.mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(),
- this.getCoverIDAtSide((byte) aSide.ordinal()),
- this.getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))) {
- return this.mMetaTileEntity.canFill(aSide, aFluid);
- }
- return false;
- }
-
- /**
- * Can put aStack into Slot at Side
- */
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- return this.canAccessData() && (this.mRunningThroughTick || !this.mInputDisabled)
- && this.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- this.getCoverIDAtSide((byte) aSide), this.getCoverDataAtSide((byte) aSide), aIndex, this)
- && this.mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
- }
-
- @Override
- public boolean canPlaceCoverIDAtSide(final byte aSide, final int aID) {
- return this.getCoverIDAtSide(aSide) == 0;
- }
-
- @Override
- public boolean canPlaceCoverItemAtSide(final byte aSide, final ItemStack aCover) {
- return this.getCoverIDAtSide(aSide) == 0;
- }
-
- /**
- * Called when trying to charge Items
- */
- public void chargeItem(final ItemStack aStack) {
- this.decreaseStoredEU(
- GT_ModHandler.chargeElectricItem(aStack, (int) Math.min(Integer.MAX_VALUE, this.getStoredEU()),
- (int) Math.min(Integer.MAX_VALUE, this.mMetaTileEntity.getOutputTier()), false, false),
- true);
- }
-
- @Override
- public void closeInventory() {
- if (this.canAccessData()) {
- this.mMetaTileEntity.onCloseGUI();
- }
- }
-
- private boolean createNewMetatileEntity(final short aID) {
- if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
- GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
- }
- else {
- if (aID != 0) {
- if (this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.setBaseMetaTileEntity(null);
- }
- GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
- this.mTickTimer = 0;
- this.mID = aID;
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean decreaseStoredEnergyUnits(final long aEnergy, final boolean aIgnoreTooLessEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- return this.mHasEnoughEnergy = this.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy)
- || this.decreaseStoredSteam(aEnergy, false)
- || aIgnoreTooLessEnergy && this.decreaseStoredSteam(aEnergy, true);
- }
-
- public boolean decreaseStoredEU(final long aEnergy, final boolean aIgnoreTooLessEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- if (this.mMetaTileEntity.getEUVar() - aEnergy >= 0 || aIgnoreTooLessEnergy) {
- this.setStoredEU(this.mMetaTileEntity.getEUVar() - aEnergy);
- if (this.mMetaTileEntity.getEUVar() < 0) {
- this.setStoredEU(0);
- return false;
- }
- return true;
- }
- return false;
- }
-
- public boolean decreaseStoredSteam(final long aEnergy, final boolean aIgnoreTooLessEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- if (this.mMetaTileEntity.getSteamVar() - aEnergy >= 0 || aIgnoreTooLessEnergy) {
- this.setStoredSteam(this.mMetaTileEntity.getSteamVar() - aEnergy);
- if (this.mMetaTileEntity.getSteamVar() < 0) {
- this.setStoredSteam(0);
- return false;
- }
- return true;
- }
- return false;
- }
-
- @Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- if (this.canAccessData()) {
- this.mInventoryChanged = true;
- return this.mMetaTileEntity.decrStackSize(aIndex, aAmount);
- }
- return null;
- }
-
- public double demandedEnergyUnits() {
- if (this.mReleaseEnergy || !this.canAccessData() || !this.mMetaTileEntity.isEnetInput()) {
- return 0;
- }
- return this.getEUCapacity() - this.getStoredEU();
- }
-
- public int demandsEnergy() {
- if (this.mReleaseEnergy || !this.canAccessData() || !this.mMetaTileEntity.isEnetInput()) {
- return 0;
- }
- return this.getCapacity() - this.getStored();
- }
-
- @Override
- public void disableWorking() {
- this.mWorks = false;
- }
-
- /**
- * Called when trying to discharge Items
- */
- public void dischargeItem(final ItemStack aStack) {
- this.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(aStack,
- (int) Math.min(Integer.MAX_VALUE, this.getEUCapacity() - this.getStoredEU()),
- (int) Math.min(Integer.MAX_VALUE, this.mMetaTileEntity.getInputTier()), false, false, false), true);
- }
-
- public void doEnergyExplosion() {
- if (this.getUniversalEnergyCapacity() > 0
- && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5) {
- this.doExplosion(this.oOutput * (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() ? 4
- : this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2 ? 2 : 1));
- GT_Mod.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(this.mOwnerName),
- "electricproblems");
- }
- }
-
- @Override
- public void doExplosion(final long aAmount) {
- if (this.canAccessData()) {
- // This is only for Electric Machines
- if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) {
- try {
- this.mReleaseEnergy = true;
- IEnergyConnected.Util.emitEnergyToNetwork(GT_Values.V[5],
- Math.max(1, this.getStoredEU() / GT_Values.V[5]), this);
- }
- catch (final Exception e) {
- /*
- * Fun Fact: all these "do nothing" Comments you see in my
- * Code, are just there to let Eclipse shut up about the
- * intended empty Brackets, but I need eclipse to yell at me
- * in some of the regular Cases where I forget to add Code
- */}
- }
- this.mReleaseEnergy = false;
- // Normal Explosion Code
- this.mMetaTileEntity.onExplosion();
- this.mMetaTileEntity.doExplosion(aAmount);
- }
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- if (this.mTickTimer > 5 && this.canAccessData() && (this.mRunningThroughTick || !this.mOutputDisabled)
- && (aSide == ForgeDirection.UNKNOWN || this.mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(),
- this.getCoverIDAtSide((byte) aSide.ordinal()),
- this.getCoverDataAtSide((byte) aSide.ordinal()),
- aFluid == null ? null : aFluid.getFluid(), this))) {
- return this.mMetaTileEntity.drain(aSide, aFluid, doDrain);
- }
- return null;
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final int maxDrain, final boolean doDrain) {
- if (this.mTickTimer > 5 && this.canAccessData() && (this.mRunningThroughTick || !this.mOutputDisabled)
- && (aSide == ForgeDirection.UNKNOWN || this.mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(),
- this.getCoverIDAtSide((byte) aSide.ordinal()),
- this.getCoverDataAtSide((byte) aSide.ordinal()), this.mMetaTileEntity.getFluid() == null
- ? null : this.mMetaTileEntity.getFluid().getFluid(),
- this))) {
- return this.mMetaTileEntity.drain(aSide, maxDrain, doDrain);
- }
- return null;
- }
-
- @Override
- public boolean drainEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- if (!this.canAccessData() || !this.mMetaTileEntity.isElectric() || !this.outputsEnergyTo(aSide)
- || this.getStoredEU() - aVoltage * aAmperage < this.mMetaTileEntity.getMinimumStoredEU()) {
- return false;
- }
- if (this.decreaseStoredEU(aVoltage * aAmperage, false)) {
- this.mAverageEUOutput[this.mAverageEUOutputIndex] += aVoltage * aAmperage;
- return true;
- }
- return false;
- }
-
- public void drawEnergy(final double amount) {
- this.mAverageEUOutput[this.mAverageEUOutputIndex] += amount;
- this.decreaseStoredEU((int) amount, true);
- }
-
- @Override
- public boolean dropCover(final byte aSide, final byte aDroppedSide, final boolean aForced) {
- if (this.getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, this.getCoverIDAtSide(aSide),
- this.mCoverData[aSide], this, aForced) || aForced) {
- final ItemStack tStack = this.getCoverBehaviorAtSide(aSide).getDrop(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this);
- if (tStack != null) {
- tStack.setTagCompound(null);
- final EntityItem tEntity = new EntityItem(this.worldObj, this.getOffsetX(aDroppedSide, 1) + 0.5,
- this.getOffsetY(aDroppedSide, 1) + 0.5, this.getOffsetZ(aDroppedSide, 1) + 0.5, tStack);
- tEntity.motionX = 0;
- tEntity.motionY = 0;
- tEntity.motionZ = 0;
- this.worldObj.spawnEntityInWorld(tEntity);
- }
- this.setCoverIDAtSide(aSide, 0);
- if (this.mMetaTileEntity.hasSidedRedstoneOutputBehavior()) {
- this.setOutputRedstoneSignal(aSide, (byte) 0);
- }
- else {
- this.setOutputRedstoneSignal(aSide, (byte) 15);
- }
- return true;
- }
- return false;
- }
-
- public boolean emitsEnergyTo(final TileEntity aReceiver, final Direction aDirection) {
- return this.outputsEnergyTo((byte) aDirection.toSideValue());
- }
-
- public boolean emitsEnergyTo(final TileEntity aReceiver, final ForgeDirection aDirection) {
- return this.outputsEnergyTo((byte) aDirection.ordinal());
- }
-
- @Override
- public void enableWorking() {
- if (!this.mWorks) {
- this.mWorkUpdate = true;
- }
- this.mWorks = true;
- }
-
- @Override
- public int fill(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
- if (this.mTickTimer > 5 && this.canAccessData() && (this.mRunningThroughTick || !this.mInputDisabled)
- && (aSide == ForgeDirection.UNKNOWN || this.mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(),
- this.getCoverIDAtSide((byte) aSide.ordinal()),
- this.getCoverDataAtSide((byte) aSide.ordinal()),
- aFluid == null ? null : aFluid.getFluid(), this))) {
- return this.mMetaTileEntity.fill(aSide, aFluid, doFill);
- }
- return 0;
- }
-
- /**
- * returns all valid Inventory Slots, no matter which Side (Unless it's
- * covered). The Side Stuff is done in the following two Functions.
- */
- @Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- if (this.canAccessData() && (this.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- this.getCoverIDAtSide((byte) aSide), this.getCoverDataAtSide((byte) aSide), -1, this)
- || this.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- this.getCoverIDAtSide((byte) aSide), this.getCoverDataAtSide((byte) aSide), -1, this))) {
- return this.mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
- }
- return new int[0];
- }
-
- @Override
- public long getAverageElectricInput() {
- int rEU = 0;
- for (final int tEU : this.mAverageEUInput) {
- rEU += tEU;
- }
- return rEU / this.mAverageEUInput.length;
- }
-
- @Override
- public long getAverageElectricOutput() {
- int rEU = 0;
- for (final int tEU : this.mAverageEUOutput) {
- rEU += tEU;
- }
- return rEU / this.mAverageEUOutput.length;
- }
-
- @Override
- public byte getBackFacing() {
- return GT_Utility.getOppositeSide(this.mFacing);
- }
-
- @Override
- public float getBlastResistance(final byte aSide) {
- return this.canAccessData() ? Math.max(0, this.getMetaTileEntity().getExplosionResistance(aSide)) : 10.0F;
- }
-
- public int getCapacity() {
- return (int) Math.min(Integer.MAX_VALUE, this.getEUCapacity());
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- return this.mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- @Override
- public byte getColorization() {
- return (byte) (this.mColor - 1);
- }
-
- @Override
- public byte getComparatorValue(final byte aSide) {
- return this.canAccessData() ? this.mMetaTileEntity.getComparatorValue(aSide) : 0;
- }
-
- @Override
- public GT_CoverBehavior getCoverBehaviorAtSide(final byte aSide) {
- return aSide >= 0 && aSide < this.mCoverBehaviors.length ? this.mCoverBehaviors[aSide]
- : GregTech_API.sNoBehavior;
- }
-
- @Override
- public int getCoverDataAtSide(final byte aSide) {
- if (aSide >= 0 && aSide < 6) {
- return this.mCoverData[aSide];
- }
- return 0;
- }
-
- @Override
- public int getCoverIDAtSide(final byte aSide) {
- if (aSide >= 0 && aSide < 6) {
- return this.mCoverSides[aSide];
- }
- return 0;
- }
-
- @Override
- public ItemStack getCoverItemAtSide(final byte aSide) {
- return GT_Utility.intToStack(this.getCoverIDAtSide(aSide));
- }
-
- public ITexture getCoverTexture(final byte aSide) {
- return GregTech_API.sCovers.get(new GT_ItemStack(this.getCoverIDAtSide(aSide)));
- }
-
- public ArrayList<String> getDebugInfo(final EntityPlayer aPlayer, final int aLogLevel) {
- final ArrayList<String> tList = new ArrayList<String>();
- if (aLogLevel > 2) {
- tList.add("Meta-ID: " + this.mID + (this.canAccessData() ? " valid" : " invalid")
- + (this.mMetaTileEntity == null ? " MetaTileEntity == null!" : " "));
- }
- if (aLogLevel > 1) {
- if (this.mTimeStatistics.length > 0) {
- double tAverageTime = 0;
- for (final int tTime : this.mTimeStatistics) {
- tAverageTime += tTime;
- }
- tList.add("This particular TileEntity has caused an average CPU-load of ~"
- + tAverageTime / this.mTimeStatistics.length + "ms over the last " + this.mTimeStatistics.length
- + " ticks.");
- }
- if (this.mLagWarningCount > 0) {
- tList.add("This TileEntity has also caused "
- + (this.mLagWarningCount >= 10 ? "more than 10" : this.mLagWarningCount)
- + " Lag Spike Warnings (anything taking longer than "
- + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server.");
- }
- tList.add("Is" + (this.mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : " not ") + "accessible for you");
- }
- if (aLogLevel > 0) {
- if (this.getSteamCapacity() > 0 && this.hasSteamEngineUpgrade()) {
- tList.add(this.getStoredSteam() + " of " + this.getSteamCapacity() + " Steam");
- }
- tList.add("Machine is " + (this.mActive ? "active" : "inactive"));
- if (!this.mHasEnoughEnergy) {
- tList.add(
- "ATTENTION: This Device consumes Energy at a higher Rate than you input. You could insert more to speed up the process.");
- }
- }
- return this.mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
- }
-
- @Override
- public String[] getDescription() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getDescription();
- }
- return new String[0];
- }
-
- @Override
- public Packet getDescriptionPacket() {
- this.issueClientUpdate();
- return null;
- }
-
- @Override
- public ArrayList<ItemStack> getDrops() {
- final ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, this.mID);
- final NBTTagCompound tNBT = new NBTTagCompound();
- if (this.mRecipeStuff != null && !this.mRecipeStuff.hasNoTags()) {
- tNBT.setTag("GT.CraftingComponents", this.mRecipeStuff);
- }
- if (this.mMuffler) {
- tNBT.setBoolean("mMuffler", this.mMuffler);
- }
- if (this.mLockUpgrade) {
- tNBT.setBoolean("mLockUpgrade", this.mLockUpgrade);
- }
- if (this.mSteamConverter) {
- tNBT.setBoolean("mSteamConverter", this.mSteamConverter);
- }
- if (this.mColor > 0) {
- tNBT.setByte("mColor", this.mColor);
- }
- if (this.mOtherUpgrades > 0) {
- tNBT.setByte("mOtherUpgrades", this.mOtherUpgrades);
- }
- if (this.mStrongRedstone > 0) {
- tNBT.setByte("mStrongRedstone", this.mStrongRedstone);
- }
- for (byte i = 0; i < this.mCoverSides.length; i++) {
- if (this.mCoverSides[i] != 0) {
- tNBT.setIntArray("mCoverData", this.mCoverData);
- tNBT.setIntArray("mCoverSides", this.mCoverSides);
- break;
- }
- }
- if (this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.setItemNBT(tNBT);
- }
- if (!tNBT.hasNoTags()) {
- rStack.setTagCompound(tNBT);
- }
- return new ArrayList<ItemStack>(Arrays.asList(rStack));
- }
-
- @Override
- public int getErrorDisplayID() {
- return this.mDisplayErrorCode;
- }
-
- @Override
- public long getEUCapacity() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.maxEUStore();
- }
- return 0;
- }
-
- @Override
- public byte getFrontFacing() {
- return this.mFacing;
- }
-
- @Override
- public String[] getInfoData() {
- {
- if (this.canAccessData()) {
- return this.getMetaTileEntity().getInfoData();
- }
- return new String[] {};
- }
- }
-
- @Override
- public long getInputAmperage() {
- if (this.canAccessData() && this.mMetaTileEntity.isElectric()) {
- return this.mMetaTileEntity.maxAmperesIn();
- }
- return 0;
- }
-
- @Override
- public byte getInputRedstoneSignal(final byte aSide) {
- return (byte) (this.worldObj.getIndirectPowerLevelTo(this.getOffsetX(aSide, 1), this.getOffsetY(aSide, 1),
- this.getOffsetZ(aSide, 1), aSide) & 15);
- }
-
- @Override
- public long getInputVoltage() {
- if (this.canAccessData() && this.mMetaTileEntity.isElectric()) {
- return this.mMetaTileEntity.maxEUInput();
- }
- return Integer.MAX_VALUE;
- }
-
- @Override
- public byte getInternalInputRedstoneSignal(final byte aSide) {
- return (byte) (this.getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, this.getInputRedstoneSignal(aSide),
- this.getCoverIDAtSide(aSide), this.getCoverDataAtSide(aSide), this) & 15);
- }
-
- @Override
- public String getInventoryName() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getInventoryName();
- }
- if (GregTech_API.METATILEENTITIES[this.mID] != null) {
- return GregTech_API.METATILEENTITIES[this.mID].getInventoryName();
- }
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getInventoryStackLimit();
- }
- return 64;
- }
-
- @Override
- public int getLightOpacity() {
- return this.mMetaTileEntity == null ? this.getLightValue() > 0 ? 0 : 255
- : this.mMetaTileEntity.getLightOpacity();
- }
-
- public byte getLightValue() {
- return this.mLightValue;
- }
-
- public int getMaxEnergyOutput() {
- if (this.mReleaseEnergy) {
- return Integer.MAX_VALUE;
- }
- return this.getOutput();
- }
-
- @Override
- public int getMaxItemCount() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getMaxItemCount();
- }
- return 0;
- }
-
- @Override
- public int getMaxProgress() {
- return this.canAccessData() ? this.mMetaTileEntity.maxProgresstime() : 0;
- }
-
- public int getMaxSafeInput() {
- return (int) Math.min(Integer.MAX_VALUE, this.getInputVoltage());
- }
-
- @Override
- public IMetaTileEntity getMetaTileEntity() {
- return this.hasValidMetaTileEntity() ? this.mMetaTileEntity : null;
- }
-
- @Override
- public int getMetaTileID() {
- return this.mID;
- }
-
- public double getOfferedEnergy() {
- return this.canAccessData() && this.getStoredEU() - this.mMetaTileEntity.getMinimumStoredEU() >= this.oOutput
- ? Math.max(0, this.oOutput) : 0;
- }
-
- public int getOutput() {
- return (int) Math.min(Integer.MAX_VALUE, this.oOutput);
- }
-
- @Override
- public long getOutputAmperage() {
- if (this.canAccessData() && this.mMetaTileEntity.isElectric()) {
- return this.mMetaTileEntity.maxAmperesOut();
- }
- return 0;
- }
-
- public double getOutputEnergyUnitsPerTick() {
- return this.oOutput;
- }
-
- @Override
- public byte getOutputRedstoneSignal(final byte aSide) {
- return this.getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this) ? this.mSidedRedstone[aSide] : 0;
- // return
- // (byte)(getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide,
- // getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ||
- // (mRedstone && getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide,
- // getCoverIDAtSide(aSide), getCoverDataAtSide(aSide),
- // this))?mSidedRedstone[aSide]&15:0);
- }
-
- @Override
- public long getOutputVoltage() {
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()) {
- return this.mMetaTileEntity.maxEUOutput();
- }
- return 0;
- }
-
- @Override
- public String getOwnerName() {
- if (GT_Utility.isStringInvalid(this.mOwnerName)) {
- return "Player";
- }
- return this.mOwnerName;
- }
-
- @Override
- public int getProgress() {
- return this.canAccessData() ? this.mMetaTileEntity.getProgresstime() : 0;
- }
-
- @Override
- public boolean getRedstone() {
- return this.getRedstone((byte) 0) || this.getRedstone((byte) 1) || this.getRedstone((byte) 2)
- || this.getRedstone((byte) 3) || this.getRedstone((byte) 4) || this.getRedstone((byte) 5);
- }
-
- @Override
- public boolean getRedstone(final byte aSide) {
- return this.getInternalInputRedstoneSignal(aSide) > 0;
- }
-
- @Override
- public int getSizeInventory() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getSizeInventory();
- }
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(final int aIndex) {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getStackInSlot(aIndex);
- }
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- this.setInventorySlotContents(slot, null);
- }
- return stack;
- }
-
- @Override
- public long getSteamCapacity() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.maxSteamStore();
- }
- return 0;
- }
-
- public int getStored() {
- return (int) Math.min(Integer.MAX_VALUE, Math.min(this.getStoredEU(), this.getCapacity()));
- }
-
- @Override
- public long getStoredEU() {
- if (this.canAccessData()) {
- return Math.min(this.mMetaTileEntity.getEUVar(), this.getEUCapacity());
- }
- return 0;
- }
-
- @Override
- public ItemStack[] getStoredItemData() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.getStoredItemData();
- }
- return null;
- }
-
- @Override
- public long getStoredSteam() {
- if (this.canAccessData()) {
- return Math.min(this.mMetaTileEntity.getSteamVar(), this.getSteamCapacity());
- }
- return 0;
- }
-
- @Override
- public byte getStrongestRedstone() {
- return (byte) Math.max(this.getInternalInputRedstoneSignal((byte) 0),
- Math.max(this.getInternalInputRedstoneSignal((byte) 1),
- Math.max(this.getInternalInputRedstoneSignal((byte) 2),
- Math.max(this.getInternalInputRedstoneSignal((byte) 3),
- Math.max(this.getInternalInputRedstoneSignal((byte) 4),
- this.getInternalInputRedstoneSignal((byte) 5))))));
- }
-
- @Override
- public byte getStrongOutputRedstoneSignal(final byte aSide) {
- return aSide >= 0 && aSide < 6 && (this.mStrongRedstone & 1 << aSide) != 0
- ? (byte) (this.mSidedRedstone[aSide] & 15) : 0;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- if (this.canAccessData()
- && (aSide == ForgeDirection.UNKNOWN
- || this.mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn(
- (byte) aSide.ordinal(), this.getCoverIDAtSide((byte) aSide.ordinal()),
- this.getCoverDataAtSide((byte) aSide.ordinal()), null, this)
- || this.mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
- && this.getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut(
- (byte) aSide.ordinal(), this.getCoverIDAtSide((byte) aSide.ordinal()), this
- .getCoverDataAtSide((byte) aSide.ordinal()),
- null, this))) {
- return this.mMetaTileEntity.getTankInfo(aSide);
- }
- return new FluidTankInfo[] {};
- }
-
- public ITexture[] getTexture(final Block arg0, final byte aSide) {
- final ITexture rIcon = this.getCoverTexture(aSide);
- if (rIcon != null) {
- return new ITexture[] {
- rIcon
- };
- }
- if (this.hasValidMetaTileEntity()) {
- return this.mMetaTileEntity.getTexture(this, aSide, this.mFacing, (byte) (this.mColor - 1), this.mActive,
- this.getOutputRedstoneSignal(aSide) > 0);
- }
- return Textures.BlockIcons.ERROR_RENDERING;
- }
-
- @Override
- public ITexture[] getTexture(final byte aSide) {
- final ITexture rIcon = this.getCoverTexture(aSide);
- if (rIcon != null) {
- return new ITexture[] {
- rIcon
- };
- }
- if (this.hasValidMetaTileEntity()) {
- return this.mMetaTileEntity.getTexture(this, aSide, this.mFacing, (byte) (this.mColor - 1), this.mActive,
- this.getOutputRedstoneSignal(aSide) > 0);
- }
- return Textures.BlockIcons.ERROR_RENDERING;
- }
-
- @Override
- public long getTimer() {
- return this.mTickTimer;
- }
-
- @Override
- public long getUniversalEnergyCapacity() {
- return Math.max(this.getEUCapacity(), this.getSteamCapacity());
- }
-
- @Override
- public long getUniversalEnergyStored() {
- return Math.max(this.getStoredEU(), this.getStoredSteam());
- }
-
- public int getUpgradeCount() {
- return (this.mMuffler ? 1 : 0) + (this.mLockUpgrade ? 1 : 0) + (this.mSteamConverter ? 1 : 0)
- + this.mOtherUpgrades;
- }
-
- @Override
- public byte getWorkDataValue() {
- return this.mWorkData;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public boolean hasInventoryBeenModified() {
- return this.mInventoryChanged;
- }
-
- @Override
- public boolean hasMufflerUpgrade() {
- return this.mMuffler;
- }
-
- @Override
- public boolean hasSteamEngineUpgrade() {
- if (this.canAccessData() && this.mMetaTileEntity.isSteampowered()) {
- return true;
- }
- return this.mSteamConverter;
- }
-
- @Override
- public boolean hasThingsToDo() {
- return this.getMaxProgress() > 0;
- }
-
- protected boolean hasValidMetaTileEntity() {
- return this.mMetaTileEntity != null && this.mMetaTileEntity.getBaseMetaTileEntity() == this;
- }
-
- @Override
- public boolean hasWorkJustBeenEnabled() {
- return this.mWorkUpdate;
- }
-
- @Override
- public boolean increaseProgress(final int aProgressAmountInTicks) {
- return this.canAccessData()
- ? this.mMetaTileEntity.increaseProgress(aProgressAmountInTicks) != aProgressAmountInTicks : false;
- }
-
- @Override
- public boolean increaseStoredEnergyUnits(final long aEnergy, final boolean aIgnoreTooMuchEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- if (this.getStoredEU() < this.getEUCapacity() || aIgnoreTooMuchEnergy) {
- this.setStoredEU(this.mMetaTileEntity.getEUVar() + aEnergy);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean increaseStoredSteam(final long aEnergy, final boolean aIgnoreTooMuchEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- if (this.mMetaTileEntity.getSteamVar() < this.getSteamCapacity() || aIgnoreTooMuchEnergy) {
- this.setStoredSteam(this.mMetaTileEntity.getSteamVar() + aEnergy);
- return true;
- }
- return false;
- }
-
- public int injectEnergy(final Direction aDirection, final int aAmount) {
- return this.injectEnergyUnits((byte) aDirection.toSideValue(), aAmount, 1) > 0 ? 0 : aAmount;
- }
-
- public int injectEnergy(final ForgeDirection aForgeDirection, final int aAmount) {
- return this.injectEnergyUnits((byte) aForgeDirection.ordinal(), aAmount, 1) > 0 ? 0 : aAmount;
- }
-
- @Override
- public long injectEnergyUnits(final byte aSide, final long aVoltage, long aAmperage) {
- if (!this.canAccessData() || !this.mMetaTileEntity.isElectric() || !this.inputEnergyFrom(aSide)
- || aAmperage <= 0 || aVoltage <= 0 || this.getStoredEU() >= this.getEUCapacity()
- || this.mMetaTileEntity.maxAmperesIn() <= this.mAcceptedAmperes) {
- return 0;
- }
- if (aVoltage > this.getInputVoltage()) {
- this.doExplosion(aVoltage);
- return 0;
- }
- if (this.increaseStoredEnergyUnits(aVoltage
- * (aAmperage = Math.min(aAmperage, Math.min(this.mMetaTileEntity.maxAmperesIn() - this.mAcceptedAmperes,
- 1 + (this.getEUCapacity() - this.getStoredEU()) / aVoltage))),
- true)) {
- this.mAverageEUInput[this.mAverageEUInputIndex] += aVoltage * aAmperage;
- this.mAcceptedAmperes += aAmperage;
- return aAmperage;
- }
- return 0;
- }
-
- public double injectEnergyUnits(final ForgeDirection aDirection, final double aAmount) {
- return this.injectEnergyUnits((byte) aDirection.ordinal(), (int) aAmount, 1) > 0 ? 0 : aAmount;
- }
-
- @Override
- public boolean injectRotationalEnergy(final byte aSide, final long aSpeed, final long aEnergy) {
- if (!this.canAccessData() || this.getCoverIDAtSide(aSide) != 0) {
- return false;
- }
- return this.mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy);
- }
-
- @Override
- public boolean inputEnergyFrom(final byte aSide) {
- if (aSide == 6) {
- return true;
- }
- if (this.isServerSide()) {
- return (aSide >= 0 && aSide < 6 ? this.mActiveEUInputs[aSide] : false) && !this.mReleaseEnergy;
- }
- return this.isEnergyInputSide(aSide);
- }
-
- @Override
- public void invalidate() {
- this.tileEntityInvalid = false;
- if (this.canAccessData()) {
- this.mMetaTileEntity.onRemoval();
- this.mMetaTileEntity.setBaseMetaTileEntity(null);
- }
- super.invalidate();
- }
-
- @Override
- public boolean isActive() {
- return this.mActive;
- }
-
- public boolean isAddedToEnergyNet() {
- return false;
- }
-
- @Override
- public boolean isAllowedToWork() {
- return this.mWorks;
- }
-
- @Override
- public boolean isDigitalChest() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.isDigitalChest();
- }
- return false;
- }
-
- private boolean isEnergyInputSide(final byte aSide) {
- if (aSide >= 0 && aSide < 6) {
- if (!this.getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- return false;
- }
- if (this.isInvalid() || this.mReleaseEnergy) {
- return false;
- }
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetInput()) {
- return this.mMetaTileEntity.isInputFacing(aSide);
- }
- }
- return false;
- }
-
- private boolean isEnergyOutputSide(final byte aSide) {
- if (aSide >= 0 && aSide < 6) {
- if (!this.getCoverBehaviorAtSide(aSide).letsEnergyOut(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- return false;
- }
- if (this.isInvalid() || this.mReleaseEnergy) {
- return this.mReleaseEnergy;
- }
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.mMetaTileEntity.isEnetOutput()) {
- return this.mMetaTileEntity.isOutputFacing(aSide);
- }
- }
- return false;
- }
-
- @Override
- public boolean isGivingInformation() {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.isGivingInformation();
- }
- return false;
- }
-
- @Override
- public boolean isInvalidTileEntity() {
- return this.isInvalid();
- }
-
- /**
- * Can put aStack into Slot
- */
- @Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- return this.canAccessData() && this.mMetaTileEntity.isItemValidForSlot(aIndex, aStack);
- }
-
- @Override
- public boolean isMufflerUpgradable() {
- return this.isUpgradable() && !this.hasMufflerUpgrade();
- }
-
- @Override
- public boolean isSteamEngineUpgradable() {
- return this.isUpgradable() && !this.hasSteamEngineUpgrade() && this.getSteamCapacity() > 0;
- }
-
- @Override
- public void issueBlockUpdate() {
- this.mNeedsBlockUpdate = true;
- }
-
- @Override
- public void issueClientUpdate() {
- this.mSendClientData = true;
- }
-
- @Override
- public void issueCoverUpdate(final byte aSide) {
- this.issueClientUpdate();
- }
-
- @Override
- public void issueTextureUpdate() {
- this.mNeedsUpdate = true;
- }
-
- public boolean isTeleporterCompatible(final Direction aSide) {
- return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible();
- }
-
- public boolean isTeleporterCompatible(final ForgeDirection aSide) {
- return this.canAccessData() && this.mMetaTileEntity.isTeleporterCompatible();
- }
-
- @Override
- public boolean isUniversalEnergyStored(final long aEnergyAmount) {
- if (this.getUniversalEnergyStored() >= aEnergyAmount) {
- return true;
- }
- this.mHasEnoughEnergy = false;
- return false;
- }
-
- @Override
- public boolean isUpgradable() {
- return this.canAccessData() && this.getUpgradeCount() < 8;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer aPlayer) {
- return this.canAccessData() && this.playerOwnsThis(aPlayer, false) && this.mTickTimer > 40
- && this.getTileEntityOffset(0, 0, 0) == this
- && aPlayer.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5) < 64
- && this.mMetaTileEntity.isAccessAllowed(aPlayer);
- }
-
- @Override
- public boolean isValidFacing(final byte aSide) {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.isFacingValid(aSide);
- }
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- if (this.canAccessData()) {
- return this.mMetaTileEntity.isValidSlot(aIndex);
- }
- return false;
- }
-
- @Override
- public void markDirty() {
- super.markDirty();
- this.mInventoryChanged = true;
- }
-
- @Override
- public void onChunkUnload() {
- super.onChunkUnload();
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity collider) {
- this.mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- }
-
- @Override
- public void onLeftclick(final EntityPlayer aPlayer) {
- try {
- if (aPlayer != null && this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.onLeftclick(this, aPlayer);
- }
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- @Override
- public void onMachineBlockUpdate() {
- if (this.canAccessData()) {
- this.mMetaTileEntity.onMachineBlockUpdate();
- }
- }
-
- @Override
- public boolean onRightclick(final EntityPlayer aPlayer, final byte aSide, final float aX, final float aY,
- final float aZ) {
- if (this.isClientSide()) {
- if (this.getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) {
- return true;
- }
- if (!this.getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- return false;
- }
- }
- if (this.isServerSide()) {
- if (!this.privateAccess() || aPlayer.getDisplayName().equalsIgnoreCase(this.getOwnerName())) {
- final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- if (this.getColorization() >= 0
- && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
- tCurrentItem.func_150996_a(Items.bucket);
- this.setColorization((byte) (this.getColorization() >= 16 ? -2 : -1));
- return true;
- }
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
- if (this.mMetaTileEntity.onWrenchRightClick(aSide,
- GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ), aPlayer, aX, aY, aZ)) {
- GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
- this.setCoverDataAtSide(aSide,
- this.getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide,
- this.getCoverIDAtSide(aSide), this.getCoverDataAtSide(aSide), this, aPlayer,
- aX, aY, aZ));
- this.mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- this.mInputDisabled = !this.mInputDisabled;
- if (this.mInputDisabled) {
- this.mOutputDisabled = !this.mOutputDisabled;
- }
- GT_Utility.sendChatToPlayer(aPlayer,
- "Auto-Input: " + (this.mInputDisabled ? "Disabled" : "Enabled") + " Auto-Output: "
- + (this.mOutputDisabled ? "Disabled" : "Enabled"));
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- if (this.mWorks) {
- this.disableWorking();
- }
- else {
- this.enableWorking();
- }
- GT_Utility.sendChatToPlayer(aPlayer,
- "Machine Processing: " + (this.isAllowedToWork() ? "Enabled" : "Disabled"));
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
- final byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) {
- this.mStrongRedstone ^= 1 << tSide;
- GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: "
- + ((this.mStrongRedstone & 1 << tSide) != 0 ? "Strong" : "Weak"));
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
-
- if (this.getCoverIDAtSide(aSide) == 0) {
- if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
- if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(aSide,
- new GT_ItemStack(tCurrentItem), this)
- && this.mMetaTileEntity.allowCoverOnSide(aSide, new GT_ItemStack(tCurrentItem))) {
- this.setCoverItemAtSide(aSide, tCurrentItem);
- if (!aPlayer.capabilities.isCreativeMode) {
- tCurrentItem.stackSize--;
- }
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- }
- return true;
- }
- }
- else {
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- this.dropCover(aSide, aSide, false);
- }
- return true;
- }
- }
- }
-
- if (this.getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ)) {
- return true;
- }
-
- if (!this.getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- return false;
- }
-
- if (this.isUpgradable() && aPlayer.inventory
- .getCurrentItem() != null) {/*
- * if (ItemList.
- * Upgrade_SteamEngine.
- * isStackEqual(aPlayer.
- * inventory.getCurrentItem(
- * ))) { if
- * (addSteamEngineUpgrade())
- * { GT_Utility.
- * sendSoundToPlayers(
- * worldObj,
- * GregTech_API.sSoundList.
- * get(3), 1.0F, -1, xCoord,
- * yCoord, zCoord); if
- * (!aPlayer.capabilities.
- * isCreativeMode)
- * aPlayer.inventory.
- * getCurrentItem().
- * stackSize--; } return
- * true; }
- */
- if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) {
- if (this.addMufflerUpgrade()) {
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- if (!aPlayer.capabilities.isCreativeMode) {
- aPlayer.inventory.getCurrentItem().stackSize--;
- }
- }
- return true;
- }
- if (ItemList.Upgrade_Lock.isStackEqual(aPlayer.inventory.getCurrentItem())) {
- if (this.isUpgradable() && !this.mLockUpgrade) {
- this.mLockUpgrade = true;
- this.setOwnerName(aPlayer.getDisplayName());
- GT_Utility.sendSoundToPlayers(this.worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1,
- this.xCoord, this.yCoord, this.zCoord);
- if (!aPlayer.capabilities.isCreativeMode) {
- aPlayer.inventory.getCurrentItem().stackSize--;
- }
+ private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[]{GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior};
+ protected MetaTileEntity mMetaTileEntity;
+ protected long mStoredEnergy = 0, mStoredSteam = 0;
+ protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0;
+ protected boolean mReleaseEnergy = false;
+ protected int[] mAverageEUInput = new int[]{0, 0, 0, 0, 0}, mAverageEUOutput = new int[]{0, 0, 0, 0, 0};
+ private boolean[] mActiveEUInputs = new boolean[]{false, false, false, false, false, false}, mActiveEUOutputs = new boolean[]{false, false, false, false, false, false};
+ private byte[] mSidedRedstone = new byte[]{15, 15, 15, 15, 15, 15};
+ private int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0}, mCoverData = new int[]{0, 0, 0, 0, 0, 0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING];
+ private boolean mHasEnoughEnergy = true, mRunningThroughTick = false, mInputDisabled = false, mOutputDisabled = false, mMuffler = false, mLockUpgrade = false, mActive = false, mRedstone = false, mWorkUpdate = false, mSteamConverter = false, mInventoryChanged = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false, oRedstone = false;
+ private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, 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 short mID = 0;
+ private long mTickTimer = 0, oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE;
+ private String mOwnerName = "";
+ private NBTTagCompound mRecipeStuff = new NBTTagCompound();
+
+ public GregtechBaseMetaTileEntityLossless() {
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ try {
+ super.writeToNBT(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ try {
+ aNBT.setInteger("mID", mID);
+ aNBT.setLong("mStoredSteam", mStoredSteam);
+ aNBT.setLong("mStoredEnergy", mStoredEnergy);
+ aNBT.setIntArray("mCoverData", mCoverData);
+ aNBT.setIntArray("mCoverSides", mCoverSides);
+ aNBT.setByteArray("mRedstoneSided", mSidedRedstone);
+ aNBT.setByte("mColor", mColor);
+ aNBT.setByte("mLightValue", mLightValue);
+ aNBT.setByte("mOtherUpgrades", mOtherUpgrades);
+ aNBT.setByte("mWorkData", mWorkData);
+ aNBT.setByte("mStrongRedstone", mStrongRedstone);
+ aNBT.setShort("mFacing", mFacing);
+ aNBT.setString("mOwnerName", mOwnerName);
+ aNBT.setBoolean("mLockUpgrade", mLockUpgrade);
+ aNBT.setBoolean("mMuffler", mMuffler);
+ aNBT.setBoolean("mSteamConverter", mSteamConverter);
+ aNBT.setBoolean("mActive", mActive);
+ aNBT.setBoolean("mRedstone", mRedstone);
+ aNBT.setBoolean("mWorks", !mWorks);
+ aNBT.setBoolean("mInputDisabled", mInputDisabled);
+ aNBT.setBoolean("mOutputDisabled", mOutputDisabled);
+ aNBT.setTag("GT.CraftingComponents", mRecipeStuff);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ try {
+ if (hasValidMetaTileEntity()) {
+ NBTTagList tItemList = new NBTTagList();
+ for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) {
+ ItemStack tStack = mMetaTileEntity.getRealInventory()[i];
+ if (tStack != null) {
+ NBTTagCompound tTag = new NBTTagCompound();
+ tTag.setInteger("IntSlot", i);
+ tStack.writeToNBT(tTag);
+ tItemList.appendTag(tTag);
+ }
+ }
+ aNBT.setTag("Inventory", tItemList);
+
+ try {
+ mMetaTileEntity.saveNBTData(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+ setInitialValuesAsNBT(aNBT, (short) 0);
+ }
+
+ @Override
+ public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) {
+ if (aNBT == null) {
+ 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});
+ } else {
+ if (aID <= 0) mID = (short) aNBT.getInteger("mID");
+ else mID = aID;
+ mStoredSteam = aNBT.getInteger("mStoredSteam");
+ mStoredEnergy = aNBT.getInteger("mStoredEnergy");
+ mColor = aNBT.getByte("mColor");
+ mLightValue = aNBT.getByte("mLightValue");
+ mWorkData = aNBT.getByte("mWorkData");
+ mStrongRedstone = aNBT.getByte("mStrongRedstone");
+ mFacing = oFacing = (byte) aNBT.getShort("mFacing");
+ mOwnerName = aNBT.getString("mOwnerName");
+ mLockUpgrade = aNBT.getBoolean("mLockUpgrade");
+ mMuffler = aNBT.getBoolean("mMuffler");
+ mSteamConverter = aNBT.getBoolean("mSteamConverter");
+ mActive = aNBT.getBoolean("mActive");
+ mRedstone = aNBT.getBoolean("mRedstone");
+ mWorks = !aNBT.getBoolean("mWorks");
+ mInputDisabled = aNBT.getBoolean("mInputDisabled");
+ mOutputDisabled = aNBT.getBoolean("mOutputDisabled");
+ mOtherUpgrades = (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries") + aNBT.getByte("mLiBatteries"));
+ mCoverSides = aNBT.getIntArray("mCoverSides");
+ mCoverData = aNBT.getIntArray("mCoverData");
+ mSidedRedstone = aNBT.getByteArray("mRedstoneSided");
+ mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
+
+ if (mCoverData.length != 6) mCoverData = 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};
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+
+ if (mID != 0 && createNewMetatileEntity(mID)) {
+ NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
+ for (int i = 0; i < tItemList.tagCount(); i++) {
+ NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
+ int tSlot = tTag.getInteger("IntSlot");
+ if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) {
+ mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
+ }
+ }
+
+ try {
+ mMetaTileEntity.loadNBTData(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+
+ if (mCoverData.length != 6) mCoverData = 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};
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ }
+
+ private boolean createNewMetatileEntity(short aID) {
+ if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
+ GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
+ } else {
+ if (aID != 0) {
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
+ GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
+ mTickTimer = 0;
+ mID = aID;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Used for ticking special BaseMetaTileEntities, which need that for Energy Conversion
+ * It's called right before onPostTick()
+ */
+ public void updateStatus() {
+ //
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * 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);
+ }
+
+ @Override
+ public void updateEntity() {
+ super.updateEntity();
+
+ if (!hasValidMetaTileEntity()) {
+ if (mMetaTileEntity == null) return;
+ mMetaTileEntity.setBaseMetaTileEntity(this);
+ }
+
+ mRunningThroughTick = true;
+ long tTime = System.currentTimeMillis();
+
+ for (int tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
+ try {
+ switch (tCode) {
+ case 0:
+ tCode++;
+ if (mTickTimer++ == 0) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ if (isServerSide()) for (byte i = 0; i < 6; i++)
+ if (getCoverIDAtSide(i) != 0)
+ if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
+ dropCover(i, i, true);
+
+ worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
+
+ mMetaTileEntity.onFirstTick(this);
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ }
+ case 1:
+ tCode++;
+ if (isClientSide()) {
+ if (mColor != oColor) {
+ mMetaTileEntity.onColorChangeClient(oColor = mColor);
+ issueTextureUpdate();
+ }
+
+ if (mLightValue != oLightValueClient) {
+ worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1);
+ oLightValueClient = mLightValue;
+ issueTextureUpdate();
+ }
+
+ if (mNeedsUpdate) {
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ //worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ mNeedsUpdate = false;
+ }
+ }
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (isServerSide() && mTickTimer > 10) {
+ for (byte i = (byte) (tCode - 2); i < 6; i++)
+ if (getCoverIDAtSide(i) != 0) {
+ tCode++;
+ GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
+ int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
+ if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
+ mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ }
+ }
+
+ }
+ case 8:
+ tCode = 9;
+ if (isServerSide()) {
+ if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0;
+ if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0;
+
+ mAverageEUInput[mAverageEUInputIndex] = 0;
+ mAverageEUOutput[mAverageEUOutputIndex] = 0;
+ }
+ case 9:
+ tCode++;
+ mMetaTileEntity.onPreTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ case 10:
+ tCode++;
+ if (isServerSide()) {
+ if (mRedstone != oRedstone || mTickTimer == 10) {
+ for (byte i = 0; i < 6; i++)
+ mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ oRedstone = mRedstone;
+ issueBlockUpdate();
+ }
+
+ if (xCoord != oX || yCoord != oY || zCoord != oZ) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ issueClientUpdate();
+ clearTileEntityBuffer();
+ }
+
+ if (mFacing != oFacing) {
+ oFacing = mFacing;
+ for (byte i = 0; i < 6; i++)
+ if (getCoverIDAtSide(i) != 0)
+ if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
+ dropCover(i, i, true);
+ issueBlockUpdate();
+ }
+
+ if (mTickTimer > 20 && mMetaTileEntity.isElectric()) {
+ mAcceptedAmperes = 0;
+
+ if (getOutputVoltage() != oOutput) {
+ oOutput = getOutputVoltage();
+ }
+
+ if (mMetaTileEntity.isEnetOutput() || mMetaTileEntity.isEnetInput()) {
+ for (byte i = 0; i < 6; i++) {
+ boolean
+ temp = isEnergyInputSide(i);
+ if (temp != mActiveEUInputs[i]) {
+ mActiveEUInputs[i] = temp;
+ }
+ temp = isEnergyOutputSide(i);
+ if (temp != mActiveEUOutputs[i]) {
+ mActiveEUOutputs[i] = temp;
+ }
+ }
+ }
+
+
+
+ if (mMetaTileEntity.isEnetOutput() && oOutput > 0) {
+ long tOutputVoltage = oOutput, tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage);
+ if (tUsableAmperage > 0) {
+ long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this);
+ mAverageEUOutput[mAverageEUOutputIndex] += tEU;
+ decreaseStoredEU(tEU, true);
+ }
+ }
+
+
+ if (getEUCapacity() > 0) {
+ if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) {
+ Block tBlock = getBlockAtSide((byte) getRandomNumber(6));
+ if (tBlock != null && tBlock instanceof BlockFire) doEnergyExplosion();
+ }
+
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+
+ if (getRandomNumber(1000) == 0) {
+ if ((getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord)
+ || (getCoverIDAtSide((byte) 2) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord - 1) - 1 < yCoord)
+ || (getCoverIDAtSide((byte) 3) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord + 1) - 1 < yCoord)
+ || (getCoverIDAtSide((byte) 4) == 0 && worldObj.getPrecipitationHeight(xCoord - 1, zCoord) - 1 < yCoord)
+ || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord)) {
+ if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) {
+ if (getRandomNumber(10) == 0) {
+ try {
+ GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");
+ } catch (Exception e) {
+ }
+ doEnergyExplosion();
+ } else setOnFire();
+ }
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) {
+ try {
+ GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");
+ } catch (Exception e) {
+ }
+ doEnergyExplosion();
+ }
+ }
+ }
+ }
+ }
+
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ }
+ case 11:
+ tCode++;
+ if (isServerSide()) {
+ if (mMetaTileEntity.dechargerSlotCount() > 0 && getStoredEU() < getEUCapacity()) {
+ for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
+ if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) {
+ dischargeItem(mMetaTileEntity.mInventory[i]);
+ if (mMetaTileEntity.mInventory[i].stackSize <= 0)
+ mMetaTileEntity.mInventory[i] = null;
+ mInventoryChanged = true;
+ }
+ }
+ }
+ }
+ case 12:
+ tCode++;
+ if (isServerSide()) {
+ if (mMetaTileEntity.rechargerSlotCount() > 0 && getStoredEU() > 0) {
+ 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)
+ mMetaTileEntity.mInventory[i] = null;
+ mInventoryChanged = true;
+ }
+ }
+ }
+ }
+ case 13:
+ tCode++;
+ updateStatus();
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ case 14:
+ tCode++;
+ mMetaTileEntity.onPostTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) {
+ mRunningThroughTick = false;
+ return;
+ }
+ case 15:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer % 10 == 0) {
+ 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)), 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;
+ }
+ }
+
+ if (mTickTimer > 10) {
+ byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0));
+ if (tData != oTextureData) sendBlockEvent((byte) 0, oTextureData = tData);
+ 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));
+ if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
+ if (mLightValue != oLightValue) {
+ worldObj.setLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord, mLightValue);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord + 1, yCoord, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord - 1, yCoord, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord + 1, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord - 1, zCoord);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord + 1);
+ worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord - 1);
+ issueTextureUpdate();
+ sendBlockEvent((byte) 7, oLightValue = mLightValue);
+ }
+ }
+
+ if (mNeedsBlockUpdate) {
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0));
+ mNeedsBlockUpdate = false;
+ }
+ }
+ default:
+ tCode = -1;
+ break;
+ }
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ if (isServerSide() && hasValidMetaTileEntity()) {
+ tTime = System.currentTimeMillis() - tTime;
+ if (mTimeStatistics.length > 0)
+ mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
+ if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10)
+ System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ms caused by an instance of " + getMetaTileEntity().getClass());
+ }
+
+ mWorkUpdate = mInventoryChanged = mRunningThroughTick = false;
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ issueClientUpdate();
+ return null;
+ }
+
+ 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 (mID != aID && aID > 0) {
+ mID = aID;
+ createNewMetatileEntity(mID);
+ }
+
+ mCoverSides[0] = aCover0;
+ mCoverSides[1] = aCover1;
+ mCoverSides[2] = aCover2;
+ mCoverSides[3] = aCover3;
+ mCoverSides[4] = aCover4;
+ mCoverSides[5] = aCover5;
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+
+ receiveClientEvent(0, aTextureData);
+ receiveClientEvent(1, aUpdateData);
+ receiveClientEvent(2, aColorData);
+ receiveClientEvent(3, aRedstoneData);
+ }
+
+ @Override
+ public boolean receiveClientEvent(int aEventID, int aValue) {
+ super.receiveClientEvent(aEventID, aValue);
+
+ if (hasValidMetaTileEntity()) {
+ 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 immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ if (isClientSide()) {
+ issueTextureUpdate();
+ switch (aEventID) {
+ case 0:
+ mFacing = (byte) (aValue & 7);
+ mActive = ((aValue & 8) != 0);
+ mRedstone = ((aValue & 16) != 0);
+ //mLockUpgrade = ((aValue&32) != 0);
+ break;
+ case 1:
+ if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue);
+ break;
+ case 2:
+ if (aValue > 16 || aValue < 0) aValue = 0;
+ mColor = (byte) aValue;
+ break;
+ case 3:
+ mSidedRedstone[0] = (byte) ((aValue & 1) > 0 ? 15 : 0);
+ mSidedRedstone[1] = (byte) ((aValue & 2) > 0 ? 15 : 0);
+ mSidedRedstone[2] = (byte) ((aValue & 4) > 0 ? 15 : 0);
+ mSidedRedstone[3] = (byte) ((aValue & 8) > 0 ? 15 : 0);
+ mSidedRedstone[4] = (byte) ((aValue & 16) > 0 ? 15 : 0);
+ mSidedRedstone[5] = (byte) ((aValue & 32) > 0 ? 15 : 0);
+ break;
+ case 4:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.doSound((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 5:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.startSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 6:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.stopSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 7:
+ mLightValue = (byte) aValue;
+ break;
+ }
+ }
+ return true;
+ }
+
+ public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
+ ArrayList<String> tList = new ArrayList<String>();
+ if (aLogLevel > 2) {
+ tList.add("Meta-ID: " + mID + (canAccessData() ? " valid" : " invalid") + (mMetaTileEntity == null ? " MetaTileEntity == null!" : " "));
+ }
+ if (aLogLevel > 1) {
+ if (mTimeStatistics.length > 0) {
+ double tAverageTime = 0;
+ for (int tTime : mTimeStatistics) tAverageTime += tTime;
+ tList.add("This particular TileEntity has caused an average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + "ms over the last " + mTimeStatistics.length + " ticks.");
+ }
+ if (mLagWarningCount > 0) {
+ tList.add("This TileEntity has also 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) ? " " : " not ") + "accessible for you");
+ }
+ if (aLogLevel > 0) {
+ if (getSteamCapacity() > 0 && hasSteamEngineUpgrade())
+ tList.add(getStoredSteam() + " of " + getSteamCapacity() + " Steam");
+ tList.add("Machine is " + (mActive ? "active" : "inactive"));
+ if (!mHasEnoughEnergy)
+ tList.add("ATTENTION: This Device consumes Energy at a higher Rate than you input. You could insert more to speed up the process.");
+ }
+ return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
+ }
+
+ @Override
+ public void issueTextureUpdate() {
+ mNeedsUpdate = true;
+ }
+
+ @Override
+ public void issueBlockUpdate() {
+ mNeedsBlockUpdate = true;
+ }
+
+ @Override
+ public void issueClientUpdate() {
+ mSendClientData = true;
+ }
+
+ @Override
+ public void issueCoverUpdate(byte aSide) {
+ issueClientUpdate();
+ }
+
+ @Override
+ public byte getStrongestRedstone() {
+ return (byte) Math.max(getInternalInputRedstoneSignal((byte) 0), Math.max(getInternalInputRedstoneSignal((byte) 1), Math.max(getInternalInputRedstoneSignal((byte) 2), Math.max(getInternalInputRedstoneSignal((byte) 3), Math.max(getInternalInputRedstoneSignal((byte) 4), getInternalInputRedstoneSignal((byte) 5))))));
+ }
+
+ @Override
+ public boolean getRedstone() {
+ return getRedstone((byte) 0) || getRedstone((byte) 1) || getRedstone((byte) 2) || getRedstone((byte) 3) || getRedstone((byte) 4) || getRedstone((byte) 5);
+ }
+
+ @Override
+ public boolean getRedstone(byte aSide) {
+ return getInternalInputRedstoneSignal(aSide) > 0;
+ }
+
+ public ITexture getCoverTexture(byte aSide) {
+ return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ if (canAccessData()) return mMetaTileEntity.isGivingInformation();
+ return false;
+ }
+
+ @Override
+ public boolean isValidFacing(byte aSide) {
+ if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide);
+ return false;
+ }
+
+ @Override
+ public byte getBackFacing() {
+ return GT_Utility.getOppositeSide(mFacing);
+ }
+
+ @Override
+ public byte getFrontFacing() {
+ return mFacing;
+ }
+
+ @Override
+ public void setFrontFacing(byte aFacing) {
+ if (isValidFacing(aFacing)) {
+ mFacing = aFacing;
+ mMetaTileEntity.onFacingChange();
+ onMachineBlockUpdate();
+ }
+ }
+
+ @Override
+ public int getSizeInventory() {
+ if (canAccessData()) return mMetaTileEntity.getSizeInventory();
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex);
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ mInventoryChanged = true;
+ if (canAccessData())
+ mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (canAccessData()) return mMetaTileEntity.getInventoryName();
+ if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit();
+ return 64;
+ }
+
+ @Override
+ public void openInventory() {
+ if (canAccessData()) mMetaTileEntity.onOpenGUI();
+ }
+
+ @Override
+ public void closeInventory() {
+ if (canAccessData()) mMetaTileEntity.onCloseGUI();
+ }
+
+ @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);
+ }
+
+ @Override
+ public void validate() {
+ super.validate();
+ mTickTimer = 0;
+ }
+
+ @Override
+ public void invalidate() {
+ tileEntityInvalid = false;
+ if (canAccessData()) {
+ mMetaTileEntity.onRemoval();
+ mMetaTileEntity.setBaseMetaTileEntity(null);
+ }
+ super.invalidate();
+ }
+
+ @Override
+ public void onChunkUnload() {
+ super.onChunkUnload();
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot) {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null) setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();
+ }
+
+ @Override
+ public int getProgress() {
+ return canAccessData() ? mMetaTileEntity.getProgresstime() : 0;
+ }
+
+ @Override
+ public int getMaxProgress() {
+ return canAccessData() ? mMetaTileEntity.maxProgresstime() : 0;
+ }
+
+ @Override
+ public boolean increaseProgress(int aProgressAmountInTicks) {
+ return canAccessData() ? mMetaTileEntity.increaseProgress(aProgressAmountInTicks) != aProgressAmountInTicks : false;
+ }
+
+ @Override
+ public boolean hasThingsToDo() {
+ return getMaxProgress() > 0;
+ }
+
+ @Override
+ public void enableWorking() {
+ if (!mWorks) mWorkUpdate = true;
+ mWorks = true;
+ }
+
+ @Override
+ public void disableWorking() {
+ mWorks = false;
+ }
+
+ @Override
+ public boolean isAllowedToWork() {
+ return mWorks;
+ }
+
+ @Override
+ public boolean hasWorkJustBeenEnabled() {
+ return mWorkUpdate;
+ }
+
+ @Override
+ public byte getWorkDataValue() {
+ return mWorkData;
+ }
+
+ @Override
+ public void setWorkDataValue(byte aValue) {
+ mWorkData = aValue;
+ }
+
+ @Override
+ public int getMetaTileID() {
+ return mID;
+ }
+
+ @Override
+ public int setMetaTileID(short aID) {
+ return mID = aID;
+ }
+
+ @Override
+ public boolean isActive() {
+ return mActive;
+ }
+
+ @Override
+ public void setActive(boolean aActive) {
+ mActive = aActive;
+ }
+
+ @Override
+ public long getTimer() {
+ return mTickTimer;
+ }
+
+ @Override
+ public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ if (!canAccessData()) return false;
+ return mHasEnoughEnergy = decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy) || decreaseStoredSteam(aEnergy, false) || (aIgnoreTooLessEnergy && (decreaseStoredSteam(aEnergy, true)));
+ }
+
+ @Override
+ public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ if (!canAccessData()) return false;
+ if (getStoredEU() < getEUCapacity() || aIgnoreTooMuchEnergy) {
+ setStoredEU(mMetaTileEntity.getEUVar() + aEnergy);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide) {
+ if (aSide == 6) return true;
+ if (isServerSide()) return (aSide >= 0 && aSide < 6 ? mActiveEUInputs[aSide] : false) && !mReleaseEnergy;
+ return isEnergyInputSide(aSide);
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide) {
+ if (aSide == 6) return true;
+ if (isServerSide()) return (aSide >= 0 && aSide < 6 ? mActiveEUOutputs[aSide] : false) || mReleaseEnergy;
+ return isEnergyOutputSide(aSide);
+ }
+
+ @Override
+ public long getOutputAmperage() {
+ if (canAccessData() && mMetaTileEntity.isElectric()) return mMetaTileEntity.maxAmperesOut();
+ return 0;
+ }
+
+ @Override
+ public long getOutputVoltage() {
+ if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetOutput())
+ return mMetaTileEntity.maxEUOutput();
+ return 0;
+ }
+
+ @Override
+ public long getInputAmperage() {
+ if (canAccessData() && mMetaTileEntity.isElectric()) return mMetaTileEntity.maxAmperesIn();
+ return 0;
+ }
+
+ @Override
+ public long getInputVoltage() {
+ if (canAccessData() && mMetaTileEntity.isElectric()) return mMetaTileEntity.maxEUInput();
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ if (!canAccessData()) return false;
+ if (mMetaTileEntity.getSteamVar() < getSteamCapacity() || aIgnoreTooMuchEnergy) {
+ setStoredSteam(mMetaTileEntity.getSteamVar() + aEnergy);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (canAccessData()) return mMetaTileEntity.getDescription();
+ return new String[0];
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex);
+ return false;
+ }
+
+ @Override
+ public long getUniversalEnergyStored() {
+ return Math.max(getStoredEU(), getStoredSteam());
+ }
+
+ @Override
+ public long getUniversalEnergyCapacity() {
+ return Math.max(getEUCapacity(), getSteamCapacity());
+ }
+
+ @Override
+ public long getStoredEU() {
+ if (canAccessData()) return Math.min(mMetaTileEntity.getEUVar(), getEUCapacity());
+ return 0;
+ }
+
+ @Override
+ public long getEUCapacity() {
+ if (canAccessData()) return mMetaTileEntity.maxEUStore();
+ return 0;
+ }
+
+ @Override
+ public long getStoredSteam() {
+ if (canAccessData()) return Math.min(mMetaTileEntity.getSteamVar(), getSteamCapacity());
+ return 0;
+ }
+
+ @Override
+ public long getSteamCapacity() {
+ if (canAccessData()) return mMetaTileEntity.maxSteamStore();
+ return 0;
+ }
+
+ private boolean isEnergyInputSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) {
+ if (!getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ return false;
+ if (isInvalid() || mReleaseEnergy) return false;
+ if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetInput())
+ return mMetaTileEntity.isInputFacing(aSide);
+ }
+ return false;
+ }
+
+ private boolean isEnergyOutputSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) {
+ if (!getCoverBehaviorAtSide(aSide).letsEnergyOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ return false;
+ if (isInvalid() || mReleaseEnergy) return mReleaseEnergy;
+ if (canAccessData() && mMetaTileEntity.isElectric() && mMetaTileEntity.isEnetOutput())
+ return mMetaTileEntity.isOutputFacing(aSide);
+ }
+ return false;
+ }
+
+ protected boolean hasValidMetaTileEntity() {
+ return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;
+ }
+
+ protected boolean canAccessData() {
+ return !isDead && hasValidMetaTileEntity();
+ }
+
+ public boolean setStoredEU(long aEnergy) {
+ if (!canAccessData()) return false;
+ if (aEnergy < 0) aEnergy = 0;
+ mMetaTileEntity.setEUVar(aEnergy);
+ return true;
+ }
+
+ public boolean setStoredSteam(long aEnergy) {
+ if (!canAccessData()) return false;
+ if (aEnergy < 0) aEnergy = 0;
+ mMetaTileEntity.setSteamVar(aEnergy);
+ return true;
+ }
+
+ public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ if (!canAccessData()) {
+ return false;
+ }
+ if (mMetaTileEntity.getEUVar() - aEnergy >= 0 || aIgnoreTooLessEnergy) {
+ setStoredEU(mMetaTileEntity.getEUVar() - aEnergy);
+ if (mMetaTileEntity.getEUVar() < 0) {
+ setStoredEU(0);
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public boolean decreaseStoredSteam(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ if (!canAccessData()) return false;
+ if (mMetaTileEntity.getSteamVar() - aEnergy >= 0 || aIgnoreTooLessEnergy) {
+ setStoredSteam(mMetaTileEntity.getSteamVar() - aEnergy);
+ if (mMetaTileEntity.getSteamVar() < 0) {
+ setStoredSteam(0);
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public boolean playerOwnsThis(EntityPlayer aPlayer, boolean aCheckPrecicely) {
+ if (!canAccessData()) return false;
+ if (aCheckPrecicely || privateAccess() || mOwnerName.equals(""))
+ if (mOwnerName.equals("") && isServerSide()) setOwnerName(aPlayer.getDisplayName());
+ else if (privateAccess() && !aPlayer.getDisplayName().equals("Player") && !mOwnerName.equals("Player") && !mOwnerName.equals(aPlayer.getDisplayName()))
+ return false;
+ return true;
+ }
+
+ public boolean privateAccess() {
+ if (!canAccessData()) return mLockUpgrade;
+ return mLockUpgrade || mMetaTileEntity.ownerControl();
+ }
+
+ public void doEnergyExplosion() {
+ if (getUniversalEnergyCapacity() > 0 && getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 5) {
+ doExplosion(oOutput * (getUniversalEnergyStored() >= getUniversalEnergyCapacity() ? 4 : getUniversalEnergyStored() >= getUniversalEnergyCapacity() / 2 ? 2 : 1));
+ GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "electricproblems");
+ }
+ }
+
+ @Override
+ public void doExplosion(long aAmount) {
+ if (canAccessData()) {
+ // This is only for Electric Machines
+ if (GregTech_API.sMachineWireFire && mMetaTileEntity.isElectric()) {
+ try {
+ mReleaseEnergy = true;
+ IEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this);
+ } catch (Exception e) {/* Fun Fact: all these "do nothing" Comments you see in my Code, are just there to let Eclipse shut up about the intended empty Brackets, but I need eclipse to yell at me in some of the regular Cases where I forget to add Code */}
+ }
+ mReleaseEnergy = false;
+ // Normal Explosion Code
+ mMetaTileEntity.onExplosion();
+ mMetaTileEntity.doExplosion(aAmount);
+ }
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops() {
+ ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID);
+ NBTTagCompound tNBT = new NBTTagCompound();
+ if (mRecipeStuff != null && !mRecipeStuff.hasNoTags()) tNBT.setTag("GT.CraftingComponents", mRecipeStuff);
+ if (mMuffler) tNBT.setBoolean("mMuffler", mMuffler);
+ if (mLockUpgrade) tNBT.setBoolean("mLockUpgrade", mLockUpgrade);
+ if (mSteamConverter) tNBT.setBoolean("mSteamConverter", mSteamConverter);
+ if (mColor > 0) tNBT.setByte("mColor", mColor);
+ if (mOtherUpgrades > 0) tNBT.setByte("mOtherUpgrades", mOtherUpgrades);
+ if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone);
+ for (byte i = 0; i < mCoverSides.length; i++) {
+ if (mCoverSides[i] != 0) {
+ tNBT.setIntArray("mCoverData", mCoverData);
+ tNBT.setIntArray("mCoverSides", mCoverSides);
+ break;
+ }
+ }
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT);
+ if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT);
+ return new ArrayList<ItemStack>(Arrays.asList(rStack));
+ }
+
+ public int getUpgradeCount() {
+ return (mMuffler ? 1 : 0) + (mLockUpgrade ? 1 : 0) + (mSteamConverter ? 1 : 0) + mOtherUpgrades;
+ }
+
+ @Override
+ public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ if (isClientSide()) {
+ if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true;
+ if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ return false;
+ }
+ if (isServerSide()) {
+ if (!privateAccess() || aPlayer.getDisplayName().equalsIgnoreCase(getOwnerName())) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ 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 (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, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
+ setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
+ mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ mInputDisabled = !mInputDisabled;
+ if (mInputDisabled) mOutputDisabled = !mOutputDisabled;
+ GT_Utility.sendChatToPlayer(aPlayer, "Auto-Input: " + (mInputDisabled ? "Disabled" : "Enabled") + " Auto-Output: " + (mOutputDisabled ? "Disabled" : "Enabled"));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ if (mWorks) disableWorking();
+ else enableWorking();
+ GT_Utility.sendChatToPlayer(aPlayer, "Machine Processing: " + (isAllowedToWork() ? "Enabled" : "Disabled"));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) {
+ mStrongRedstone ^= (1 << tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, "Redstone Output at Side " + tSide + " set to: " + ((mStrongRedstone & (1 << tSide)) != 0 ? "Strong" : "Weak"));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (getCoverIDAtSide(aSide) == 0) {
+ if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
+ if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(aSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(aSide, new GT_ItemStack(tCurrentItem))) {
+ setCoverItemAtSide(aSide, tCurrentItem);
+ if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--;
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 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, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord);
+ dropCover(aSide, aSide, false);
+ }
+ return true;
+ }
+ }
+ }
+
+ if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ))
+ return true;
+
+ if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ return false;
+
+ if (isUpgradable() && aPlayer.inventory.getCurrentItem() != null) {/*
+ if (ItemList.Upgrade_SteamEngine.isStackEqual(aPlayer.inventory.getCurrentItem())) {
+ if (addSteamEngineUpgrade()) {
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1, xCoord, yCoord, zCoord);
+ if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--;
}
return true;
- }
- }
- }
- }
-
- try {
- if (this.hasValidMetaTileEntity()) {
- return this.mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ);
- }
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
-
- return true;
- }
-
- @Override
- public void openInventory() {
- if (this.canAccessData()) {
- this.mMetaTileEntity.onOpenGUI();
- }
- }
-
- @Override
- public boolean outputsEnergyTo(final byte aSide) {
- if (aSide == 6) {
- return true;
- }
- if (this.isServerSide()) {
- return (aSide >= 0 && aSide < 6 ? this.mActiveEUOutputs[aSide] : false) || this.mReleaseEnergy;
- }
- return this.isEnergyOutputSide(aSide);
- }
-
- public boolean playerOwnsThis(final EntityPlayer aPlayer, final boolean aCheckPrecicely) {
- if (!this.canAccessData()) {
- return false;
- }
- if (aCheckPrecicely || this.privateAccess() || this.mOwnerName.equals("")) {
- if (this.mOwnerName.equals("") && this.isServerSide()) {
- this.setOwnerName(aPlayer.getDisplayName());
- }
- else if (this.privateAccess() && !aPlayer.getDisplayName().equals("Player")
- && !this.mOwnerName.equals("Player") && !this.mOwnerName.equals(aPlayer.getDisplayName())) {
- return false;
- }
- }
- return true;
- }
-
- public boolean privateAccess() {
- if (!this.canAccessData()) {
- return this.mLockUpgrade;
- }
- return this.mLockUpgrade || this.mMetaTileEntity.ownerControl();
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound aNBT) {
- super.readFromNBT(aNBT);
- this.setInitialValuesAsNBT(aNBT, (short) 0);
- }
-
- @Override
- public boolean receiveClientEvent(final int aEventID, int aValue) {
- super.receiveClientEvent(aEventID, aValue);
-
- if (this.hasValidMetaTileEntity()) {
- try {
- this.mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue);
- }
- catch (final 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 immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- if (this.isClientSide()) {
- this.issueTextureUpdate();
- switch (aEventID) {
- case 0:
- this.mFacing = (byte) (aValue & 7);
- this.mActive = (aValue & 8) != 0;
- this.mRedstone = (aValue & 16) != 0;
- // mLockUpgrade = ((aValue&32) != 0);
- break;
- case 1:
- if (this.hasValidMetaTileEntity()) {
- this.mMetaTileEntity.onValueUpdate((byte) aValue);
- }
- break;
- case 2:
- if (aValue > 16 || aValue < 0) {
- aValue = 0;
- }
- this.mColor = (byte) aValue;
- break;
- case 3:
- this.mSidedRedstone[0] = (byte) ((aValue & 1) > 0 ? 15 : 0);
- this.mSidedRedstone[1] = (byte) ((aValue & 2) > 0 ? 15 : 0);
- this.mSidedRedstone[2] = (byte) ((aValue & 4) > 0 ? 15 : 0);
- this.mSidedRedstone[3] = (byte) ((aValue & 8) > 0 ? 15 : 0);
- this.mSidedRedstone[4] = (byte) ((aValue & 16) > 0 ? 15 : 0);
- this.mSidedRedstone[5] = (byte) ((aValue & 32) > 0 ? 15 : 0);
- break;
- case 4:
- if (this.hasValidMetaTileEntity() && this.mTickTimer > 20) {
- this.mMetaTileEntity.doSound((byte) aValue, this.xCoord + 0.5, this.yCoord + 0.5,
- this.zCoord + 0.5);
- }
- break;
- case 5:
- if (this.hasValidMetaTileEntity() && this.mTickTimer > 20) {
- this.mMetaTileEntity.startSoundLoop((byte) aValue, this.xCoord + 0.5, this.yCoord + 0.5,
- this.zCoord + 0.5);
- }
- break;
- case 6:
- if (this.hasValidMetaTileEntity() && this.mTickTimer > 20) {
- this.mMetaTileEntity.stopSoundLoop((byte) aValue, this.xCoord + 0.5, this.yCoord + 0.5,
- this.zCoord + 0.5);
- }
- break;
- case 7:
- this.mLightValue = (byte) aValue;
- break;
- }
- }
- return true;
- }
-
- public final void receiveMetaTileEntityData(final short aID, final int aCover0, final int aCover1,
- final int aCover2, final int aCover3, final int aCover4, final int aCover5, final byte aTextureData,
- final byte aUpdateData, final byte aRedstoneData, final byte aColorData) {
- this.issueTextureUpdate();
- if (this.mID != aID && aID > 0) {
- this.mID = aID;
- this.createNewMetatileEntity(this.mID);
- }
-
- this.mCoverSides[0] = aCover0;
- this.mCoverSides[1] = aCover1;
- this.mCoverSides[2] = aCover2;
- this.mCoverSides[3] = aCover3;
- this.mCoverSides[4] = aCover4;
- this.mCoverSides[5] = aCover5;
-
- for (byte i = 0; i < 6; i++) {
- this.mCoverBehaviors[i] = GregTech_API.getCoverBehavior(this.mCoverSides[i]);
- }
-
- this.receiveClientEvent(0, aTextureData);
- this.receiveClientEvent(1, aUpdateData);
- this.receiveClientEvent(2, aColorData);
- this.receiveClientEvent(3, aRedstoneData);
- }
-
- @Override
- public void setActive(final boolean aActive) {
- this.mActive = aActive;
- }
-
- @Override
- public byte setColorization(byte aColor) {
- if (aColor > 15 || aColor < -1) {
- aColor = -1;
- }
- if (this.canAccessData()) {
- this.mMetaTileEntity.onColorChangeServer(aColor);
- }
- return this.mColor = (byte) (aColor + 1);
- }
-
- @Override
- public void setCoverDataAtSide(final byte aSide, final int aData) {
- if (aSide >= 0 && aSide < 6) {
- this.mCoverData[aSide] = aData;
- }
- }
-
- @Override
- public void setCoverIDAtSide(final byte aSide, final int aID) {
- if (aSide >= 0 && aSide < 6) {
- this.mCoverSides[aSide] = aID;
- this.mCoverData[aSide] = 0;
- this.mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
- this.issueCoverUpdate(aSide);
- this.issueBlockUpdate();
- }
- }
-
- @Override
- public void setCoverItemAtSide(final byte aSide, final ItemStack aCover) {
- GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
- }
-
- @Override
- public void setErrorDisplayID(final int aErrorID) {
- this.mDisplayErrorCode = aErrorID;
- }
-
- @Override
- public void setFrontFacing(final byte aFacing) {
- if (this.isValidFacing(aFacing)) {
- this.mFacing = aFacing;
- this.mMetaTileEntity.onFacingChange();
- this.onMachineBlockUpdate();
- }
- }
-
- @Override
- public void setGenericRedstoneOutput(final boolean aOnOff) {
- this.mRedstone = aOnOff;
- }
-
- @Override
- public void setInitialValuesAsNBT(final NBTTagCompound aNBT, final short aID) {
- if (aNBT == null) {
- if (aID > 0) {
- this.mID = aID;
- }
- else {
- this.mID = this.mID > 0 ? this.mID : 0;
- }
- if (this.mID != 0) {
- this.createNewMetatileEntity(this.mID);
- }
- this.mSidedRedstone = this.hasValidMetaTileEntity() && this.mMetaTileEntity.hasSidedRedstoneOutputBehavior()
- ? new byte[] {
- 0, 0, 0, 0, 0, 0
- } : new byte[] {
- 15, 15, 15, 15, 15, 15
- };
- }
- else {
- if (aID <= 0) {
- this.mID = (short) aNBT.getInteger("mID");
- }
- else {
- this.mID = aID;
- }
- this.mStoredSteam = aNBT.getInteger("mStoredSteam");
- this.mStoredEnergy = aNBT.getInteger("mStoredEnergy");
- this.mColor = aNBT.getByte("mColor");
- this.mLightValue = aNBT.getByte("mLightValue");
- this.mWorkData = aNBT.getByte("mWorkData");
- this.mStrongRedstone = aNBT.getByte("mStrongRedstone");
- this.mFacing = this.oFacing = (byte) aNBT.getShort("mFacing");
- this.mOwnerName = aNBT.getString("mOwnerName");
- this.mLockUpgrade = aNBT.getBoolean("mLockUpgrade");
- this.mMuffler = aNBT.getBoolean("mMuffler");
- this.mSteamConverter = aNBT.getBoolean("mSteamConverter");
- this.mActive = aNBT.getBoolean("mActive");
- this.mRedstone = aNBT.getBoolean("mRedstone");
- this.mWorks = !aNBT.getBoolean("mWorks");
- this.mInputDisabled = aNBT.getBoolean("mInputDisabled");
- this.mOutputDisabled = aNBT.getBoolean("mOutputDisabled");
- this.mOtherUpgrades = (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries")
- + aNBT.getByte("mLiBatteries"));
- this.mCoverSides = aNBT.getIntArray("mCoverSides");
- this.mCoverData = aNBT.getIntArray("mCoverData");
- this.mSidedRedstone = aNBT.getByteArray("mRedstoneSided");
- this.mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
-
- if (this.mCoverData.length != 6) {
- this.mCoverData = new int[] {
- 0, 0, 0, 0, 0, 0
- };
- }
- if (this.mCoverSides.length != 6) {
- this.mCoverSides = new int[] {
- 0, 0, 0, 0, 0, 0
- };
- }
- if (this.mSidedRedstone.length != 6) {
- if (this.hasValidMetaTileEntity() && this.mMetaTileEntity.hasSidedRedstoneOutputBehavior()) {
- this.mSidedRedstone = new byte[] {
- 0, 0, 0, 0, 0, 0
- };
- }
- else {
- this.mSidedRedstone = new byte[] {
- 15, 15, 15, 15, 15, 15
- };
- }
- }
-
- for (byte i = 0; i < 6; i++) {
- this.mCoverBehaviors[i] = GregTech_API.getCoverBehavior(this.mCoverSides[i]);
- }
-
- if (this.mID != 0 && this.createNewMetatileEntity(this.mID)) {
- final NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
- for (int i = 0; i < tItemList.tagCount(); i++) {
- final NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
- final int tSlot = tTag.getInteger("IntSlot");
- if (tSlot >= 0 && tSlot < this.mMetaTileEntity.getRealInventory().length) {
- this.mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
- }
- }
-
- try {
- this.mMetaTileEntity.loadNBTData(aNBT);
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
- }
-
- if (this.mCoverData.length != 6) {
- this.mCoverData = new int[] {
- 0, 0, 0, 0, 0, 0
- };
- }
- if (this.mCoverSides.length != 6) {
- this.mCoverSides = new int[] {
- 0, 0, 0, 0, 0, 0
- };
- }
- if (this.mSidedRedstone.length != 6) {
- if (this.hasValidMetaTileEntity() && this.mMetaTileEntity.hasSidedRedstoneOutputBehavior()) {
- this.mSidedRedstone = new byte[] {
- 0, 0, 0, 0, 0, 0
- };
- }
- else {
- this.mSidedRedstone = new byte[] {
- 15, 15, 15, 15, 15, 15
- };
- }
- }
-
- for (byte i = 0; i < 6; i++) {
- this.mCoverBehaviors[i] = GregTech_API.getCoverBehavior(this.mCoverSides[i]);
- }
- }
-
- @Override
- public void setInternalOutputRedstoneSignal(final byte aSide, final byte aStrength) {
- if (!this.getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, this.getCoverIDAtSide(aSide),
- this.getCoverDataAtSide(aSide), this)) {
- this.setOutputRedstoneSignal(aSide, aStrength);
- }
- }
-
- @Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- this.mInventoryChanged = true;
- if (this.canAccessData()) {
- this.mMetaTileEntity.setInventorySlotContents(aIndex,
- this.worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
- }
- }
-
- @Override
- public void setItemCount(final int aCount) {
- if (this.canAccessData()) {
- this.mMetaTileEntity.setItemCount(aCount);
- }
- }
-
- @Override
- public void setLightValue(final byte aLightValue) {
- this.mLightValue = (byte) (aLightValue & 15);
- }
-
- @Override
- public void setMetaTileEntity(final IMetaTileEntity aMetaTileEntity) {
- this.mMetaTileEntity = (MetaTileEntity) aMetaTileEntity;
- }
-
- @Override
- public int setMetaTileID(final short aID) {
- return this.mID = aID;
- }
-
- @Override
- public void setOutputRedstoneSignal(final byte aSide, byte aStrength) {
- aStrength = (byte) Math.min(Math.max(0, aStrength), 15);
- if (aSide >= 0 && aSide < 6 && this.mSidedRedstone[aSide] != aStrength) {
- this.mSidedRedstone[aSide] = aStrength;
- this.issueBlockUpdate();
- }
- }
-
- @Override
- public String setOwnerName(final String aName) {
- if (GT_Utility.isStringInvalid(aName)) {
- return this.mOwnerName = "Player";
- }
- return this.mOwnerName = aName;
- }
-
- public void setStored(final int aEU) {
- if (this.canAccessData()) {
- this.setStoredEU(aEU);
- }
- }
-
- public boolean setStoredEU(long aEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- if (aEnergy < 0) {
- aEnergy = 0;
- }
- this.mMetaTileEntity.setEUVar(aEnergy);
- return true;
- }
-
- public boolean setStoredSteam(long aEnergy) {
- if (!this.canAccessData()) {
- return false;
- }
- if (aEnergy < 0) {
- aEnergy = 0;
- }
- this.mMetaTileEntity.setSteamVar(aEnergy);
- return true;
- }
-
- @Override
- public void setStrongOutputRedstoneSignal(final byte aSide, final byte aStrength) {
- this.mStrongRedstone |= 1 << aSide;
- this.setOutputRedstoneSignal(aSide, aStrength);
- }
-
- @Override
- public void setWorkDataValue(final byte aValue) {
- this.mWorkData = aValue;
- }
-
- @Override
- public void updateEntity() {
- super.updateEntity();
-
- if (!this.hasValidMetaTileEntity()) {
- if (this.mMetaTileEntity == null) {
- return;
- }
- this.mMetaTileEntity.setBaseMetaTileEntity(this);
- }
-
- this.mRunningThroughTick = true;
- long tTime = System.currentTimeMillis();
-
- for (int tCode = 0; this.hasValidMetaTileEntity() && tCode >= 0;) {
- try {
- switch (tCode) {
- case 0:
- tCode++;
- if (this.mTickTimer++ == 0) {
- this.oX = this.xCoord;
- this.oY = this.yCoord;
- this.oZ = this.zCoord;
- if (this.isServerSide()) {
- for (byte i = 0; i < 6; i++) {
- if (this.getCoverIDAtSide(i) != 0) {
- if (!this.mMetaTileEntity.allowCoverOnSide(i,
- new GT_ItemStack(this.getCoverIDAtSide(i)))) {
- this.dropCover(i, i, true);
- }
- }
- }
- }
-
- this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
-
- this.mMetaTileEntity.onFirstTick(this);
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- }
- case 1:
- tCode++;
- if (this.isClientSide()) {
- if (this.mColor != this.oColor) {
- this.mMetaTileEntity.onColorChangeClient(this.oColor = this.mColor);
- this.issueTextureUpdate();
- }
-
- if (this.mLightValue != this.oLightValueClient) {
- this.worldObj.setLightValue(EnumSkyBlock.Block, this.xCoord, this.yCoord, this.zCoord,
- this.mLightValue);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord + 1, this.yCoord,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord - 1, this.yCoord,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord + 1,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord - 1,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord + 1);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord - 1);
- this.oLightValueClient = this.mLightValue;
- this.issueTextureUpdate();
- }
-
- if (this.mNeedsUpdate) {
- this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
- // worldObj.func_147479_m(xCoord, yCoord,
- // zCoord);
- this.mNeedsUpdate = false;
- }
- }
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- if (this.isServerSide() && this.mTickTimer > 10) {
- for (byte i = (byte) (tCode - 2); i < 6; i++) {
- if (this.getCoverIDAtSide(i) != 0) {
- tCode++;
- final GT_CoverBehavior tCover = this.getCoverBehaviorAtSide(i);
- final int tCoverTickRate = tCover.getTickRate(i, this.getCoverIDAtSide(i),
- this.mCoverData[i], this);
- if (tCoverTickRate > 0 && this.mTickTimer % tCoverTickRate == 0) {
- this.mCoverData[i] = tCover.doCoverThings(i, this.getInputRedstoneSignal(i),
- this.getCoverIDAtSide(i), this.mCoverData[i], this, this.mTickTimer);
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- }
- }
- }
-
- }
- case 8:
- tCode = 9;
- if (this.isServerSide()) {
- if (++this.mAverageEUInputIndex >= this.mAverageEUInput.length) {
- this.mAverageEUInputIndex = 0;
- }
- if (++this.mAverageEUOutputIndex >= this.mAverageEUOutput.length) {
- this.mAverageEUOutputIndex = 0;
- }
-
- this.mAverageEUInput[this.mAverageEUInputIndex] = 0;
- this.mAverageEUOutput[this.mAverageEUOutputIndex] = 0;
- }
- case 9:
- tCode++;
- this.mMetaTileEntity.onPreTick(this, this.mTickTimer);
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- case 10:
- tCode++;
- if (this.isServerSide()) {
- if (this.mRedstone != this.oRedstone || this.mTickTimer == 10) {
- for (byte i = 0; i < 6; i++) {
- this.mCoverBehaviors[i] = GregTech_API.getCoverBehavior(this.mCoverSides[i]);
- }
- this.oRedstone = this.mRedstone;
- this.issueBlockUpdate();
- }
-
- if (this.xCoord != this.oX || this.yCoord != this.oY || this.zCoord != this.oZ) {
- this.oX = this.xCoord;
- this.oY = this.yCoord;
- this.oZ = this.zCoord;
- this.issueClientUpdate();
- this.clearTileEntityBuffer();
- }
-
- if (this.mFacing != this.oFacing) {
- this.oFacing = this.mFacing;
- for (byte i = 0; i < 6; i++) {
- if (this.getCoverIDAtSide(i) != 0) {
- if (!this.mMetaTileEntity.allowCoverOnSide(i,
- new GT_ItemStack(this.getCoverIDAtSide(i)))) {
- this.dropCover(i, i, true);
- }
- }
- }
- this.issueBlockUpdate();
- }
-
- if (this.mTickTimer > 20 && this.mMetaTileEntity.isElectric()) {
- this.mAcceptedAmperes = 0;
-
- if (this.getOutputVoltage() != this.oOutput) {
- this.oOutput = this.getOutputVoltage();
- }
-
- if (this.mMetaTileEntity.isEnetOutput() || this.mMetaTileEntity.isEnetInput()) {
- for (byte i = 0; i < 6; i++) {
- boolean temp = this.isEnergyInputSide(i);
- if (temp != this.mActiveEUInputs[i]) {
- this.mActiveEUInputs[i] = temp;
- }
- temp = this.isEnergyOutputSide(i);
- if (temp != this.mActiveEUOutputs[i]) {
- this.mActiveEUOutputs[i] = temp;
- }
- }
- }
-
- if (this.mMetaTileEntity.isEnetOutput() && this.oOutput > 0) {
- final long tOutputVoltage = this.oOutput,
- tUsableAmperage = Math
- .min(this.getOutputAmperage(),
- (this.getStoredEU()
- - this.mMetaTileEntity.getMinimumStoredEU())
- / tOutputVoltage);
- if (tUsableAmperage > 0) {
- final long tEU = tOutputVoltage * IEnergyConnected.Util
- .emitEnergyToNetwork(this.oOutput, tUsableAmperage, this);
- this.mAverageEUOutput[this.mAverageEUOutputIndex] += tEU;
- this.decreaseStoredEU(tEU, true);
- }
- }
-
- if (this.getEUCapacity() > 0) {
- if (GregTech_API.sMachineFireExplosions && this.getRandomNumber(1000) == 0) {
- final Block tBlock = this.getBlockAtSide((byte) this.getRandomNumber(6));
- if (tBlock != null && tBlock instanceof BlockFire) {
- this.doEnergyExplosion();
- }
- }
-
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
-
- if (this.getRandomNumber(1000) == 0) {
- if (this.getCoverIDAtSide((byte) 1) == 0
- && this.worldObj.getPrecipitationHeight(this.xCoord, this.zCoord)
- - 2 < this.yCoord
- || this.getCoverIDAtSide((byte) 2) == 0
- && this.worldObj.getPrecipitationHeight(this.xCoord,
- this.zCoord - 1) - 1 < this.yCoord
- || this.getCoverIDAtSide((byte) 3) == 0
- && this.worldObj.getPrecipitationHeight(this.xCoord,
- this.zCoord + 1) - 1 < this.yCoord
- || this.getCoverIDAtSide((byte) 4) == 0
- && this.worldObj.getPrecipitationHeight(this.xCoord - 1,
- this.zCoord) - 1 < this.yCoord
- || this.getCoverIDAtSide((byte) 5) == 0
- && this.worldObj.getPrecipitationHeight(this.xCoord + 1,
- this.zCoord) - 1 < this.yCoord) {
- if (GregTech_API.sMachineRainExplosions && this.worldObj.isRaining()
- && this.getBiome().rainfall > 0) {
- if (this.getRandomNumber(10) == 0) {
- try {
- GT_Mod.achievements.issueAchievement(this.getWorldObj()
- .getPlayerEntityByName(this.mOwnerName), "badweather");
- }
- catch (final Exception e) {
- }
- this.doEnergyExplosion();
- }
- else {
- this.setOnFire();
- }
- }
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- if (GregTech_API.sMachineThunderExplosions && this.worldObj.isThundering()
- && this.getBiome().rainfall > 0 && this.getRandomNumber(3) == 0) {
- try {
- GT_Mod.achievements.issueAchievement(
- this.getWorldObj().getPlayerEntityByName(this.mOwnerName),
- "badweather");
- }
- catch (final Exception e) {
- }
- this.doEnergyExplosion();
- }
- }
- }
- }
- }
-
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- }
- case 11:
- tCode++;
- if (this.isServerSide()) {
- if (this.mMetaTileEntity.dechargerSlotCount() > 0
- && this.getStoredEU() < this.getEUCapacity()) {
- for (int i = this.mMetaTileEntity.dechargerSlotStartIndex(), k = this.mMetaTileEntity
- .dechargerSlotCount() + i; i < k; i++) {
- if (this.mMetaTileEntity.mInventory[i] != null
- && this.getStoredEU() < this.getEUCapacity()) {
- this.dischargeItem(this.mMetaTileEntity.mInventory[i]);
- if (this.mMetaTileEntity.mInventory[i].stackSize <= 0) {
- this.mMetaTileEntity.mInventory[i] = null;
- }
- this.mInventoryChanged = true;
- }
- }
- }
- }
- case 12:
- tCode++;
- if (this.isServerSide()) {
- if (this.mMetaTileEntity.rechargerSlotCount() > 0 && this.getStoredEU() > 0) {
- for (int i = this.mMetaTileEntity.rechargerSlotStartIndex(), k = this.mMetaTileEntity
- .rechargerSlotCount() + i; i < k; i++) {
- if (this.getStoredEU() > 0 && this.mMetaTileEntity.mInventory[i] != null) {
- this.chargeItem(this.mMetaTileEntity.mInventory[i]);
- if (this.mMetaTileEntity.mInventory[i].stackSize <= 0) {
- this.mMetaTileEntity.mInventory[i] = null;
- }
- this.mInventoryChanged = true;
- }
- }
- }
- }
- case 13:
- tCode++;
- this.updateStatus();
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- case 14:
- tCode++;
- this.mMetaTileEntity.onPostTick(this, this.mTickTimer);
- if (!this.hasValidMetaTileEntity()) {
- this.mRunningThroughTick = false;
- return;
- }
- case 15:
- tCode++;
- if (this.isServerSide()) {
- if (this.mTickTimer % 10 == 0) {
- if (this.mSendClientData) {
- GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_TileEntity(
- this.xCoord, (short) this.yCoord, this.zCoord, this.mID,
- this.mCoverSides[0], this.mCoverSides[1], this.mCoverSides[2],
- this.mCoverSides[3], this.mCoverSides[4], this.mCoverSides[5],
- this.oTextureData = (byte) (this.mFacing & 7 | (this.mActive ? 8 : 0)
- | (this.mRedstone ? 16 : 0) | (this.mLockUpgrade ? 32 : 0)),
- this.oUpdateData = this.hasValidMetaTileEntity()
- ? this.mMetaTileEntity.getUpdateData() : 0,
- this.oRedstoneData = (byte) ((this.mSidedRedstone[0] > 0 ? 1 : 0)
- | (this.mSidedRedstone[1] > 0 ? 2 : 0)
- | (this.mSidedRedstone[2] > 0 ? 4 : 0)
- | (this.mSidedRedstone[3] > 0 ? 8 : 0)
- | (this.mSidedRedstone[4] > 0 ? 16 : 0)
- | (this.mSidedRedstone[5] > 0 ? 32 : 0)),
- this.oColor = this.mColor), this.xCoord, this.zCoord);
- this.mSendClientData = false;
- }
- }
-
- if (this.mTickTimer > 10) {
- byte tData = (byte) (this.mFacing & 7 | (this.mActive ? 8 : 0)
- | (this.mRedstone ? 16 : 0) | (this.mLockUpgrade ? 32 : 0));
- if (tData != this.oTextureData) {
- this.sendBlockEvent((byte) 0, this.oTextureData = tData);
- }
- tData = this.mMetaTileEntity.getUpdateData();
- if (tData != this.oUpdateData) {
- this.sendBlockEvent((byte) 1, this.oUpdateData = tData);
- }
- if (this.mColor != this.oColor) {
- this.sendBlockEvent((byte) 2, this.oColor = this.mColor);
- }
- tData = (byte) ((this.mSidedRedstone[0] > 0 ? 1 : 0)
- | (this.mSidedRedstone[1] > 0 ? 2 : 0) | (this.mSidedRedstone[2] > 0 ? 4 : 0)
- | (this.mSidedRedstone[3] > 0 ? 8 : 0) | (this.mSidedRedstone[4] > 0 ? 16 : 0)
- | (this.mSidedRedstone[5] > 0 ? 32 : 0));
- if (tData != this.oRedstoneData) {
- this.sendBlockEvent((byte) 3, this.oRedstoneData = tData);
- }
- if (this.mLightValue != this.oLightValue) {
- this.worldObj.setLightValue(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord, this.mLightValue);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord + 1, this.yCoord,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord - 1, this.yCoord,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord + 1,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord - 1,
- this.zCoord);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord + 1);
- this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord,
- this.zCoord - 1);
- this.issueTextureUpdate();
- this.sendBlockEvent((byte) 7, this.oLightValue = this.mLightValue);
- }
- }
-
- if (this.mNeedsBlockUpdate) {
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord,
- this.getBlockOffset(0, 0, 0));
- this.mNeedsBlockUpdate = false;
- }
- }
- default:
- tCode = -1;
- break;
- }
- }
- catch (final Throwable e) {
- GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1)
- + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- if (this.isServerSide() && this.hasValidMetaTileEntity()) {
- tTime = System.currentTimeMillis() - tTime;
- if (this.mTimeStatistics.length > 0) {
- this.mTimeStatistics[this.mTimeStatisticsIndex = (this.mTimeStatisticsIndex + 1)
- % this.mTimeStatistics.length] = (int) tTime;
- }
- if (tTime > 0 && tTime > GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING && this.mTickTimer > 1000
- && this.getMetaTileEntity().doTickProfilingMessageDuringThisTick()
- && this.mLagWarningCount++ < 10) {
- System.out.println("WARNING: Possible Lag Source at [" + this.xCoord + ", " + this.yCoord + ", "
- + this.zCoord + "] in Dimension " + this.worldObj.provider.dimensionId + " with " + tTime
- + "ms caused by an instance of " + this.getMetaTileEntity().getClass());
- }
- }
-
- this.mWorkUpdate = this.mInventoryChanged = this.mRunningThroughTick = false;
- }
-
- /**
- * Used for ticking special BaseMetaTileEntities, which need that for Energy
- * Conversion It's called right before onPostTick()
- */
- public void updateStatus() {
- //
- }
-
- @Override
- public void validate() {
- super.validate();
- this.mTickTimer = 0;
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound aNBT) {
- try {
- super.writeToNBT(aNBT);
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- try {
- aNBT.setInteger("mID", this.mID);
- aNBT.setLong("mStoredSteam", this.mStoredSteam);
- aNBT.setLong("mStoredEnergy", this.mStoredEnergy);
- aNBT.setIntArray("mCoverData", this.mCoverData);
- aNBT.setIntArray("mCoverSides", this.mCoverSides);
- aNBT.setByteArray("mRedstoneSided", this.mSidedRedstone);
- aNBT.setByte("mColor", this.mColor);
- aNBT.setByte("mLightValue", this.mLightValue);
- aNBT.setByte("mOtherUpgrades", this.mOtherUpgrades);
- aNBT.setByte("mWorkData", this.mWorkData);
- aNBT.setByte("mStrongRedstone", this.mStrongRedstone);
- aNBT.setShort("mFacing", this.mFacing);
- aNBT.setString("mOwnerName", this.mOwnerName);
- aNBT.setBoolean("mLockUpgrade", this.mLockUpgrade);
- aNBT.setBoolean("mMuffler", this.mMuffler);
- aNBT.setBoolean("mSteamConverter", this.mSteamConverter);
- aNBT.setBoolean("mActive", this.mActive);
- aNBT.setBoolean("mRedstone", this.mRedstone);
- aNBT.setBoolean("mWorks", !this.mWorks);
- aNBT.setBoolean("mInputDisabled", this.mInputDisabled);
- aNBT.setBoolean("mOutputDisabled", this.mOutputDisabled);
- aNBT.setTag("GT.CraftingComponents", this.mRecipeStuff);
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- try {
- if (this.hasValidMetaTileEntity()) {
- final NBTTagList tItemList = new NBTTagList();
- for (int i = 0; i < this.mMetaTileEntity.getRealInventory().length; i++) {
- final ItemStack tStack = this.mMetaTileEntity.getRealInventory()[i];
- if (tStack != null) {
- final NBTTagCompound tTag = new NBTTagCompound();
- tTag.setInteger("IntSlot", i);
- tStack.writeToNBT(tTag);
- tItemList.appendTag(tTag);
- }
- }
- aNBT.setTag("Inventory", tItemList);
-
- try {
- this.mMetaTileEntity.saveNBTData(aNBT);
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- catch (final Throwable e) {
- GT_Log.err.println(
- "Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
+ }*/
+ if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) {
+ if (addMufflerUpgrade()) {
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1, xCoord, yCoord, zCoord);
+ if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--;
+ }
+ return true;
+ }
+ if (ItemList.Upgrade_Lock.isStackEqual(aPlayer.inventory.getCurrentItem())) {
+ if (isUpgradable() && !mLockUpgrade) {
+ mLockUpgrade = true;
+ setOwnerName(aPlayer.getDisplayName());
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(3), 1.0F, -1, xCoord, yCoord, zCoord);
+ if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--;
+ }
+ return true;
+ }
+ }
+ }
+ }
+
+ try {
+ if (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 immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+
+ return true;
+ }
+
+ @Override
+ public void onLeftclick(EntityPlayer aPlayer) {
+ 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 immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @Override
+ public boolean isDigitalChest() {
+ if (canAccessData()) return mMetaTileEntity.isDigitalChest();
+ return false;
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData() {
+ if (canAccessData()) return mMetaTileEntity.getStoredItemData();
+ return null;
+ }
+
+ @Override
+ public void setItemCount(int aCount) {
+ if (canAccessData()) mMetaTileEntity.setItemCount(aCount);
+ }
+
+ @Override
+ public int getMaxItemCount() {
+ if (canAccessData()) return mMetaTileEntity.getMaxItemCount();
+ return 0;
+ }
+
+ /**
+ * Can put aStack into Slot
+ */
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ /**
+ * returns all valid Inventory Slots, no matter which Side (Unless it's covered).
+ * The Side Stuff is done in the following two Functions.
+ */
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ if (canAccessData() && (getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this)))
+ return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
+ return new int[0];
+ }
+
+ /**
+ * Can put aStack into Slot at Side
+ */
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return canAccessData() && (mRunningThroughTick || !mInputDisabled) && getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
+ }
+
+ /**
+ * Can pull aStack out of Slot from Side
+ */
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return canAccessData() && (mRunningThroughTick || !mOutputDisabled) && getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean isUpgradable() {
+ return canAccessData() && getUpgradeCount() < 8;
+ }
+
+ @Override
+ public byte getInternalInputRedstoneSignal(byte aSide) {
+ return (byte) (getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) & 15);
+ }
+
+ @Override
+ public byte getInputRedstoneSignal(byte aSide) {
+ return (byte) (worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide) & 15);
+ }
+
+ @Override
+ public byte getOutputRedstoneSignal(byte aSide) {
+ return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : 0;
+// return (byte)(getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (mRedstone && getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))?mSidedRedstone[aSide]&15:0);
+ }
+
+ @Override
+ public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) {
+ if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ setOutputRedstoneSignal(aSide, aStrength);
+ }
+
+ @Override
+ public void setOutputRedstoneSignal(byte aSide, byte aStrength) {
+ aStrength = (byte) Math.min(Math.max(0, aStrength), 15);
+ if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) {
+ mSidedRedstone[aSide] = aStrength;
+ issueBlockUpdate();
+ }
+ }
+
+ @Override
+ public boolean isSteamEngineUpgradable() {
+ return isUpgradable() && !hasSteamEngineUpgrade() && getSteamCapacity() > 0;
+ }
+
+ @Override
+ public boolean addSteamEngineUpgrade() {
+ if (isSteamEngineUpgradable()) {
+ issueBlockUpdate();
+ mSteamConverter = true;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean hasSteamEngineUpgrade() {
+ if (canAccessData() && mMetaTileEntity.isSteampowered()) return true;
+ return mSteamConverter;
+ }
+
+ @Override
+ public boolean hasMufflerUpgrade() {
+ return mMuffler;
+ }
+
+ @Override
+ public boolean isMufflerUpgradable() {
+ return isUpgradable() && !hasMufflerUpgrade();
+ }
+
+ @Override
+ public boolean addMufflerUpgrade() {
+ if (isMufflerUpgradable()) return mMuffler = true;
+ return false;
+ }
+
+ @Override
+ public boolean hasInventoryBeenModified() {
+ return mInventoryChanged;
+ }
+
+ @Override
+ public void setGenericRedstoneOutput(boolean aOnOff) {
+ mRedstone = aOnOff;
+ }
+
+ @Override
+ public int getErrorDisplayID() {
+ return mDisplayErrorCode;
+ }
+
+ @Override
+ public void setErrorDisplayID(int aErrorID) {
+ mDisplayErrorCode = aErrorID;
+ }
+
+ @Override
+ public IMetaTileEntity getMetaTileEntity() {
+ return hasValidMetaTileEntity() ? mMetaTileEntity : null;
+ }
+
+ @Override
+ public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) {
+ mMetaTileEntity = (MetaTileEntity) aMetaTileEntity;
+ }
+
+ @Override
+ public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) {
+ return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior;
+ }
+
+ @Override
+ public void setCoverIDAtSide(byte aSide, int aID) {
+ if (aSide >= 0 && aSide < 6) {
+ mCoverSides[aSide] = aID;
+ mCoverData[aSide] = 0;
+ mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
+ issueCoverUpdate(aSide);
+ issueBlockUpdate();
+ }
+ }
+
+ @Override
+ public void setCoverItemAtSide(byte aSide, ItemStack aCover) {
+ GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
+ }
+
+ @Override
+ public int getCoverIDAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) return mCoverSides[aSide];
+ return 0;
+ }
+
+ @Override
+ public ItemStack getCoverItemAtSide(byte aSide) {
+ return GT_Utility.intToStack(getCoverIDAtSide(aSide));
+ }
+
+ @Override
+ public boolean canPlaceCoverIDAtSide(byte aSide, int aID) {
+ return getCoverIDAtSide(aSide) == 0;
+ }
+
+ @Override
+ public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) {
+ return getCoverIDAtSide(aSide) == 0;
+ }
+
+ @Override
+ public void setCoverDataAtSide(byte aSide, int aData) {
+ if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData;
+ }
+
+ @Override
+ public int getCoverDataAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) return mCoverData[aSide];
+ return 0;
+ }
+
+ public byte getLightValue() {
+ return mLightValue;
+ }
+
+ @Override
+ public void setLightValue(byte aLightValue) {
+ mLightValue = (byte) (aLightValue & 15);
+ }
+
+ @Override
+ public long getAverageElectricInput() {
+ int rEU = 0;
+ for (int tEU : mAverageEUInput) rEU += tEU;
+ return rEU / mAverageEUInput.length;
+ }
+
+ @Override
+ public long getAverageElectricOutput() {
+ int rEU = 0;
+ for (int tEU : mAverageEUOutput) rEU += tEU;
+ return rEU / mAverageEUOutput.length;
+ }
+
+ @Override
+ public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) {
+ if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) {
+ ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this);
+ if (tStack != null) {
+ tStack.setTagCompound(null);
+ 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;
+ worldObj.spawnEntityInWorld(tEntity);
+ }
+ setCoverIDAtSide(aSide, 0);
+ if (mMetaTileEntity.hasSidedRedstoneOutputBehavior()) {
+ setOutputRedstoneSignal(aSide, (byte) 0);
+ } else {
+ setOutputRedstoneSignal(aSide, (byte) 15);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getOwnerName() {
+ if (GT_Utility.isStringInvalid(mOwnerName)) return "Player";
+ return mOwnerName;
+ }
+
+ @Override
+ public String setOwnerName(String aName) {
+ if (GT_Utility.isStringInvalid(aName)) return mOwnerName = "Player";
+ return mOwnerName = aName;
+ }
+
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return canAccessData() ? mMetaTileEntity.getComparatorValue(aSide) : 0;
+ }
+
+ @Override
+ public byte getStrongOutputRedstoneSignal(byte aSide) {
+ return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) : 0;
+ }
+
+ @Override
+ public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) {
+ mStrongRedstone |= (1 << aSide);
+ setOutputRedstoneSignal(aSide, aStrength);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ if (canAccessData()) {
+ mInventoryChanged = true;
+ return mMetaTileEntity.decrStackSize(aIndex, aAmount);
+ }
+ return null;
+ }
+
+ @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 (aVoltage > getInputVoltage()) {
+ doExplosion(aVoltage);
+ return 0;
+ }
+ 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;
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!canAccessData() || !mMetaTileEntity.isElectric() || !outputsEnergyTo(aSide) || getStoredEU() - (aVoltage * aAmperage) < mMetaTileEntity.getMinimumStoredEU())
+ return false;
+ if (decreaseStoredEU(aVoltage * aAmperage, false)) {
+ mAverageEUOutput[mAverageEUOutputIndex] += aVoltage * aAmperage;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
+ return mMetaTileEntity.acceptsRotationalEnergy(aSide);
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
+ return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (mTickTimer > 5 && canAccessData() && (mRunningThroughTick || !mInputDisabled) && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((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()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((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()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((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()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((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()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))))
+ return mMetaTileEntity.canDrain(aSide, aFluid);
+ return false;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (canAccessData() && (aSide == ForgeDirection.UNKNOWN || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this)) || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))))
+ return mMetaTileEntity.getTankInfo(aSide);
+ return new FluidTankInfo[]{};
+ }
+
+ public double getOutputEnergyUnitsPerTick() {
+ return oOutput;
+ }
+
+ public boolean isTeleporterCompatible(ForgeDirection aSide) {
+ return canAccessData() && mMetaTileEntity.isTeleporterCompatible();
+ }
+
+ public double demandedEnergyUnits() {
+ if (mReleaseEnergy || !canAccessData() || !mMetaTileEntity.isEnetInput()) return 0;
+ return getEUCapacity() - getStoredEU();
+ }
+
+ public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) {
+ return injectEnergyUnits((byte) aDirection.ordinal(), (int) aAmount, 1) > 0 ? 0 : aAmount;
+ }
+
+ public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) {
+ return inputEnergyFrom((byte) aDirection.ordinal());
+ }
+
+ public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) {
+ return outputsEnergyTo((byte) aDirection.ordinal());
+ }
+
+ public double getOfferedEnergy() {
+ return (canAccessData() && getStoredEU() - mMetaTileEntity.getMinimumStoredEU() >= oOutput) ? Math.max(0, oOutput) : 0;
+ }
+
+ public void drawEnergy(double amount) {
+ mAverageEUOutput[mAverageEUOutputIndex] += amount;
+ decreaseStoredEU((int) amount, true);
+ }
+
+ public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) {
+ return injectEnergyUnits((byte) aForgeDirection.ordinal(), aAmount, 1) > 0 ? 0 : aAmount;
+ }
+
+ public int addEnergy(int aEnergy) {
+ if (!canAccessData()) return 0;
+ if (aEnergy > 0)
+ increaseStoredEnergyUnits(aEnergy, true);
+ else
+ decreaseStoredEU(-aEnergy, true);
+ return (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getEUVar());
+ }
+
+ public boolean isAddedToEnergyNet() {
+ return false;
+ }
+
+ public int demandsEnergy() {
+ if (mReleaseEnergy || !canAccessData() || !mMetaTileEntity.isEnetInput()) return 0;
+ return getCapacity() - getStored();
+ }
+
+ public int getCapacity() {
+ return (int) Math.min(Integer.MAX_VALUE, getEUCapacity());
+ }
+
+ public int getStored() {
+ return (int) Math.min(Integer.MAX_VALUE, Math.min(getStoredEU(), getCapacity()));
+ }
+
+ public void setStored(int aEU) {
+ if (canAccessData()) setStoredEU(aEU);
+ }
+
+ public int getMaxSafeInput() {
+ return (int) Math.min(Integer.MAX_VALUE, getInputVoltage());
+ }
+
+ public int getMaxEnergyOutput() {
+ if (mReleaseEnergy) return Integer.MAX_VALUE;
+ return getOutput();
+ }
+
+ public int getOutput() {
+ return (int) Math.min(Integer.MAX_VALUE, oOutput);
+ }
+
+ public int injectEnergy(Direction aDirection, int aAmount) {
+ return injectEnergyUnits((byte) aDirection.toSideValue(), aAmount, 1) > 0 ? 0 : aAmount;
+ }
+
+ public boolean isTeleporterCompatible(Direction aSide) {
+ return canAccessData() && mMetaTileEntity.isTeleporterCompatible();
+ }
+
+ public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) {
+ return inputEnergyFrom((byte) aDirection.toSideValue());
+ }
+
+ public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {
+ return outputsEnergyTo((byte) aDirection.toSideValue());
+ }
+
+ @Override
+ public boolean isInvalidTileEntity() {
+ return isInvalid();
+ }
+
+ @Override
+ public boolean addStackToSlot(int aIndex, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return true;
+ if (aIndex < 0 || aIndex >= getSizeInventory()) return false;
+ ItemStack tStack = getStackInSlot(aIndex);
+ if (GT_Utility.isStackInvalid(tStack)) {
+ setInventorySlotContents(aIndex, aStack);
+ return true;
+ }
+ aStack = GT_OreDictUnificator.get(aStack);
+ if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
+ tStack.stackSize += aStack.stackSize;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) {
+ return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack));
+ }
+
+ @Override
+ public byte getColorization() {
+ return (byte) (mColor - 1);
+ }
+
+ @Override
+ public byte setColorization(byte aColor) {
+ if (aColor > 15 || aColor < -1) aColor = -1;
+ if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor);
+ return mColor = (byte) (aColor + 1);
+ }
+
+ @Override
+ public float getBlastResistance(byte aSide) {
+ return canAccessData() ? Math.max(0, getMetaTileEntity().getExplosionResistance(aSide)) : 10.0F;
+ }
+
+ @Override
+ public boolean isUniversalEnergyStored(long aEnergyAmount) {
+ if (getUniversalEnergyStored() >= aEnergyAmount) return true;
+ mHasEnoughEnergy = false;
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ {
+ if (canAccessData()) return getMetaTileEntity().getInfoData();
+ return new String[]{};
+ }
+ }
+
+ @Override
+ public void markDirty() {
+ super.markDirty();
+ mInventoryChanged = true;
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return mMetaTileEntity == null ? getLightValue() > 0 ? 0 : 255 : mMetaTileEntity.getLightOpacity();
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
+ }
+
+
+ public ITexture[] getTexture(Block arg0, byte aSide) {
+ ITexture rIcon = getCoverTexture(aSide);
+ if (rIcon != null) return new ITexture[]{rIcon};
+ if (hasValidMetaTileEntity())
+ return mMetaTileEntity.getTexture(this, aSide, mFacing, (byte) (mColor - 1), mActive, getOutputRedstoneSignal(aSide) > 0);
+ return Textures.BlockIcons.ERROR_RENDERING;
+ }
+
+ public ITexture[] getTexture(byte aSide) {
+ ITexture rIcon = getCoverTexture(aSide);
+ if (rIcon != null) return new ITexture[]{rIcon};
+ if (hasValidMetaTileEntity())
+ return mMetaTileEntity.getTexture(this, aSide, mFacing, (byte) (mColor - 1), mActive, getOutputRedstoneSignal(aSide) > 0);
+ return Textures.BlockIcons.ERROR_RENDERING;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java
index 0268ceeeca..47189bd4f4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java
@@ -1,18 +1,20 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Utility;
+
+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;
@@ -26,703 +28,613 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * Extend this Class to add a new MetaPipe Call the Constructor with the desired
- * ID at the load-phase (not preload and also not postload!) Implement the
- * newMetaEntity-Method to return a new ready instance of your MetaTileEntity
+ * Extend this Class to add a new MetaPipe
+ * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!)
+ * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity
* <p/>
- * Call the Constructor like the following example inside the Load Phase, to
- * register it. "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic
- * E-Furnace");"
+ * Call the Constructor like the following example inside the Load Phase, to register it.
+ * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");"
*/
public abstract class GregtechMetaPipeEntity_BaseSuperConductor implements IMetaTileEntity {
- /**
- * The Inventory of the MetaTileEntity. Amount of Slots can be larger than
- * 256. HAYO!
- */
- public final ItemStack[] mInventory;
- /**
- * This variable tells, which directions the Block is connected to. It is a
- * Bitmask.
- */
- public byte mConnections = 0;
- /**
- * 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
- */
- private IGregTechTileEntity mBaseMetaTileEntity;
-
- /**
- * This registers your Machine at the List. Use only ID's larger than 2048,
- * because i reserved these ones. See also the List in the API, as it has a
- * Description containing all the reservations.
- *
- * @param aID
- * the ID
- * @example for Constructor overload.
- * <p/>
- * public GT_MetaTileEntity_EBench(int aID, String mName, String
- * mNameRegional) { super(aID, mName, mNameRegional); }
- */
- public GregtechMetaPipeEntity_BaseSuperConductor(final int aID, final String aBasicName, final String aRegionalName,
- final int aInvSlotCount) {
- if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted) {
- throw new IllegalAccessError("This Constructor has to be called in the load Phase");
- }
- if (GregTech_API.METATILEENTITIES[aID] == null) {
- GregTech_API.METATILEENTITIES[aID] = this;
- }
- else {
- throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
- }
- this.mName = aBasicName.replaceAll(" ", "_").toLowerCase();
- this.setBaseMetaTileEntity(new BaseMetaPipeEntity());
- this.getBaseMetaTileEntity().setMetaTileID((short) aID);
- GT_LanguageManager.addStringLocalization("gt.blockmachines." + this.mName + ".name", aRegionalName);
- this.mInventory = new ItemStack[aInvSlotCount];
-
- if (GT_Values.GT.isClientSide()) {
- final ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
- tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
- }
- }
-
- /**
- * This is the normal Constructor.
- */
- public GregtechMetaPipeEntity_BaseSuperConductor(final String aName, final int aInvSlotCount) {
- this.mInventory = new ItemStack[aInvSlotCount];
- this.mName = aName;
- }
-
- @Override
- public boolean acceptsRotationalEnergy(final byte aSide) {
- return false;
- }
-
- @Override
- public void addCollisionBoxesToList(final World aWorld, final int aX, final int aY, final int aZ,
- final AxisAlignedBB inputAABB, final List<AxisAlignedBB> outputAABB, final Entity collider) {
- final AxisAlignedBB axisalignedbb1 = this.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) {
- outputAABB.add(axisalignedbb1);
- }
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
- return true;
- }
-
- @Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- return this.drain(aSide, new FluidStack(aFluid, 1), false) != null;
- }
-
- @Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- return this.isValidSlot(aIndex) && aStack != null && aIndex < this.mInventory.length
- && this.allowPullStack(this.getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- return this.fill(aSide, new FluidStack(aFluid, 1), false) == 1;
- }
-
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- return this.isValidSlot(aIndex) && aStack != null && aIndex < this.mInventory.length
- && (this.mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, this.mInventory[aIndex]))
- && this.allowPutStack(this.getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public void closeInventory() {
- //
- }
-
- @Override
- public boolean connectsToItemPipe(final byte aSide) {
- return false;
- }
-
- @Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final ItemStack tStack = this.getStackInSlot(aIndex);
- ItemStack rStack = GT_Utility.copy(tStack);
- if (tStack != null) {
- if (tStack.stackSize <= aAmount) {
- if (this.setStackToZeroInsteadOfNull(aIndex)) {
- tStack.stackSize = 0;
- }
- else {
- this.setInventorySlotContents(aIndex, null);
- }
- }
- else {
- rStack = tStack.splitStack(aAmount);
- if (tStack.stackSize == 0 && !this.setStackToZeroInsteadOfNull(aIndex)) {
- this.setInventorySlotContents(aIndex, null);
- }
- }
- }
- return rStack;
- }
-
- @Override
- public void doExplosion(final long aExplosionPower) {
- final float tStrength = aExplosionPower < GT_Values.V[0] ? 1.0F
- : aExplosionPower < GT_Values.V[1] ? 2.0F
- : aExplosionPower < GT_Values.V[2] ? 3.0F
- : aExplosionPower < GT_Values.V[3] ? 4.0F
- : aExplosionPower < GT_Values.V[4] ? 5.0F
- : aExplosionPower < GT_Values.V[4] * 2 ? 6.0F
- : aExplosionPower < GT_Values.V[5] ? 7.0F
- : aExplosionPower < GT_Values.V[6] ? 8.0F
- : aExplosionPower < GT_Values.V[7] ? 9.0F
- : 10.0F;
- final int tX = this.getBaseMetaTileEntity().getXCoord(), tY = this.getBaseMetaTileEntity().getYCoord(),
- tZ = this.getBaseMetaTileEntity().getZCoord();
- final World tWorld = this.getBaseMetaTileEntity().getWorld();
- tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions) {
- tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
- }
- }
-
- @Override
- public void doSound(final byte aIndex, final double aX, final double aY, final double aZ) {
- /* Do nothing */}
-
- @Override
- public boolean doTickProfilingMessageDuringThisTick() {
- return this.doTickProfilingInThisTick;
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- if (this.getFluid() != null && aFluid != null && this.getFluid().isFluidEqual(aFluid)) {
- return this.drain(aFluid.amount, doDrain);
- }
- return null;
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final int maxDrain, final boolean doDrain) {
- return this.drain(maxDrain, doDrain);
- }
-
- /**
- * tries to empty this Tank
- */
- @Override
- public FluidStack drain(final int maxDrain, final boolean doDrain) {
- return null;
- }
-
- /**
- * tries to fill this Tank
- */
- @Override
- public int fill(final FluidStack resource, final boolean doFill) {
- return 0;
- }
-
- @Override
- public int fill(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
- return this.fill_default(aSide, aFluid, doFill);
- }
-
- public int fill_default(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
- return this.fill(aFluid, doFill);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final ArrayList<Integer> tList = new ArrayList<Integer>();
- final IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity();
- final boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2,
- tTileEntity)
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2,
- tTileEntity);
- for (int i = 0; i < this.getSizeInventory(); i++) {
- if (this.isValidSlot(i) && (tSkip
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i,
- tTileEntity)
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i,
- tTileEntity))) {
- tList.add(i);
- }
- }
- final int[] rArray = new int[tList.size()];
- for (int i = 0; i < rArray.length; i++) {
- rArray[i] = tList.get(i);
- }
- return rArray;
- }
-
- @Override
- public IGregTechTileEntity getBaseMetaTileEntity() {
- return this.mBaseMetaTileEntity;
- }
-
- /**
- * Liquid Capacity
- */
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- }
-
- @Override
- public byte getComparatorValue(final byte aSide) {
- return 0;
- }
-
- @Override
- public float getExplosionResistance(final byte aSide) {
- return 10.0F;
- }
-
- /**
- * gets the contained Liquid
- */
- @Override
- public FluidStack getFluid() {
- return null;
- }
-
- @Override
- public int getFluidAmount() {
- return 0;
- }
-
- @Override
- public FluidTankInfo getInfo() {
- return new FluidTankInfo(this);
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] {};
- }
-
- @Override
- public String getInventoryName() {
- if (GregTech_API.METATILEENTITIES[this.getBaseMetaTileEntity().getMetaTileID()] != null) {
- return GregTech_API.METATILEENTITIES[this.getBaseMetaTileEntity().getMetaTileID()].getMetaName();
- }
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public int getLightOpacity() {
- return 0;
- }
-
- public int getMaxItemCount() {
- return 0;
- }
-
- @Override
- public String getMetaName() {
- return this.mName;
- }
-
- /**
- * Progress this machine has already made
- */
- public int getProgresstime() {
- return 0;
- }
-
- @Override
- public ItemStack[] getRealInventory() {
- return this.mInventory;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public int getSizeInventory() {
- return this.mInventory.length;
- }
-
- @Override
- public ArrayList<String> getSpecialDebugInfo(final IGregTechTileEntity aBaseMetaTileEntity,
- final EntityPlayer aPlayer, final int aLogLevel, final ArrayList<String> aList) {
- return aList;
- }
-
- @Override
- public String getSpecialVoltageToolTip() {
- return null;
- }
-
- @Override
- public ItemStack getStackForm(final long aAmount) {
- return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, this.getBaseMetaTileEntity().getMetaTileID());
- }
-
- @Override
- public ItemStack getStackInSlot(final int aIndex) {
- if (aIndex >= 0 && aIndex < this.mInventory.length) {
- return this.mInventory[aIndex];
- }
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int i) {
- return null;
- }
-
- public ItemStack[] getStoredItemData() {
- return null;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- if (this.getCapacity() <= 0 && !this.getBaseMetaTileEntity().hasSteamEngineUpgrade()) {
- return new FluidTankInfo[] {};
- }
- return new FluidTankInfo[] {
- this.getInfo()
- };
- }
-
- /**
- * Tank pressure
- */
- public int getTankPressure() {
- return 0;
- }
-
- /**
- * For Pipe Rendering
- */
- public abstract float getThickNess();
-
- @Override
- public byte getUpdateData() {
- return 0;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- /**
- * Increases the Progress, returns the overflown Progress.
- */
- public int increaseProgress(final int aProgress) {
- return 0;
- }
-
- @Override
- public void initDefaultModes(final NBTTagCompound aNBT) {
- /* Do nothing */}
-
- public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- return 0;
- }
-
- @Override
- public boolean injectRotationalEnergy(final byte aSide, final long aSpeed, final long aEnergy) {
- return false;
- }
-
- @Override
- public void inValidate() {
- /* Do nothing */}
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- public boolean isDigitalChest() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isGivingInformation() {
- return false;
- }
-
- @Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- return this.getBaseMetaTileEntity().isValidSlot(aIndex);
- }
-
- @Override
- public boolean isLiquidInput(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isLiquidOutput(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public void markDirty() {
- //
- }
-
- /**
- * Progress this Machine has to do to produce something
- */
- public int maxProgresstime() {
- return 0;
- }
-
- /**
- * When a GUI is closed
- */
- public void onCloseGUI() {
- /* Do nothing */}
-
- @Override
- public void onColorChangeClient(final byte aColor) {
- //
- }
-
- @Override
- public void onColorChangeServer(final byte aColor) {
- //
- }
-
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- /* Do nothing */}
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- //
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity collider) {
- //
- }
-
- @Override
- public void onExplosion() {
- /* Do nothing */}
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- /* Do nothing */}
-
- @Override
- public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- /* Do nothing */}
-
- @Override
- public void onMachineBlockUpdate() {
- /* Do nothing */}
-
- /**
- * When a GUI is opened
- */
- public void onOpenGUI() {
- /* Do nothing */}
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- /* Do nothing */}
-
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- /* Do nothing */}
-
- @Override
- public void onRemoval() {
- /* Do nothing */}
-
- /**
- * a Player rightclicks the Machine Sneaky rightclicks are not getting
- * passed to this!
- */
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer,
- final byte aSide, final float aX, final float aY, final float aZ) {
- return false;
- }
-
- @Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- /* Do nothing */}
-
- @Override
- public void onServerStart() {
- /* Do nothing */}
-
- @Override
- public void onValueUpdate(final byte aValue) {
- /* Do nothing */}
-
- @Override
- public void onWorldLoad(final File aSaveDirectory) {
- /* Do nothing */}
-
- @Override
- public void onWorldSave(final File aSaveDirectory) {
- /* Do nothing */}
-
- @Override
- public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer aPlayer,
- final float aX, final float aY, final float aZ) {
- return false;
- }
-
- @Override
- public void openInventory() {
- //
- }
-
- @Override
- public void receiveClientEvent(final byte aEventID, final byte aValue) {
- /* Do nothing */}
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister aBlockIconRegister) {
- /* Do nothing */}
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInInventory(final Block aBlock, final int aMeta, final RenderBlocks aRenderer) {
- return false;
- }
-
- /**
- * For Pipe Rendering
- */
- public abstract boolean renderInside(byte aSide);
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInWorld(final IBlockAccess aWorld, final int aX, final int aY, final int aZ,
- final Block aBlock, final RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- public final void sendLoopEnd(final byte aIndex) {
- if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) {
- this.getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
- }
- }
-
- @Override
- public final void sendLoopStart(final byte aIndex) {
- if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) {
- this.getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
- }
- }
-
- @Override
- public final void sendSound(final byte aIndex) {
- if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) {
- this.getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
- }
- }
-
- @Override
- public void setBaseMetaTileEntity(final IGregTechTileEntity aBaseMetaTileEntity) {
- if (this.mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
- this.mBaseMetaTileEntity.getMetaTileEntity().inValidate();
- this.mBaseMetaTileEntity.setMetaTileEntity(null);
- }
- this.mBaseMetaTileEntity = aBaseMetaTileEntity;
- if (this.mBaseMetaTileEntity != null) {
- this.mBaseMetaTileEntity.setMetaTileEntity(this);
- }
- }
-
- @Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- if (aIndex >= 0 && aIndex < this.mInventory.length) {
- this.mInventory[aIndex] = aStack;
- }
- }
-
- public void setItemCount(final int aCount) {
- /* Do nothing */}
-
- @Override
- public void setItemNBT(final NBTTagCompound aNBT) {
- /* Do nothing */}
-
- @Override
- public boolean setStackToZeroInsteadOfNull(final int aIndex) {
- return false;
- }
-
- @Override
- public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- /* Do nothing */}
-
- @Override
- public void stopSoundLoop(final byte aValue, final double aX, final double aY, final double aZ) {
- /* Do nothing */}
+ /**
+ * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
+ */
+ public final ItemStack[] mInventory;
+ /**
+ * This variable tells, which directions the Block is connected to. It is a Bitmask.
+ */
+ public byte mConnections = 0;
+ /**
+ * 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
+ */
+ private IGregTechTileEntity mBaseMetaTileEntity;
+
+ /**
+ * This registers your Machine at the List.
+ * Use only ID's larger than 2048, because i reserved these ones.
+ * See also the List in the API, as it has a Description containing all the reservations.
+ *
+ * @param aID the ID
+ * @example for Constructor overload.
+ * <p/>
+ * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) {
+ * super(aID, mName, mNameRegional);
+ * }
+ */
+ public GregtechMetaPipeEntity_BaseSuperConductor(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted)
+ throw new IllegalAccessError("This Constructor has to be called in the load Phase");
+ if (GregTech_API.METATILEENTITIES[aID] == null) {
+ GregTech_API.METATILEENTITIES[aID] = this;
+ } else {
+ throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
+ }
+ mName = aBasicName.replaceAll(" ", "_").toLowerCase();
+ setBaseMetaTileEntity(new BaseMetaPipeEntity());
+ getBaseMetaTileEntity().setMetaTileID((short) aID);
+ GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
+ mInventory = new ItemStack[aInvSlotCount];
+
+ if (GT.isClientSide()) {
+ ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
+ tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
+ }
+ }
+
+ /**
+ * This is the normal Constructor.
+ */
+ public GregtechMetaPipeEntity_BaseSuperConductor(String aName, int aInvSlotCount) {
+ mInventory = new ItemStack[aInvSlotCount];
+ mName = aName;
+ }
+
+ /**
+ * For Pipe Rendering
+ */
+ public abstract float getThickNess();
+
+ /**
+ * For Pipe Rendering
+ */
+ public abstract boolean renderInside(byte aSide);
+
+ @Override
+ public IGregTechTileEntity getBaseMetaTileEntity() {
+ return mBaseMetaTileEntity;
+ }
+
+ @Override
+ public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
+ mBaseMetaTileEntity.getMetaTileEntity().inValidate();
+ mBaseMetaTileEntity.setMetaTileEntity(null);
+ }
+ mBaseMetaTileEntity = aBaseMetaTileEntity;
+ if (mBaseMetaTileEntity != null) {
+ mBaseMetaTileEntity.setMetaTileEntity(this);
+ }
+ }
+
+ @Override
+ public ItemStack getStackForm(long aAmount) {
+ return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
+ }
+
+ @Override
+ public void onServerStart() {/*Do nothing*/}
+
+ @Override
+ public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return true;
+ }
+
+ @Override
+ 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) {
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {/*Do nothing*/}
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void inValidate() {/*Do nothing*/}
+
+ @Override
+ public void onRemoval() {/*Do nothing*/}
+
+ @Override
+ public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ /**
+ * When a GUI is opened
+ */
+ public void onOpenGUI() {/*Do nothing*/}
+
+ /**
+ * When a GUI is closed
+ */
+ 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) {
+ return false;
+ }
+
+ @Override
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
+
+ @Override
+ public void onValueUpdate(byte aValue) {/*Do nothing*/}
+
+ @Override
+ public byte getUpdateData() {
+ return 0;
+ }
+
+ @Override
+ 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*/}
+
+ @Override
+ public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public final void sendSound(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
+ }
+
+ @Override
+ public final void sendLoopStart(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
+ }
+
+ @Override
+ public final void sendLoopEnd(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean setStackToZeroInsteadOfNull(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
+ return aList;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return true;
+ }
+
+ /**
+ * gets the contained Liquid
+ */
+ @Override
+ public FluidStack getFluid() {
+ return null;
+ }
+
+ /**
+ * tries to fill this Tank
+ */
+ @Override
+ public int fill(FluidStack resource, boolean doFill) {
+ return 0;
+ }
+
+ /**
+ * tries to empty this Tank
+ */
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return null;
+ }
+
+ /**
+ * Tank pressure
+ */
+ public int getTankPressure() {
+ return 0;
+ }
+
+ /**
+ * Liquid Capacity
+ */
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ /**
+ * Progress this machine has already made
+ */
+ public int getProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Progress this Machine has to do to produce something
+ */
+ public int maxProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Increases the Progress, returns the overflown Progress.
+ */
+ public int increaseProgress(int aProgress) {
+ return 0;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {/*Do nothing*/}
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return 0;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ return false;
+ }
+
+ @Override
+ public String getSpecialVoltageToolTip() {
+ return null;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{};
+ }
+
+ public boolean isDigitalChest() {
+ return false;
+ }
+
+ public ItemStack[] getStoredItemData() {
+ return null;
+ }
+
+ public void setItemCount(int aCount) {/*Do nothing*/}
+
+ public int getMaxItemCount() {
+ return 0;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return mInventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex];
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null)
+ return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return getBaseMetaTileEntity().isValidSlot(aIndex);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack);
+ if (tStack != null) {
+ if (tStack.stackSize <= aAmount) {
+ if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0;
+ else setInventorySlotContents(aIndex, null);
+ } else {
+ rStack = tStack.splitStack(aAmount);
+ if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex))
+ setInventorySlotContents(aIndex, null);
+ }
+ }
+ return rStack;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
+ boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ for (int i = 0; i < getSizeInventory(); i++)
+ if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity)))
+ tList.add(i);
+ int[] rArray = new int[tList.size()];
+ for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i);
+ return rArray;
+ }
+
+ @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);
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ return fill(aSide, new FluidStack(aFluid, 1), false) == 1;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ return drain(aSide, new FluidStack(aFluid, 1), false) != null;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ return new FluidTankInfo[]{getInfo()};
+ }
+
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill(aFluid, doFill);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill_default(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid))
+ return drain(aFluid.amount, doDrain);
+ return null;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ return drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return 0;
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ return new FluidTankInfo(this);
+ }
+
+ @Override
+ public String getMetaName() {
+ return mName;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int i) {
+ return null;
+ }
+
+ @Override
+ public boolean doTickProfilingMessageDuringThisTick() {
+ return doTickProfilingInThisTick;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return false;
+ }
+
+ @Override
+ public boolean connectsToItemPipe(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {
+ //
+ }
+
+ @Override
+ public void closeInventory() {
+ //
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public float getExplosionResistance(byte aSide) {
+ return 10.0F;
+ }
+
+ @Override
+ public ItemStack[] getRealInventory() {
+ return mInventory;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public void markDirty() {
+ //
+ }
+
+ @Override
+ public void onColorChangeServer(byte aColor) {
+ //
+ }
+
+ @Override
+ public void onColorChangeClient(byte aColor) {
+ //
+ }
+
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ return 0;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @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 : 10.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)
+ tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return 0;
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ //
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java
index 1854681b63..f62b8b69ff 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java
@@ -1,6 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.GT;
import gregtech.api.interfaces.ITexture;
import gtPlusPlus.core.lib.CORE;
@@ -8,70 +8,59 @@ public abstract class GregtechMetaTileEntityLossless extends MetaTileEntityLossl
/**
* Value between [0 - 9] to describe the Tier of this Machine.
*/
- public final byte mTier;
-
+ public final byte mTier;
+
/**
* A simple Description.
*/
- public final String mDescription;
-
+ public final String mDescription;
+
/**
* Contains all Textures used by this Block.
*/
- public final ITexture[][][] mTextures;
-
- public GregtechMetaTileEntityLossless(final int aID, final String aName, final String aNameRegional,
- final int aTier, final int aInvSlotCount, final String aDescription, final ITexture... aTextures) {
+ public final ITexture[][][] mTextures;
+
+ public GregtechMetaTileEntityLossless(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aInvSlotCount);
- this.mTier = (byte) Math.max(0, Math.min(aTier, 9));
- this.mDescription = aDescription;
-
+ mTier = (byte)Math.max(0, Math.min(aTier, 9));
+ mDescription = aDescription;
+
// must always be the last call!
- if (GT_Values.GT.isClientSide()) {
- this.mTextures = this.getTextureSet(aTextures);
- }
- else {
- this.mTextures = null;
- }
+ if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null;
}
-
- public GregtechMetaTileEntityLossless(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
+
+ public GregtechMetaTileEntityLossless(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
- this.mTier = (byte) aTier;
- this.mDescription = aDescription;
- this.mTextures = aTextures;
-
+ mTier = (byte)aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+
}
-
+
@Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription, CORE.GT_Tooltip
- };
+ public byte getTileEntityBaseType() {
+ return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4)));
}
-
- @Override
+
+ @Override
public long getInputTier() {
- return this.mTier;
- }
-
- @Override
+ return mTier;
+ }
+
+ @Override
public long getOutputTier() {
- return this.mTier;
+ return mTier;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, CORE.GT_Tooltip};
}
-
+
/**
- * Used Client Side to get a Texture Set for this Block. Called after
- * setting the Tier and the Description so that those two are accessible.
- *
- * @param aTextures
- * is the optional Array you can give to the Constructor.
+ * Used Client Side to get a Texture Set for this Block.
+ * Called after setting the Tier and the Description so that those two are accessible.
+ * @param aTextures is the optional Array you can give to the Constructor.
*/
public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
-
- @Override
- public byte getTileEntityBaseType() {
- return (byte) Math.min(3, this.mTier <= 0 ? 0 : 1 + (this.mTier - 1) / 4);
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java
index c25da76fac..aee474d9bf 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java
@@ -14,270 +14,238 @@ import net.minecraftforge.fluids.FluidStack;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my generic Tanks. Filling and emptying
- * behavior have to be implemented manually
+ * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually
*/
public abstract class GregtechMetaTileEntityLosslessBasicTank extends GregtechMetaTileEntityLosslessTieredMachineBlock {
- public FluidStack mFluid;
-
- /**
- * @param aInvSlotCount
- * should be 3
- */
- public GregtechMetaTileEntityLosslessBasicTank(final int aID, final String aName, final String aNameRegional,
- final int aTier, final int aInvSlotCount, final String aDescription, final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public GregtechMetaTileEntityLosslessBasicTank(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == this.getOutputSlot();
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex == this.getInputSlot();
- }
-
- public abstract boolean canTankBeEmptied();
-
- public abstract boolean canTankBeFilled();
-
- public abstract boolean displaysItemStack();
-
- public abstract boolean displaysStackSize();
-
- public abstract boolean doesEmptyContainers();
-
- public abstract boolean doesFillContainers();
-
- @Override
- public FluidStack drain(final int maxDrain, final boolean doDrain) {
- if (this.getDrainableStack() == null || !this.canTankBeEmptied()) {
- return null;
- }
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- this.getBaseMetaTileEntity().markDirty();
- return null;
- }
-
- int used = maxDrain;
- if (this.getDrainableStack().amount < used) {
- used = this.getDrainableStack().amount;
- }
-
- if (doDrain) {
- this.getDrainableStack().amount -= used;
- this.getBaseMetaTileEntity().markDirty();
- }
-
- final FluidStack drained = this.getDrainableStack().copy();
- drained.amount = used;
-
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- this.getBaseMetaTileEntity().markDirty();
- }
-
- return drained;
- }
-
- @Override
- public int fill(final FluidStack aFluid, final boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !this.canTankBeFilled()
- || !this.isFluidInputAllowed(aFluid)) {
- return 0;
- }
-
- if (this.getFillableStack() == null || this.getFillableStack().getFluid().getID() <= 0) {
- if (aFluid.amount <= this.getCapacity()) {
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getBaseMetaTileEntity().markDirty();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.setFillableStack(aFluid.copy());
- this.getFillableStack().amount = this.getCapacity();
- this.getBaseMetaTileEntity().markDirty();
- }
- return this.getCapacity();
- }
-
- if (!this.getFillableStack().isFluidEqual(aFluid)) {
- return 0;
- }
-
- final int space = this.getCapacity() - this.getFillableStack().amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- this.getFillableStack().amount += aFluid.amount;
- this.getBaseMetaTileEntity().markDirty();
- }
- return aFluid.amount;
- }
- if (doFill) {
- this.getFillableStack().amount = this.getCapacity();
- }
- return space;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicTank(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
-
- public FluidStack getDisplayedFluid() {
- return this.getDrainableStack();
- }
-
- public FluidStack getDrainableStack() {
- return this.mFluid;
- }
-
- public FluidStack getFillableStack() {
- return this.mFluid;
- }
-
- @Override
- public FluidStack getFluid() {
- return this.getDrainableStack();
- }
-
- @Override
- public int getFluidAmount() {
- return this.getDrainableStack() != null ? this.getDrainableStack().amount : 0;
- }
-
- public int getInputSlot() {
- return 0;
- }
-
- public int getOutputSlot() {
- return 1;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_BasicTank(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public int getStackDisplaySlot() {
- return 2;
- }
-
- public boolean isFluidChangingAllowed() {
- return true;
- }
-
- public boolean isFluidInputAllowed(final FluidStack aFluid) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex != this.getStackDisplaySlot();
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- }
-
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.isFluidChangingAllowed() && this.getFillableStack() != null
- && this.getFillableStack().amount <= 0) {
- this.setFillableStack(null);
- }
-
- if (this.displaysItemStack() && this.getStackDisplaySlot() >= 0
- && this.getStackDisplaySlot() < this.mInventory.length) {
- if (this.getDisplayedFluid() == null) {
- if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot()], true, true)) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- }
- }
- else {
- this.mInventory[this.getStackDisplaySlot()] = GT_Utility
- .getFluidDisplayStack(this.getDisplayedFluid(), this.displaysStackSize());
- }
- }
-
- if (this.doesEmptyContainers()) {
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true);
- if (tFluid != null && this.isFluidInputAllowed(tFluid)) {
- if (this.getFillableStack() == null) {
- if (this.isFluidInputAllowed(tFluid) && tFluid.amount <= this.getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(),
- GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.setFillableStack(tFluid.copy());
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- else {
- if (tFluid.isFluidEqual(this.getFillableStack())
- && tFluid.amount + this.getFillableStack().amount <= this.getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(),
- GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), 1)) {
- this.getFillableStack().amount += tFluid.amount;
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- }
- }
- }
- }
- }
-
- if (this.doesFillContainers()) {
- final ItemStack tOutput = GT_Utility.fillFluidContainer(this.getDrainableStack(),
- this.mInventory[this.getInputSlot()], false, true);
- if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tOutput, 1)) {
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- if (tFluid != null) {
- this.getDrainableStack().amount -= tFluid.amount;
- }
- if (this.getDrainableStack().amount <= 0 && this.isFluidChangingAllowed()) {
- this.setDrainableStack(null);
- }
- }
- }
- }
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- if (this.mFluid != null) {
- aNBT.setTag("mFluid", this.mFluid.writeToNBT(new NBTTagCompound()));
- }
- }
-
- public FluidStack setDrainableStack(final FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
-
- public FluidStack setFillableStack(final FluidStack aFluid) {
- this.mFluid = aFluid;
- return this.mFluid;
- }
+ public FluidStack mFluid;
+
+ /**
+ * @param aInvSlotCount should be 3
+ */
+ public GregtechMetaTileEntityLosslessBasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public GregtechMetaTileEntityLosslessBasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex != getStackDisplaySlot();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ }
+
+ public abstract boolean doesFillContainers();
+
+ public abstract boolean doesEmptyContainers();
+
+ public abstract boolean canTankBeFilled();
+
+ public abstract boolean canTankBeEmptied();
+
+ public abstract boolean displaysItemStack();
+
+ public abstract boolean displaysStackSize();
+
+ public int getInputSlot() {
+ return 0;
+ }
+
+ public int getOutputSlot() {
+ return 1;
+ }
+
+ public int getStackDisplaySlot() {
+ return 2;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return true;
+ }
+
+ public boolean isFluidChangingAllowed() {
+ return true;
+ }
+
+ public FluidStack getFillableStack() {
+ return mFluid;
+ }
+
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ mFluid = aFluid;
+ return mFluid;
+ }
+
+ public FluidStack getDrainableStack() {
+ return mFluid;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ mFluid = aFluid;
+ return mFluid;
+ }
+
+ public FluidStack getDisplayedFluid() {
+ return getDrainableStack();
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_BasicTank(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (isFluidChangingAllowed() && getFillableStack() != null && getFillableStack().amount <= 0)
+ setFillableStack(null);
+
+ if (displaysItemStack() && getStackDisplaySlot() >= 0 && getStackDisplaySlot() < mInventory.length) {
+ if (getDisplayedFluid() == null) {
+ if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true))
+ mInventory[getStackDisplaySlot()] = null;
+ } else {
+ mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize());
+ }
+ }
+
+ 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.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ setFillableStack(tFluid.copy());
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
+ }
+ }
+ } else {
+ if (tFluid.isFluidEqual(getFillableStack()) && tFluid.amount + getFillableStack().amount <= getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ getFillableStack().amount += tFluid.amount;
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
+ }
+ }
+ }
+ }
+ }
+
+ if (doesFillContainers()) {
+ 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);
+ if (tFluid != null) getDrainableStack().amount -= tFluid.amount;
+ if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) setDrainableStack(null);
+ }
+ }
+ }
+ }
+
+ @Override
+ public FluidStack getFluid() {
+ return getDrainableStack();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return getDrainableStack() != null ? getDrainableStack().amount : 0;
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ 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()) {
+ if (doFill) {
+ setFillableStack(aFluid.copy());
+ getBaseMetaTileEntity().markDirty();
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ setFillableStack(aFluid.copy());
+ getFillableStack().amount = getCapacity();
+ getBaseMetaTileEntity().markDirty();
+ }
+ return getCapacity();
+ }
+
+ if (!getFillableStack().isFluidEqual(aFluid))
+ return 0;
+
+ int space = getCapacity() - getFillableStack().amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ getFillableStack().amount += aFluid.amount;
+ getBaseMetaTileEntity().markDirty();
+ }
+ return aFluid.amount;
+ }
+ if (doFill)
+ getFillableStack().amount = getCapacity();
+ return space;
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ if (getDrainableStack() == null || !canTankBeEmptied()) return null;
+ if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) {
+ setDrainableStack(null);
+ getBaseMetaTileEntity().markDirty();
+ return null;
+ }
+
+ int used = maxDrain;
+ if (getDrainableStack().amount < used)
+ used = getDrainableStack().amount;
+
+ if (doDrain) {
+ getDrainableStack().amount -= used;
+ getBaseMetaTileEntity().markDirty();
+ }
+
+ FluidStack drained = getDrainableStack().copy();
+ drained.amount = used;
+
+ if (getDrainableStack().amount <= 0 && isFluidChangingAllowed()) {
+ setDrainableStack(null);
+ getBaseMetaTileEntity().markDirty();
+ }
+
+ return drained;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == getOutputSlot();
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == getInputSlot();
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java
index 3e6964eefa..7f4c1a4ed8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java
@@ -1,77 +1,67 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.GT;
import gregtech.api.interfaces.ITexture;
import gregtech.api.metatileentity.MetaTileEntity;
public abstract class GregtechMetaTileEntityLosslessTieredMachineBlock extends MetaTileEntity {
- /**
- * Value between [0 - 9] to describe the Tier of this Machine.
- */
- public final byte mTier;
+ /**
+ * Value between [0 - 9] to describe the Tier of this Machine.
+ */
+ public final byte mTier;
- /**
- * A simple Description.
- */
- public final String mDescription;
+ /**
+ * A simple Description.
+ */
+ public final String mDescription;
- /**
- * Contains all Textures used by this Block.
- */
- public final ITexture[][][] mTextures;
+ /**
+ * Contains all Textures used by this Block.
+ */
+ public final ITexture[][][] mTextures;
- public GregtechMetaTileEntityLosslessTieredMachineBlock(final int aID, final String aName,
- final String aNameRegional, final int aTier, final int aInvSlotCount, final String aDescription,
- final ITexture... aTextures) {
- super(aID, aName, aNameRegional, aInvSlotCount);
- this.mTier = (byte) Math.max(0, Math.min(aTier, 9));
- this.mDescription = aDescription;
+ public GregtechMetaTileEntityLosslessTieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aInvSlotCount);
+ mTier = (byte) Math.max(0, Math.min(aTier, 9));
+ mDescription = aDescription;
- // must always be the last call!
- if (GT_Values.GT.isClientSide()) {
- this.mTextures = this.getTextureSet(aTextures);
- }
- else {
- this.mTextures = null;
- }
- }
+ // must always be the last call!
+ if (GT.isClientSide()) mTextures = getTextureSet(aTextures);
+ else mTextures = null;
+ }
- public GregtechMetaTileEntityLosslessTieredMachineBlock(final String aName, final int aTier,
- final int aInvSlotCount, final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aInvSlotCount);
- this.mTier = (byte) aTier;
- this.mDescription = aDescription;
- this.mTextures = aTextures;
- }
+ public GregtechMetaTileEntityLosslessTieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aInvSlotCount);
+ mTier = (byte) aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+ }
- @Override
- public String[] getDescription() {
- return new String[] {
- this.mDescription
- };
- }
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (Math.min(3, mTier <= 0 ? 0 : 1 + ((mTier - 1) / 4)));
+ }
- @Override
- public long getInputTier() {
- return this.mTier;
- }
+ @Override
+ public long getInputTier() {
+ return mTier;
+ }
- @Override
- public long getOutputTier() {
- return this.mTier;
- }
+ @Override
+ public long getOutputTier() {
+ return mTier;
+ }
- /**
- * Used Client Side to get a Texture Set for this Block. Called after
- * setting the Tier and the Description so that those two are accessible.
- *
- * @param aTextures
- * is the optional Array you can give to the Constructor.
- */
- public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription};
+ }
- @Override
- public byte getTileEntityBaseType() {
- return (byte) Math.min(3, this.mTier <= 0 ? 0 : 1 + (this.mTier - 1) / 4);
- }
+ /**
+ * Used Client Side to get a Texture Set for this Block.
+ * Called after setting the Tier and the Description so that those two are accessible.
+ *
+ * @param aTextures is the optional Array you can give to the Constructor.
+ */
+ public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java
index 8de6ebe602..7ec9547ab4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java
@@ -1,17 +1,20 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+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.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;
@@ -25,944 +28,838 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * Extend this Class to add a new MetaMachine Call the Constructor with the
- * desired ID at the load-phase (not preload and also not postload!) Implement
- * the newMetaEntity-Method to return a new ready instance of your
- * MetaTileEntity
+ * Extend this Class to add a new MetaMachine
+ * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!)
+ * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity
* <p/>
- * Call the Constructor like the following example inside the Load Phase, to
- * register it. "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic
- * E-Furnace");"
+ * Call the Constructor like the following example inside the Load Phase, to register it.
+ * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");"
*/
public abstract class MetaTileEntityLossless implements IMetaTileEntity {
- /**
- * Only assigned for the MetaTileEntity in the List! Also only used to get
- * the localized Name for the ItemStack and for getInvName.
- */
- public final String mName;
- /**
- * The Inventory of the MetaTileEntity. Amount of Slots can be larger than
- * 256. HAYO!
- */
- public final ItemStack[] mInventory;
- public boolean doTickProfilingInThisTick = true;
- /**
- * accessibility to this Field is no longer given, see below
- */
- private IGregTechTileEntity mBaseMetaTileEntity;
-
- /**
- * This registers your Machine at the List. Use only ID's larger than 2048,
- * because i reserved these ones. See also the List in the API, as it has a
- * Description containing all the reservations.
- *
- * @param aID
- * the ID
- * @example for Constructor overload.
- * <p/>
- * public GT_MetaTileEntity_EBench(int aID, String mName, String
- * mNameRegional) { super(aID, mName, mNameRegional); }
- */
- public MetaTileEntityLossless(final int aID, final String aBasicName, final String aRegionalName,
- final int aInvSlotCount) {
- if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted) {
- throw new IllegalAccessError("This Constructor has to be called in the load Phase");
- }
- if (GregTech_API.METATILEENTITIES[aID] == null) {
- GregTech_API.METATILEENTITIES[aID] = this;
- }
- else {
- throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
- }
- this.mName = aBasicName.replaceAll(" ", "_").toLowerCase();
- this.setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity());
- this.getBaseMetaTileEntity().setMetaTileID((short) aID);
- GT_LanguageManager.addStringLocalization("gt.blockmachines." + this.mName + ".name", aRegionalName);
- this.mInventory = new ItemStack[aInvSlotCount];
-
- if (GT_Values.GT.isClientSide()) {
- final ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
- tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
- }
- }
-
- /**
- * This is the normal Constructor.
- */
- public MetaTileEntityLossless(final String aName, final int aInvSlotCount) {
- this.mInventory = new ItemStack[aInvSlotCount];
- this.mName = aName;
- }
-
- @Override
- public boolean acceptsRotationalEnergy(final byte aSide) {
- return false;
- }
-
- @Override
- public void addCollisionBoxesToList(final World aWorld, final int aX, final int aY, final int aZ,
- final AxisAlignedBB inputAABB, final List<AxisAlignedBB> outputAABB, final Entity collider) {
- final AxisAlignedBB axisalignedbb1 = this.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) {
- outputAABB.add(axisalignedbb1);
- }
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- return this.drain(aSide, new FluidStack(aFluid, 1), false) != null;
- }
-
- @Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- return this.isValidSlot(aIndex) && aStack != null && aIndex < this.mInventory.length
- && this.allowPullStack(this.getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- return this.fill(aSide, new FluidStack(aFluid, 1), false) == 1;
- }
-
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- return this.isValidSlot(aIndex) && aStack != null && aIndex < this.mInventory.length
- && (this.mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, this.mInventory[aIndex]))
- && this.allowPutStack(this.getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public void closeInventory() {
- //
- }
-
- @Override
- public boolean connectsToItemPipe(final byte aSide) {
- return false;
- }
-
- /**
- * gets the amount of DechargerSlots
- */
- public int dechargerSlotCount() {
- return 0;
- }
-
- /**
- * gets the first DechargerSlot
- */
- public int dechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final ItemStack tStack = this.getStackInSlot(aIndex);
- ItemStack rStack = GT_Utility.copy(tStack);
- if (tStack != null) {
- if (tStack.stackSize <= aAmount) {
- if (this.setStackToZeroInsteadOfNull(aIndex)) {
- tStack.stackSize = 0;
- }
- else {
- this.setInventorySlotContents(aIndex, null);
- }
- }
- else {
- rStack = tStack.splitStack(aAmount);
- if (tStack.stackSize == 0 && !this.setStackToZeroInsteadOfNull(aIndex)) {
- this.setInventorySlotContents(aIndex, null);
- }
- }
- }
- return rStack;
- }
-
- @Override
- public void doExplosion(final long aExplosionPower) {
- final float tStrength = aExplosionPower < GT_Values.V[0] ? 1.0F
- : aExplosionPower < GT_Values.V[1] ? 2.0F
- : aExplosionPower < GT_Values.V[2] ? 3.0F
- : aExplosionPower < GT_Values.V[3] ? 4.0F
- : aExplosionPower < GT_Values.V[4] ? 5.0F
- : aExplosionPower < GT_Values.V[4] * 2 ? 6.0F
- : aExplosionPower < GT_Values.V[5] ? 7.0F
- : aExplosionPower < GT_Values.V[6] ? 8.0F
- : aExplosionPower < GT_Values.V[7] ? 9.0F
- : 10.0F;
- final int tX = this.getBaseMetaTileEntity().getXCoord(), tY = this.getBaseMetaTileEntity().getYCoord(),
- tZ = this.getBaseMetaTileEntity().getZCoord();
- final World tWorld = this.getBaseMetaTileEntity().getWorld();
- GT_Utility.sendSoundToPlayers(tWorld, GregTech_API.sSoundList.get(209), 1.0F, -1, tX, tY, tZ);
- tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions) {
- tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
- }
- }
-
- @Override
- public void doSound(final byte aIndex, final double aX, final double aY, final double aZ) {
- /* Do nothing */}
-
- @Override
- public boolean doTickProfilingMessageDuringThisTick() {
- return this.doTickProfilingInThisTick;
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- if (this.getFluid() != null && aFluid != null && this.getFluid().isFluidEqual(aFluid)) {
- return this.drain(aFluid.amount, doDrain);
- }
- return null;
- }
-
- @Override
- public FluidStack drain(final ForgeDirection aSide, final int maxDrain, final boolean doDrain) {
- return this.drain(maxDrain, doDrain);
- }
-
- /**
- * tries to empty this Tank
- */
- @Override
- public FluidStack drain(final int maxDrain, final boolean doDrain) {
- return null;
- }
-
- /**
- * tries to fill this Tank
- */
- @Override
- public int fill(final FluidStack resource, final boolean doFill) {
- return 0;
- }
-
- @Override
- public int fill(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
- if (this.getBaseMetaTileEntity().hasSteamEngineUpgrade() && GT_ModHandler.isSteam(aFluid)
- && aFluid.amount > 1) {
- final int tSteam = (int) Math.min(Integer.MAX_VALUE, Math.min(aFluid.amount / 2,
- this.getBaseMetaTileEntity().getSteamCapacity() - this.getBaseMetaTileEntity().getStoredSteam()));
- if (tSteam > 0) {
- if (doFill) {
- this.getBaseMetaTileEntity().increaseStoredSteam(tSteam, true);
- }
- return tSteam * 2;
- }
- }
- else {
- return this.fill_default(aSide, aFluid, doFill);
- }
- return 0;
- }
-
- public int fill_default(final ForgeDirection aSide, final FluidStack aFluid, final boolean doFill) {
- return this.fill(aFluid, doFill);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final ArrayList<Integer> tList = new ArrayList<Integer>();
- final IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity();
- final boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2,
- tTileEntity)
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2,
- tTileEntity);
- for (int i = 0; i < this.getSizeInventory(); i++) {
- if (this.isValidSlot(i) && (tSkip
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i,
- tTileEntity)
- || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide,
- tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i,
- tTileEntity))) {
- tList.add(i);
- }
- }
- final int[] rArray = new int[tList.size()];
- for (int i = 0; i < rArray.length; i++) {
- rArray[i] = tList.get(i);
- }
- return rArray;
- }
-
- @Override
- public IGregTechTileEntity getBaseMetaTileEntity() {
- return this.mBaseMetaTileEntity;
- }
-
- /**
- * Liquid Capacity
- */
- @Override
- public int getCapacity() {
- return 0;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(final World aWorld, final int aX, final int aY, final int aZ) {
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- }
-
- /**
- * Gets the Output for the comparator on the given Side
- */
- @Override
- public byte getComparatorValue(final byte aSide) {
- return 0;
- }
-
- /**
- * This is used to get the internal Energy. I use this for the IDSU.
- */
- public long getEUVar() {
- return ((GregtechBaseMetaTileEntityLossless) this.mBaseMetaTileEntity).mStoredEnergy;
- }
-
- @Override
- public float getExplosionResistance(final byte aSide) {
- return 10.0F;
- }
-
- /**
- * gets the contained Liquid
- */
- @Override
- public FluidStack getFluid() {
- return null;
- }
-
- @Override
- public int getFluidAmount() {
- return 0;
- }
-
- @Override
- public FluidTankInfo getInfo() {
- return new FluidTankInfo(this);
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] {};
- }
-
- /**
- * Determines the Tier of the Machine, used for de-charging Tools.
- */
- public long getInputTier() {
- return GT_Utility.getTier(this.getBaseMetaTileEntity().getInputVoltage());
- }
-
- @Override
- public String getInventoryName() {
- if (GregTech_API.METATILEENTITIES[this.getBaseMetaTileEntity().getMetaTileID()] != null) {
- return GregTech_API.METATILEENTITIES[this.getBaseMetaTileEntity().getMetaTileID()].getMetaName();
- }
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public int getLightOpacity() {
- return ((GregtechBaseMetaTileEntityLossless) this.getBaseMetaTileEntity()).getLightValue() > 0 ? 0 : 255;
- }
-
- public String getLocalName() {
- return GT_LanguageManager.getTranslation("gt.blockmachines." + this.mName + ".name");
- }
-
- public int getMaxItemCount() {
- return 0;
- }
-
- @Override
- public String getMetaName() {
- return this.mName;
- }
-
- /**
- * @return the amount of EU, which this Device stores before starting to
- * emit Energy. useful if you don't want to emit stored Energy until
- * a certain Level is reached.
- */
- public long getMinimumStoredEU() {
- return 512;
- }
-
- /**
- * Determines the Tier of the Machine, used for charging Tools.
- */
- public long getOutputTier() {
- return GT_Utility.getTier(this.getBaseMetaTileEntity().getOutputVoltage());
- }
-
- /**
- * Progress this machine has already made
- */
- public int getProgresstime() {
- return 0;
- }
-
- @Override
- public ItemStack[] getRealInventory() {
- return this.mInventory;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public int getSizeInventory() {
- return this.mInventory.length;
- }
-
- @Override
- public ArrayList<String> getSpecialDebugInfo(final IGregTechTileEntity aBaseMetaTileEntity,
- final EntityPlayer aPlayer, final int aLogLevel, final ArrayList<String> aList) {
- return aList;
- }
-
- @Override
- public String getSpecialVoltageToolTip() {
- return null;
- }
-
- @Override
- public ItemStack getStackForm(final long aAmount) {
- return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, this.getBaseMetaTileEntity().getMetaTileID());
- }
-
- @Override
- public ItemStack getStackInSlot(final int aIndex) {
- if (aIndex >= 0 && aIndex < this.mInventory.length) {
- return this.mInventory[aIndex];
- }
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int i) {
- return null;
- }
-
- /**
- * This is used to get the internal Steam Energy.
- */
- public long getSteamVar() {
- return ((GregtechBaseMetaTileEntityLossless) this.mBaseMetaTileEntity).mStoredSteam;
- }
-
- public ItemStack[] getStoredItemData() {
- return null;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- if (this.getCapacity() <= 0 && !this.getBaseMetaTileEntity().hasSteamEngineUpgrade()) {
- return new FluidTankInfo[] {};
- }
- return new FluidTankInfo[] {
- this.getInfo()
- };
- }
-
- /**
- * Tank pressure
- */
- public int getTankPressure() {
- return 0;
- }
-
- @Override
- public byte getUpdateData() {
- return 0;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- /**
- * If this TileEntity makes use of Sided Redstone behaviors. Determines
- * only, if the Output Redstone Array is getting filled with 0 for true, or
- * 15 for false.
- */
- public boolean hasSidedRedstoneOutputBehavior() {
- return false;
- }
-
- /**
- * Increases the Progress, returns the overflown Progress.
- */
- public int increaseProgress(final int aProgress) {
- return 0;
- }
-
- @Override
- public void initDefaultModes(final NBTTagCompound aNBT) {
- /* Do nothing */}
-
- @Override
- public boolean injectRotationalEnergy(final byte aSide, final long aSpeed, final long aEnergy) {
- return false;
- }
-
- @Override
- public void inValidate() {
- /* Do nothing */}
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return false;
- }
-
- public boolean isDigitalChest() {
- return false;
- }
-
- /**
- * @return true if this Device emits Energy at all
- */
- public boolean isElectric() {
- return true;
- }
-
- /**
- * @return true if this Device consumes Energy at all
- */
- public boolean isEnetInput() {
- return false;
- }
-
- /**
- * @return true if this Device emits Energy at all
- */
- public boolean isEnetOutput() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isGivingInformation() {
- return false;
- }
-
- /**
- * @return true if that Side is an Input.
- */
- public boolean isInputFacing(final byte aSide) {
- return false;
- }
-
- @Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- return this.getBaseMetaTileEntity().isValidSlot(aIndex);
- }
-
- @Override
- public boolean isLiquidInput(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isLiquidOutput(final byte aSide) {
- return true;
- }
-
- /**
- * @return true if that Side is an Output.
- */
- public boolean isOutputFacing(final byte aSide) {
- return false;
- }
-
- /**
- * If this accepts up to 4 Overclockers
- */
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- /**
- * @return true if this Device emits Energy at all
- */
- public boolean isPneumatic() {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- /**
- * @return true if this Device emits Energy at all
- */
- public boolean isSteampowered() {
- return false;
- }
-
- /**
- * if the IC2 Teleporter can drain from this.
- */
- public boolean isTeleporterCompatible() {
- return this.isEnetOutput() && this.getBaseMetaTileEntity().getOutputVoltage() >= 128
- && this.getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000;
- }
-
- /**
- * If this accepts Transformer Upgrades
- */
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- /**
- * @return true if Transformer Upgrades increase Packet Amount.
- */
- public boolean isTransformingLowEnergy() {
- return true;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return true;
- }
-
- @Override
- public void markDirty() {
- //
- }
-
- /**
- * How many Amperes this Block can suck at max. Surpassing this value won't
- * blow it up.
- */
- public long maxAmperesIn() {
- return 1;
- }
-
- /**
- * @return the amount of E-net Impulses of the maxEUOutput size, which can
- * be outputted by this Device. Default is 1 Pulse, this shouldn't
- * be set to smaller Values than 1, as it won't output anything in
- * that Case!
- */
- public long maxAmperesOut() {
- return 1;
- }
-
- /**
- * @return the amount of EU/t, which can be accepted by this Device before
- * it explodes.
- */
- public long maxEUInput() {
- return 0;
- }
-
- /**
- * @return the amount of EU/t, which can be outputted by this Device.
- */
- public long maxEUOutput() {
- return 0;
- }
-
- /**
- * @return the amount of EU, which can be stored in this Device. Default is
- * 0 EU.
- */
- public long maxEUStore() {
- return 0;
- }
-
- /**
- * Progress this Machine has to do to produce something
- */
- public int maxProgresstime() {
- return 0;
- }
-
- /**
- * @return the amount of Steam, which can be stored in this Device. Default
- * is 0 EU.
- */
- public long maxSteamStore() {
- return 0;
- }
-
- /**
- * When a GUI is closed
- */
- public void onCloseGUI() {
- /* Do nothing */}
-
- @Override
- public void onColorChangeClient(final byte aColor) {
- //
- }
-
- @Override
- public void onColorChangeServer(final byte aColor) {
- //
- }
-
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- /* Do nothing */}
-
- @Override
- public void onCreated(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) {
- //
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
- final Entity collider) {
- //
- }
-
- @Override
- public void onExplosion() {
- /* Do nothing */}
-
- /**
- * When the Facing gets changed.
- */
- public void onFacingChange() {
- /* Do nothing */}
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- /* Do nothing */}
-
- @Override
- public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- /* Do nothing */}
-
- @Override
- public void onMachineBlockUpdate() {
- /* Do nothing */}
-
- /**
- * When a GUI is opened
- */
- public void onOpenGUI() {
- /* Do nothing */}
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- /* Do nothing */}
-
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- /* Do nothing */}
-
- @Override
- public void onRemoval() {
- /* Do nothing */}
-
- /**
- * a Player rightclicks the Machine Sneaky rightclicks are not getting
- * passed to this!
- */
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- return false;
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer,
- final byte aSide, final float aX, final float aY, final float aZ) {
- return this.onRightclick(aBaseMetaTileEntity, aPlayer);
- }
-
- @Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- /* Do nothing */}
-
- @Override
- public void onServerStart() {
- /* Do nothing */}
-
- @Override
- public void onValueUpdate(final byte aValue) {
- /* Do nothing */}
-
- @Override
- public void onWorldLoad(final File aSaveDirectory) {
- /* Do nothing */}
-
- @Override
- public void onWorldSave(final File aSaveDirectory) {
- /* Do nothing */}
-
- @Override
- public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer aPlayer,
- final float aX, final float aY, final float aZ) {
- if (this.getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {
- this.getBaseMetaTileEntity().setFrontFacing(aWrenchingSide);
- return true;
- }
- return false;
- }
-
- @Override
- public void openInventory() {
- //
- }
-
- /**
- * gets if this is protected from other Players per default or not
- */
- public boolean ownerControl() {
- return false;
- }
-
- @Override
- public void receiveClientEvent(final byte aEventID, final byte aValue) {
- /* Do nothing */}
-
- /**
- * gets the amount of RechargerSlots
- */
- public int rechargerSlotCount() {
- return 0;
- }
-
- /**
- * gets the first RechargerSlot
- */
- public int rechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister aBlockIconRegister) {
- /* Do nothing */}
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInInventory(final Block aBlock, final int aMeta, final RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInWorld(final IBlockAccess aWorld, final int aX, final int aY, final int aZ,
- final Block aBlock, final RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- public final void sendLoopEnd(final byte aIndex) {
- if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) {
- this.getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
- }
- }
-
- @Override
- public final void sendLoopStart(final byte aIndex) {
- if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) {
- this.getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
- }
- }
-
- @Override
- public final void sendSound(final byte aIndex) {
- if (!this.getBaseMetaTileEntity().hasMufflerUpgrade()) {
- this.getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
- }
- }
-
- @Override
- public void setBaseMetaTileEntity(final IGregTechTileEntity aBaseMetaTileEntity) {
- if (this.mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
- this.mBaseMetaTileEntity.getMetaTileEntity().inValidate();
- this.mBaseMetaTileEntity.setMetaTileEntity(null);
- }
- this.mBaseMetaTileEntity = aBaseMetaTileEntity;
- if (this.mBaseMetaTileEntity != null) {
- this.mBaseMetaTileEntity.setMetaTileEntity(this);
- }
- }
-
- /**
- * This is used to set the internal Energy to the given Parameter. I use
- * this for the IDSU.
- */
- public void setEUVar(final long aEnergy) {
- ((GregtechBaseMetaTileEntityLossless) this.mBaseMetaTileEntity).mStoredEnergy = aEnergy;
- }
-
- @Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- if (aIndex >= 0 && aIndex < this.mInventory.length) {
- this.mInventory[aIndex] = aStack;
- }
- }
-
- public void setItemCount(final int aCount) {
- /* Do nothing */}
-
- @Override
- public void setItemNBT(final NBTTagCompound aNBT) {
- /* Do nothing */}
-
- @Override
- public boolean setStackToZeroInsteadOfNull(final int aIndex) {
- return false;
- }
-
- /**
- * This is used to set the internal Steam Energy to the given Parameter.
- */
- public void setSteamVar(final long aSteam) {
- ((GregtechBaseMetaTileEntityLossless) this.mBaseMetaTileEntity).mStoredSteam = aSteam;
- }
-
- @Override
- public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- /* Do nothing */}
-
- @Override
- public void stopSoundLoop(final byte aValue, final double aX, final double aY, final double aZ) {
- /* Do nothing */}
+ /**
+ * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName.
+ */
+ public final String mName;
+ /**
+ * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
+ */
+ public final ItemStack[] mInventory;
+ public boolean doTickProfilingInThisTick = true;
+ /**
+ * accessibility to this Field is no longer given, see below
+ */
+ private IGregTechTileEntity mBaseMetaTileEntity;
+
+ /**
+ * This registers your Machine at the List.
+ * Use only ID's larger than 2048, because i reserved these ones.
+ * See also the List in the API, as it has a Description containing all the reservations.
+ *
+ * @param aID the ID
+ * @example for Constructor overload.
+ * <p/>
+ * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) {
+ * super(aID, mName, mNameRegional);
+ * }
+ */
+ public MetaTileEntityLossless(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted)
+ throw new IllegalAccessError("This Constructor has to be called in the load Phase");
+ if (GregTech_API.METATILEENTITIES[aID] == null) {
+ GregTech_API.METATILEENTITIES[aID] = this;
+ } else {
+ throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
+ }
+ mName = aBasicName.replaceAll(" ", "_").toLowerCase();
+ setBaseMetaTileEntity(GregTech_API.constructBaseMetaTileEntity());
+ getBaseMetaTileEntity().setMetaTileID((short) aID);
+ GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
+ mInventory = new ItemStack[aInvSlotCount];
+
+ if (GT.isClientSide()) {
+ ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
+ tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
+ }
+ }
+
+ /**
+ * This is the normal Constructor.
+ */
+ public MetaTileEntityLossless(String aName, int aInvSlotCount) {
+ mInventory = new ItemStack[aInvSlotCount];
+ mName = aName;
+ }
+
+ @Override
+ public IGregTechTileEntity getBaseMetaTileEntity() {
+ return mBaseMetaTileEntity;
+ }
+
+ @Override
+ public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
+ mBaseMetaTileEntity.getMetaTileEntity().inValidate();
+ mBaseMetaTileEntity.setMetaTileEntity(null);
+ }
+ mBaseMetaTileEntity = aBaseMetaTileEntity;
+ if (mBaseMetaTileEntity != null) {
+ mBaseMetaTileEntity.setMetaTileEntity(this);
+ }
+ }
+
+ @Override
+ public ItemStack getStackForm(long aAmount) {
+ return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
+ }
+
+ public String getLocalName() {
+ return GT_LanguageManager.getTranslation("gt.blockmachines." + mName + ".name");
+ }
+
+ @Override
+ public void onServerStart() {/*Do nothing*/}
+
+ @Override
+ public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ 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) {
+ if (getBaseMetaTileEntity().isValidFacing(aWrenchingSide)) {
+ getBaseMetaTileEntity().setFrontFacing(aWrenchingSide);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {/*Do nothing*/}
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void inValidate() {/*Do nothing*/}
+
+ @Override
+ public void onRemoval() {/*Do nothing*/}
+
+ @Override
+ public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ /**
+ * When a GUI is opened
+ */
+ public void onOpenGUI() {/*Do nothing*/}
+
+ /**
+ * When a GUI is closed
+ */
+ public void onCloseGUI() {/*Do nothing*/}
+
+ /**
+ * a Player rightclicks the Machine
+ * Sneaky rightclicks are not getting passed to this!
+ */
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ return false;
+ }
+
+ @Override
+ 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*/}
+
+ @Override
+ public void onValueUpdate(byte aValue) {/*Do nothing*/}
+
+ @Override
+ public byte getUpdateData() {
+ return 0;
+ }
+
+ @Override
+ 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*/}
+
+ @Override
+ public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public final void sendSound(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
+ }
+
+ @Override
+ public final void sendLoopStart(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
+ }
+
+ @Override
+ public final void sendLoopEnd(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
+ }
+
+ /**
+ * @return true if this Device emits Energy at all
+ */
+ public boolean isElectric() {
+ return true;
+ }
+
+ /**
+ * @return true if this Device emits Energy at all
+ */
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ /**
+ * @return true if this Device emits Energy at all
+ */
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ /**
+ * @return true if this Device emits Energy at all
+ */
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ /**
+ * @return true if this Device consumes Energy at all
+ */
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ /**
+ * @return the amount of EU, which can be stored in this Device. Default is 0 EU.
+ */
+ public long maxEUStore() {
+ return 0;
+ }
+
+ /**
+ * @return the amount of EU/t, which can be accepted by this Device before it explodes.
+ */
+ public long maxEUInput() {
+ return 0;
+ }
+
+ /**
+ * @return the amount of EU/t, which can be outputted by this Device.
+ */
+ public long maxEUOutput() {
+ return 0;
+ }
+
+ /**
+ * @return the amount of E-net Impulses of the maxEUOutput size, which can be outputted by this Device.
+ * Default is 1 Pulse, this shouldn't be set to smaller Values than 1, as it won't output anything in that Case!
+ */
+ public long maxAmperesOut() {
+ return 1;
+ }
+
+ /**
+ * How many Amperes this Block can suck at max. Surpassing this value won't blow it up.
+ */
+ public long maxAmperesIn() {
+ return 1;
+ }
+
+ /**
+ * @return true if that Side is an Output.
+ */
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ /**
+ * @return true if that Side is an Input.
+ */
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ /**
+ * @return true if Transformer Upgrades increase Packet Amount.
+ */
+ public boolean isTransformingLowEnergy() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean setStackToZeroInsteadOfNull(int aIndex) {
+ return false;
+ }
+
+ /**
+ * This is used to get the internal Energy. I use this for the IDSU.
+ */
+ public long getEUVar() {
+ return ((GregtechBaseMetaTileEntityLossless) mBaseMetaTileEntity).mStoredEnergy;
+ }
+
+ /**
+ * This is used to set the internal Energy to the given Parameter. I use this for the IDSU.
+ */
+ public void setEUVar(long aEnergy) {
+ ((GregtechBaseMetaTileEntityLossless) mBaseMetaTileEntity).mStoredEnergy = aEnergy;
+ }
+
+ /**
+ * This is used to get the internal Steam Energy.
+ */
+ public long getSteamVar() {
+ return ((GregtechBaseMetaTileEntityLossless) mBaseMetaTileEntity).mStoredSteam;
+ }
+
+ /**
+ * This is used to set the internal Steam Energy to the given Parameter.
+ */
+ public void setSteamVar(long aSteam) {
+ ((GregtechBaseMetaTileEntityLossless) mBaseMetaTileEntity).mStoredSteam = aSteam;
+ }
+
+ /**
+ * @return the amount of Steam, which can be stored in this Device. Default is 0 EU.
+ */
+ public long maxSteamStore() {
+ return 0;
+ }
+
+ /**
+ * @return the amount of EU, which this Device stores before starting to emit Energy.
+ * useful if you don't want to emit stored Energy until a certain Level is reached.
+ */
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ /**
+ * Determines the Tier of the Machine, used for de-charging Tools.
+ */
+ public long getInputTier() {
+ return GT_Utility.getTier(getBaseMetaTileEntity().getInputVoltage());
+ }
+
+ /**
+ * Determines the Tier of the Machine, used for charging Tools.
+ */
+ public long getOutputTier() {
+ return GT_Utility.getTier(getBaseMetaTileEntity().getOutputVoltage());
+ }
+
+ /**
+ * gets the first RechargerSlot
+ */
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ /**
+ * gets the amount of RechargerSlots
+ */
+ public int rechargerSlotCount() {
+ return 0;
+ }
+
+ /**
+ * gets the first DechargerSlot
+ */
+ public int dechargerSlotStartIndex() {
+ return 0;
+ }
+
+ /**
+ * gets the amount of DechargerSlots
+ */
+ public int dechargerSlotCount() {
+ return 0;
+ }
+
+ /**
+ * gets if this is protected from other Players per default or not
+ */
+ public boolean ownerControl() {
+ return false;
+ }
+
+ @Override
+ public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
+ return aList;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return true;
+ }
+
+ /**
+ * gets the contained Liquid
+ */
+ @Override
+ public FluidStack getFluid() {
+ return null;
+ }
+
+ /**
+ * tries to fill this Tank
+ */
+ @Override
+ public int fill(FluidStack resource, boolean doFill) {
+ return 0;
+ }
+
+ /**
+ * tries to empty this Tank
+ */
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return null;
+ }
+
+ /**
+ * Tank pressure
+ */
+ public int getTankPressure() {
+ return 0;
+ }
+
+ /**
+ * Liquid Capacity
+ */
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {/*Do nothing*/}
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ /**
+ * If this accepts up to 4 Overclockers
+ */
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ /**
+ * If this accepts Transformer Upgrades
+ */
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ /**
+ * Progress this machine has already made
+ */
+ public int getProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Progress this Machine has to do to produce something
+ */
+ public int maxProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Increases the Progress, returns the overflown Progress.
+ */
+ public int increaseProgress(int aProgress) {
+ return 0;
+ }
+
+ /**
+ * If this TileEntity makes use of Sided Redstone behaviors.
+ * Determines only, if the Output Redstone Array is getting filled with 0 for true, or 15 for false.
+ */
+ public boolean hasSidedRedstoneOutputBehavior() {
+ return false;
+ }
+
+ /**
+ * When the Facing gets changed.
+ */
+ public void onFacingChange() {/*Do nothing*/}
+
+ /**
+ * if the IC2 Teleporter can drain from this.
+ */
+ public boolean isTeleporterCompatible() {
+ return isEnetOutput() && getBaseMetaTileEntity().getOutputVoltage() >= 128 && getBaseMetaTileEntity().getUniversalEnergyCapacity() >= 500000;
+ }
+
+ /**
+ * Gets the Output for the comparator on the given Side
+ */
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return 0;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ return false;
+ }
+
+ @Override
+ public String getSpecialVoltageToolTip() {
+ return null;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{};
+ }
+
+ public boolean isDigitalChest() {
+ return false;
+ }
+
+ public ItemStack[] getStoredItemData() {
+ return null;
+ }
+
+ public void setItemCount(int aCount) {/*Do nothing*/}
+
+ public int getMaxItemCount() {
+ return 0;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return mInventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex];
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null)
+ return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return getBaseMetaTileEntity().isValidSlot(aIndex);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack);
+ if (tStack != null) {
+ if (tStack.stackSize <= aAmount) {
+ if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0;
+ else setInventorySlotContents(aIndex, null);
+ } else {
+ rStack = tStack.splitStack(aAmount);
+ if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex))
+ setInventorySlotContents(aIndex, null);
+ }
+ }
+ return rStack;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
+ boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ for (int i = 0; i < getSizeInventory(); i++)
+ if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity)))
+ tList.add(i);
+ int[] rArray = new int[tList.size()];
+ for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i);
+ return rArray;
+ }
+
+ @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);
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ return fill(aSide, new FluidStack(aFluid, 1), false) == 1;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ return drain(aSide, new FluidStack(aFluid, 1), false) != null;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ return new FluidTankInfo[]{getInfo()};
+ }
+
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill(aFluid, doFill);
+ }
+
+ @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()));
+ if (tSteam > 0) {
+ if (doFill) getBaseMetaTileEntity().increaseStoredSteam(tSteam, true);
+ return tSteam * 2;
+ }
+ } else {
+ return fill_default(aSide, aFluid, doFill);
+ }
+ return 0;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid))
+ return drain(aFluid.amount, doDrain);
+ return null;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ return drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return 0;
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ return new FluidTankInfo(this);
+ }
+
+ @Override
+ public String getMetaName() {
+ return mName;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int i) {
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public boolean doTickProfilingMessageDuringThisTick() {
+ return doTickProfilingInThisTick;
+ }
+
+ @Override
+ public void markDirty() {
+ //
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {
+ //
+ }
+
+ @Override
+ public void closeInventory() {
+ //
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public boolean connectsToItemPipe(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public float getExplosionResistance(byte aSide) {
+ return 10.0F;
+ }
+
+ @Override
+ public ItemStack[] getRealInventory() {
+ return mInventory;
+ }
+
+ @Override
+ public void onColorChangeServer(byte aColor) {
+ //
+ }
+
+ @Override
+ public void onColorChangeClient(byte aColor) {
+ //
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @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 : 10.0F;
+ int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
+ World tWorld = getBaseMetaTileEntity().getWorld();
+ GT_Utility.sendSoundToPlayers(tWorld, GregTech_API.sSoundList.get(209), 1.0F, -1, tX, tY, tZ);
+ tWorld.setBlock(tX, tY, tZ, Blocks.air);
+ if (GregTech_API.sMachineExplosions)
+ tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return ((GregtechBaseMetaTileEntityLossless) getBaseMetaTileEntity()).getLightValue() > 0 ? 0 : 255;
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ //
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
index 79f0ec3b9d..05661df905 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines;
-import java.util.UUID;
-
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -13,140 +11,113 @@ import gtPlusPlus.core.handler.events.UnbreakableBlockManager;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.core.util.player.PlayerUtils;
+
+import java.util.UUID;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_TieredMachineBlock {
- public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
- public int mSuccess = 0, mTargetStackSize = 0;
- public UUID ownerUUID;
- UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
- private boolean value_last = false, value_current = false;
-
- public GregtechMetaSafeBlockBase(final int aID, final String aName, final String aNameRegional, final int aTier,
- final int aInvSlotCount, final String aDescription) {
+ public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
+ public int mSuccess = 0, mTargetStackSize = 0;
+ public UUID ownerUUID;
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ private boolean value_last = false, value_current = false;
+
+ public GregtechMetaSafeBlockBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
- public GregtechMetaSafeBlockBase(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
+ public GregtechMetaSafeBlockBase(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return true;
- }
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[6][17][];
+ ITexture tIcon = getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT), tShitGoesWrong = new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE);
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tUp, tIcon}; //Back
+ rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Right, Strangely The top side as well when facing East?
+ rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Top And Bottom, When Facing South (What the hell?)
+ rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Left, Top if facing West and Bottom if facing east?
+ rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Top and Bottom when Facing North..
+ rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tOut}; // Front
+ }
+ return rTextures;
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aSide != aBaseMetaTileEntity.getBackFacing();
}
@Override
- public long getMinimumStoredEU() {
- return 512;
- }
-
- public abstract ITexture getOverlayIcon();
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return this.mTextures[5][aColorIndex + 1];
- }
- if (GT_Utility.getOppositeSide(aSide) == aFacing) {
- return this.mTextures[0][aColorIndex + 1];
- }
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) return mTextures[5][aColorIndex + 1];
+ if (GT_Utility.getOppositeSide(aSide) == aFacing) return mTextures[0][aColorIndex + 1];
switch (aFacing) {
+ case 0:
+ return mTextures[4][aColorIndex + 1];
+ case 1:
+ return mTextures[2][aColorIndex + 1];
+ case 2:
+ switch (aSide) {
case 0:
- return this.mTextures[4][aColorIndex + 1];
+ return mTextures[2][aColorIndex + 1];
case 1:
- return this.mTextures[2][aColorIndex + 1];
- case 2:
- switch (aSide) {
- case 0:
- return this.mTextures[2][aColorIndex + 1];
- case 1:
- return this.mTextures[2][aColorIndex + 1];
- case 4:
- return this.mTextures[1][aColorIndex + 1];
- case 5:
- return this.mTextures[3][aColorIndex + 1];
- }
- case 3:
- switch (aSide) {
- case 0:
- return this.mTextures[4][aColorIndex + 1];
- case 1:
- return this.mTextures[4][aColorIndex + 1];
- case 4:
- return this.mTextures[3][aColorIndex + 1];
- case 5:
- return this.mTextures[1][aColorIndex + 1];
- }
+ return mTextures[2][aColorIndex + 1];
case 4:
- switch (aSide) {
- case 0:
- return this.mTextures[3][aColorIndex + 1];
- case 1:
- return this.mTextures[1][aColorIndex + 1];
- case 2:
- return this.mTextures[3][aColorIndex + 1];
- case 3:
- return this.mTextures[1][aColorIndex + 1];
- }
+ return mTextures[1][aColorIndex + 1];
case 5:
- switch (aSide) {
- case 0:
- return this.mTextures[1][aColorIndex + 1];
- case 1:
- return this.mTextures[3][aColorIndex + 1];
- case 2:
- return this.mTextures[1][aColorIndex + 1];
- case 3:
- return this.mTextures[3][aColorIndex + 1];
- }
+ return mTextures[3][aColorIndex + 1];
+ }
+ case 3:
+ switch (aSide) {
+ case 0:
+ return mTextures[4][aColorIndex + 1];
+ case 1:
+ return mTextures[4][aColorIndex + 1];
+ case 4:
+ return mTextures[3][aColorIndex + 1];
+ case 5:
+ return mTextures[1][aColorIndex + 1];
+ }
+ case 4:
+ switch (aSide) {
+ case 0:
+ return mTextures[3][aColorIndex + 1];
+ case 1:
+ return mTextures[1][aColorIndex + 1];
+ case 2:
+ return mTextures[3][aColorIndex + 1];
+ case 3:
+ return mTextures[1][aColorIndex + 1];
+ }
+ case 5:
+ switch (aSide) {
+ case 0:
+ return mTextures[1][aColorIndex + 1];
+ case 1:
+ return mTextures[3][aColorIndex + 1];
+ case 2:
+ return mTextures[1][aColorIndex + 1];
+ case 3:
+ return mTextures[3][aColorIndex + 1];
+ }
}
- return this.mTextures[5][aColorIndex + 1];
+ return mTextures[5][aColorIndex + 1];
}
@Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[6][17][];
- final ITexture tIcon = this.getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST),
- tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT),
- tShitGoesWrong = new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE);
- for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon
- }; // Back
- rTextures[1][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
- }; // Right, Strangely The top side as well when facing East?
- rTextures[2][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
- }; // Top And Bottom, When Facing South (What the hell?)
- rTextures[3][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
- }; // Left, Top if facing West and Bottom if facing east?
- rTextures[4][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon
- }; // Top and Bottom when Facing North..
- rTextures[5][i + 1] = new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut
- }; // Front
- }
- return rTextures;
+ public boolean isSimpleMachine() {
+ return false;
+ }
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < mInventory.length - 1;
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ public boolean isFacingValid(byte aFacing) {
return true;
}
@@ -161,44 +132,38 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
+ public boolean isInputFacing(byte aSide) {
+ return !isOutputFacing(aSide);
}
@Override
- public boolean isInputFacing(final byte aSide) {
- return !this.isOutputFacing(aSide);
+ public boolean isOutputFacing(byte aSide) {
+ return getBaseMetaTileEntity().getBackFacing() == aSide;
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return this.getBaseMetaTileEntity().getBackFacing() == aSide;
+ public boolean isTeleporterCompatible() {
+ return false;
}
@Override
- public boolean isSimpleMachine() {
- return false;
+ public long getMinimumStoredEU() {
+ return 512;
}
@Override
- public boolean isTeleporterCompatible() {
- return false;
+ public long maxEUStore() {
+ return 512 + V[mTier] * 50;
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex < this.mInventory.length - 1;
+ public long maxEUInput() {
+ return V[mTier];
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
- this.bOutput = aNBT.getBoolean("bOutput");
- this.bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
- this.mTargetStackSize = aNBT.getInteger("mTargetStackSize");
- if (aNBT.hasKey("ownerUUID")) {
- this.ownerUUID = UUID.fromString(aNBT.getString("ownerUUID"));
- }
+ public long maxEUOutput() {
+ return bOutput ? V[mTier] : 0;
}
@Override
@@ -212,190 +177,176 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered
}
@Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUOutput() {
- return this.bOutput ? GT_Values.V[this.mTier] : 0;
- }
-
- @Override
- public long maxEUStore() {
- return 512 + GT_Values.V[this.mTier] * 50;
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
}
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
- /*
- * if (aBaseMetaTileEntity.isAllowedToWork() &&
- * aBaseMetaTileEntity.isServerSide() &&
- * aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) &&
- * (aBaseMetaTileEntity.hasWorkJustBeenEnabled() ||
- * aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0
- * || mSuccess > 0)) {
- */
- if (aBaseMetaTileEntity.isServerSide() && (aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || this.mSuccess > 0)) {
- this.value_last = this.value_current;
- this.value_current = this.bUnbreakable;
- if (this.value_last != this.value_current) {
- Utils.LOG_WARNING("VALUE CHANGE - Ticking for a moment.");
- if (this.bUnbreakable == true) {
- // Xasda.setmTileEntity((BaseMetaTileEntity)
- // aBaseMetaTileEntity);
- // Utils.LOG_ERROR("Safe is Indestructible.");
- this.getBaseMetaTileEntity()
- .getBlock(this.getBaseMetaTileEntity().getXCoord(),
- this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord())
- .setResistance(Float.MAX_VALUE);
- this.getBaseMetaTileEntity()
- .getBlock(this.getBaseMetaTileEntity().getXCoord(),
- this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord())
- .setBlockUnbreakable();
- }
- else {
- // Xasda.setmTileEntity((BaseMetaTileEntity)
- // aBaseMetaTileEntity);
- // Utils.LOG_ERROR("Safe is not Indestructible.");
- this.getBaseMetaTileEntity()
- .getBlock(this.getBaseMetaTileEntity().getXCoord(),
- this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord())
- .setResistance(1F);
- this.getBaseMetaTileEntity()
- .getBlock(this.getBaseMetaTileEntity().getXCoord(),
- this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord())
- .setHardness(2);
-
- }
- }
- else {
-
- }
-
- /*
- * mSuccess--; moveItems(aBaseMetaTileEntity, aTimer);
- * aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert); if
- * (bRedstoneIfFull) {
- * aBaseMetaTileEntity.setGenericRedstoneOutput(!bInvert); for (int
- * i = 0; i < mInventory.length; i++) if (isValidSlot(i)) { if
- * (mInventory[i] == null) {
- * aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert);
- * aBaseMetaTileEntity.decreaseStoredEnergyUnits(1, true); break; }
- * } } }
- */
- }
- }
+ public abstract ITexture getOverlayIcon();
@Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- // Utils.LOG_WARNING("Clicky Clicky.");
+ if (aBaseMetaTileEntity.isClientSide()) {
+ //Utils.LOG_WARNING("Clicky Clicky.");
return true;
}
if (!aPlayer.equals(null)) {
- final UUID tempUUID = aPlayer.getUniqueID();
- /*
- * if (!aPlayer.worldObj.isRemote){
- * //PlayerCache.appendParamChanges(aPlayer.getDisplayName(),
- * aPlayer.getUniqueID().toString()); }
- */
- // Utils.LOG_INFO("test");
- if (this.ownerUUID == null) {
+ UUID tempUUID = aPlayer.getUniqueID();
+ /*if (!aPlayer.worldObj.isRemote){
+ //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString());
+ }*/
+ //Utils.LOG_INFO("test");
+ if (ownerUUID == null){
Utils.LOG_INFO("No owner yet for this block.");
}
else {
- // Utils.LOG_INFO("test");
- Utils.LOG_INFO("Current Owner: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID) + " - UUID: "
- + this.ownerUUID);
+ //Utils.LOG_INFO("test");
+ Utils.LOG_INFO("Current Owner: "+PlayerCache.lookupPlayerByUUID(ownerUUID)+" - UUID: "+ownerUUID);
}
Utils.LOG_WARNING("Is ownerUUID Null");
- if (this.ownerUUID == null) {
+ if (ownerUUID == null){
Utils.LOG_WARNING("OwnerUUID is Null, let's set it.");
- Utils.LOG_WARNING("Accessing Players UUID is: " + tempUUID);
- this.ownerUUID = tempUUID;
- // Utils.messagePlayer(aPlayer, "Owner of this safe, now set.
- // Try accessing it again.");
- Utils.LOG_WARNING("Block Owner is now set to: " + this.ownerUUID);
+ Utils.LOG_WARNING("Accessing Players UUID is: "+tempUUID);
+ ownerUUID = tempUUID;
+ //Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
+ Utils.LOG_WARNING("Block Owner is now set to: "+ownerUUID);
}
Utils.LOG_WARNING("No, it is not.");
Utils.LOG_WARNING("Checking ownerUUID.");
- if (this.ownerUUID != null) {
+ if (ownerUUID != null){
Utils.LOG_WARNING("ownerUUID != Null, if accessor == owner.");
- Utils.LOG_WARNING("Accessing is: " + PlayerCache.lookupPlayerByUUID(tempUUID));
- if (this.ownerUUID.equals(tempUUID)) {
- Utils.LOG_WARNING("Owner's UUID: " + this.ownerUUID);
+ Utils.LOG_WARNING("Accessing is: "+PlayerCache.lookupPlayerByUUID(tempUUID));
+ if (ownerUUID.equals(tempUUID)){
+ Utils.LOG_WARNING("Owner's UUID: "+ownerUUID);
aBaseMetaTileEntity.openGUI(aPlayer);
- // Utils.LOG_WARNING("GUI should now be open for you sir.");
+ //Utils.LOG_WARNING("GUI should now be open for you sir.");
}
else {
PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you.");
- PlayerUtils.messagePlayer(aPlayer,
- "it is owned by: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID));
- Utils.LOG_WARNING("Expecting Player : " + PlayerCache.lookupPlayerByUUID(this.ownerUUID));
+ PlayerUtils.messagePlayer(aPlayer, "it is owned by: "+PlayerCache.lookupPlayerByUUID(ownerUUID));
+ Utils.LOG_WARNING("Expecting Player : "+PlayerCache.lookupPlayerByUUID(ownerUUID));
Utils.LOG_ERROR("Access Denied.");
return true;
}
}
- /*
- * else { Utils.LOG_ERROR(
- * "This is NOT good. Tell Draknyte1 your safe broke."); }
- */
- /*
- * Utils.LOG_WARNING("Clicky Clicky."); Utils.messagePlayer(aPlayer,
- * "Owner of this safe, now set.");
- * aBaseMetaTileEntity.openGUI(aPlayer);
- */
+ /*else {
+ Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke.");
+ }*/
+ /*Utils.LOG_WARNING("Clicky Clicky.");
+ Utils.messagePlayer(aPlayer, "Owner of this safe, now set.");
+ aBaseMetaTileEntity.openGUI(aPlayer); */
}
return true;
}
@Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- if (aSide == this.getBaseMetaTileEntity().getBackFacing()) {
- this.mTargetStackSize = (byte) ((this.mTargetStackSize + (aPlayer.isSneaking() ? -1 : 1)) % 65);
- if (this.mTargetStackSize == 0) {
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("bUnbreakable", bUnbreakable);
+ aNBT.setBoolean("bOutput", bOutput);
+ aNBT.setBoolean("bRedstoneIfFull", bRedstoneIfFull);
+ aNBT.setInteger("mTargetStackSize", mTargetStackSize);
+ aNBT.setString("ownerUUID", ownerUUID.toString());
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ bUnbreakable = aNBT.getBoolean("bUnbreakable");
+ bOutput = aNBT.getBoolean("bOutput");
+ bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
+ mTargetStackSize = aNBT.getInteger("mTargetStackSize");
+ if (aNBT.hasKey("ownerUUID"))
+ ownerUUID = UUID.fromString(aNBT.getString("ownerUUID"));
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ if (mTargetStackSize > 0) aNBT.setInteger("mTargetStackSize", mTargetStackSize);
+ }
+
+ @Override
+ 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) {
GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + mTargetStackSize);
+ }
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ /*if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
+ */
+ if (aBaseMetaTileEntity.isServerSide() && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
+ value_last = value_current;
+ value_current = bUnbreakable;
+ if (value_last != value_current){
+ Utils.LOG_WARNING("VALUE CHANGE - Ticking for a moment.");
+ if (bUnbreakable == true){
+ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity);
+ //Utils.LOG_ERROR("Safe is Indestructible.");
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setResistance(Float.MAX_VALUE);
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setBlockUnbreakable();
+ }
+ else {
+ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity);
+ //Utils.LOG_ERROR("Safe is not Indestructible.");
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setResistance(1F);
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setHardness(2);
+
+ }
}
else {
- GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + this.mTargetStackSize);
+
}
+
+
+
+
+
+
+
+
+ /*mSuccess--;
+ moveItems(aBaseMetaTileEntity, aTimer);
+ aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert);
+ if (bRedstoneIfFull) {
+ aBaseMetaTileEntity.setGenericRedstoneOutput(!bInvert);
+ for (int i = 0; i < mInventory.length; i++)
+ if (isValidSlot(i)) {
+ if (mInventory[i] == null) {
+ aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert);
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(1, true);
+ break;
+ }
+ }
+ }
+ }*/
}
}
- /*
- * protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long
- * aTimer) { int tCost = GT_Utility.moveOneItemStack(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); if (tCost > 0 ||
- * aBaseMetaTileEntity.hasInventoryBeenModified()) { mSuccess = 50;
- * aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true); } }
- */
+ /*protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ int tCost = GT_Utility.moveOneItemStack(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);
+ if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ mSuccess = 50;
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true);
+ }
+ }*/
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
- aNBT.setBoolean("bOutput", this.bOutput);
- aNBT.setBoolean("bRedstoneIfFull", this.bRedstoneIfFull);
- aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
- aNBT.setString("ownerUUID", this.ownerUUID.toString());
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return true;
}
@Override
- public void setItemNBT(final NBTTagCompound aNBT) {
- super.setItemNBT(aNBT);
- if (this.mTargetStackSize > 0) {
- aNBT.setInteger("mTargetStackSize", this.mTargetStackSize);
- }
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide != aBaseMetaTileEntity.getBackFacing();
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
index a00d41717f..348e7dd118 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -1,8 +1,15 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.creative;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.*;
+import gregtech.api.gui.GT_Container_1by1;
+import gregtech.api.gui.GT_Container_2by2;
+import gregtech.api.gui.GT_Container_3by3;
+import gregtech.api.gui.GT_Container_4by4;
+import gregtech.api.gui.GT_GUIContainer_1by1;
+import gregtech.api.gui.GT_GUIContainer_2by2;
+import gregtech.api.gui.GT_GUIContainer_3by3;
+import gregtech.api.gui.GT_GUIContainer_4by4;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -20,312 +27,243 @@ import net.minecraft.util.EnumChatFormatting;
/**
* 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
+ *
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
*/
public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
- public boolean mCharge = false, mDecharge = false;
- public int mBatteryCount = 1, mChargeableCount = 1;
-
- private long count = 0;
- private long mStored = 0;
-
- private long mMax = 0;
-
- public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, final String aNameRegional,
- final int aTier, final String aDescription, final int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
- }
-
- public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures, final int aSlotCount) {
+ public GregtechMetaCreativeEnergyBuffer(String aName, int aTier,
+ String aDescription, ITexture[][][] aTextures, int aSlotCount) {
super(aName, aTier, aDescription, aTextures, aSlotCount);
// TODO Auto-generated constructor stub
}
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName().startsWith("gt.metaitem.01.")) {
- final 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")) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- if (!GT_Utility.isStackValid(aStack)) {
- return false;
- }
- if (GT_ModHandler.isElectricItem(aStack, this.mTier)) {
- return true;
- }
- return false;
+ public GregtechMetaCreativeEnergyBuffer(int aID, String aName,
+ String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
}
- @Override
- public int dechargerSlotCount() {
- return this.mDecharge ? this.mInventory.length : 0;
- }
-
- @Override
- public int dechargerSlotStartIndex() {
- return 0;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- switch (this.mInventory.length) {
- case 1:
- return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- case 4:
- return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- case 9:
- return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- case 16:
- return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
- return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName());
- }
+ public boolean mCharge = false, mDecharge = false;
+ public int mBatteryCount = 1, mChargeableCount = 1;
@Override
public String[] getDescription() {
- return new String[] {
- this.mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN + "Alkalus"
- };
- }
-
- @Override
- public String[] getInfoData() {
- this.count++;
- if (this.mMax == 0 || this.count % 20 == 0) {
- final long[] tmp = this.getStoredEnergy();
- this.mStored = tmp[0];
- this.mMax = tmp[1];
- }
-
- return new String[] {
- this.getLocalName(), "THIS IS A CREATIVE ITEM - FOR TESTING",
- GT_Utility.formatNumbers(this.mStored) + " EU /", GT_Utility.formatNumbers(this.mMax) + " EU"
- };
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 1;
- }
-
- @Override
- public int getProgresstime() {
- return Integer.MAX_VALUE;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- switch (this.mInventory.length) {
- case 1:
- return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
- case 4:
- return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
- case 9:
- return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity);
- case 16:
- return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
- }
- return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public long[] getStoredEnergy() {
- long tScale = this.getBaseMetaTileEntity().getEUCapacity();
- long tStored = this.getBaseMetaTileEntity().getStoredEU();
- this.setEUVar(Long.MAX_VALUE);
- if (this.mInventory != null) {
- for (final ItemStack aStack : this.mInventory) {
- if (GT_ModHandler.isElectricItem(aStack)) {
-
- if (aStack.getItem() instanceof GT_MetaBase_Item) {
- final Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack);
- if (stats != null) {
- tScale = tScale + stats[0];
- tStored = tStored + ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
- }
- }
- else if (aStack.getItem() instanceof IElectricItem) {
- tStored = tStored + (long) ic2.api.item.ElectricItem.manager.getCharge(aStack);
- tScale = tScale + (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack);
- }
- }
- }
-
- }
- return new long[] {
- tStored, tScale
- };
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
+ return new String[] {mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"};
}
/*
* MACHINE_STEEL_SIDE
*/
@Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[2][17][];
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[2][17][];
for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)
- };
+ rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) };
rTextures[1][i + 1] = new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
- this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]
- };
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
+ mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
}
return rTextures;
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide, byte aFacing, byte aColorIndex, boolean aActive,
+ boolean aRedstone) {
+ return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
}
@Override
- public boolean isElectric() {
- return true;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaCreativeEnergyBuffer(mName, mTier, mDescription,
+ mTextures, mInventory.length);
}
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
+ @Override public boolean isSimpleMachine() {return false;}
+ @Override public boolean isElectric() {return true;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return true;}
+ @Override public boolean isEnetInput() {return true;}
+ @Override public boolean isEnetOutput() {return true;}
+ @Override public boolean isInputFacing(byte aSide) {return aSide!=getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isTeleporterCompatible() {return false;}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
+ public long getMinimumStoredEU() {
+ return 1;
}
@Override
- public boolean isGivingInformation() {
- return true;
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
}
@Override
- public boolean isInputFacing(final byte aSide) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ public long maxEUInput() {
+ return V[mTier];
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ public long maxEUOutput() {
+ return V[mTier];
}
@Override
- public boolean isSimpleMachine() {
- return false;
+ public long maxAmperesIn() {
+ return mChargeableCount * 16;
}
@Override
- public boolean isTeleporterCompatible() {
- return false;
+ public long maxAmperesOut() {
+ return mChargeableCount * 16;
}
+ @Override public int rechargerSlotStartIndex() {return 0;}
+ @Override public int dechargerSlotStartIndex() {return 0;}
+ @Override public int rechargerSlotCount() {return mCharge?mInventory.length:0;}
+ @Override public int dechargerSlotCount() {return mDecharge?mInventory.length:0;}
+ @Override public int getProgresstime() {return Integer.MAX_VALUE;}
+ @Override public int maxProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyCapacity();}
+ @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
@Override
- public boolean isValidSlot(final int aIndex) {
- return true;
+ public void saveNBTData(NBTTagCompound aNBT) {
+ //
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
+ public void loadNBTData(NBTTagCompound aNBT) {
//
}
@Override
- public long maxAmperesIn() {
- return this.mChargeableCount * 16;
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory,
+ IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mInventory.length) {
+ case 1: return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ case 4: return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ case 9: return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity);
+ case 16: return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
}
@Override
- public long maxAmperesOut() {
- return this.mChargeableCount * 16;
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory,
+ IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mInventory.length) {
+ case 1: return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 4: return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 9: return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 16: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
}
@Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ this.getBaseMetaTileEntity().increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity
+ .getEUCapacity() / 3;
+ mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
+ mBatteryCount = 1;
+ mChargeableCount = 1;
+ this.getBaseMetaTileEntity().increaseStoredEnergyUnits(mMax, true);
+ for (ItemStack tStack : mInventory) if (GT_ModHandler.isElectricItem(tStack, mTier)) {
+ if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++;
+ mChargeableCount++;
+ }
+ }
}
@Override
- public long maxEUOutput() {
- return GT_Values.V[this.mTier];
+ 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")){
+ return true;
+ }
+ }
+ return false;
}
@Override
- public long maxEUStore() {
- return Long.MAX_VALUE;
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if(!GT_Utility.isStackValid(aStack)){
+ return false;
+ }
+ if(GT_ModHandler.isElectricItem(aStack, this.mTier)){
+ return true;
+ }
+ return false;
}
@Override
- public int maxProgresstime() {
- return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
- }
+ public long[] getStoredEnergy(){
+ long tScale = getBaseMetaTileEntity().getEUCapacity();
+ long tStored = getBaseMetaTileEntity().getStoredEU();
+ this.setEUVar(Long.MAX_VALUE);
+ if (mInventory != null) {
+ for (ItemStack aStack : mInventory) {
+ if (GT_ModHandler.isElectricItem(aStack)) {
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaCreativeEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures,
- this.mInventory.length);
- }
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
- if (aBaseMetaTileEntity.isServerSide()) {
- this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
- this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
- this.mBatteryCount = 1;
- this.mChargeableCount = 1;
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits(this.mMax, true);
- for (final ItemStack tStack : this.mInventory) {
- if (GT_ModHandler.isElectricItem(tStack, this.mTier)) {
- if (GT_ModHandler.isChargerItem(tStack)) {
- this.mBatteryCount++;
+ if (aStack.getItem() instanceof GT_MetaBase_Item) {
+ Long[] stats = ((GT_MetaBase_Item) aStack.getItem())
+ .getElectricStats(aStack);
+ if (stats != null) {
+ tScale = tScale + stats[0];
+ tStored = tStored
+ + ((GT_MetaBase_Item) aStack.getItem())
+ .getRealCharge(aStack);
+ }
+ } else if (aStack.getItem() instanceof IElectricItem) {
+ tStored = tStored
+ + (long) ic2.api.item.ElectricItem.manager
+ .getCharge(aStack);
+ tScale = tScale
+ + (long) ((IElectricItem) aStack.getItem())
+ .getMaxCharge(aStack);
}
- this.mChargeableCount++;
}
}
+
}
- }
- @Override
- public int rechargerSlotCount() {
- return this.mCharge ? this.mInventory.length : 0;
+ return new long[] { tStored, tScale };
}
+ private long count=0;
+ private long mStored=0;
+ private long mMax=0;
+
@Override
- public int rechargerSlotStartIndex() {
- return 0;
+ public String[] getInfoData() {
+ count++;
+ if(mMax==0||count%20==0){
+ long[] tmp = getStoredEnergy();
+ mStored=tmp[0];
+ mMax=tmp[1];
+ }
+
+ return new String[] {
+ getLocalName(),
+ "THIS IS A CREATIVE ITEM - FOR TESTING",
+ GT_Utility.formatNumbers(mStored)+" EU /",
+ GT_Utility.formatNumbers(mMax)+" EU"};
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- //
+ public boolean isGivingInformation() {
+ return true;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
index 2d62db692c..56a48602c9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
@@ -5,24 +5,23 @@ import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.fluids.Fluid;
public class GregtechFluid extends Fluid implements Runnable {
- public final String mTextureName;
- private final short[] mRGBa;
+ public final String mTextureName;
+ private final short[] mRGBa;
- public GregtechFluid(final String aName, final String aTextureName, final short[] aRGBa) {
- super(aName);
- this.mRGBa = aRGBa;
- this.mTextureName = aTextureName;
- GregTech_API.sGTBlockIconload.add(this);
- }
+ public GregtechFluid(String aName, String aTextureName, short[] aRGBa) {
+ super(aName);
+ mRGBa = aRGBa;
+ mTextureName = aTextureName;
+ GregTech_API.sGTBlockIconload.add(this);
+ }
- @Override
- public int getColor() {
- return Math.max(0, Math.min(255, this.mRGBa[0])) << 16 | Math.max(0, Math.min(255, this.mRGBa[1])) << 8
- | Math.max(0, Math.min(255, this.mRGBa[2]));
- }
+ @Override
+ public int getColor() {
+ return (Math.max(0, Math.min(255, mRGBa[0])) << 16) | (Math.max(0, Math.min(255, mRGBa[1])) << 8) | Math.max(0, Math.min(255, mRGBa[2]));
+ }
- @Override
- public void run() {
- this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + "fluids/fluid." + this.mTextureName));
- }
+ @Override
+ public void run() {
+ setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + mTextureName));
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
index 2b72e42e24..2994bb1b71 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
@@ -1,153 +1,130 @@
package gtPlusPlus.xmod.gregtech.api.objects;
-import java.util.*;
-
import gregtech.api.objects.GT_ArrayList;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
import net.minecraft.item.ItemStack;
public class GregtechItemData {
- private static final GregtechMaterialStack[] EMPTY_GT_MaterialStack_ARRAY = new GregtechMaterialStack[0];
-
- public final List<Object> mExtraData = new GT_ArrayList<Object>(false,
- 1);
- public final GregtechOrePrefixes mPrefix;
- public final GregtechMaterialStack mMaterial;
- public final GregtechMaterialStack[] mByProducts;
- public boolean mBlackListed = false;
- public ItemStack mUnificationTarget = null;
-
- public GregtechItemData(final GregtechItemData... aData) {
- this.mPrefix = null;
- this.mBlackListed = true;
-
- final ArrayList<GregtechMaterialStack> aList = new ArrayList<GregtechMaterialStack>(),
- rList = new ArrayList<GregtechMaterialStack>();
-
- for (final GregtechItemData tData : aData) {
- if (tData != null) {
- if (tData.hasValidMaterialData() && tData.mMaterial.mAmount > 0) {
- aList.add(tData.mMaterial.clone());
- }
- for (final GregtechMaterialStack tMaterial : tData.mByProducts) {
- if (tMaterial.mAmount > 0) {
- aList.add(tMaterial.clone());
- }
- }
- }
- }
-
- for (final GregtechMaterialStack aMaterial : aList) {
- boolean temp = true;
- for (final GregtechMaterialStack tMaterial : rList) {
- if (aMaterial.mMaterial == tMaterial.mMaterial) {
- tMaterial.mAmount += aMaterial.mAmount;
- temp = false;
- break;
- }
- }
- if (temp) {
- rList.add(aMaterial.clone());
- }
- }
-
- Collections.sort(rList, new Comparator<GregtechMaterialStack>() {
- @Override
- public int compare(final GregtechMaterialStack a, final GregtechMaterialStack b) {
- return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;
- }
- });
-
- if (rList.isEmpty()) {
- this.mMaterial = null;
- }
- else {
- this.mMaterial = rList.get(0);
- rList.remove(0);
- }
-
- this.mByProducts = rList.toArray(new GregtechMaterialStack[rList.size()]);
- }
-
- public GregtechItemData(final GregtechMaterialStack aMaterial, final GregtechMaterialStack... aByProducts) {
- this.mPrefix = null;
- this.mMaterial = aMaterial.mMaterial == null ? null : aMaterial.clone();
- this.mBlackListed = true;
- if (aByProducts == null) {
- this.mByProducts = GregtechItemData.EMPTY_GT_MaterialStack_ARRAY;
- }
- else {
- final GregtechMaterialStack[] tByProducts = aByProducts.length < 1
- ? GregtechItemData.EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[aByProducts.length];
- int j = 0;
- for (int i = 0; i < aByProducts.length; i++) {
- if (aByProducts[i] != null && aByProducts[i].mMaterial != null) {
- tByProducts[j++] = aByProducts[i].clone();
- }
- }
- this.mByProducts = j > 0 ? new GregtechMaterialStack[j] : GregtechItemData.EMPTY_GT_MaterialStack_ARRAY;
- for (int i = 0; i < this.mByProducts.length; i++) {
- this.mByProducts[i] = tByProducts[i];
- }
- }
- }
-
- public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial) {
- this(aPrefix, aMaterial, false);
- }
-
- public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial,
- final boolean aBlackListed) {
- this.mPrefix = aPrefix;
- this.mMaterial = aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aPrefix.mMaterialAmount);
- this.mBlackListed = aBlackListed;
- this.mByProducts = aPrefix.mSecondaryMaterial == null || aPrefix.mSecondaryMaterial.mMaterial == null
- ? GregtechItemData.EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[] {
- aPrefix.mSecondaryMaterial.clone()
- };
- }
-
- public GregtechItemData(final GT_Materials aMaterial, final long aAmount,
- final GregtechMaterialStack... aByProducts) {
- this(new GregtechMaterialStack(aMaterial, aAmount), aByProducts);
- }
-
- public GregtechItemData(final GT_Materials aMaterial, final long aAmount, final GT_Materials aByProduct,
- final long aByProductAmount) {
- this(new GregtechMaterialStack(aMaterial, aAmount), new GregtechMaterialStack(aByProduct, aByProductAmount));
- }
-
- public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() {
- final ArrayList<GregtechMaterialStack> rList = new ArrayList();
- if (this.hasValidMaterialData()) {
- rList.add(this.mMaterial);
- }
- rList.addAll(Arrays.asList(this.mByProducts));
- return rList;
- }
-
- public GregtechMaterialStack getByProduct(final int aIndex) {
- return aIndex >= 0 && aIndex < this.mByProducts.length ? this.mByProducts[aIndex] : null;
- }
-
- public boolean hasValidMaterialData() {
- return this.mMaterial != null && this.mMaterial.mMaterial != null;
- }
-
- public boolean hasValidPrefixData() {
- return this.mPrefix != null;
- }
-
- public boolean hasValidPrefixMaterialData() {
- return this.mPrefix != null && this.mMaterial != null && this.mMaterial.mMaterial != null;
- }
-
- @Override
- public String toString() {
- if (this.mPrefix == null || this.mMaterial == null || this.mMaterial.mMaterial == null) {
- return "";
- }
- return this.mPrefix.name() + this.mMaterial.mMaterial.name();
- }
+ private static final GregtechMaterialStack[] EMPTY_GT_MaterialStack_ARRAY = new GregtechMaterialStack[0];
+
+ public final List<Object> mExtraData = new GT_ArrayList<Object>(false, 1);
+ public final GregtechOrePrefixes mPrefix;
+ public final GregtechMaterialStack mMaterial;
+ public final GregtechMaterialStack[] mByProducts;
+ public boolean mBlackListed = false;
+ public ItemStack mUnificationTarget = null;
+
+ public GregtechItemData(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, boolean aBlackListed) {
+ mPrefix = aPrefix;
+ mMaterial = aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aPrefix.mMaterialAmount);
+ mBlackListed = aBlackListed;
+ mByProducts = aPrefix.mSecondaryMaterial == null || aPrefix.mSecondaryMaterial.mMaterial == null ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[]{aPrefix.mSecondaryMaterial.clone()};
+ }
+
+ public GregtechItemData(GregtechOrePrefixes aPrefix, GT_Materials aMaterial) {
+ this(aPrefix, aMaterial, false);
+ }
+
+ public GregtechItemData(GregtechMaterialStack aMaterial, GregtechMaterialStack... aByProducts) {
+ mPrefix = null;
+ mMaterial = aMaterial.mMaterial == null ? null : aMaterial.clone();
+ mBlackListed = true;
+ if (aByProducts == null) {
+ mByProducts = EMPTY_GT_MaterialStack_ARRAY;
+ } else {
+ GregtechMaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[aByProducts.length];
+ int j = 0;
+ for (int i = 0; i < aByProducts.length; i++)
+ if (aByProducts[i] != null && aByProducts[i].mMaterial != null)
+ tByProducts[j++] = aByProducts[i].clone();
+ mByProducts = j > 0 ? new GregtechMaterialStack[j] : EMPTY_GT_MaterialStack_ARRAY;
+ for (int i = 0; i < mByProducts.length; i++) mByProducts[i] = tByProducts[i];
+ }
+ }
+
+ public GregtechItemData(GT_Materials aMaterial, long aAmount, GregtechMaterialStack... aByProducts) {
+ this(new GregtechMaterialStack(aMaterial, aAmount), aByProducts);
+ }
+
+ public GregtechItemData(GT_Materials aMaterial, long aAmount, GT_Materials aByProduct, long aByProductAmount) {
+ this(new GregtechMaterialStack(aMaterial, aAmount), new GregtechMaterialStack(aByProduct, aByProductAmount));
+ }
+
+ public GregtechItemData(GregtechItemData... aData) {
+ mPrefix = null;
+ mBlackListed = true;
+
+ ArrayList<GregtechMaterialStack> aList = new ArrayList<GregtechMaterialStack>(), rList = new ArrayList<GregtechMaterialStack>();
+
+ for (GregtechItemData tData : aData)
+ if (tData != null) {
+ if (tData.hasValidMaterialData() && tData.mMaterial.mAmount > 0) aList.add(tData.mMaterial.clone());
+ for (GregtechMaterialStack tMaterial : tData.mByProducts)
+ if (tMaterial.mAmount > 0) aList.add(tMaterial.clone());
+ }
+
+ for (GregtechMaterialStack aMaterial : aList) {
+ boolean temp = true;
+ for (GregtechMaterialStack tMaterial : rList)
+ if (aMaterial.mMaterial == tMaterial.mMaterial) {
+ tMaterial.mAmount += aMaterial.mAmount;
+ temp = false;
+ break;
+ }
+ if (temp) rList.add(aMaterial.clone());
+ }
+
+ Collections.sort(rList, new Comparator<GregtechMaterialStack>() {
+ @Override
+ public int compare(GregtechMaterialStack a, GregtechMaterialStack b) {
+ return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;
+ }
+ });
+
+ if (rList.isEmpty()) {
+ mMaterial = null;
+ } else {
+ mMaterial = rList.get(0);
+ rList.remove(0);
+ }
+
+ mByProducts = rList.toArray(new GregtechMaterialStack[rList.size()]);
+ }
+
+ public boolean hasValidPrefixMaterialData() {
+ return mPrefix != null && mMaterial != null && mMaterial.mMaterial != null;
+ }
+
+ public boolean hasValidPrefixData() {
+ return mPrefix != null;
+ }
+
+ public boolean hasValidMaterialData() {
+ return mMaterial != null && mMaterial.mMaterial != null;
+ }
+
+ public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() {
+ ArrayList<GregtechMaterialStack> rList = new ArrayList();
+ if (hasValidMaterialData()) rList.add(mMaterial);
+ rList.addAll(Arrays.asList(mByProducts));
+ return rList;
+ }
+
+ public GregtechMaterialStack getByProduct(int aIndex) {
+ return aIndex >= 0 && aIndex < mByProducts.length ? mByProducts[aIndex] : null;
+ }
+
+ @Override
+ public String toString() {
+ if (mPrefix == null || mMaterial == null || mMaterial.mMaterial == null) return "";
+ return mPrefix.name() + mMaterial.mMaterial.name();
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
index 7a99fa2a8b..245db1745f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
@@ -3,52 +3,40 @@ package gtPlusPlus.xmod.gregtech.api.objects;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
public class GregtechMaterialStack implements Cloneable {
- public long mAmount;
- public GT_Materials mMaterial;
-
- public GregtechMaterialStack(final GT_Materials aMaterial, final long aAmount) {
- this.mMaterial = aMaterial == null ? GT_Materials._NULL : aMaterial;
- this.mAmount = aAmount;
- }
-
- @Override
- public GregtechMaterialStack clone() {
- return new GregtechMaterialStack(this.mMaterial, this.mAmount);
- }
-
- public GregtechMaterialStack copy(final long aAmount) {
- return new GregtechMaterialStack(this.mMaterial, aAmount);
- }
-
- @Override
- public boolean equals(final Object aObject) {
- if (aObject == this) {
- return true;
- }
- if (aObject == null) {
- return false;
- }
- if (aObject instanceof GT_Materials) {
- return aObject == this.mMaterial;
- }
- if (aObject instanceof GregtechMaterialStack) {
- return ((GregtechMaterialStack) aObject).mMaterial == this.mMaterial
- && (this.mAmount < 0 || ((GregtechMaterialStack) aObject).mAmount < 0
- || ((GregtechMaterialStack) aObject).mAmount == this.mAmount);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return this.mMaterial.hashCode();
- }
-
- @Override
- public String toString() {
- return (this.mMaterial.mMaterialList.size() > 1 && this.mAmount > 1 ? "(" : "")
- + this.mMaterial.getToolTip(true)
- + (this.mMaterial.mMaterialList.size() > 1 && this.mAmount > 1 ? ")" : "")
- + (this.mAmount > 1 ? this.mAmount : "");
- }
+ public long mAmount;
+ public GT_Materials mMaterial;
+
+ public GregtechMaterialStack(GT_Materials aMaterial, long aAmount) {
+ mMaterial = aMaterial == null ? GT_Materials._NULL : aMaterial;
+ mAmount = aAmount;
+ }
+
+ public GregtechMaterialStack copy(long aAmount) {
+ return new GregtechMaterialStack(mMaterial, aAmount);
+ }
+
+ @Override
+ public GregtechMaterialStack clone() {
+ return new GregtechMaterialStack(mMaterial, mAmount);
+ }
+
+ @Override
+ public boolean equals(Object aObject) {
+ if (aObject == this) return true;
+ if (aObject == null) return false;
+ if (aObject instanceof GT_Materials) return aObject == mMaterial;
+ if (aObject instanceof GregtechMaterialStack)
+ return ((GregtechMaterialStack) aObject).mMaterial == mMaterial && (mAmount < 0 || ((GregtechMaterialStack) aObject).mAmount < 0 || ((GregtechMaterialStack) aObject).mAmount == mAmount);
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return (mMaterial.mMaterialList.size() > 1 && mAmount > 1 ? "(" : "") + mMaterial.getToolTip(true) + (mMaterial.mMaterialList.size() > 1 && mAmount > 1 ? ")" : "") + (mAmount > 1 ? mAmount : "");
+ }
+
+ @Override
+ public int hashCode() {
+ return mMaterial.hashCode();
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java
index 8f7b153551..03c59c7ac6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.api.objects;
import gregtech.api.enums.Dyes;
-import gregtech.api.interfaces.*;
+import gregtech.api.interfaces.IColorModulationContainer;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
import gtPlusPlus.core.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
@@ -10,167 +12,151 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
public class GregtechRenderedTexture implements ITexture, IColorModulationContainer {
- private final IIconContainer mIconContainer;
- private final boolean mAllowAlpha;
- /**
- * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!!
- * <p/>
- * Just set this variable to another different Array instead. Otherwise some
- * colored things will get Problems.
- */
- public short[] mRGBa;
-
- public GregtechRenderedTexture(final IIconContainer aIcon) {
- this(aIcon, Dyes._NULL.mRGBa);
- }
-
- public GregtechRenderedTexture(final IIconContainer aIcon, final short[] aRGBa) {
- this(aIcon, aRGBa, true);
- }
-
- public GregtechRenderedTexture(final IIconContainer aIcon, final short[] aRGBa, final boolean aAllowAlpha) {
- if (aRGBa.length != 4) {
- throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture");
- }
- this.mIconContainer = aIcon;
- this.mAllowAlpha = aAllowAlpha;
- this.mRGBa = aRGBa;
- }
-
- @Override
- public short[] getRGBA() {
- return this.mRGBa;
- }
-
- @Override
- public boolean isValidTexture() {
- return this.mIconContainer != null;
- }
-
- @Override
- public void renderXNeg(final RenderBlocks aRenderer, final Block aBlock, final int aX, final int aY, final int aZ) {
- Tessellator.instance.setColorRGBA((int) (this.mRGBa[0] * 0.6F), (int) (this.mRGBa[1] * 0.6F),
- (int) (this.mRGBa[2] * 0.6F), this.mAllowAlpha ? 255 - this.mRGBa[3] : 255);
- aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, this.mIconContainer.getIcon());
- if (this.mIconContainer.getOverlayIcon() != null) {
- Tessellator.instance.setColorRGBA(153, 153, 153, 255);
- aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, this.mIconContainer.getOverlayIcon());
- }
- }
-
- @Override
- public void renderXPos(final RenderBlocks aRenderer, final Block aBlock, final int aX, final int aY, final int aZ) {
- Tessellator.instance.setColorRGBA((int) (this.mRGBa[0] * 0.6F), (int) (this.mRGBa[1] * 0.6F),
- (int) (this.mRGBa[2] * 0.6F), this.mAllowAlpha ? 255 - this.mRGBa[3] : 255);
- aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, this.mIconContainer.getIcon());
- if (this.mIconContainer.getOverlayIcon() != null) {
- Tessellator.instance.setColorRGBA(153, 153, 153, 255);
- aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, this.mIconContainer.getOverlayIcon());
- }
- }
-
- @Override
- public void renderYNeg(final RenderBlocks aRenderer, final Block aBlock, final int aX, final int aY, final int aZ) {
- Tessellator.instance.setColorRGBA((int) (this.mRGBa[0] * 0.5F), (int) (this.mRGBa[1] * 0.5F),
- (int) (this.mRGBa[2] * 0.5F), this.mAllowAlpha ? 255 - this.mRGBa[3] : 255);
- IIcon aIcon = this.mIconContainer.getIcon();
-
- double d3 = aIcon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d4 = aIcon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d5 = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- double d6 = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
-
- if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = aIcon.getMaxU();
- d4 = aIcon.getMinU();
- }
-
- if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d5 = aIcon.getMinV();
- d6 = aIcon.getMaxV();
- }
-
- final double d11 = aX + aRenderer.renderMinX;
- final double d12 = aX + aRenderer.renderMaxX;
- final double d13 = aY + aRenderer.renderMinY;
- final double d14 = aZ + aRenderer.renderMinZ;
- final double d15 = aZ + aRenderer.renderMaxZ;
-
- Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6);
- Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5);
- Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5);
- Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6);
-
- if ((aIcon = this.mIconContainer.getOverlayIcon()) != null) {
- Tessellator.instance.setColorRGBA(128, 128, 128, 255);
-
- Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6);
- Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5);
- Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5);
- Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6);
- }
- }
-
- @Override
- public void renderYPos(final RenderBlocks aRenderer, final Block aBlock, final int aX, final int aY, final int aZ) {
- Tessellator.instance.setColorRGBA((int) (this.mRGBa[0] * 1.0F), (int) (this.mRGBa[1] * 1.0F),
- (int) (this.mRGBa[2] * 1.0F), this.mAllowAlpha ? 255 - this.mRGBa[3] : 255);
- aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, this.mIconContainer.getIcon());
- if (this.mIconContainer.getOverlayIcon() != null) {
- Tessellator.instance.setColorRGBA(255, 255, 255, 255);
- aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, this.mIconContainer.getOverlayIcon());
- }
- }
-
- @Override
- public void renderZNeg(final RenderBlocks aRenderer, final Block aBlock, final int aX, final int aY, final int aZ) {
- try {
- Utils.LOG_WARNING("renderZNeg Method();.");
- Utils.LOG_WARNING("Setting RGBA of instance.");
- Tessellator.instance.setColorRGBA((int) (this.mRGBa[0] * 0.8F), (int) (this.mRGBa[1] * 0.8F),
- (int) (this.mRGBa[2] * 0.8F), this.mAllowAlpha ? 255 - this.mRGBa[3] : 255);
- aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, this.mIconContainer.getIcon());
- Utils.LOG_WARNING("Is mIconContainer null? " + this.mIconContainer.toString());
- Utils.LOG_WARNING("mIconContainer.getIcon.getIconName(): " + this.mIconContainer.getIcon().getIconName());
- Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourceDomain()"
- + this.mIconContainer.getTextureFile().getResourceDomain());
- Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourcePath()"
- + this.mIconContainer.getTextureFile().getResourcePath());
- if (this.mIconContainer.getOverlayIcon() != null) {
- Tessellator.instance.setColorRGBA(204, 204, 204, 255);
- aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, this.mIconContainer.getOverlayIcon());
- Utils.LOG_WARNING(
- "Is miconContainer.getOverlayIcon null? " + this.mIconContainer.getOverlayIcon().toString());
- Utils.LOG_WARNING(
- "mIconContainer.getIcon.getIconName(): " + this.mIconContainer.getOverlayIcon().getIconName());
- Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourceDomain()"
- + this.mIconContainer.getTextureFile().getResourceDomain());
- Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourcePath()"
- + this.mIconContainer.getTextureFile().getResourcePath());
- }
- }
- catch (final NullPointerException e) {
-
- e.printStackTrace();
- Utils.LOG_WARNING(
- "renderZNeg failed." + e.getMessage() + "|" + e.getClass() + "|" + e.getLocalizedMessage());
- Minecraft.getMinecraft().shutdown();
- }
- }
-
- @Override
- public void renderZPos(final RenderBlocks aRenderer, final Block aBlock, final int aX, final int aY, final int aZ) {
- try {
- Tessellator.instance.setColorRGBA((int) (this.mRGBa[0] * 0.8F), (int) (this.mRGBa[1] * 0.8F),
- (int) (this.mRGBa[2] * 0.8F), this.mAllowAlpha ? 255 - this.mRGBa[3] : 255);
- aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, this.mIconContainer.getIcon());
- if (this.mIconContainer.getOverlayIcon() != null) {
- Tessellator.instance.setColorRGBA(204, 204, 204, 255);
- aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, this.mIconContainer.getOverlayIcon());
- }
- }
- catch (final NullPointerException e) {
- Utils.LOG_WARNING("renderZPos failed.");
- }
- }
+ private final IIconContainer mIconContainer;
+ private final boolean mAllowAlpha;
+ /**
+ * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!!
+ * <p/>
+ * Just set this variable to another different Array instead.
+ * Otherwise some colored things will get Problems.
+ */
+ public short[] mRGBa;
+
+ public GregtechRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) {
+ if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture");
+ mIconContainer = aIcon;
+ mAllowAlpha = aAllowAlpha;
+ mRGBa = aRGBa;
+ }
+
+ public GregtechRenderedTexture(IIconContainer aIcon, short[] aRGBa) {
+ this(aIcon, aRGBa, true);
+ }
+
+ public GregtechRenderedTexture(IIconContainer aIcon) {
+ this(aIcon, Dyes._NULL.mRGBa);
+ }
+
+ @Override
+ public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(153, 153, 153, 255);
+ aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ }
+
+ @Override
+ public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(153, 153, 153, 255);
+ aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ }
+
+ @Override
+ public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(255, 255, 255, 255);
+ aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ }
+
+ @Override
+ public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ IIcon aIcon = mIconContainer.getIcon();
+
+ double d3 = aIcon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
+ double d4 = aIcon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
+ double d5 = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
+ double d6 = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
+
+ if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
+ d3 = aIcon.getMaxU();
+ d4 = aIcon.getMinU();
+ }
+
+ if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
+ d5 = aIcon.getMinV();
+ d6 = aIcon.getMaxV();
+ }
+
+ double d11 = aX + aRenderer.renderMinX;
+ double d12 = aX + aRenderer.renderMaxX;
+ double d13 = aY + aRenderer.renderMinY;
+ double d14 = aZ + aRenderer.renderMinZ;
+ double d15 = aZ + aRenderer.renderMaxZ;
+
+ Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6);
+ Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6);
+
+ if ((aIcon = mIconContainer.getOverlayIcon()) != null) {
+ Tessellator.instance.setColorRGBA(128, 128, 128, 255);
+
+ Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6);
+ Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6);
+ }
+ }
+
+ @Override
+ public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ try {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(204, 204, 204, 255);
+ aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ } catch (NullPointerException e){
+ Utils.LOG_WARNING("renderZPos failed.");
+ }
+ }
+
+ @Override
+ public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ try {
+ Utils.LOG_WARNING("renderZNeg Method();.");
+ Utils.LOG_WARNING("Setting RGBA of instance.");
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ Utils.LOG_WARNING("Is mIconContainer null? "+mIconContainer.toString());
+ Utils.LOG_WARNING("mIconContainer.getIcon.getIconName(): "+mIconContainer.getIcon().getIconName());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourceDomain()"+mIconContainer.getTextureFile().getResourceDomain());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourcePath()"+mIconContainer.getTextureFile().getResourcePath());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(204, 204, 204, 255);
+ aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ Utils.LOG_WARNING("Is miconContainer.getOverlayIcon null? "+mIconContainer.getOverlayIcon().toString());
+ Utils.LOG_WARNING("mIconContainer.getIcon.getIconName(): "+mIconContainer.getOverlayIcon().getIconName());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourceDomain()"+mIconContainer.getTextureFile().getResourceDomain());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourcePath()"+mIconContainer.getTextureFile().getResourcePath());
+ }
+ } catch (NullPointerException e){
+
+
+ e.printStackTrace();
+ Utils.LOG_WARNING("renderZNeg failed."+e.getMessage()+"|"+e.getClass()+"|"+e.getLocalizedMessage());
+ Minecraft.getMinecraft().shutdown();
+ }
+ }
+
+ @Override
+ public short[] getRGBA() {
+ return mRGBa;
+ }
+
+ @Override
+ public boolean isValidTexture() {
+ return mIconContainer != null;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java b/src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
index 8bf321a73d..8f4fe09dbe 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
@@ -1,24 +1,20 @@
package gtPlusPlus.xmod.gregtech.api.recipe;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.ToolDictNames;
import gregtech.api.interfaces.IOreRecipeRegistrator;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingSkookumChoocherToolRecipes implements IOreRecipeRegistrator {
- public ProcessingSkookumChoocherToolRecipes() {
- // GregtechOrePrefixes.toolSkookumChoocher.add(this);
- }
+ public ProcessingSkookumChoocherToolRecipes() {
+ //GregtechOrePrefixes.toolSkookumChoocher.add(this);
+ }
- @Override
- public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- GT_ModHandler.addShapelessCraftingRecipe(
- MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(7734, 1, aMaterial, aMaterial, null),
- new Object[] {
- aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial),
- ToolDictNames.craftingToolScrewdriver
- });
- }
+ @Override
+ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ GT_ModHandler.addShapelessCraftingRecipe(MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(7734, 1, aMaterial, aMaterial, null), new Object[]{aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial), ToolDictNames.craftingToolScrewdriver});
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
index fed71886e3..de41b3cafa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
@@ -1,19 +1,27 @@
package gtPlusPlus.xmod.gregtech.api.util;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map.Entry;
-
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.M;
+import static gregtech.api.enums.GT_Values.W;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
import gregtech.api.objects.GT_HashSet;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Proxy.OreDictEventContainer;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechItemData;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechMaterialStack;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -23,476 +31,336 @@ import net.minecraftforge.oredict.OreDictionary;
* <p/>
* This is the Core of my OreDict Unification Code
* <p/>
- * If you just want to use this to unificate your Items, then use the Function
- * in the GregTech_API File
+ * If you just want to use this to unificate your Items, then use the Function in the GregTech_API File
* <p/>
- * P.S. It is intended to be named "Unificator" and not "Unifier", because that
- * sounds more awesome.
+ * P.S. It is intended to be named "Unificator" and not "Unifier", because that sounds more awesome.
*/
public class GregtechOreDictUnificator {
- private static final HashMap<String, ItemStack> sName2StackMap = new HashMap<String, ItemStack>();
- private static final HashMap<GT_ItemStack, GregtechItemData> sItemStack2DataMap = new HashMap<GT_ItemStack, GregtechItemData>();
- private static final GT_HashSet<GT_ItemStack> sNoUnificationList = new GT_HashSet<GT_ItemStack>();
- public static volatile int VERSION = 508;
- private static int isRegisteringOre = 0, isAddingOre = 0;
- private static boolean mRunThroughTheList = true;
-
- static {
- GregTech_API.sItemStackMappings.add(GregtechOreDictUnificator.sItemStack2DataMap);
- }
-
- public static void add(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final ItemStack aStack) {
- GregtechOreDictUnificator.set(aPrefix, aMaterial, aStack, false, false);
- }
-
- public static void addAssociation(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial,
- final ItemStack aStack, final boolean aBlackListed) {
- if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) {
- return;
- }
- if (Items.feather.getDamage(aStack) == GT_Values.W) {
- for (byte i = 0; i < 16; i++) {
- GregtechOreDictUnificator.setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack),
- new GregtechItemData(aPrefix, aMaterial, aBlackListed));
- }
- }
- GregtechOreDictUnificator.setItemData(aStack, new GregtechItemData(aPrefix, aMaterial, aBlackListed));
- }
-
- public static void addItemData(final ItemStack aStack, final GregtechItemData aData) {
- if (GT_Utility.isStackValid(aStack) && GregtechOreDictUnificator.getItemData(aStack) == null && aData != null) {
- GregtechOreDictUnificator.setItemData(aStack, aData);
- }
- }
-
- /**
- * The Blacklist just prevents the Item from being unificated into something
- * else. Useful if you have things like the Industrial Diamond, which is
- * better than regular Diamond, but also usable in absolutely all Diamond
- * Recipes.
- */
- public static void addToBlacklist(final ItemStack aStack) {
- if (GT_Utility.isStackValid(aStack)
- && !GT_Utility.isStackInList(aStack, GregtechOreDictUnificator.sNoUnificationList)) {
- GregtechOreDictUnificator.sNoUnificationList.add(aStack);
- }
- }
-
- public static ItemStack get(final boolean aUseBlackList, final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return null;
- }
- final GregtechItemData tPrefixMaterial = GregtechOreDictUnificator.getAssociation(aStack);
- ItemStack rStack = null;
- if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData()
- || aUseBlackList && tPrefixMaterial.mBlackListed) {
- return GT_Utility.copy(aStack);
- }
- if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered
- && GregtechOreDictUnificator.isBlacklisted(aStack)) {
- tPrefixMaterial.mBlackListed = true;
- return GT_Utility.copy(aStack);
- }
- if (tPrefixMaterial.mUnificationTarget == null) {
- tPrefixMaterial.mUnificationTarget = GregtechOreDictUnificator.sName2StackMap
- .get(tPrefixMaterial.toString());
- }
- rStack = tPrefixMaterial.mUnificationTarget;
- if (GT_Utility.isStackInvalid(rStack)) {
- return GT_Utility.copy(aStack);
- }
- assert rStack != null;
- rStack.setTagCompound(aStack.getTagCompound());
- return GT_Utility.copyAmount(aStack.stackSize, rStack);
- }
-
- public static ItemStack get(final GregtechOrePrefixes aPrefix, final Object aMaterial, final ItemStack aReplacement,
- final long aAmount) {
- return GregtechOreDictUnificator.get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true);
- }
-
- public static ItemStack get(final GregtechOrePrefixes aPrefix, final Object aMaterial, final long aAmount) {
- return GregtechOreDictUnificator.get(aPrefix, aMaterial, null, aAmount);
- }
-
- public static ItemStack get(final ItemStack aStack) {
- return GregtechOreDictUnificator.get(true, aStack);
- }
-
- public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount) {
- return GregtechOreDictUnificator.get(aName, aReplacement, aAmount, true, true);
- }
-
- public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount,
- final boolean aMentionPossibleTypos, final boolean aNoInvalidAmounts) {
- if (aNoInvalidAmounts && aAmount < 1) {
- return null;
- }
- if (!GregtechOreDictUnificator.sName2StackMap.containsKey(aName.toString()) && aMentionPossibleTypos) {
- GT_Log.err.println("Unknown Key for Unification, Typo? " + aName);
- }
- return GT_Utility.copyAmount(aAmount, GregtechOreDictUnificator.sName2StackMap.get(aName.toString()),
- GregtechOreDictUnificator.getFirstOre(aName, aAmount), aReplacement);
- }
-
- public static ItemStack get(final Object aName, final long aAmount) {
- return GregtechOreDictUnificator.get(aName, null, aAmount, true, true);
- }
-
- public static GregtechItemData getAssociation(final ItemStack aStack) {
- final GregtechItemData rData = GregtechOreDictUnificator.getItemData(aStack);
- return rData != null && rData.hasValidPrefixMaterialData() ? rData : null;
- }
-
- public static ItemStack getDust(final GregtechMaterialStack aMaterial) {
- return aMaterial == null ? null : GregtechOreDictUnificator.getDust(aMaterial.mMaterial, aMaterial.mAmount);
- }
-
- public static ItemStack getDust(final GT_Materials aMaterial, final long aMaterialAmount) {
- if (aMaterialAmount <= 0) {
- return null;
- }
- ItemStack rStack = null;
- if (aMaterialAmount % GT_Values.M == 0 || aMaterialAmount >= GT_Values.M * 16) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.dust, aMaterial, aMaterialAmount / GT_Values.M);
- }
- if (rStack == null && (aMaterialAmount * 4 % GT_Values.M == 0 || aMaterialAmount >= GT_Values.M * 8)) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.dustSmall, aMaterial,
- aMaterialAmount * 4 / GT_Values.M);
- }
- if (rStack == null && aMaterialAmount * 9 >= GT_Values.M) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.dustTiny, aMaterial,
- aMaterialAmount * 9 / GT_Values.M);
- }
- return rStack;
- }
-
- public static ItemStack getDust(final GT_Materials aMaterial, final OrePrefixes aPrefix) {
- return aMaterial == null ? null : GregtechOreDictUnificator.getDust(aMaterial, aPrefix.mMaterialAmount);
- }
-
- public static ItemStack getDustOrIngot(final GregtechMaterialStack aMaterial) {
- ItemStack rStack = GregtechOreDictUnificator.getDust(aMaterial);
- if (rStack == null) {
- rStack = GregtechOreDictUnificator.getIngot(aMaterial);
- }
- return rStack;
- }
-
- public static ItemStack getDustOrIngot(final GT_Materials aMaterial, final long aMaterialAmount) {
- if (aMaterialAmount <= 0) {
- return null;
- }
- ItemStack rStack = GregtechOreDictUnificator.getDust(aMaterial, aMaterialAmount);
- if (rStack == null) {
- rStack = GregtechOreDictUnificator.getIngot(aMaterial, aMaterialAmount);
- }
- return rStack;
- }
-
- public static ItemStack getFirstOre(final Object aName, final long aAmount) {
- if (GT_Utility.isStringInvalid(aName)) {
- return null;
- }
- final ItemStack tStack = GregtechOreDictUnificator.sName2StackMap.get(aName.toString());
- if (GT_Utility.isStackValid(tStack)) {
- return GT_Utility.copyAmount(aAmount, tStack);
- }
- return GT_Utility.copyAmount(aAmount, GregtechOreDictUnificator.getOres(aName).toArray());
- }
-
- public static ItemStack getGem(final GregtechMaterialStack aMaterial) {
- return aMaterial == null ? null : GregtechOreDictUnificator.getGem(aMaterial.mMaterial, aMaterial.mAmount);
- }
-
- public static ItemStack getGem(final GT_Materials aMaterial, final long aMaterialAmount) {
- ItemStack rStack = null;
- if (aMaterialAmount >= GT_Values.M || aMaterialAmount >= GT_Values.M * 32) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.gem, aMaterial, aMaterialAmount / GT_Values.M);
- }
- if (rStack == null && (aMaterialAmount * 2 % GT_Values.M == 0 || aMaterialAmount >= GT_Values.M * 16)) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.gemFlawed, aMaterial,
- aMaterialAmount * 2 / GT_Values.M);
- }
- if (rStack == null && aMaterialAmount * 4 >= GT_Values.M) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.gemChipped, aMaterial,
- aMaterialAmount * 4 / GT_Values.M);
- }
- return rStack;
- }
-
- public static ItemStack getGem(final GT_Materials aMaterial, final OrePrefixes aPrefix) {
- return aMaterial == null ? null : GregtechOreDictUnificator.getGem(aMaterial, aPrefix.mMaterialAmount);
- }
-
- public static ItemStack getIngot(final GregtechMaterialStack aMaterial) {
- return aMaterial == null ? null : GregtechOreDictUnificator.getIngot(aMaterial.mMaterial, aMaterial.mAmount);
- }
-
- public static ItemStack getIngot(final GT_Materials aMaterial, final long aMaterialAmount) {
- if (aMaterialAmount <= 0) {
- return null;
- }
- ItemStack rStack = null;
- if (aMaterialAmount % (GT_Values.M * 9) == 0 && aMaterialAmount / (GT_Values.M * 9) > 1
- || aMaterialAmount >= GT_Values.M * 72) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial,
- aMaterialAmount / (GT_Values.M * 9));
- }
- if (rStack == null && (aMaterialAmount % GT_Values.M == 0 || aMaterialAmount >= GT_Values.M * 8)) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.ingot, aMaterial, aMaterialAmount / GT_Values.M);
- }
- if (rStack == null && aMaterialAmount * 9 >= GT_Values.M) {
- rStack = GregtechOreDictUnificator.get(GregtechOrePrefixes.nugget, aMaterial,
- aMaterialAmount * 9 / GT_Values.M);
- }
- return rStack;
- }
-
- public static ItemStack getIngot(final GT_Materials aMaterial, final OrePrefixes aPrefix) {
- return aMaterial == null ? null : GregtechOreDictUnificator.getIngot(aMaterial, aPrefix.mMaterialAmount);
- }
-
- public static ItemStack getIngotOrDust(final GregtechMaterialStack aMaterial) {
- ItemStack rStack = GregtechOreDictUnificator.getIngot(aMaterial);
- if (aMaterial != null && aMaterial.mMaterial != null) {
- rStack = GregtechOreDictUnificator.getDust(aMaterial);
- }
- if (rStack == null) {
- rStack = GregtechOreDictUnificator.getDust(aMaterial);
- }
- return rStack;
- }
-
- public static ItemStack getIngotOrDust(final GT_Materials aMaterial, final long aMaterialAmount) {
- if (aMaterialAmount <= 0) {
- return null;
- }
- ItemStack rStack = GregtechOreDictUnificator.getIngot(aMaterial, aMaterialAmount);
- if (rStack == null) {
- rStack = GregtechOreDictUnificator.getDust(aMaterial, aMaterialAmount);
- }
- return rStack;
- }
-
- public static GregtechItemData getItemData(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return null;
- }
- GregtechItemData rData = GregtechOreDictUnificator.sItemStack2DataMap.get(new GT_ItemStack(aStack));
- if (rData == null) {
- rData = GregtechOreDictUnificator.sItemStack2DataMap
- .get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, aStack)));
- }
- return rData;
- }
-
- /**
- * @return a Copy of the OreDictionary.getOres() List
- */
- public static ArrayList<ItemStack> getOres(final Object aOreName) {
- final String aName = aOreName == null ? GT_Values.E : aOreName.toString();
- final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- if (GT_Utility.isStringValid(aName)) {
- rList.addAll(OreDictionary.getOres(aName));
- }
- return rList;
- }
-
- /**
- * @return a Copy of the OreDictionary.getOres() List
- */
- public static ArrayList<ItemStack> getOres(final OrePrefixes aPrefix, final Object aMaterial) {
- return GregtechOreDictUnificator.getOres(aPrefix.get(aMaterial));
- }
-
- public static ItemStack[] getStackArray(final boolean aUseBlackList, final Object... aStacks) {
- final ItemStack[] rStacks = new ItemStack[aStacks.length];
- for (int i = 0; i < aStacks.length; i++) {
- rStacks[i] = GregtechOreDictUnificator.get(aUseBlackList, GT_Utility.copy(aStacks[i]));
- }
- return rStacks;
- }
-
- public static boolean isAddingOres() {
- return GregtechOreDictUnificator.isAddingOre > 0;
- }
-
- public static boolean isBlacklisted(final ItemStack aStack) {
- return GT_Utility.isStackInList(aStack, GregtechOreDictUnificator.sNoUnificationList);
- }
-
- public static boolean isItemStackDye(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- for (final Dyes tDye : Dyes.VALUES) {
- if (GregtechOreDictUnificator.isItemStackInstanceOf(aStack, tDye.toString())) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean isItemStackInstanceOf(final ItemStack aStack, final Object aName) {
- if (GT_Utility.isStringInvalid(aName) || GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- for (final ItemStack tOreStack : GregtechOreDictUnificator.getOres(aName.toString())) {
- if (GT_Utility.areStacksEqual(tOreStack, aStack, true)) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean isRegisteringOres() {
- return GregtechOreDictUnificator.isRegisteringOre > 0;
- }
-
- public static boolean registerOre(final GregtechOrePrefixes aPrefix, final Object aMaterial,
- final ItemStack aStack) {
- return GregtechOreDictUnificator.registerOre(aPrefix.get(aMaterial), aStack);
- }
-
- public static boolean registerOre(final Object aName, final ItemStack aStack) {
- if (aName == null || GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- final String tName = aName.toString();
- if (GT_Utility.isStringInvalid(tName)) {
- return false;
- }
- final ArrayList<ItemStack> tList = GregtechOreDictUnificator.getOres(tName);
- for (int i = 0; i < tList.size(); i++) {
- if (GT_Utility.areStacksEqual(tList.get(i), aStack, true)) {
- return false;
- }
- }
- GregtechOreDictUnificator.isRegisteringOre++;
- OreDictionary.registerOre(tName, GT_Utility.copyAmount(1, aStack));
- GregtechOreDictUnificator.isRegisteringOre--;
- return true;
- }
-
- public static void registerRecipes(final OreDictEventContainer tOre) {
+ private static final HashMap<String, ItemStack> sName2StackMap = new HashMap<String, ItemStack>();
+ private static final HashMap<GT_ItemStack, GregtechItemData> sItemStack2DataMap = new HashMap<GT_ItemStack, GregtechItemData>();
+ private static final GT_HashSet<GT_ItemStack> sNoUnificationList = new GT_HashSet<GT_ItemStack>();
+ public static volatile int VERSION = 508;
+ private static int isRegisteringOre = 0, isAddingOre = 0;
+ private static boolean mRunThroughTheList = true;
+
+ static {
+ GregTech_API.sItemStackMappings.add(sItemStack2DataMap);
+ }
+
+ /**
+ * The Blacklist just prevents the Item from being unificated into something else.
+ * Useful if you have things like the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes.
+ */
+ public static void addToBlacklist(ItemStack aStack) {
+ if (GT_Utility.isStackValid(aStack) && !GT_Utility.isStackInList(aStack, sNoUnificationList))
+ sNoUnificationList.add(aStack);
+ }
+
+ public static boolean isBlacklisted(ItemStack aStack) {
+ return GT_Utility.isStackInList(aStack, sNoUnificationList);
+ }
+
+ public static void add(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack) {
+ set(aPrefix, aMaterial, aStack, false, false);
+ }
+
+ public static void set(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack) {
+ set(aPrefix, aMaterial, aStack, true, false);
+ }
+
+ public static void set(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack, boolean aOverwrite, boolean aAlreadyRegistered) {
+ if (aMaterial == null || aPrefix == null || GT_Utility.isStackInvalid(aStack) || Items.feather.getDamage(aStack) == W)
+ return;
+ isAddingOre++;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack);
+ addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack));
+ if (aOverwrite || GT_Utility.isStackInvalid(sName2StackMap.get(aPrefix.get(aMaterial).toString())))
+ sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack);
+ isAddingOre--;
+ }
+
+ public static ItemStack getFirstOre(Object aName, long aAmount) {
+ if (GT_Utility.isStringInvalid(aName)) return null;
+ ItemStack tStack = sName2StackMap.get(aName.toString());
+ if (GT_Utility.isStackValid(tStack)) return GT_Utility.copyAmount(aAmount, tStack);
+ return GT_Utility.copyAmount(aAmount, getOres(aName).toArray());
+ }
+
+ public static ItemStack get(Object aName, long aAmount) {
+ return get(aName, null, aAmount, true, true);
+ }
+
+ public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount) {
+ return get(aName, aReplacement, aAmount, true, true);
+ }
+
+ public static ItemStack get(GregtechOrePrefixes aPrefix, Object aMaterial, long aAmount) {
+ return get(aPrefix, aMaterial, null, aAmount);
+ }
+
+ public static ItemStack get(GregtechOrePrefixes aPrefix, Object aMaterial, ItemStack aReplacement, long aAmount) {
+ return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true);
+ }
+
+ public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, boolean aNoInvalidAmounts) {
+ if (aNoInvalidAmounts && aAmount < 1) return null;
+ if (!sName2StackMap.containsKey(aName.toString()) && aMentionPossibleTypos)
+ GT_Log.err.println("Unknown Key for Unification, Typo? " + aName);
+ return GT_Utility.copyAmount(aAmount, sName2StackMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement);
+ }
+
+ public static ItemStack[] setStackArray(boolean aUseBlackList, ItemStack... aStacks) {
+ for (int i = 0; i < aStacks.length; i++) aStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i]));
+ return aStacks;
+ }
+
+ public static ItemStack[] getStackArray(boolean aUseBlackList, Object... aStacks) {
+ ItemStack[] rStacks = new ItemStack[aStacks.length];
+ for (int i = 0; i < aStacks.length; i++) rStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i]));
+ return rStacks;
+ }
+
+ public static ItemStack setStack(ItemStack aStack) {
+ return setStack(true, aStack);
+ }
+
+ public static ItemStack setStack(boolean aUseBlackList, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return aStack;
+ ItemStack tStack = get(aUseBlackList, aStack);
+ if (GT_Utility.areStacksEqual(aStack, tStack)) return aStack;
+ aStack.func_150996_a(tStack.getItem());
+ Items.feather.setDamage(aStack, Items.feather.getDamage(tStack));
+ return aStack;
+ }
+
+ public static ItemStack get(ItemStack aStack) {
+ return get(true, aStack);
+ }
+
+ public static ItemStack get(boolean aUseBlackList, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return null;
+ GregtechItemData tPrefixMaterial = getAssociation(aStack);
+ ItemStack rStack = null;
+ if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed))
+ return GT_Utility.copy(aStack);
+ if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) {
+ tPrefixMaterial.mBlackListed = true;
+ return GT_Utility.copy(aStack);
+ }
+ if (tPrefixMaterial.mUnificationTarget == null)
+ tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString());
+ rStack = tPrefixMaterial.mUnificationTarget;
+ if (GT_Utility.isStackInvalid(rStack)) return GT_Utility.copy(aStack);
+ assert rStack != null;
+ rStack.setTagCompound(aStack.getTagCompound());
+ return GT_Utility.copyAmount(aStack.stackSize, rStack);
+ }
+
+ public static void addItemData(ItemStack aStack, GregtechItemData aData) {
+ if (GT_Utility.isStackValid(aStack) && getItemData(aStack) == null && aData != null) setItemData(aStack, aData);
+ }
+
+ public static void setItemData(ItemStack aStack, GregtechItemData aData) {
+ if (GT_Utility.isStackInvalid(aStack) || aData == null) return;
+ GregtechItemData tData = getItemData(aStack);
+ if (tData == null || !tData.hasValidPrefixMaterialData()) {
+ if (tData != null) for (Object tObject : tData.mExtraData)
+ if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject);
+ if (aStack.stackSize > 1) {
+ if (aData.mMaterial != null) aData.mMaterial.mAmount /= aStack.stackSize;
+ for (GregtechMaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ }
+ sItemStack2DataMap.put(new GT_ItemStack(aStack), aData);
+ if (aData.hasValidMaterialData()) {
+ long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M;
+ for (GregtechMaterialStack tMaterial : aData.mByProducts)
+ tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M;
+ if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack);
+ }
+ if (mRunThroughTheList) {
+ if (GregTech_API.sLoadStarted) {
+ mRunThroughTheList = false;
+ for (Entry<GT_ItemStack, GregtechItemData> tEntry : sItemStack2DataMap.entrySet())
+ if (!tEntry.getValue().hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling)
+ GregtechRecipeRegistrator.registerMaterialRecycling(tEntry.getKey().toStack(), tEntry.getValue());
+ }
+ } else {
+ if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling)
+ GregtechRecipeRegistrator.registerMaterialRecycling(aStack, aData);
+ }
+ } else {
+ for (Object tObject : aData.mExtraData)
+ if (!tData.mExtraData.contains(tObject)) tData.mExtraData.add(tObject);
+ }
+ }
+
+ public static void addAssociation(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack, boolean aBlackListed) {
+ if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return;
+ if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++)
+ setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new GregtechItemData(aPrefix, aMaterial, aBlackListed));
+ setItemData(aStack, new GregtechItemData(aPrefix, aMaterial, aBlackListed));
+ }
+
+ public static GregtechItemData getItemData(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return null;
+ GregtechItemData rData = sItemStack2DataMap.get(new GT_ItemStack(aStack));
+ if (rData == null) rData = sItemStack2DataMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack)));
+ return rData;
+ }
+
+ public static GregtechItemData getAssociation(ItemStack aStack) {
+ GregtechItemData rData = getItemData(aStack);
+ return rData != null && rData.hasValidPrefixMaterialData() ? rData : null;
+ }
+
+ public static boolean isItemStackInstanceOf(ItemStack aStack, Object aName) {
+ if (GT_Utility.isStringInvalid(aName) || GT_Utility.isStackInvalid(aStack)) return false;
+ for (ItemStack tOreStack : getOres(aName.toString()))
+ if (GT_Utility.areStacksEqual(tOreStack, aStack, true)) return true;
+ return false;
+ }
+
+ public static boolean isItemStackDye(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ for (Dyes tDye : Dyes.VALUES) if (isItemStackInstanceOf(aStack, tDye.toString())) return true;
+ return false;
+ }
+
+ public static boolean registerOre(GregtechOrePrefixes aPrefix, Object aMaterial, ItemStack aStack) {
+ return registerOre(aPrefix.get(aMaterial), aStack);
+ }
+
+ public static boolean registerOre(Object aName, ItemStack aStack) {
+ if (aName == null || GT_Utility.isStackInvalid(aStack)) return false;
+ String tName = aName.toString();
+ if (GT_Utility.isStringInvalid(tName)) return false;
+ ArrayList<ItemStack> tList = getOres(tName);
+ for (int i = 0; i < tList.size(); i++) if (GT_Utility.areStacksEqual(tList.get(i), aStack, true)) return false;
+ isRegisteringOre++;
+ OreDictionary.registerOre(tName, GT_Utility.copyAmount(1, aStack));
+ isRegisteringOre--;
+ return true;
+ }
+
+ public static boolean isRegisteringOres() {
+ return isRegisteringOre > 0;
+ }
+
+ public static boolean isAddingOres() {
+ return isAddingOre > 0;
+ }
+
+ public static void resetUnificationEntries() {
+ for (GregtechItemData tPrefixMaterial : sItemStack2DataMap.values()) tPrefixMaterial.mUnificationTarget = null;
+ }
+
+ public static ItemStack getGem(GregtechMaterialStack aMaterial) {
+ return aMaterial == null ? null : getGem(aMaterial.mMaterial, aMaterial.mAmount);
+ }
+
+ public static ItemStack getGem(GT_Materials aMaterial, OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getGem(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getGem(GT_Materials aMaterial, long aMaterialAmount) {
+ ItemStack rStack = null;
+ if (((aMaterialAmount >= M) || aMaterialAmount >= M * 32))
+ rStack = get(GregtechOrePrefixes.gem, aMaterial, aMaterialAmount / M);
+ if (rStack == null && (((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16))
+ rStack = get(GregtechOrePrefixes.gemFlawed, aMaterial, (aMaterialAmount * 2) / M);
+ if (rStack == null && (((aMaterialAmount * 4) >= M)))
+ rStack = get(GregtechOrePrefixes.gemChipped, aMaterial, (aMaterialAmount * 4) / M);
+ return rStack;
+ }
+
+ public static ItemStack getDust(GregtechMaterialStack aMaterial) {
+ return aMaterial == null ? null : getDust(aMaterial.mMaterial, aMaterial.mAmount);
+ }
+
+ public static ItemStack getDust(GT_Materials aMaterial, OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getDust(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getDust(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = null;
+ if (((aMaterialAmount % M == 0) || aMaterialAmount >= M * 16))
+ rStack = get(GregtechOrePrefixes.dust, aMaterial, aMaterialAmount / M);
+ if (rStack == null && (((aMaterialAmount * 4) % M == 0) || aMaterialAmount >= M * 8))
+ rStack = get(GregtechOrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M);
+ if (rStack == null && (((aMaterialAmount * 9) >= M)))
+ rStack = get(GregtechOrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M);
+ return rStack;
+ }
+
+ public static ItemStack getIngot(GregtechMaterialStack aMaterial) {
+ return aMaterial == null ? null : getIngot(aMaterial.mMaterial, aMaterial.mAmount);
+ }
+
+ public static ItemStack getIngot(GT_Materials aMaterial, OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getIngot(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getIngot(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = null;
+ if (((aMaterialAmount % (M * 9) == 0 && aMaterialAmount / (M * 9) > 1) || aMaterialAmount >= M * 72))
+ rStack = get(GregtechOrePrefixes.block, aMaterial, aMaterialAmount / (M * 9));
+ if (rStack == null && ((aMaterialAmount % M == 0) || aMaterialAmount >= M * 8))
+ rStack = get(GregtechOrePrefixes.ingot, aMaterial, aMaterialAmount / M);
+ if (rStack == null && (((aMaterialAmount * 9) >= M)))
+ rStack = get(GregtechOrePrefixes.nugget, aMaterial, (aMaterialAmount * 9) / M);
+ return rStack;
+ }
+
+ public static ItemStack getIngotOrDust(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = getIngot(aMaterial, aMaterialAmount);
+ if (rStack == null) rStack = getDust(aMaterial, aMaterialAmount);
+ return rStack;
+ }
+
+ public static ItemStack getIngotOrDust(GregtechMaterialStack aMaterial) {
+ ItemStack rStack = getIngot(aMaterial);
+ if(aMaterial!=null&&aMaterial.mMaterial!=null)rStack = getDust(aMaterial);
+ if (rStack == null) rStack = getDust(aMaterial);
+ return rStack;
+ }
+
+ public static ItemStack getDustOrIngot(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = getDust(aMaterial, aMaterialAmount);
+ if (rStack == null) rStack = getIngot(aMaterial, aMaterialAmount);
+ return rStack;
+ }
+
+ public static ItemStack getDustOrIngot(GregtechMaterialStack aMaterial) {
+ ItemStack rStack = getDust(aMaterial);
+ if (rStack == null) rStack = getIngot(aMaterial);
+ return rStack;
+ }
+
+ /**
+ * @return a Copy of the OreDictionary.getOres() List
+ */
+ public static ArrayList<ItemStack> getOres(OrePrefixes aPrefix, Object aMaterial) {
+ return getOres(aPrefix.get(aMaterial));
+ }
+
+ /**
+ * @return a Copy of the OreDictionary.getOres() List
+ */
+ public static ArrayList<ItemStack> getOres(Object aOreName) {
+ String aName = aOreName == null ? E : aOreName.toString();
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ if (GT_Utility.isStringValid(aName)) rList.addAll(OreDictionary.getOres(aName));
+ return rList;
+ }
+
+ public static void registerRecipes(OreDictEventContainer tOre) {
// TODO Auto-generated method stub
-
- }
-
- public static void resetUnificationEntries() {
- for (final GregtechItemData tPrefixMaterial : GregtechOreDictUnificator.sItemStack2DataMap.values()) {
- tPrefixMaterial.mUnificationTarget = null;
- }
- }
-
- public static void set(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final ItemStack aStack) {
- GregtechOreDictUnificator.set(aPrefix, aMaterial, aStack, true, false);
- }
-
- public static void set(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, ItemStack aStack,
- final boolean aOverwrite, final boolean aAlreadyRegistered) {
- if (aMaterial == null || aPrefix == null || GT_Utility.isStackInvalid(aStack)
- || Items.feather.getDamage(aStack) == GT_Values.W) {
- return;
- }
- GregtechOreDictUnificator.isAddingOre++;
- aStack = GT_Utility.copyAmount(1, aStack);
- if (!aAlreadyRegistered) {
- GregtechOreDictUnificator.registerOre(aPrefix.get(aMaterial), aStack);
- }
- GregtechOreDictUnificator.addAssociation(aPrefix, aMaterial, aStack,
- GregtechOreDictUnificator.isBlacklisted(aStack));
- if (aOverwrite || GT_Utility
- .isStackInvalid(GregtechOreDictUnificator.sName2StackMap.get(aPrefix.get(aMaterial).toString()))) {
- GregtechOreDictUnificator.sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack);
- }
- GregtechOreDictUnificator.isAddingOre--;
- }
-
- public static void setItemData(ItemStack aStack, final GregtechItemData aData) {
- if (GT_Utility.isStackInvalid(aStack) || aData == null) {
- return;
- }
- final GregtechItemData tData = GregtechOreDictUnificator.getItemData(aStack);
- if (tData == null || !tData.hasValidPrefixMaterialData()) {
- if (tData != null) {
- for (final Object tObject : tData.mExtraData) {
- if (!aData.mExtraData.contains(tObject)) {
- aData.mExtraData.add(tObject);
- }
- }
- }
- if (aStack.stackSize > 1) {
- if (aData.mMaterial != null) {
- aData.mMaterial.mAmount /= aStack.stackSize;
- }
- for (final GregtechMaterialStack tMaterial : aData.mByProducts) {
- tMaterial.mAmount /= aStack.stackSize;
- }
- aStack = GT_Utility.copyAmount(1, aStack);
- }
- GregtechOreDictUnificator.sItemStack2DataMap.put(new GT_ItemStack(aStack), aData);
- if (aData.hasValidMaterialData()) {
- long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0
- : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : GT_Values.M;
- for (final GregtechMaterialStack tMaterial : aData.mByProducts) {
- tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0
- : tMaterial.mAmount >= 0 ? tMaterial.mAmount : GT_Values.M;
- }
- if (tValidMaterialAmount < GT_Values.M) {
- GT_ModHandler.addToRecyclerBlackList(aStack);
- }
- }
- if (GregtechOreDictUnificator.mRunThroughTheList) {
- if (GregTech_API.sLoadStarted) {
- GregtechOreDictUnificator.mRunThroughTheList = false;
- for (final Entry<GT_ItemStack, GregtechItemData> tEntry : GregtechOreDictUnificator.sItemStack2DataMap
- .entrySet()) {
- if (!tEntry.getValue().hasValidPrefixData()
- || tEntry.getValue().mPrefix.mAllowNormalRecycling) {
- GregtechRecipeRegistrator.registerMaterialRecycling(tEntry.getKey().toStack(),
- tEntry.getValue());
- }
- }
- }
- }
- else {
- if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling) {
- GregtechRecipeRegistrator.registerMaterialRecycling(aStack, aData);
- }
- }
- }
- else {
- for (final Object tObject : aData.mExtraData) {
- if (!tData.mExtraData.contains(tObject)) {
- tData.mExtraData.add(tObject);
- }
- }
- }
- }
-
- public static ItemStack setStack(final boolean aUseBlackList, final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return aStack;
- }
- final ItemStack tStack = GregtechOreDictUnificator.get(aUseBlackList, aStack);
- if (GT_Utility.areStacksEqual(aStack, tStack)) {
- return aStack;
- }
- aStack.func_150996_a(tStack.getItem());
- Items.feather.setDamage(aStack, Items.feather.getDamage(tStack));
- return aStack;
- }
-
- public static ItemStack setStack(final ItemStack aStack) {
- return GregtechOreDictUnificator.setStack(true, aStack);
- }
-
- public static ItemStack[] setStackArray(final boolean aUseBlackList, final ItemStack... aStacks) {
- for (int i = 0; i < aStacks.length; i++) {
- aStacks[i] = GregtechOreDictUnificator.get(aUseBlackList, GT_Utility.copy(aStacks[i]));
- }
- return aStacks;
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
index 8b2f21732d..027b89c8e1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
@@ -1,9 +1,13 @@
package gtPlusPlus.xmod.gregtech.api.util;
-import java.util.*;
-
+import static gregtech.api.enums.GT_Values.L;
+import static gregtech.api.enums.GT_Values.M;
+import static gregtech.api.enums.GT_Values.RA;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.interfaces.internal.IThaumcraftCompat;
import gregtech.api.util.GT_ModHandler;
@@ -13,6 +17,11 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechItemData;
import gtPlusPlus.xmod.gregtech.api.objects.GregtechMaterialStack;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@@ -21,648 +30,311 @@ import net.minecraft.item.ItemStack;
* Class for Automatic Recipe registering.
*/
public class GregtechRecipeRegistrator {
- /**
- * List of GT_Materials, which are used in the Creation of Sticks. All Rod
- * GT_Materials are automatically added to this List.
- */
- public static final List<GT_Materials> sRodMaterialList = new ArrayList<GT_Materials>();
- private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0),
- sMt2 = new ItemStack(Blocks.dirt, 1, 0);
- private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R";
- private static final ItemStack[][] sShapes1 = new ItemStack[][] {
- {
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt1, null
- }, {
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt1
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1, null, null, null
- }, {
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1
- }, {
- null, null, null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, null, GregtechRecipeRegistrator.sMt1, null, null,
- GregtechRecipeRegistrator.sMt2, null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, null, GregtechRecipeRegistrator.sMt2, null, null,
- GregtechRecipeRegistrator.sMt2, null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2, null, null,
- GregtechRecipeRegistrator.sMt2, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt2, null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null, null,
- GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1, null, null, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, null, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt1, null, null, GregtechRecipeRegistrator.sMt2
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2, null, null
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt1, null, null,
- GregtechRecipeRegistrator.sMt1, null
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2, null, null,
- GregtechRecipeRegistrator.sMt1, null
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt2, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt2, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null
- }, {
- GregtechRecipeRegistrator.sMt1, null, null, null, GregtechRecipeRegistrator.sMt2, null, null, null,
- GregtechRecipeRegistrator.sMt2
- }, {
- null, null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt2, null,
- GregtechRecipeRegistrator.sMt2, null, null
- }, {
- GregtechRecipeRegistrator.sMt1, null, null, null, GregtechRecipeRegistrator.sMt2, null, null, null,
- null
- }, {
- null, null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt2, null, null, null,
- null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2, null, null, null, null, null, null,
- null
- }, {
- GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1, null, null, null, null, null, null,
- null
- }, {
- GregtechRecipeRegistrator.sMt1, null, null, GregtechRecipeRegistrator.sMt2, null, null, null, null,
- null
- }, {
- GregtechRecipeRegistrator.sMt2, null, null, GregtechRecipeRegistrator.sMt1, null, null, null, null,
- null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt2, null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt2, null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt2,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1,
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- null, GregtechRecipeRegistrator.sMt2, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt2, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1
- }, {
- GregtechRecipeRegistrator.sMt1, null, null, null, GregtechRecipeRegistrator.sMt1, null, null, null,
- null
- }, {
- null, GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt1, null, null, null, null,
- null
- }, {
- GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1, null,
- GregtechRecipeRegistrator.sMt2, null, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt2, null, null
- }, {
- null, GregtechRecipeRegistrator.sMt1, GregtechRecipeRegistrator.sMt1,
- GregtechRecipeRegistrator.sMt1, null, GregtechRecipeRegistrator.sMt2, null, null,
- GregtechRecipeRegistrator.sMt2
- }
- };
- private static final String[][] sShapesA = new String[][] {
- null, null, null, {
- "Helmet",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P
- }, {
- "ChestPlate",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P
- }, {
- "Pants",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + " " + GregtechRecipeRegistrator.s_P
- }, {
- "Boots", GregtechRecipeRegistrator.s_P + " " + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P
- }, {
- "Sword", " " + GregtechRecipeRegistrator.s_P + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H,
- " " + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Pickaxe",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_I,
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_H,
- " " + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Shovel",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H,
- " " + GregtechRecipeRegistrator.s_R + " ", " " + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Axe",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Axe",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Hoe",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- " " + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Hoe",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- " " + GregtechRecipeRegistrator.s_R + " "
- }, {
- "Sickle", " " + GregtechRecipeRegistrator.s_P + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F + " ",
- GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R
- }, {
- "Sickle", " " + GregtechRecipeRegistrator.s_P + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F + " ",
- GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R
- }, {
- "Sickle", " " + GregtechRecipeRegistrator.s_P + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F + " ",
- GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R
- }, {
- "Sickle", " " + GregtechRecipeRegistrator.s_P + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F + " ",
- GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R
- }, {
- "Sword", " " + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H,
- " " + GregtechRecipeRegistrator.s_P + " "
- }, {
- "Pickaxe", " " + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_I
- }, {
- "Shovel", " " + GregtechRecipeRegistrator.s_R + " ", " " + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H
- }, {
- "Axe", GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H
- }, {
- "Axe", GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H
- }, {
- "Hoe", " " + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H
- }, {
- "Hoe", " " + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_H
- }, {
- "Spear", GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- " " + " " + GregtechRecipeRegistrator.s_R
- }, {
- "Spear", GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H + " ",
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + " ",
- " " + " " + GregtechRecipeRegistrator.s_R
- }, {
- "Knive", GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_F
- }, {
- "Knive", GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R
- }, {
- "Knive", GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R
- }, {
- "Knive", GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F,
- GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_H
- }, {
- "Knive", GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F,
- GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_H
- }, null, null, null, null, {
- "WarAxe",
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_H
- }, null, null, null, {
- "Shears", GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F
- }, {
- "Shears", GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F
- }, {
- "Scythe",
- GregtechRecipeRegistrator.s_I + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_H,
- GregtechRecipeRegistrator.s_R + GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_P,
- GregtechRecipeRegistrator.s_R + " " + " "
- }, {
- "Scythe",
- GregtechRecipeRegistrator.s_H + GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_I,
- GregtechRecipeRegistrator.s_P + GregtechRecipeRegistrator.s_F + GregtechRecipeRegistrator.s_R,
- " " + " " + GregtechRecipeRegistrator.s_R
- }
- };
- public static volatile int VERSION = 508;
-
- public static void registerMaterialRecycling(final ItemStack aStack, final GregtechItemData aData) {
- if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack)
- || aData == null || !aData.hasValidMaterialData() || aData.mMaterial.mAmount <= 0
- || GT_Utility.getFluidForFilledItem(aStack, false) != null) {
- return;
- }
- GregtechRecipeRegistrator.registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData,
- aData.mPrefix == null);
- GregtechRecipeRegistrator.registerReverseSmelting(GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial,
- aData.mMaterial.mAmount, true);
- GregtechRecipeRegistrator.registerReverseFluidSmelting(GT_Utility.copyAmount(1, aStack),
- aData.mMaterial.mMaterial, aData.mMaterial.mAmount, aData.getByProduct(0));
- GregtechRecipeRegistrator.registerReverseArcSmelting(GT_Utility.copyAmount(1, aStack), aData);
- }
-
- public static void registerMaterialRecycling(final ItemStack aStack, final GT_Materials aMaterial,
- final long aMaterialAmount, GregtechMaterialStack aByproduct) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return;
- }
- if (aByproduct != null) {
- aByproduct = aByproduct.clone();
- aByproduct.mAmount /= aStack.stackSize;
- }
- GregtechOreDictUnificator.addItemData(GT_Utility.copyAmount(1, aStack),
- new GregtechItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct));
- }
-
- public static void registerReverseArcSmelting(final ItemStack aStack, GregtechItemData aData) {
- if (aStack == null || aData == null) {
- return;
- }
- aData = new GregtechItemData(aData);
-
- if (!aData.hasValidMaterialData()) {
- return;
- }
-
- for (final GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
- if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) {
- tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
- continue;
- }
- if (tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
- tMaterial.mAmount /= 4;
- continue;
- }
- if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
- tMaterial.mAmount /= 2;
- continue;
- }
- if (tMaterial.mMaterial.contains(SubTag.NO_SMELTING)) {
- tMaterial.mAmount = 0;
- continue;
- }
- if (tMaterial.mMaterial.contains(SubTag.METAL)) {
- tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
- continue;
- }
- tMaterial.mAmount = 0;
- }
-
- aData = new GregtechItemData(aData);
-
- if (aData.mByProducts.length > 3) {
- for (final GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
- aData = new GregtechItemData(aData);
- }
- }
-
- if (!aData.hasValidMaterialData()) {
- return;
- }
-
- long tAmount = 0;
- for (final GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
- tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
- }
-
- GT_Values.RA.addArcFurnaceRecipe(aStack, new ItemStack[] {
- GregtechOreDictUnificator.getIngotOrDust(aData.mMaterial),
- GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(0)),
- GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(1)),
- GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(2))
- }, null, (int) Math.max(16, tAmount / GT_Values.M), 96);
- }
-
- public static void registerReverseArcSmelting(final ItemStack aStack, final GT_Materials aMaterial,
- final long aMaterialAmount, final GregtechMaterialStack aByProduct01,
- final GregtechMaterialStack aByProduct02, final GregtechMaterialStack aByProduct03) {
- GregtechRecipeRegistrator.registerReverseArcSmelting(aStack,
- new GregtechItemData(aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aMaterialAmount),
- aByProduct01, aByProduct02, aByProduct03));
- }
-
- /**
- * @param aStack
- * the stack to be recycled.
- * @param aMaterial
- * the Material.
- * @param aMaterialAmount
- * the amount of it in Material Units.
- */
- public static void registerReverseFluidSmelting(final ItemStack aStack, final GT_Materials aMaterial,
- final long aMaterialAmount, final GregtechMaterialStack aByproduct) {
- if (aStack == null || aMaterial == null || aMaterial.mSmeltInto.mStandardMoltenFluid == null
- || !aMaterial.contains(SubTag.SMELTING_TO_FLUID)
- || GT_Values.L * aMaterialAmount / (GT_Values.M * aStack.stackSize) <= 0) {
- return;
- }
- GT_Values.RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct == null ? null
- : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL)
- ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE)
- ? GregtechOreDictUnificator.getDust(GT_Materials._NULL, aByproduct.mAmount / 2)
- : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) ? GregtechOreDictUnificator
- .getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null
- : GregtechOreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount),
- aMaterial.mSmeltInto.getMolten(GT_Values.L * aMaterialAmount / (GT_Values.M * aStack.stackSize)), 10000,
- (int) Math.max(1, 24 * aMaterialAmount / GT_Values.M),
- Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())));
- }
-
- public static void registerReverseMacerating(final ItemStack aStack, GregtechItemData aData,
- final boolean aAllowHammer) {
- if (aStack == null || aData == null) {
- return;
- }
- aData = new GregtechItemData(aData);
-
- if (!aData.hasValidMaterialData()) {
- return;
- }
-
- for (final GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
- tMaterial.mMaterial = tMaterial.mMaterial.mMacerateInto;
- }
-
- aData = new GregtechItemData(aData);
-
- if (!aData.hasValidMaterialData()) {
- return;
- }
-
- long tAmount = 0;
- for (final GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
- tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
- }
-
- GT_Values.RA.addPulveriserRecipe(aStack, new ItemStack[] {
- GregtechOreDictUnificator.getDust(aData.mMaterial),
- GregtechOreDictUnificator.getDust(aData.getByProduct(0)),
- GregtechOreDictUnificator.getDust(aData.getByProduct(1)),
- GregtechOreDictUnificator.getDust(aData.getByProduct(2))
- }, null, (int) Math.max(16, tAmount / GT_Values.M), 4);
-
- if (aAllowHammer) {
- for (final GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
- if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL)) {
- if (GT_Values.RA.addForgeHammerRecipe(GT_Utility.copyAmount(1, aStack),
- GregtechOreDictUnificator.getDust(aData.mMaterial), 200, 32)) {
- break;
- }
- }
- }
- }
- final ItemStack tDust = GregtechOreDictUnificator.getDust(aData.mMaterial);
- if (tDust != null && GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), tDust,
- GregtechOreDictUnificator.getDust(aData.getByProduct(0)), 100,
- GregtechOreDictUnificator.getDust(aData.getByProduct(1)), 100, true)) {
- if (GregTech_API.sThaumcraftCompat != null) {
- GregTech_API.sThaumcraftCompat.addCrucibleRecipe(IThaumcraftCompat.ADVANCEDENTROPICPROCESSING, aStack,
- tDust, Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO,
- Math.max(1, aData.mMaterial.mAmount * 2 / GT_Values.M))));
- }
- }
- }
-
- public static void registerReverseMacerating(final ItemStack aStack, final GT_Materials aMaterial,
- final long aMaterialAmount, final GregtechMaterialStack aByProduct01,
- final GregtechMaterialStack aByProduct02, final GregtechMaterialStack aByProduct03,
- final boolean aAllowHammer) {
- GregtechRecipeRegistrator.registerReverseMacerating(aStack,
- new GregtechItemData(aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aMaterialAmount),
- aByProduct01, aByProduct02, aByProduct03),
- aAllowHammer);
- }
-
- /**
- * @param aStack
- * the stack to be recycled.
- * @param aMaterial
- * the Material.
- * @param aMaterialAmount
- * the amount of it in Material Units.
- * @param aAllowAlloySmelter
- * if it is allowed to be recycled inside the Alloy Smelter.
- */
- public static void registerReverseSmelting(final ItemStack aStack, final GT_Materials aMaterial,
- long aMaterialAmount, final boolean aAllowAlloySmelter) {
- if (aStack == null || aMaterial == null || aMaterialAmount <= 0 || aMaterial.contains(SubTag.NO_SMELTING)
- || aMaterialAmount > GT_Values.M && aMaterial.contains(SubTag.METAL)) {
- return;
- }
- aMaterialAmount /= aStack.stackSize;
-
- if (aAllowAlloySmelter) {
- CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(GT_Utility.copyAmount(1, aStack),
- GregtechOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
- }
- else {
- GT_ModHandler.addSmeltingRecipe(GT_Utility.copyAmount(1, aStack),
- GregtechOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
- }
- }
-
- /**
- * You give this Function a Material and it will scan almost everything for
- * adding recycling Recipes
- *
- * @param aMat
- * a Material, for example an Ingot or a Gem.
- * @param aOutput
- * the Dust you usually get from macerating aMat
- * @param aRecipeReplacing
- * allows to replace the Recipe with a Plate variant
- */
- public static synchronized void registerUsagesForGT_Materials(ItemStack aMat, String aPlate,
- final boolean aRecipeReplacing) {
- if (aMat == null) {
- return;
- }
- aMat = GT_Utility.copy(aMat);
- ItemStack tStack;
- final GregtechItemData aItemData = GregtechOreDictUnificator.getItemData(aMat);
- if (aItemData == null || aItemData.mPrefix != GregtechOrePrefixes.ingot) {
- aPlate = null;
- }
- if (aPlate != null && GregtechOreDictUnificator.getFirstOre(aPlate, 1) == null) {
- aPlate = null;
- }
-
- GregtechRecipeRegistrator.sMt1.func_150996_a(aMat.getItem());
- GregtechRecipeRegistrator.sMt1.stackSize = 1;
- Items.feather.setDamage(GregtechRecipeRegistrator.sMt1, Items.feather.getDamage(aMat));
-
- GregtechRecipeRegistrator.sMt2.func_150996_a(new ItemStack(Blocks.dirt).getItem());
- GregtechRecipeRegistrator.sMt2.stackSize = 1;
- Items.feather.setDamage(GregtechRecipeRegistrator.sMt2, 0);
-
- for (final ItemStack[] tRecipe : GregtechRecipeRegistrator.sShapes1) {
- int tAmount1 = 0;
- for (final ItemStack tMat : tRecipe) {
- if (tMat == GregtechRecipeRegistrator.sMt1) {
- tAmount1++;
- }
- }
- if (aItemData != null && aItemData.hasValidPrefixMaterialData()) {
- for (final ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) {
- GregtechOreDictUnificator.addItemData(tCrafted, new GregtechItemData(aItemData.mMaterial.mMaterial,
- aItemData.mMaterial.mAmount * tAmount1));
- }
- }
- }
-
- for (final GT_Materials tMaterial : GregtechRecipeRegistrator.sRodMaterialList) {
- final ItemStack tMt2 = GregtechOreDictUnificator.get(GregtechOrePrefixes.stick, tMaterial, 1);
- if (tMt2 != null) {
- GregtechRecipeRegistrator.sMt2.func_150996_a(tMt2.getItem());
- GregtechRecipeRegistrator.sMt2.stackSize = 1;
- Items.feather.setDamage(GregtechRecipeRegistrator.sMt2, Items.feather.getDamage(tMt2));
-
- for (int i = 0; i < GregtechRecipeRegistrator.sShapes1.length; i++) {
- final ItemStack[] tRecipe = GregtechRecipeRegistrator.sShapes1[i];
-
- int tAmount1 = 0, tAmount2 = 0;
- for (final ItemStack tMat : tRecipe) {
- if (tMat == GregtechRecipeRegistrator.sMt1) {
- tAmount1++;
- }
- if (tMat == GregtechRecipeRegistrator.sMt2) {
- tAmount2++;
- }
- }
- for (final ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) {
- if (aItemData != null && aItemData.hasValidPrefixMaterialData()) {
- GregtechOreDictUnificator.addItemData(tCrafted,
- new GregtechItemData(aItemData.mMaterial.mMaterial,
- aItemData.mMaterial.mAmount * tAmount1, new GregtechMaterialStack(tMaterial,
- OrePrefixes.stick.mMaterialAmount * tAmount2)));
- }
-
- if (aRecipeReplacing && aPlate != null && GregtechRecipeRegistrator.sShapesA[i] != null
- && GregtechRecipeRegistrator.sShapesA[i].length > 1) {
- assert aItemData != null;
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements,
- aItemData.mMaterial.mMaterial + "." + GregtechRecipeRegistrator.sShapesA[i][0],
- true)) {
- if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
- switch (GregtechRecipeRegistrator.sShapesA[i].length) {
- case 2:
- GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- GregtechRecipeRegistrator.sShapesA[i][1],
- GregtechRecipeRegistrator.s_P.charAt(0), aPlate,
- GregtechRecipeRegistrator.s_R.charAt(0),
- OrePrefixes.stick.get(tMaterial),
- GregtechRecipeRegistrator.s_I.charAt(0), aItemData
- });
- break;
- case 3:
- GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- GregtechRecipeRegistrator.sShapesA[i][1],
- GregtechRecipeRegistrator.sShapesA[i][2],
- GregtechRecipeRegistrator.s_P.charAt(0), aPlate,
- GregtechRecipeRegistrator.s_R.charAt(0),
- OrePrefixes.stick.get(tMaterial),
- GregtechRecipeRegistrator.s_I.charAt(0), aItemData
- });
- break;
- default:
- GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- GregtechRecipeRegistrator.sShapesA[i][1],
- GregtechRecipeRegistrator.sShapesA[i][2],
- GregtechRecipeRegistrator.sShapesA[i][3],
- GregtechRecipeRegistrator.s_P.charAt(0), aPlate,
- GregtechRecipeRegistrator.s_R.charAt(0),
- OrePrefixes.stick.get(tMaterial),
- GregtechRecipeRegistrator.s_I.charAt(0), aItemData
- });
- break;
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ /**
+ * List of GT_Materials, which are used in the Creation of Sticks. All Rod GT_Materials are automatically added to this List.
+ */
+ public static final List<GT_Materials> sRodMaterialList = new ArrayList<GT_Materials>();
+ private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0);
+ private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R";
+ private static final ItemStack[][]
+ sShapes1 = new ItemStack[][]{
+ {sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null},
+ {sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1},
+ {null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1},
+ {sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null},
+ {sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1},
+ {sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1},
+ {null, null, null, sMt1, null, sMt1, sMt1, null, sMt1},
+ {null, sMt1, null, null, sMt1, null, null, sMt2, null},
+ {sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null},
+ {null, sMt1, null, null, sMt2, null, null, sMt2, null},
+ {sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null},
+ {null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null},
+ {sMt1, sMt1, null, null, sMt2, null, null, sMt2, null},
+ {null, sMt1, sMt1, null, sMt2, null, null, sMt2, null},
+ {null, sMt1, null, sMt1, null, null, null, sMt1, sMt2},
+ {null, sMt1, null, null, null, sMt1, sMt2, sMt1, null},
+ {null, sMt1, null, sMt1, null, sMt1, null, null, sMt2},
+ {null, sMt1, null, sMt1, null, sMt1, sMt2, null, null},
+ {null, sMt2, null, null, sMt1, null, null, sMt1, null},
+ {null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1},
+ {null, sMt2, null, null, sMt2, null, null, sMt1, null},
+ {null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null},
+ {null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1},
+ {null, sMt2, null, null, sMt2, null, sMt1, sMt1, null},
+ {sMt1, null, null, null, sMt2, null, null, null, sMt2},
+ {null, null, sMt1, null, sMt2, null, sMt2, null, null},
+ {sMt1, null, null, null, sMt2, null, null, null, null},
+ {null, null, sMt1, null, sMt2, null, null, null, null},
+ {sMt1, sMt2, null, null, null, null, null, null, null},
+ {sMt2, sMt1, null, null, null, null, null, null, null},
+ {sMt1, null, null, sMt2, null, null, null, null, null},
+ {sMt2, null, null, sMt1, null, null, null, null, null},
+ {sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null},
+ {sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null},
+ {null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1},
+ {null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1},
+ {sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null},
+ {sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null},
+ {null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1},
+ {null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1},
+ {sMt1, null, null, null, sMt1, null, null, null, null},
+ {null, sMt1, null, sMt1, null, null, null, null, null},
+ {sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null},
+ {null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2}
+ };
+ private static final String[][] sShapesA = new String[][]{
+ null,
+ null,
+ null,
+ {"Helmet", s_P + s_P + s_P, s_P + s_H + s_P},
+ {"ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P},
+ {"Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P},
+ {"Boots", s_P + " " + s_P, s_P + s_H + s_P},
+ {"Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " "},
+ {"Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " "},
+ {"Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " "},
+ {"Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " "},
+ {"Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " "},
+ {"Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " "},
+ {"Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " "},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " "},
+ {"Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I},
+ {"Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H},
+ {"Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H},
+ {"Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H},
+ {"Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H},
+ {"Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H},
+ {"Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R},
+ {"Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R},
+ {"Knive", s_H + s_P, s_R + s_F},
+ {"Knive", s_F + s_H, s_P + s_R},
+ {"Knive", s_F + s_H, s_P + s_R},
+ {"Knive", s_P + s_F, s_R + s_H},
+ {"Knive", s_P + s_F, s_R + s_H},
+ null,
+ null,
+ null,
+ null,
+ {"WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H},
+ null,
+ null,
+ null,
+ {"Shears", s_H + s_P, s_P + s_F},
+ {"Shears", s_H + s_P, s_P + s_F},
+ {"Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " "},
+ {"Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R}
+ };
+ public static volatile int VERSION = 508;
+
+ public static void registerMaterialRecycling(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByproduct) {
+ if (GT_Utility.isStackInvalid(aStack)) return;
+ if (aByproduct != null) {
+ aByproduct = aByproduct.clone();
+ aByproduct.mAmount /= aStack.stackSize;
+ }
+ GregtechOreDictUnificator.addItemData(GT_Utility.copyAmount(1, aStack), new GregtechItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct));
+ }
+
+ public static void registerMaterialRecycling(ItemStack aStack, GregtechItemData aData) {
+ if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) || aData == null || !aData.hasValidMaterialData() || aData.mMaterial.mAmount <= 0 || GT_Utility.getFluidForFilledItem(aStack, false) != null)
+ return;
+ registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null);
+ registerReverseSmelting(GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, true);
+ registerReverseFluidSmelting(GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, aData.getByProduct(0));
+ registerReverseArcSmelting(GT_Utility.copyAmount(1, aStack), aData);
+ }
+
+ /**
+ * @param aStack the stack to be recycled.
+ * @param aMaterial the Material.
+ * @param aMaterialAmount the amount of it in Material Units.
+ */
+ public static void registerReverseFluidSmelting(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByproduct) {
+ if (aStack == null || aMaterial == null || aMaterial.mSmeltInto.mStandardMoltenFluid == null || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0)
+ return;
+ RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct == null ? null : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) ? GregtechOreDictUnificator.getDust(GT_Materials._NULL, aByproduct.mAmount / 2) : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) ? GregtechOreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null : GregtechOreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), 10000, (int) Math.max(1, (24 * aMaterialAmount) / M), Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())));
+ }
+
+ /**
+ * @param aStack the stack to be recycled.
+ * @param aMaterial the Material.
+ * @param aMaterialAmount the amount of it in Material Units.
+ * @param aAllowAlloySmelter if it is allowed to be recycled inside the Alloy Smelter.
+ */
+ public static void registerReverseSmelting(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, boolean aAllowAlloySmelter) {
+ if (aStack == null || aMaterial == null || aMaterialAmount <= 0 || aMaterial.contains(SubTag.NO_SMELTING) || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL)))
+ return;
+ aMaterialAmount /= aStack.stackSize;
+
+ if (aAllowAlloySmelter)
+ CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(GT_Utility.copyAmount(1, aStack), GregtechOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
+ else
+ GT_ModHandler.addSmeltingRecipe(GT_Utility.copyAmount(1, aStack), GregtechOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
+ }
+
+ public static void registerReverseArcSmelting(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByProduct01, GregtechMaterialStack aByProduct02, GregtechMaterialStack aByProduct03) {
+ registerReverseArcSmelting(aStack, new GregtechItemData(aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03));
+ }
+
+ public static void registerReverseArcSmelting(ItemStack aStack, GregtechItemData aData) {
+ if (aStack == null || aData == null) return;
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
+ if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) {
+ tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
+ tMaterial.mAmount /= 4;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
+ tMaterial.mAmount /= 2;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.NO_SMELTING)) {
+ tMaterial.mAmount = 0;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.METAL)) {
+ tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
+ continue;
+ }
+ tMaterial.mAmount = 0;
+ }
+
+ aData = new GregtechItemData(aData);
+
+ if (aData.mByProducts.length > 3) for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ long tAmount = 0;
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+
+ RA.addArcFurnaceRecipe(aStack, new ItemStack[]{GregtechOreDictUnificator.getIngotOrDust(aData.mMaterial), GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(0)), GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(1)), GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 96);
+ }
+
+ public static void registerReverseMacerating(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByProduct01, GregtechMaterialStack aByProduct02, GregtechMaterialStack aByProduct03, boolean aAllowHammer) {
+ registerReverseMacerating(aStack, new GregtechItemData(aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer);
+ }
+
+ public static void registerReverseMacerating(ItemStack aStack, GregtechItemData aData, boolean aAllowHammer) {
+ if (aStack == null || aData == null) return;
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ tMaterial.mMaterial = tMaterial.mMaterial.mMacerateInto;
+
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ long tAmount = 0;
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+
+ RA.addPulveriserRecipe(aStack, new ItemStack[]{GregtechOreDictUnificator.getDust(aData.mMaterial), GregtechOreDictUnificator.getDust(aData.getByProduct(0)), GregtechOreDictUnificator.getDust(aData.getByProduct(1)), GregtechOreDictUnificator.getDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 4);
+
+ if (aAllowHammer) for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL)) {
+ if (RA.addForgeHammerRecipe(GT_Utility.copyAmount(1, aStack), GregtechOreDictUnificator.getDust(aData.mMaterial), 200, 32))
+ break;
+ }
+ ItemStack tDust = GregtechOreDictUnificator.getDust(aData.mMaterial);
+ if (tDust != null && GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), tDust, GregtechOreDictUnificator.getDust(aData.getByProduct(0)), 100, GregtechOreDictUnificator.getDust(aData.getByProduct(1)), 100, true)) {
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.addCrucibleRecipe(IThaumcraftCompat.ADVANCEDENTROPICPROCESSING, aStack, tDust, Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, Math.max(1, (aData.mMaterial.mAmount * 2) / M))));
+ }
+ }
+
+ /**
+ * You give this Function a Material and it will scan almost everything for adding recycling Recipes
+ *
+ * @param aMat a Material, for example an Ingot or a Gem.
+ * @param aOutput the Dust you usually get from macerating aMat
+ * @param aRecipeReplacing allows to replace the Recipe with a Plate variant
+ */
+ public static synchronized void registerUsagesForGT_Materials(ItemStack aMat, String aPlate, boolean aRecipeReplacing) {
+ if (aMat == null) return;
+ aMat = GT_Utility.copy(aMat);
+ ItemStack tStack;
+ GregtechItemData aItemData = GregtechOreDictUnificator.getItemData(aMat);
+ if (aItemData == null || aItemData.mPrefix != GregtechOrePrefixes.ingot) aPlate = null;
+ if (aPlate != null && GregtechOreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null;
+
+ sMt1.func_150996_a(aMat.getItem());
+ sMt1.stackSize = 1;
+ Items.feather.setDamage(sMt1, Items.feather.getDamage(aMat));
+
+ sMt2.func_150996_a(new ItemStack(Blocks.dirt).getItem());
+ sMt2.stackSize = 1;
+ Items.feather.setDamage(sMt2, 0);
+
+ for (ItemStack[] tRecipe : sShapes1) {
+ int tAmount1 = 0;
+ for (ItemStack tMat : tRecipe) {
+ if (tMat == sMt1) tAmount1++;
+ }
+ if (aItemData != null && aItemData.hasValidPrefixMaterialData())
+ for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) {
+ GregtechOreDictUnificator.addItemData(tCrafted, new GregtechItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1));
+ }
+ }
+
+ for (GT_Materials tMaterial : sRodMaterialList) {
+ ItemStack tMt2 = GregtechOreDictUnificator.get(GregtechOrePrefixes.stick, tMaterial, 1);
+ if (tMt2 != null) {
+ sMt2.func_150996_a(tMt2.getItem());
+ sMt2.stackSize = 1;
+ Items.feather.setDamage(sMt2, Items.feather.getDamage(tMt2));
+
+ for (int i = 0; i < sShapes1.length; i++) {
+ ItemStack[] tRecipe = sShapes1[i];
+
+ int tAmount1 = 0, tAmount2 = 0;
+ for (ItemStack tMat : tRecipe) {
+ if (tMat == sMt1) tAmount1++;
+ if (tMat == sMt2) tAmount2++;
+ }
+ for (ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) {
+ if (aItemData != null && aItemData.hasValidPrefixMaterialData())
+ GregtechOreDictUnificator.addItemData(tCrafted, new GregtechItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new GregtechMaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2)));
+
+ if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) {
+ assert aItemData != null;
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], true)) {
+ if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
+ switch (sShapesA[i].length) {
+ case 2:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ case 3:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ default:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
index dde081e520..3ef5af0774 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -1,19 +1,24 @@
package gtPlusPlus.xmod.gregtech.common;
-import java.util.*;
-
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.common.ModContainer;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.ToolDictNames;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.objects.ItemData;
import gregtech.api.objects.MaterialStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_RecipeRegistrator;
+import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Proxy.OreDictEventContainer;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
@@ -22,274 +27,219 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.util.GregtechOreDictUnificator;
import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipeRegistrator;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.common.ModContainer;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class Meta_GT_Proxy {
+
+ //Store Some MetaTileEntity Data here, why not?
+ public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[GregTech_API.MAXIMUM_METATILE_IDS];
- // Dunno
- public static class GregtechOreDictEventContainer {
- public final OreDictionary.OreRegisterEvent mEvent;
- public final GregtechOrePrefixes mPrefix;
- public final GT_Materials mMaterial;
- public final String mModID;
-
- public GregtechOreDictEventContainer(final OreDictionary.OreRegisterEvent aEvent,
- final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aModID) {
- this.mEvent = aEvent;
- this.mPrefix = aPrefix;
- this.mMaterial = aMaterial;
- this.mModID = aModID == null || aModID.equals("UNKNOWN") ? null : aModID;
- }
- }
-
- // Store Some MetaTileEntity Data here, why not?
- public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[GregTech_API.MAXIMUM_METATILE_IDS];
- public static List<Runnable> GT_BlockIconload = new ArrayList<Runnable>();
-
- public static List<Runnable> GT_ItemIconload = new ArrayList<Runnable>();
-
+ public static List<Runnable> GT_BlockIconload = new ArrayList<Runnable>();
+ public static List<Runnable> GT_ItemIconload = new ArrayList<Runnable>();
+
+
+
@SideOnly(Side.CLIENT)
- public static IIconRegister sBlockIcons, sItemIcons;
- // Silly Vars
- private static final Collection<String> mIgnoredItems = new HashSet<String>(
- Arrays.asList(new String[] {
- "itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater", "itemBucketFreshWater",
- "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer",
- "itemChisel", "itemRubber", "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber",
- "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium", "itemTear", "itemClaw",
- "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen",
- "itemForcicium", "itemForcillium", "itemRoyalJelly", "itemHoneydew", "itemHoney", "itemPollen",
- "itemReedTypha", "itemSulfuricAcid", "itemPotash", "itemCompressedCarbon", "itemBitumen",
- "itemBioFuel", "itemCokeSugar", "itemCokeCactus", "itemCharcoalSugar", "itemCharcoalCactus",
- "itemSludge", "itemEnrichedAlloy", "itemQuicksilver", "itemMercury", "itemOsmium",
- "itemUltimateCircuit", "itemEnergizedStar", "itemAntimatterMolecule", "itemAntimatterGlob",
- "itemCoal", "itemBoat", "itemHerbalMedicineCake", "itemCakeSponge", "itemFishandPumpkinCakeSponge",
- "itemSoulCleaver", "itemInstantCake", "itemWhippingCream", "itemGlisteningWhippingCream",
- "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream", "itemBlazeCleaver",
- "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver",
- "itemFishandPumpkinCake", "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor"
- }));
- private static final Collection<String> mIgnoredNames = new HashSet<String>(
- Arrays.asList(new String[] {
- "grubBee", "chainLink", "candyCane", "bRedString", "bVial", "bFlask", "anorthositeSmooth",
- "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth",
- "marbleSmooth", "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat",
- "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch", "blockPumpkin",
- "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled",
- "blockSpawner", "blockCloth", "mobHead", "mobEgg", "enderFlower", "enderChest", "clayHardened",
- "dayGemMaterial", "nightGemMaterial", "snowLayer", "bPlaceholder", "hardenedClay",
- "eternalLifeEssence", "sandstone", "wheatRice", "transdimBlock", "bambooBasket", "lexicaBotania",
- "livingwoodTwig", "redstoneCrystal", "pestleAndMortar", "glowstone", "whiteStone", "stoneSlab",
- "transdimBlock", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack", "clayCup",
- "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal",
- "cloth", "cobblestoneSlab", "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall",
- "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian", "blockCarpet",
- "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart",
- "brSmallMachineCyaniteProcessor", "meteoriteCoal", "blockCobble", "pressOreProcessor",
- "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew",
- "blockPeat", "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather",
- "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl", "crafterWood", "taintedSoil",
- "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural",
- "aluminiumNatural", "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram",
- "strangeMatter", "coalGenerator", "electricFurnace", "unfinishedTank", "valvePart", "aquaRegia",
- "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste",
- "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone",
- "blockMagicWood", "blockEnderCore", "blockHeeEndium", "oreHeeEndPowder", "oreHeeStardust",
- "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite",
- "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal", "shardFire", "shardWater", "shardAir",
- "shardEarth", "ingotRefinedIron", "blockMarble", "ingotUnstable"
- }));
- private static final Collection<String> mInvalidNames = new HashSet<String>(
- Arrays.asList(new String[] {
- "diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre", "universalCable", "bronzeTube",
- "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery",
- "10kEUStore", "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot",
- "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem", "osmoniumIngot", "tapaziteGem",
- "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem",
- "copperIngot", "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick",
- "emeraldStick", "copperStick", "tinStick", "silverStick", "bronzeStick", "steelStick", "leadStick",
- "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre",
- "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire",
- "aluminiumWire", "silverWire", "tinWire", "dustSiliconSmall", "AluminumOre", "plateHeavyT2",
- "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre",
- "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre",
- "HSLivingmetalIngot", "oilMoving", "oilStill", "oilBucket", "petroleumOre", "dieselFuel",
- "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod",
- "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod",
- "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod", "arditeRod", "manyullynRod", "bronzeRod",
- "boneRod", "slimeRod", "redalloyBundled", "bluestoneBundled", "infusedteslatiteInsulated",
- "redalloyInsulated", "infusedteslatiteBundled"
- }));
- public static boolean mOreDictActivated = false;
- public static boolean mSortToTheEnd = true;
- public final static HashSet<ItemStack> mRegisteredOres = new HashSet<ItemStack>(10000);
- public final static Collection<GregtechOreDictEventContainer> mEvents = new HashSet<GregtechOreDictEventContainer>();
-
- public final static Collection<OreDictEventContainer> mEventsFake = new HashSet<OreDictEventContainer>();
-
- /*
- * public static Fluid addFluid(String aName, String aLocalized,
- * GT_Materials aMaterial, int aState, int aTemperatureK) { return
- * addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null,
- * 0); }
- *
- * public static Fluid addFluid(String aName, String aLocalized,
- * GT_Materials aMaterial, int aState, int aTemperatureK, ItemStack
- * aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) { return
- * addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState,
- * aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount); }
- *
- * public static Fluid addFluid(String aName, String aTexture, String
- * aLocalized, GT_Materials aMaterial, short[] aRGBa, int aState, int
- * aTemperatureK, ItemStack aFullContainer, ItemStack aEmptyContainer, int
- * aFluidAmount) { aName = aName.toLowerCase(); Fluid rFluid = new
- * GregtechFluid(aName, aTexture, aRGBa != null ? aRGBa :
- * Dyes._NULL.getRGBA());
- * GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(),
- * aLocalized == null ? aName : aLocalized); if
- * (FluidRegistry.registerFluid(rFluid)) { switch (aState) { case 0:
- * rFluid.setGaseous(false); rFluid.setViscosity(10000); break; case 1: case
- * 4: rFluid.setGaseous(false); rFluid.setViscosity(1000); break; case 2:
- * rFluid.setGaseous(true); rFluid.setDensity(-100);
- * rFluid.setViscosity(200); break; case 3: rFluid.setGaseous(true);
- * rFluid.setDensity(55536); rFluid.setViscosity(10);
- * rFluid.setLuminosity(15); } } else { rFluid =
- * FluidRegistry.getFluid(aName); } if (rFluid.getTemperature() == new
- * Fluid("test").getTemperature()) { rFluid.setTemperature(aTemperatureK); }
- * if (aMaterial != null) { switch (aState) { case 0: aMaterial.mSolid =
- * rFluid; break; case 1: aMaterial.mFluid = rFluid; break; case 2:
- * aMaterial.mGas = rFluid; break; case 3: aMaterial.mPlasma = rFluid;
- * break; case 4: aMaterial.mStandardMoltenFluid = rFluid; } } if
- * ((aFullContainer != null) && (aEmptyContainer != null) &&
- * (!FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid,
- * aFluidAmount), aFullContainer, aEmptyContainer))) {
- * GT_Values.RA.addFluidCannerRecipe(aFullContainer,
- * GT_Utility.getContainerItem(aFullContainer, false), null, new
- * FluidStack(rFluid, aFluidAmount)); } return rFluid; }
- */
+ public static IIconRegister sBlockIcons, sItemIcons;
- /**
- * This gives you a new BaseMetaTileEntity. As some Interfaces are not
- * always loaded (Buildcraft, Univeral Electricity) I have to use Invocation
- * at the Constructor of the BaseMetaTileEntity
- */
- private static Class<BaseMetaTileEntity> sBaseMetaTileEntityClass = null;
+ //Silly Vars
+ private static final Collection<String> mIgnoredItems = new HashSet<String>(Arrays.asList(new String[]{"itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater",
+ "itemBucketFreshWater", "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer", "itemChisel", "itemRubber",
+ "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber", "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium",
+ "itemTear", "itemClaw", "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen", "itemForcicium", "itemForcillium",
+ "itemRoyalJelly", "itemHoneydew", "itemHoney", "itemPollen", "itemReedTypha", "itemSulfuricAcid", "itemPotash", "itemCompressedCarbon",
+ "itemBitumen", "itemBioFuel", "itemCokeSugar", "itemCokeCactus", "itemCharcoalSugar", "itemCharcoalCactus", "itemSludge", "itemEnrichedAlloy",
+ "itemQuicksilver", "itemMercury", "itemOsmium", "itemUltimateCircuit", "itemEnergizedStar", "itemAntimatterMolecule", "itemAntimatterGlob",
+ "itemCoal", "itemBoat", "itemHerbalMedicineCake", "itemCakeSponge", "itemFishandPumpkinCakeSponge", "itemSoulCleaver", "itemInstantCake",
+ "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream",
+ "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake",
+ "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor"}));
+ private static final Collection<String> mIgnoredNames = new HashSet<String>(Arrays.asList(new String[]{"grubBee", "chainLink", "candyCane", "bRedString", "bVial",
+ "bFlask", "anorthositeSmooth", "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth", "marbleSmooth",
+ "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat", "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch",
+ "blockPumpkin", "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled", "blockSpawner", "blockCloth", "mobHead",
+ "mobEgg", "enderFlower", "enderChest", "clayHardened", "dayGemMaterial", "nightGemMaterial", "snowLayer", "bPlaceholder", "hardenedClay",
+ "eternalLifeEssence", "sandstone", "wheatRice", "transdimBlock", "bambooBasket", "lexicaBotania", "livingwoodTwig", "redstoneCrystal",
+ "pestleAndMortar", "glowstone", "whiteStone", "stoneSlab", "transdimBlock", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack",
+ "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab",
+ "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian",
+ "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal",
+ "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat",
+ "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl",
+ "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural",
+ "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace",
+ "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste",
+ "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone", "blockMagicWood", "blockEnderCore", "blockHeeEndium",
+ "oreHeeEndPowder", "oreHeeStardust", "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite",
+ "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal","shardFire","shardWater","shardAir","shardEarth","ingotRefinedIron","blockMarble","ingotUnstable"}));
+ private static final Collection<String> mInvalidNames = new HashSet<String>(Arrays.asList(new String[]{"diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre",
+ "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore",
+ "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem",
+ "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot",
+ "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick",
+ "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre",
+ "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire",
+ "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre",
+ "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill",
+ "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod",
+ "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod",
+ "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod", "redalloyBundled", "bluestoneBundled", "infusedteslatiteInsulated",
+ "redalloyInsulated", "infusedteslatiteBundled"}));
+ public static boolean mOreDictActivated = false;
+ public static boolean mSortToTheEnd = true;
+ public final static HashSet<ItemStack> mRegisteredOres = new HashSet<ItemStack>(10000);
+ public final static Collection<GregtechOreDictEventContainer> mEvents = new HashSet<GregtechOreDictEventContainer>();
+ public final static Collection<OreDictEventContainer> mEventsFake = new HashSet<OreDictEventContainer>();
- public static void activateOreDictHandler() {
- Meta_GT_Proxy.mOreDictActivated = true;
- GregtechOreDictEventContainer tEvent;
- if (Meta_GT_Proxy.mEvents.size() == 0) {
- Utils.LOG_INFO("Found nothing to iterate over for use in material addition.");
- }
- for (final Iterator<GregtechOreDictEventContainer> i$ = Meta_GT_Proxy.mEvents.iterator(); i$
- .hasNext(); Meta_GT_Proxy.registerRecipes(tEvent)) {
- tEvent = i$.next();
- }
- OreDictEventContainer tEvent2;
- if (Meta_GT_Proxy.mEventsFake.size() == 0) {
- Utils.LOG_INFO("Found nothing to iterate over for use in GT material addition.");
- }
- for (final Iterator<OreDictEventContainer> i$ = Meta_GT_Proxy.mEventsFake.iterator(); i$
- .hasNext(); Meta_GT_Proxy.registerRecipes(tEvent2)) {
- tEvent2 = i$.next();
+ public Meta_GT_Proxy() {
+ Utils.LOG_INFO("GT_PROXY - initialized.");
+ for (String tOreName : OreDictionary.getOreNames()) {
+ ItemStack tOreStack;
+ for (Iterator<?> i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
+ tOreStack = (ItemStack) i$.next();
+ }
}
}
- public static boolean areWeUsingGregtech5uExperimental() {
- final int version = GregTech_API.VERSION;
- if (version == 508 || version == 507) {
- return false;
- }
- else if (version == 509) {
- return true;
- }
- else {
- return false;
- }
+ /*public static Fluid addFluid(String aName, String aLocalized, GT_Materials aMaterial, int aState, int aTemperatureK) {
+ return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
}
- public static BaseMetaTileEntity constructBaseMetaTileEntity() {
- if (Meta_GT_Proxy.sBaseMetaTileEntityClass == null) {
- try {
- return (Meta_GT_Proxy.sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
- }
- catch (final Throwable e) {
- /* Do nothing */}
- }
-
- try {
- return Meta_GT_Proxy.sBaseMetaTileEntityClass.newInstance();
- }
- catch (final Throwable e) {
- Utils.LOG_INFO("Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- e.printStackTrace(GT_Log.err);
- throw new RuntimeException(e);
- }
+ public static Fluid addFluid(String aName, String aLocalized, GT_Materials aMaterial, int aState, int aTemperatureK, ItemStack aFullContainer,
+ ItemStack aEmptyContainer, int aFluidAmount) {
+ return addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
}
+ public static Fluid addFluid(String aName, String aTexture, String aLocalized, GT_Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK,
+ ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) {
+ aName = aName.toLowerCase();
+ Fluid rFluid = new GregtechFluid(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA());
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
+ case 0:
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
+ break;
+ case 1:
+ case 4:
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
+ break;
+ case 2:
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
+ break;
+ case 3:
+ rFluid.setGaseous(true);
+ rFluid.setDensity(55536);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
+ }
+ } else {
+ rFluid = FluidRegistry.getFluid(aName);
+ }
+ if (rFluid.getTemperature() == new Fluid("test").getTemperature()) {
+ rFluid.setTemperature(aTemperatureK);
+ }
+ if (aMaterial != null) {
+ switch (aState) {
+ case 0:
+ aMaterial.mSolid = rFluid;
+ break;
+ case 1:
+ aMaterial.mFluid = rFluid;
+ break;
+ case 2:
+ aMaterial.mGas = rFluid;
+ break;
+ case 3:
+ aMaterial.mPlasma = rFluid;
+ break;
+ case 4:
+ aMaterial.mStandardMoltenFluid = rFluid;
+ }
+ }
+ if ((aFullContainer != null) && (aEmptyContainer != null)
+ && (!FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer))) {
+ GT_Values.RA.addFluidCannerRecipe(aFullContainer, GT_Utility.getContainerItem(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
+ }
+ return rFluid;
+ }*/
+
@SubscribeEvent
- public static void registerOre2(final OreDictionary.OreRegisterEvent aEvent) {
- final ModContainer tContainer = Loader.instance().activeModContainer();
+ public static void registerOre2(OreDictionary.OreRegisterEvent aEvent) {
+ ModContainer tContainer = Loader.instance().activeModContainer();
String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId();
String aOriginalMod = aMod;
if (GregtechOreDictUnificator.isRegisteringOres()) {
aMod = CORE.MODID;
- }
- else if (aMod.equals(CORE.MODID)) {
+ } else if (aMod.equals(CORE.MODID)) {
aMod = "UNKNOWN";
}
- if (aEvent == null || aEvent.Ore == null || aEvent.Ore.getItem() == null || aEvent.Name == null
- || aEvent.Name.isEmpty() || aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9) {
+ if ((aEvent == null) || (aEvent.Ore == null) || (aEvent.Ore.getItem() == null) || (aEvent.Name == null) || (aEvent.Name.isEmpty())
+ || (aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9)) {
if (aOriginalMod.equals(CORE.MODID)) {
aOriginalMod = "UNKNOWN";
}
- GT_Log.ore.println(aOriginalMod
+ GT_Log.ore
+ .println(aOriginalMod
+ " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
- throw new IllegalArgumentException(aOriginalMod
+ throw new IllegalArgumentException(
+ aOriginalMod
+ " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
}
try {
aEvent.Ore.stackSize = 1;
String tModToName = aMod + " -> " + aEvent.Name;
- if (Meta_GT_Proxy.mOreDictActivated || GregTech_API.sPostloadStarted
- || Meta_GT_Proxy.mSortToTheEnd && GregTech_API.sLoadFinished) {
+ if ((mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((mSortToTheEnd) && (GregTech_API.sLoadFinished))) {
tModToName = aOriginalMod + " --Late--> " + aEvent.Name;
}
- if (aEvent.Ore.getItem() instanceof ItemBlock || GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air) {
+ if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) {
GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
}
- Meta_GT_Proxy.mRegisteredOres.add(aEvent.Ore);
- if (Meta_GT_Proxy.mIgnoredNames.contains(aEvent.Name)) {
+ mRegisteredOres.add(aEvent.Ore);
+ if (mIgnoredNames.contains(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
return;
}
- if (aEvent.Name.contains("|") || aEvent.Name.contains("*") || aEvent.Name.contains(":")
- || aEvent.Name.contains(".") || aEvent.Name.contains("$")) {
+ if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
+ || (aEvent.Name.contains("$"))) {
GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly.");
return;
}
if (aEvent.Name.contains(" ")) {
- GT_Log.ore.println(
- tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
- GregtechOreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""),
- GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
+ GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
+ GregtechOreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
return;
}
- if (Meta_GT_Proxy.mInvalidNames.contains(aEvent.Name)) {
+ if (mInvalidNames.contains(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
return;
}
- final GregtechOrePrefixes aPrefix = GregtechOrePrefixes.getOrePrefix(aEvent.Name);
- GT_Materials aMaterial = GT_Materials._NULL;
+ GregtechOrePrefixes aPrefix = GregtechOrePrefixes.getOrePrefix(aEvent.Name);
+ GT_Materials aMaterial = GT_Materials._NULL;
if (aPrefix == null) {
if (aEvent.Name.toLowerCase().equals(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased.");
@@ -302,129 +252,101 @@ public class Meta_GT_Proxy {
if (Character.isUpperCase(aEvent.Name.charAt(0))) {
GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
}
- }
- else {
+ } else {
if (aPrefix.mDontUnificateActively) {
GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
}
if (aPrefix != aPrefix.mPrefixInto) {
- final String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(),
- aPrefix.mPrefixInto.toString());
+ String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString());
if (!GregtechOreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(
- tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
+ GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
}
GregtechOreDictUnificator.registerOre(tNewName, aEvent.Ore);
return;
}
- final String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
+ String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
if (tName.length() > 0) {
- final char firstChar = tName.charAt(0);
+ char firstChar = tName.charAt(0);
if (Character.isUpperCase(firstChar) || Character.isLowerCase(firstChar) || firstChar == '_') {
if (aPrefix.mIsMaterialBased) {
aMaterial = GT_Materials.get(tName);
if (aMaterial != aMaterial.mMaterialInto) {
GregtechOreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore);
if (!GregtechOreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(
- tModToName + " uses a deprecated Material and is getting re-registered as "
- + aPrefix.get(aMaterial.mMaterialInto));
+ GT_Log.ore.println(tModToName + " uses a deprecated Material and is getting re-registered as "
+ + aPrefix.get(aMaterial.mMaterialInto));
}
return;
}
if (!aPrefix.isIgnored(aMaterial)) {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
}
if (aMaterial != GT_Materials._NULL) {
GT_Materials tReRegisteredMaterial;
- for (final Iterator<?> i$ = aMaterial.mOreReRegistrations.iterator(); i$
- .hasNext(); GregtechOreDictUnificator.registerOre(aPrefix,
- tReRegisteredMaterial, aEvent.Ore)) {
+ for (Iterator<?> i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GregtechOreDictUnificator.registerOre(aPrefix,
+ tReRegisteredMaterial, aEvent.Ore)) {
tReRegisteredMaterial = (GT_Materials) i$.next();
}
- aMaterial.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
- switch (aPrefix) {
- case gem:
- break;
- case plate:
- break;
- case stick:
- if (!GregtechRecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
- GregtechRecipeRegistrator.sRodMaterialList.add(aMaterial);
- }
- break;
- case dust:
- break;
- case ingot:
- break;
+ aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ switch (aPrefix) {
+ case gem:
+ break;
+ case plate:
+ break;
+ case stick:
+ if (!GregtechRecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
+ GregtechRecipeRegistrator.sRodMaterialList.add(aMaterial);
+ }
+ break;
+ case dust:
+ break;
+ case ingot:
+ break;
}
if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
return;
}
- }
- else {
- for (final Dyes tDye : Dyes.VALUES) {
+ } else {
+ for (Dyes tDye : Dyes.VALUES) {
if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) {
GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
- GT_Log.ore.println(tModToName
- + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
+ GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
return;
}
}
- // System.out.println("Material Name:
- // "+aEvent.Name+ " !!!Unknown Material
- // detected!!! Please report to GregTech
- // Intergalactical for additional compatiblity.
- // This is not an Error, an Issue nor a Lag
- // Source, it is just an Information, which you
- // should pass to me.");
- // GT_Log.ore.println(tModToName + " uses an
- // unknown Material. Report this to GregTech.");
+ // System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
+ // GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech.");
return;
}
- }
- else {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
+ } else {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
}
}
- }
- else if (aPrefix.mIsSelfReferencing) {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
- }
- else {
+ } else if (aPrefix.mIsSelfReferencing) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ } else {
GT_Log.ore.println(tModToName + " uses a Prefix as full OreDict Name, and is therefor invalid.");
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
return;
}
}
GT_Log.ore.println(tModToName);
- final GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial,
- aMod);
- if (!Meta_GT_Proxy.mOreDictActivated || !GregTech_API.sUnificationEntriesRegistered) {
- Meta_GT_Proxy.mEvents.add(tOre);
+ GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
+ if ((!mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
+ mEvents.add(tOre);
+ } else {
+ mEvents.clear();
}
- else {
- Meta_GT_Proxy.mEvents.clear();
+ if (mOreDictActivated) {
+ registerRecipes(tOre);
}
- if (Meta_GT_Proxy.mOreDictActivated) {
- Meta_GT_Proxy.registerRecipes(tOre);
- }
- }
- catch (final Throwable e) {
+ } catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
}
- private static final void registerRecipes(final GregtechOreDictEventContainer tOre) {
- if (tOre.mEvent.Ore == null || tOre.mEvent.Ore.getItem() == null) {
+ private static final void registerRecipes(GregtechOreDictEventContainer tOre) {
+ if ((tOre.mEvent.Ore == null) || (tOre.mEvent.Ore.getItem() == null)) {
return;
}
if (tOre.mEvent.Ore.stackSize != 1) {
@@ -432,25 +354,16 @@ public class Meta_GT_Proxy {
}
if (tOre.mPrefix != null) {
if (!tOre.mPrefix.isIgnored(tOre.mMaterial)) {
- tOre.mPrefix.processOre(tOre.mMaterial == null ? GT_Materials._NULL : tOre.mMaterial, tOre.mEvent.Name,
- tOre.mModID, GT_Utility.copyAmount(1L, new Object[] {
- tOre.mEvent.Ore
- }));
+ tOre.mPrefix.processOre((GT_Materials) (tOre.mMaterial == null ? GT_Materials._NULL : tOre.mMaterial), tOre.mEvent.Name, tOre.mModID,
+ GT_Utility.copyAmount(1L, new Object[]{tOre.mEvent.Ore}));
}
- }
- else {
- // System.out.println("Thingy Name: "+ aOre.mEvent.Name+ "
- // !!!Unknown 'Thingy' detected!!! This Object seems to probably not
- // follow a valid OreDictionary Convention, or I missed a
- // Convention. Please report to GregTech Intergalactical for
- // additional compatiblity. This is not an Error, an Issue nor a Lag
- // Source, it is just an Information, which you should pass to
- // me.");
+ } else {
+ // System.out.println("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
}
}
- private static final void registerRecipes(final OreDictEventContainer aOre) {
- if (aOre.mEvent.Ore == null || aOre.mEvent.Ore.getItem() == null) {
+ private static final void registerRecipes(OreDictEventContainer aOre) {
+ if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)) {
return;
}
if (aOre.mEvent.Ore.stackSize != 1) {
@@ -458,56 +371,40 @@ public class Meta_GT_Proxy {
}
if (aOre.mPrefix != null) {
if (!aOre.mPrefix.isIgnored(aOre.mMaterial)) {
- aOre.mPrefix.processOre(aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, aOre.mEvent.Name,
- aOre.mModID, GT_Utility.copyAmount(1L, new Object[] {
- aOre.mEvent.Ore
- }));
+ aOre.mPrefix.processOre(aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, aOre.mEvent.Name, aOre.mModID,
+ GT_Utility.copyAmount(1L, new Object[]{aOre.mEvent.Ore}));
}
- }
- else {
- // System.out.println("Thingy Name: "+ aOre.mEvent.Name+ "
- // !!!Unknown 'Thingy' detected!!! This Object seems to probably not
- // follow a valid OreDictionary Convention, or I missed a
- // Convention. Please report to GregTech Intergalactical for
- // additional compatiblity. This is not an Error, an Issue nor a Lag
- // Source, it is just an Information, which you should pass to
- // me.");
+ } else {
+ // System.out.println("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
}
}
+
+
public static void registerUnificationEntries() {
GregTech_API.sUnification.mConfig.save();
GregTech_API.sUnification.mConfig.load();
GregtechOreDictUnificator.resetUnificationEntries();
- for (final GregtechOreDictEventContainer tOre : Meta_GT_Proxy.mEvents) {
- if (!(tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems) && tOre.mPrefix != null
- && tOre.mPrefix.mIsUnificatable && tOre.mMaterial != null) {
+ for (GregtechOreDictEventContainer tOre : mEvents) {
+ if ((!(tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable)
+ && (tOre.mMaterial != null)) {
if (GregtechOreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
- }
- else {
+ } else {
GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore,
- tOre.mModID != null && GregTech_API.sUnification.get(
- ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name,
- false),
- true);
+ GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) && (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, false)), true);
}
}
}
- for (final GregtechOreDictEventContainer tOre : Meta_GT_Proxy.mEvents) {
- if (tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems && tOre.mPrefix != null
- && tOre.mPrefix.mIsUnificatable && tOre.mMaterial != null) {
+ for (GregtechOreDictEventContainer tOre : mEvents) {
+ if (((tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable)
+ && (tOre.mMaterial != null)) {
if (GregtechOreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
- }
- else {
+ } else {
GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
- GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore,
- tOre.mModID != null && GregTech_API.sUnification.get(
- ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name,
- false),
- true);
+ GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) &&
+ (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, false)), true);
}
}
}
@@ -516,44 +413,85 @@ public class Meta_GT_Proxy {
GT_Recipe.reInit();
}
- public Meta_GT_Proxy() {
- Utils.LOG_INFO("GT_PROXY - initialized.");
- for (final String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- for (final Iterator<?> i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); this
- .registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- tOreStack = (ItemStack) i$.next();
- }
+ public static void activateOreDictHandler() {
+ mOreDictActivated = true;
+ GregtechOreDictEventContainer tEvent;
+ if (mEvents.size() == 0){
+ Utils.LOG_INFO("Found nothing to iterate over for use in material addition.");
+ }
+ for (Iterator<GregtechOreDictEventContainer> i$ = mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
+ tEvent = (GregtechOreDictEventContainer) i$.next();
+ }
+ OreDictEventContainer tEvent2;
+ if (mEventsFake.size() == 0){
+ Utils.LOG_INFO("Found nothing to iterate over for use in GT material addition.");
+ }
+ for (Iterator<OreDictEventContainer> i$ = mEventsFake.iterator(); i$.hasNext(); registerRecipes(tEvent2)) {
+ tEvent2 = (OreDictEventContainer) i$.next();
}
}
+
+ //Dunno
+ public static class GregtechOreDictEventContainer {
+ public final OreDictionary.OreRegisterEvent mEvent;
+ public final GregtechOrePrefixes mPrefix;
+ public final GT_Materials mMaterial;
+ public final String mModID;
+
+ public GregtechOreDictEventContainer(OreDictionary.OreRegisterEvent aEvent, GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aModID) {
+ this.mEvent = aEvent;
+ this.mPrefix = aPrefix;
+ this.mMaterial = aMaterial;
+ this.mModID = ((aModID == null) || (aModID.equals("UNKNOWN")) ? null : aModID);
+ }
+ }
+
+ public static boolean areWeUsingGregtech5uExperimental(){
+ int version = GregTech_API.VERSION;
+ if (version == 508 || version == 507){
+ return false;
+ }
+ else if (version == 509){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+
+
+
+
+
@SubscribeEvent
- public void registerOre(final OreDictionary.OreRegisterEvent aEvent) {
- final ModContainer tContainer = Loader.instance().activeModContainer();
+ public void registerOre(OreDictionary.OreRegisterEvent aEvent) {
+ ModContainer tContainer = Loader.instance().activeModContainer();
String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId();
String aOriginalMod = aMod;
if (GT_OreDictUnificator.isRegisteringOres()) {
aMod = "gregtech";
- }
- else if (aMod.equals("gregtech")) {
+ } else if (aMod.equals("gregtech")) {
aMod = "UNKNOWN";
}
- if (aEvent == null || aEvent.Ore == null || aEvent.Ore.getItem() == null || aEvent.Name == null
- || aEvent.Name.isEmpty() || aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9) {
+ if ((aEvent == null) || (aEvent.Ore == null) || (aEvent.Ore.getItem() == null) || (aEvent.Name == null) || (aEvent.Name.isEmpty())
+ || (aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9)) {
if (aOriginalMod.equals("gregtech")) {
aOriginalMod = "UNKNOWN";
}
- GT_Log.ore.println(aOriginalMod
+ GT_Log.ore
+ .println(aOriginalMod
+ " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
- throw new IllegalArgumentException(aOriginalMod
+ throw new IllegalArgumentException(
+ aOriginalMod
+ " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
}
try {
aEvent.Ore.stackSize = 1;
if (true || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) {
- if (aOriginalMod.toLowerCase().contains("xycraft") || aOriginalMod.toLowerCase().contains("tconstruct")
- || aOriginalMod.toLowerCase().contains("natura")
- && !aOriginalMod.toLowerCase().contains("natural")) {
+ if ((aOriginalMod.toLowerCase().contains("xycraft")) || (aOriginalMod.toLowerCase().contains("tconstruct"))
+ || ((aOriginalMod.toLowerCase().contains("natura")) && (!aOriginalMod.toLowerCase().contains("natural")))) {
if (GT_Values.D1) {
GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P");
}
@@ -561,15 +499,14 @@ public class Meta_GT_Proxy {
}
}
String tModToName = aMod + " -> " + aEvent.Name;
- if (Meta_GT_Proxy.mOreDictActivated || GregTech_API.sPostloadStarted
- || Meta_GT_Proxy.mSortToTheEnd && GregTech_API.sLoadFinished) {
+ if ((mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((mSortToTheEnd) && (GregTech_API.sLoadFinished))) {
tModToName = aOriginalMod + " --Late--> " + aEvent.Name;
}
- if (aEvent.Ore.getItem() instanceof ItemBlock || GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air) {
+ if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
}
- Meta_GT_Proxy.mRegisteredOres.add(aEvent.Ore);
- if (aEvent.Name.startsWith("item") && Meta_GT_Proxy.mIgnoredItems.contains(aEvent.Name)) {
+ mRegisteredOres.add(aEvent.Ore);
+ if ((aEvent.Name.startsWith("item")) && (mIgnoredItems.contains(aEvent.Name))) {
GT_Log.ore.println(tModToName);
if (aEvent.Name.equals("itemCopperWire")) {
GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
@@ -579,7 +516,7 @@ public class Meta_GT_Proxy {
}
return;
}
- if (Meta_GT_Proxy.mIgnoredNames.contains(aEvent.Name)) {
+ if (mIgnoredNames.contains(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
return;
}
@@ -591,8 +528,8 @@ public class Meta_GT_Proxy {
GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore);
return;
}
- if (aEvent.Name.contains("|") || aEvent.Name.contains("*") || aEvent.Name.contains(":")
- || aEvent.Name.contains(".") || aEvent.Name.contains("$")) {
+ if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
+ || (aEvent.Name.contains("$"))) {
GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly.");
return;
}
@@ -646,24 +583,19 @@ public class Meta_GT_Proxy {
return;
}
if (aEvent.Name.contains(" ")) {
- GT_Log.ore.println(
- tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
- GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""),
- GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
+ GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
+ GT_OreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
return;
}
- if (Meta_GT_Proxy.mInvalidNames.contains(aEvent.Name)) {
+ if (mInvalidNames.contains(aEvent.Name)) {
GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
return;
}
- final OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name);
+ OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name);
Materials aMaterial = Materials._NULL;
- if (aPrefix == OrePrefixes.nugget && aMod.equals("Thaumcraft")
- && aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource")) {
+ if ((aPrefix == OrePrefixes.nugget) && (aMod.equals("Thaumcraft")) && (aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource"))) {
return;
}
if (aPrefix == null) {
@@ -678,354 +610,326 @@ public class Meta_GT_Proxy {
if (Character.isUpperCase(aEvent.Name.charAt(0))) {
GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
}
- }
- else {
+ } else {
if (aPrefix.mDontUnificateActively) {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
}
if (aPrefix != aPrefix.mPrefixInto) {
- final String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(),
- aPrefix.mPrefixInto.toString());
+ String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString());
if (!GT_OreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(
- tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
+ GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
}
GT_OreDictUnificator.registerOre(tNewName, aEvent.Ore);
return;
}
- final String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
+ String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
if (tName.length() > 0) {
- final char firstChar = tName.charAt(0);
+ char firstChar = tName.charAt(0);
if (Character.isUpperCase(firstChar) || Character.isLowerCase(firstChar) || firstChar == '_') {
if (aPrefix.mIsMaterialBased) {
aMaterial = Materials.get(tName);
if (aMaterial != aMaterial.mMaterialInto) {
GT_OreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore);
if (!GT_OreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(
- tModToName + " uses a deprecated Material and is getting re-registered as "
- + aPrefix.get(aMaterial.mMaterialInto));
+ GT_Log.ore.println(tModToName + " uses a deprecated Material and is getting re-registered as "
+ + aPrefix.get(aMaterial.mMaterialInto));
}
return;
}
if (!aPrefix.isIgnored(aMaterial)) {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
}
if (aMaterial != Materials._NULL) {
Materials tReRegisteredMaterial;
- for (final Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$
- .hasNext(); GT_OreDictUnificator.registerOre(aPrefix, tReRegisteredMaterial,
- aEvent.Ore)) {
+ for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GT_OreDictUnificator.registerOre(aPrefix,
+ tReRegisteredMaterial, aEvent.Ore)) {
tReRegisteredMaterial = (Materials) i$.next();
}
- aMaterial.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
- if (GregTech_API.sThaumcraftCompat != null && aPrefix.doGenerateItem(aMaterial)
- && !aPrefix.isIgnored(aMaterial)) {
- final long tAmount = aPrefix.mMaterialAmount < 0L ? 3628800L
- : aPrefix.mMaterialAmount;
- final List<TC_Aspects.TC_AspectStack> tAspects = new ArrayList();
+ aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ if ((GregTech_API.sThaumcraftCompat != null) && (aPrefix.doGenerateItem(aMaterial)) && (!aPrefix.isIgnored(aMaterial))) {
+ long tAmount = aPrefix.mMaterialAmount < 0L ? 3628800L : aPrefix.mMaterialAmount;
+ List<TC_Aspects.TC_AspectStack> tAspects = new ArrayList();
TC_Aspects.TC_AspectStack tAspect;
- for (final Iterator i$ = aPrefix.mAspects.iterator(); i$.hasNext(); tAspect
- .addToAspectList(tAspects)) {
+ for (Iterator i$ = aPrefix.mAspects.iterator(); i$.hasNext(); tAspect.addToAspectList(tAspects)) {
tAspect = (TC_Aspects.TC_AspectStack) i$.next();
}
tAspect = null;
- for (final Iterator i$ = aMaterial.mAspects.iterator(); i$.hasNext(); tAspect
- .copy(tAspect.mAmount * tAmount / 3628800L).addToAspectList(tAspects)) {
+ for (Iterator i$ = aMaterial.mAspects.iterator(); i$.hasNext(); tAspect.copy(tAspect.mAmount * tAmount / 3628800L)
+ .addToAspectList(tAspects)) {
tAspect = (TC_Aspects.TC_AspectStack) i$.next();
}
- GregTech_API.sThaumcraftCompat
- .registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }), tAspects, aEvent.Name);
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}),
+ tAspects, aEvent.Name);
}
switch (aPrefix) {
- case crystal:
- if (aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz
- || aMaterial == Materials.Fluix) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, aMaterial, aEvent.Ore);
- }
- break;
- case gem:
- switch (aMaterial) {
- case Lapis:
- case Sodalite:
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- break;
- case Lazurite:
- GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- break;
- case InfusedAir:
- case InfusedWater:
- case InfusedFire:
- case InfusedEarth:
- case InfusedOrder:
- case InfusedEntropy:
- GT_OreDictUnificator.registerOre(
- aMaterial.name().replaceFirst("Infused", "shard"), aEvent.Ore);
- break;
- case Chocolate:
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- break;
- case CertusQuartz:
- case NetherQuartz:
- GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial),
- aEvent.Ore);
- case Fluix:
- case Quartz:
- case Quartzite:
- GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial,
- aEvent.Ore);
- GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz,
- aEvent.Ore);
- default:
- break;
- }
- break;
- case cableGt01:
- if (aMaterial == Materials.Tin) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore);
- }
- if (aMaterial == Materials.AnyCopper) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper,
- aEvent.Ore);
- }
- if (aMaterial == Materials.Gold) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore);
- }
- if (aMaterial == Materials.AnyIron) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore);
- }
- break;
- case lens:
- if (aMaterial.contains(SubTag.TRANSPARENT) && aMaterial.mColor != Dyes._NULL) {
- GT_OreDictUnificator.registerOre(
- "craftingLens"
- + aMaterial.mColor.toString().replaceFirst("dye", ""),
- aEvent.Ore);
- }
- break;
- case plate:
- if (aMaterial == Materials.Plastic || aMaterial == Materials.Rubber) {
- GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore);
- }
- if (aMaterial == Materials.Silicon) {
- GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
- }
- if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
- }
- break;
- case cell:
- if (aMaterial == Materials.Empty) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- break;
- case gearGt:
- GT_OreDictUnificator.registerOre(OrePrefixes.gear, aMaterial, aEvent.Ore);
+ case crystal:
+ if ((aMaterial == Materials.CertusQuartz) || (aMaterial == Materials.NetherQuartz) || (aMaterial == Materials.Fluix)) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.gem, aMaterial, aEvent.Ore);
+ }
+ break;
+ case gem:
+ switch (aMaterial) {
+ case Lapis:
+ case Sodalite:
+ GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
break;
- case stick:
- if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
- GT_RecipeRegistrator.sRodMaterialList.add(aMaterial);
- }
- if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if (aMaterial == Materials.Tin || aMaterial == Materials.Lead
- || aMaterial == Materials.SolderingAlloy) {
- GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal,
- aEvent.Ore);
- }
+ case Lazurite:
+ GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
break;
- case dust:
- if (aMaterial == Materials.Salt) {
- GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore);
- }
- if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore);
- }
- if (aMaterial == Materials.Wheat) {
- GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore);
- }
- if (aMaterial == Materials.Lapis) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- }
- if (aMaterial == Materials.Lazurite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- }
- if (aMaterial == Materials.Sodalite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- }
- if (aMaterial == Materials.Cocoa) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- GT_OreDictUnificator.registerOre("foodCocoapowder", aEvent.Ore);
- }
- if (aMaterial == Materials.Coffee) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- }
- if (aMaterial == Materials.BrownLimonite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- }
- if (aMaterial == Materials.YellowLimonite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeYellow, aEvent.Ore);
- }
+ case InfusedAir:
+ case InfusedWater:
+ case InfusedFire:
+ case InfusedEarth:
+ case InfusedOrder:
+ case InfusedEntropy:
+ GT_OreDictUnificator.registerOre(aMaterial.name().replaceFirst("Infused", "shard"), aEvent.Ore);
break;
- case ingot:
- if (aMaterial == Materials.Rubber) {
- GT_OreDictUnificator.registerOre("itemRubber", aEvent.Ore);
- }
- if (aMaterial == Materials.FierySteel) {
- GT_OreDictUnificator.registerOre("fieryIngot", aEvent.Ore);
- }
- if (aMaterial == Materials.IronWood) {
- GT_OreDictUnificator.registerOre("ironwood", aEvent.Ore);
- }
- if (aMaterial == Materials.Steeleaf) {
- GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore);
- }
- if (aMaterial == Materials.Knightmetal) {
- GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore);
- }
- if (aMaterial == Materials.Brass && aEvent.Ore.getItemDamage() == 2
- && aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass")
- && new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName()
- .contains("red")) {
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy,
- new ItemStack(aEvent.Ore.getItem(), 1, 0));
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.BlueAlloy,
- new ItemStack(aEvent.Ore.getItem(), 1, 1));
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.Brass,
- new ItemStack(aEvent.Ore.getItem(), 1, 2));
- GT_Values.RA.addCutterRecipe(new ItemStack(aEvent.Ore.getItem(), 1, 3),
- new ItemStack(aEvent.Ore.getItem(), 16, 4), null, 400, 8);
- }
+ case Chocolate:
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
break;
+ case CertusQuartz:
+ case NetherQuartz:
+ GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore);
+ case Fluix:
+ case Quartz:
+ case Quartzite:
+ GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore);
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore);
default:
break;
+ }
+ break;
+ case cableGt01:
+ if (aMaterial == Materials.Tin) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore);
+ }
+ if (aMaterial == Materials.AnyCopper) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
+ }
+ if (aMaterial == Materials.Gold) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore);
+ }
+ if (aMaterial == Materials.AnyIron) {
+ GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore);
+ }
+ break;
+ case lens:
+ if ((aMaterial.contains(SubTag.TRANSPARENT)) && (aMaterial.mColor != Dyes._NULL)) {
+ GT_OreDictUnificator.registerOre("craftingLens" + aMaterial.mColor.toString().replaceFirst("dye", ""), aEvent.Ore);
+ }
+ break;
+ case plate:
+ if ((aMaterial == Materials.Plastic) || (aMaterial == Materials.Rubber)) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore);
+ }
+ if (aMaterial == Materials.Silicon) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
+ }
+ if (aMaterial == Materials.Wood) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
+ }
+ break;
+ case cell:
+ if (aMaterial == Materials.Empty) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ break;
+ case gearGt:
+ GT_OreDictUnificator.registerOre(OrePrefixes.gear, aMaterial, aEvent.Ore);
+ break;
+ case stick:
+ if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
+ GT_RecipeRegistrator.sRodMaterialList.add(aMaterial);
+ }
+ if (aMaterial == Materials.Wood) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) {
+ GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore);
+ }
+ break;
+ case dust:
+ if (aMaterial == Materials.Salt) {
+ GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore);
+ }
+ if (aMaterial == Materials.Wood) {
+ GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore);
+ }
+ if (aMaterial == Materials.Wheat) {
+ GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore);
+ }
+ if (aMaterial == Materials.Lapis) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
+ }
+ if (aMaterial == Materials.Lazurite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
+ }
+ if (aMaterial == Materials.Sodalite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
+ }
+ if (aMaterial == Materials.Cocoa) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ GT_OreDictUnificator.registerOre("foodCocoapowder", aEvent.Ore);
+ }
+ if (aMaterial == Materials.Coffee) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ }
+ if (aMaterial == Materials.BrownLimonite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
+ }
+ if (aMaterial == Materials.YellowLimonite) {
+ GT_OreDictUnificator.registerOre(Dyes.dyeYellow, aEvent.Ore);
+ }
+ break;
+ case ingot:
+ if (aMaterial == Materials.Rubber) {
+ GT_OreDictUnificator.registerOre("itemRubber", aEvent.Ore);
+ }
+ if (aMaterial == Materials.FierySteel) {
+ GT_OreDictUnificator.registerOre("fieryIngot", aEvent.Ore);
+ }
+ if (aMaterial == Materials.IronWood) {
+ GT_OreDictUnificator.registerOre("ironwood", aEvent.Ore);
+ }
+ if (aMaterial == Materials.Steeleaf) {
+ GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore);
+ }
+ if (aMaterial == Materials.Knightmetal) {
+ GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore);
+ }
+ if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2)
+ && (aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass"))
+ && (new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName().contains("red"))) {
+ GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 0));
+ GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.BlueAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 1));
+ GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.Brass, new ItemStack(aEvent.Ore.getItem(), 1, 2));
+ GT_Values.RA.addCutterRecipe(new ItemStack(aEvent.Ore.getItem(), 1, 3), new ItemStack(aEvent.Ore.getItem(), 16, 4),
+ null, 400, 8);
+ }
+ break;
+ default:
+ break;
}
if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
return;
}
- }
- else {
- for (final Dyes tDye : Dyes.VALUES) {
+ } else {
+ for (Dyes tDye : Dyes.VALUES) {
if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- GT_Log.ore.println(tModToName
- + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
+ GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
return;
}
}
- // System.out.println("Material Name:
- // "+aEvent.Name+ " !!!Unknown Material
- // detected!!! Please report to GregTech
- // Intergalactical for additional compatiblity.
- // This is not an Error, an Issue nor a Lag
- // Source, it is just an Information, which you
- // should pass to me.");
- // GT_Log.ore.println(tModToName + " uses an
- // unknown Material. Report this to GregTech.");
+ // System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
+ // GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech.");
return;
}
- }
- else {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
+ } else {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
}
}
- }
- else if (aPrefix.mIsSelfReferencing) {
- aPrefix.add(GT_Utility.copyAmount(1L, new Object[] {
- aEvent.Ore
- }));
- }
- else {
+ } else if (aPrefix.mIsSelfReferencing) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ } else {
GT_Log.ore.println(tModToName + " uses a Prefix as full OreDict Name, and is therefor invalid.");
aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
return;
}
switch (aPrefix) {
- case dye:
- if (GT_Utility.isStringValid(tName)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.dye, aEvent.Ore);
- }
- break;
- case stoneSmooth:
- GT_OreDictUnificator.registerOre("stone", aEvent.Ore);
- break;
- case stoneCobble:
- GT_OreDictUnificator.registerOre("cobblestone", aEvent.Ore);
- break;
- case plank:
- if (tName.equals("Wood")) {
- GT_OreDictUnificator.addItemData(aEvent.Ore,
- new ItemData(Materials.Wood, 3628800L, new MaterialStack[0]));
- }
- break;
- case slab:
- if (tName.equals("Wood")) {
- GT_OreDictUnificator.addItemData(aEvent.Ore,
- new ItemData(Materials.Wood, 1814400L, new MaterialStack[0]));
- }
- break;
- case sheet:
- if (tName.equals("Plastic")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
- }
- if (tName.equals("Rubber")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Rubber, aEvent.Ore);
- }
- break;
- case crafting:
- if (tName.equals("ToolSolderingMetal")) {
- GregTech_API.registerSolderingMetal(aEvent.Ore);
- }
- if (tName.equals("IndustrialDiamond")) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if (tName.equals("WireCopper")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.wire, Materials.Copper, aEvent.Ore);
- }
- break;
- case wood:
- if (tName.equals("Rubber")) {
- GT_OreDictUnificator.registerOre("logRubber", aEvent.Ore);
- }
- break;
- case food:
- if (tName.equals("Cocoapowder")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.dust, Materials.Cocoa, aEvent.Ore);
- }
- break;
- default:
- break;
+ case dye:
+ if (GT_Utility.isStringValid(tName)) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.dye, aEvent.Ore);
+ }
+ break;
+ case stoneSmooth:
+ GT_OreDictUnificator.registerOre("stone", aEvent.Ore);
+ break;
+ case stoneCobble:
+ GT_OreDictUnificator.registerOre("cobblestone", aEvent.Ore);
+ break;
+ case plank:
+ if (tName.equals("Wood")) {
+ GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 3628800L, new MaterialStack[0]));
+ }
+ break;
+ case slab:
+ if (tName.equals("Wood")) {
+ GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 1814400L, new MaterialStack[0]));
+ }
+ break;
+ case sheet:
+ if (tName.equals("Plastic")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
+ }
+ if (tName.equals("Rubber")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Rubber, aEvent.Ore);
+ }
+ break;
+ case crafting:
+ if (tName.equals("ToolSolderingMetal")) {
+ GregTech_API.registerSolderingMetal(aEvent.Ore);
+ }
+ if (tName.equals("IndustrialDiamond")) {
+ GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ if (tName.equals("WireCopper")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.wire, Materials.Copper, aEvent.Ore);
+ }
+ break;
+ case wood:
+ if (tName.equals("Rubber")) {
+ GT_OreDictUnificator.registerOre("logRubber", aEvent.Ore);
+ }
+ break;
+ case food:
+ if (tName.equals("Cocoapowder")) {
+ GT_OreDictUnificator.registerOre(OrePrefixes.dust, Materials.Cocoa, aEvent.Ore);
+ }
+ break;
+ default:
+ break;
}
}
GT_Log.ore.println(tModToName);
- // GregtechOreDictEventContainer tOre = new
- // GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
- final OreDictEventContainer tOreFake = new OreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
- if (!Meta_GT_Proxy.mOreDictActivated || !GregTech_API.sUnificationEntriesRegistered) {
- Meta_GT_Proxy.mEventsFake.add(tOreFake);
+ //GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
+ OreDictEventContainer tOreFake = new OreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
+ if ((!mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
+ mEventsFake.add(tOreFake);
+ } else {
+ mEventsFake.clear();
}
- else {
- Meta_GT_Proxy.mEventsFake.clear();
+ if (mOreDictActivated) {
+ registerRecipes(tOreFake);
}
- if (Meta_GT_Proxy.mOreDictActivated) {
- Meta_GT_Proxy.registerRecipes(tOreFake);
- }
- }
- catch (final Throwable e) {
+ } catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
-
+
}
+
+
+ /**
+ * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity
+ */
+ private static Class<BaseMetaTileEntity> sBaseMetaTileEntityClass = null;
+
+ public static BaseMetaTileEntity constructBaseMetaTileEntity() {
+ if (sBaseMetaTileEntityClass == null) {
+ try {
+ return (BaseMetaTileEntity) (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
+ } catch (Throwable e) {/*Do nothing*/}
+ }
+
+ try {
+ return (BaseMetaTileEntity) (sBaseMetaTileEntityClass.newInstance());
+ } catch (Throwable e) {
+ Utils.LOG_INFO("Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ e.printStackTrace(GT_Log.err);
+ throw new RuntimeException(e);
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
index 71026d46c5..c7d6dcbbba 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
@@ -11,38 +9,37 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract {
-
- public final static int GTID = 57;
+public class GregtechMetaCasingBlocks
+extends GregtechMetaCasingBlocksAbstract {
- CasingTextureHandler TextureHandler = new CasingTextureHandler();
+ public final static int GTID = 57;
+
+ CasingTextureHandler TextureHandler = new CasingTextureHandler();
public GregtechMetaCasingBlocks() {
super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE);
for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + i] = new GT_CopiedBlockTexture(this, 6,
- i);
+ Textures.BlockIcons.CASING_BLOCKS[GTID + i] = new GT_CopiedBlockTexture(this, 6, i);
}
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name",
- "Heat Resistant Coke Oven Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); // 60
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name",
- "Material Press Machine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Electrolyzer Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Wire Factory Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Maceration Stack Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Matter Generation Coil"); // 65
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Matter Fabricator Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Iron Plated Bricks");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Multitank Exterior Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name",
- "Blast Smelter Heat Containment Coil ");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Centrifuge Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); //60
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Material Press Machine Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Electrolyzer Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Wire Factory Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Maceration Stack Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Matter Generation Coil"); //65
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Matter Fabricator Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Iron Plated Bricks");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Multitank Exterior Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil ");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block");
GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0));
GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1));
GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2));
@@ -58,22 +55,22 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract {
GregtechItemList.Casing_Reactor_I.set(new ItemStack(this, 1, 12));
GregtechItemList.Casing_Reactor_II.set(new ItemStack(this, 1, 13));
GregtechItemList.Casing_Coil_BlastSmelter.set(new ItemStack(this, 1, 14));
- GregtechItemList.Casing_BlastSmelter.set(new ItemStack(this, 1, 15));
+ GregtechItemList.Casing_BlastSmelter.set(new ItemStack(this, 1, 15));
}
@Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide) {
- final GregtechMetaCasingBlocks i = this;
- return CasingTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
+ public IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
+ return TextureHandler.getIcon(aSide, aMeta);
}
+
+
@Override
- public IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's.
- // case 0 ==
- // ID[57]
- return CasingTextureHandler.getIcon(aSide, aMeta);
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
+ GregtechMetaCasingBlocks i = this;
+ return TextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i);
}
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
index 5527a0315f..3adc9c9022 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java
@@ -5,38 +5,42 @@ import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.blocks.GT_Material_Casings;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler2;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract {
+public class GregtechMetaCasingBlocks2
+extends GregtechMetaCasingBlocksAbstract {
- public final static int GTID = 73;
-
- CasingTextureHandler2 TextureHandler = new CasingTextureHandler2();
+ public final static int GTID = 73;
+
+ CasingTextureHandler2 TextureHandler = new CasingTextureHandler2();
public GregtechMetaCasingBlocks2() {
super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE);
for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks2.GTID + i] = new GT_CopiedBlockTexture(this, 6,
- i);
+ Textures.BlockIcons.CASING_BLOCKS[GTID + i] = new GT_CopiedBlockTexture(this, 6, i);
}
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strctural Glass Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Placeholder Casing"); // 60
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Incoloy Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Incoloy Casing"); // 65
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Placeholder Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Placeholder Casing ");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Casing ");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Strctural Glass Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Placeholder Casing"); //60
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Incoloy Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Incoloy Casing"); //65
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Placeholder Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Placeholder Casing ");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Placeholder Casing ");
GregtechItemList.Casing_StructuralGlass.set(new ItemStack(this, 1, 0));
GregtechItemList.Casing_PlaceHolder1.set(new ItemStack(this, 1, 1));
GregtechItemList.Casing_PlaceHolder2.set(new ItemStack(this, 1, 2));
@@ -52,13 +56,11 @@ public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract
GregtechItemList.Casing_PlaceHolder12.set(new ItemStack(this, 1, 12));
GregtechItemList.Casing_PlaceHolder13.set(new ItemStack(this, 1, 13));
GregtechItemList.Casing_PlaceHolder14.set(new ItemStack(this, 1, 14));
- GregtechItemList.Casing_PlaceHolder15.set(new ItemStack(this, 1, 15));
+ GregtechItemList.Casing_PlaceHolder15.set(new ItemStack(this, 1, 15));
}
@Override
- public IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's.
- // case 0 ==
- // ID[57]
- return CasingTextureHandler2.getIcon(aSide, aMeta);
+ public IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
+ return TextureHandler.getIcon(aSide, aMeta);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
index 09fa9d2f5f..14ce2afc93 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
@@ -1,14 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
-import java.util.List;
-import java.util.Random;
-
-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.common.blocks.GT_Block_Casings_Abstract;
import gtPlusPlus.core.creative.AddToCreativeTab;
+
+import java.util.List;
+import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -16,128 +15,129 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
-import net.minecraft.item.*;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_Abstract {
- public GregtechMetaCasingBlocksAbstract(final Class<? extends ItemBlock> aItemClass, final String aName,
- final Material aMaterial) {
- super(aItemClass, aName, aMaterial);
- this.setStepSound(Block.soundTypeMetal);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GregTech_API.registerMachineBlock(this, -1);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + 32767 + ".name",
- "Any Sub Block of this");
- }
-
- @Override
- public void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock,
- final int aMetaData) {
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- @Override
- public boolean canBeReplacedByLeaves(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) {
- return false;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- @Override
+public abstract class GregtechMetaCasingBlocksAbstract
+ extends GT_Block_Casings_Abstract {
+ public GregtechMetaCasingBlocksAbstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) {
+ super(aItemClass, aName, aMaterial);
+ setStepSound(soundTypeMetal);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ GregTech_API.registerMachineBlock(this, -1);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
+ }
+
+ @Override
+ public String getHarvestTool(int aMeta) {
+ return "wrench";
+ }
+
+ @Override
+ public int getHarvestLevel(int aMeta) {
+ return 2;
+ }
+
+ @Override
+ public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
+ return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public float getExplosionResistance(Entity aTNT) {
+ return Blocks.iron_block.getExplosionResistance(aTNT);
+ }
+
+ @Override
protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- public int damageDropped(final int par1) {
- return par1;
- }
-
- @Override
- public float getBlockHardness(final World aWorld, final int aX, final int aY, final int aZ) {
- return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
- }
-
- @Override
- public int getDamageValue(final World par1World, final int par2, final int par3, final int par4) {
- return par1World.getBlockMetadata(par2, par3, par4);
- }
-
- @Override
- public float getExplosionResistance(final Entity aTNT) {
- return Blocks.iron_block.getExplosionResistance(aTNT);
- }
-
- @Override
- public int getHarvestLevel(final int aMeta) {
- return 2;
- }
-
- @Override
- public String getHarvestTool(final int aMeta) {
- return "wrench";
- }
-
- @Override
- public Item getItemDropped(final int par1, final Random par2Random, final int par3) {
- return Item.getItemFromBlock(this);
- }
-
- @Override
- public String getLocalizedName() {
- return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
- }
+ return false;
+ }
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(final Item aItem, final CreativeTabs par2CreativeTabs, final List aList) {
- for (int i = 0; i < 16; i++) {
- aList.add(new ItemStack(aItem, 1, i));
- }
- }
+ @Override
+ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
- @Override
+ @Override
public String getUnlocalizedName() {
- return this.mUnlocalizedName;
- }
+ return this.mUnlocalizedName;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
+ }
- @Override
- public boolean isNormalCube(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) {
- return true;
- }
+ @Override
+ public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
- @Override
+ @Override
+ public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return true;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ @Override
public boolean isOpaqueCube() {
- return true;
- }
-
- @Override
- public void onBlockAdded(final World aWorld, final int aX, final int aY, final int aZ) {
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- @Override
- public int quantityDropped(final Random par1Random) {
- return 1;
- }
-
- @Override
+ return true;
+ }
+
+ @Override
+ public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
+ return false;
+ }
+
+ @Override
+ public int damageDropped(int par1) {
+ return par1;
+ }
+
+ @Override
+ public int getDamageValue(World par1World, int par2, int par3, int par4) {
+ return par1World.getBlockMetadata(par2, par3, par4);
+ }
+
+ @Override
+ public int quantityDropped(Random par1Random) {
+ return 1;
+ }
+
+ @Override
+ public Item getItemDropped(int par1, Random par2Random, int par3) {
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister aIconRegister) {
- }
+ public void registerBlockIcons(IIconRegister aIconRegister) {
+ }
- @Override
- public boolean renderAsNormalBlock() {
- return true;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
+ for (int i = 0; i < 16; i++) {
+ aList.add(new ItemStack(aItem, 1, i));
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
index 5ac4086a61..957a12bc14 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
@@ -2,8 +2,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks;
import net.minecraft.block.Block;
-public class GregtechMetaCasingItems extends GregtechMetaItemCasingsAbstract {
- public GregtechMetaCasingItems(final Block par1) {
- super(par1);
- }
+public class GregtechMetaCasingItems
+ extends GregtechMetaItemCasingsAbstract {
+ public GregtechMetaCasingItems(Block par1) {
+ super(par1);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
index e160459c55..02ef1b9ca6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
@@ -6,31 +6,31 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-public class GregtechMetaItemCasings1 extends GregtechMetaItemCasingsAbstract {
- public GregtechMetaItemCasings1(final Block par1) {
+public class GregtechMetaItemCasings1
+extends GregtechMetaItemCasingsAbstract {
+ public GregtechMetaItemCasings1(Block par1) {
super(par1);
}
@Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList,
- final boolean aF3_H) {
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
super.addInformation(aStack, aPlayer, aList, aF3_H);
- switch (this.getDamage(aStack)) {
- case 0:
- aList.add(this.mCasing_Centrifuge);
- break;
- case 1:
- aList.add(this.mCasing_CokeOven);
- break;
- case 2:
- aList.add(this.mCasing_CokeCoil1);
- break;
- case 3:
- aList.add(this.mCasing_CokeCoil2);
- break;
- default:
- aList.add(this.mCasing_CokeCoil2);
- break;
+ switch (getDamage(aStack)) {
+ case 0:
+ aList.add(this.mCasing_Centrifuge);
+ break;
+ case 1:
+ aList.add(this.mCasing_CokeOven);
+ break;
+ case 2:
+ aList.add(this.mCasing_CokeCoil1);
+ break;
+ case 3:
+ aList.add(this.mCasing_CokeCoil2);
+ break;
+ default:
+ aList.add(this.mCasing_CokeCoil2);
+ break;
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
index a4c4faeb6c..ca0dee0692 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
@@ -1,66 +1,61 @@
package gtPlusPlus.xmod.gregtech.common.blocks;
+import gregtech.api.util.GT_LanguageManager;
+
import java.util.List;
-import gregtech.api.util.GT_LanguageManager;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-public abstract class GregtechMetaItemCasingsAbstract extends ItemBlock {
+public abstract class GregtechMetaItemCasingsAbstract
+extends ItemBlock {
- protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing",
- "Warning! Standing in the Centrifuge not recommended");
- protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven",
- "Sturdy and Strong");
- protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip",
- "Base Heating Capacity = 1350 Kelvin");
- protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip",
- "Base Heating Capacity = 2275 Kelvin");
- protected final String mNoMobsToolTip = GT_LanguageManager
- .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
- protected final String mNoTileEntityToolTip = GT_LanguageManager
- .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
+ protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended");
+ protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong");
+ protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin");
+ protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin");
+ protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
+ protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
- public GregtechMetaItemCasingsAbstract(final Block par1) {
+ public GregtechMetaItemCasingsAbstract(Block par1) {
super(par1);
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- // setCreativeTab(AddToCreativeTab.tabMachines);
+ setMaxDamage(0);
+ setHasSubtypes(true);
+ //setCreativeTab(AddToCreativeTab.tabMachines);
}
@Override
- public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList,
- final boolean aF3_H) {
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- switch (this.getDamage(aStack)) {
- case 0:
- aList.add(this.mCasing_Centrifuge);
- break;
- case 1:
- aList.add(this.mCasing_CokeOven);
- break;
- case 2:
- aList.add(this.mCasing_CokeCoil1);
- break;
- case 3:
- aList.add(this.mCasing_CokeCoil2);
- break;
- default:
- break;
- }
- aList.add(this.mNoMobsToolTip);
- aList.add(this.mNoTileEntityToolTip);
+ public int getMetadata(int aMeta) {
+ return aMeta;
}
@Override
- public int getMetadata(final int aMeta) {
- return aMeta;
+ public String getUnlocalizedName(ItemStack aStack) {
+ return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
}
@Override
- public String getUnlocalizedName(final ItemStack aStack) {
- return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ switch (getDamage(aStack)) {
+ case 0:
+ aList.add(this.mCasing_Centrifuge);
+ break;
+ case 1:
+ aList.add(this.mCasing_CokeOven);
+ break;
+ case 2:
+ aList.add(this.mCasing_CokeCoil1);
+ break;
+ case 3:
+ aList.add(this.mCasing_CokeCoil2);
+ break;
+ default:
+ break;
+ }
+ aList.add(this.mNoMobsToolTip);
+ aList.add(this.mNoTileEntityToolTip);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
index 29012b8b98..4ed8c6caae 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.gregtech.common.blocks.fluid;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
@@ -13,219 +15,180 @@ public class GregtechFluidHandler {
protected static int cellID = 0;
- private static void generateIC2FluidCell(final String fluidNameWithCaps) {
- Utils.LOG_INFO("Adding a Cell for " + fluidNameWithCaps);
- if (LoadedMods.IndustrialCraft2) {
- Utils.createInternalNameAndFluidCell(fluidNameWithCaps);
- }
- }
-
- public static void run() {
- GregtechFluidHandler.start();
+ public static void run(){
+ start();
}
- private static void start() {
-
- /*
- * Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant,
- * 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell,
- * Materials.Lubricant, 1L), ItemList.Cell_Empty.get(1L, new Object[0]),
- * 1000); Meta_GT_Proxy.addFluid("creosote", "Creosote Oil",
- * Materials.Creosote, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L),
- * ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1,
- * 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil,
- * 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1,
- * 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil,
- * 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L),
- * ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L),
- * ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L),
- * ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1,
- * 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass,
- * 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol",
- * Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell,
- * Materials.Ethanol, 1L), ItemList.Cell_Empty.get(1L, new Object[0]),
- * 1000); Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid",
- * Materials.SulfuricAcid, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid,
- * 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L),
- * ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239",
- * Materials.McGuffium239, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239,
- * 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- * Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295,
- * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L),
- * ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ private static void start(){
+
+ /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
*/
- if (!LoadedMods.ThermalFoundation) {
+ if (!LoadedMods.ThermalFoundation){
- Utils.LOG_INFO("Adding in our own GT versions of Thermal Foundation Fluids");
- FluidUtils.addFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- FluidUtils.addFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Utils.LOG_INFO("Adding in our own GT versions of Thermal Foundation Fluids");
+ FluidUtils.addFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ FluidUtils.addFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
}
- if (LoadedMods.IndustrialCraft2) {
- Utils.LOG_INFO("Adding in GT Fluids for various nuclear related content.");
-
- FluidUtils.addFluid("hydrofluoricAcid", "Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("HydrofluoricAcid");
-
- FluidUtils.addFluid("sulfurDioxide", "Sulfur Dioxide", GT_Materials.SulfurDioxide, 4, -100,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurDioxide, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("SulfurDioxide");
-
- FluidUtils.addFluid("sulfurousAcid", "Sulfurous Acid", GT_Materials.SulfurousAcid, 4, 75,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("SulfurousAcid");
-
- FluidUtils.addFluid("sulfuricApatite", "Sulfuric Apatite Mix", GT_Materials.SulfuricApatite, 4, 500,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("SulfuricApatite");
-
- FluidUtils.addFluid("uraniumHexafluoride", "Uranium Hexafluoride", GT_Materials.UraniumHexaFluoride, 4, 200,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.UraniumHexaFluoride, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("UraniumHexaFluoride");
-
- FluidUtils.addFluid("uraniumTetrafluoride", "Uranium Tetrafluoride", GT_Materials.UraniumTetraFluoride, 4,
- 950, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.UraniumTetraFluoride, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("UraniumTetraFluoride");
-
- FluidUtils.addFluid("thoriumTetrafluoride", "Thorium Tetrafluoride", GT_Materials.ThoriumTetraFluoride, 4,
- 1250, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.ThoriumTetraFluoride, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("ThoriumTetraFluoride");
-
- // Check for IHL Hydrogen Chloride
- if (!LoadedMods.IHL || ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null) {
- if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null) {
- if (LoadedMods.IHL) {
- Utils.LOG_INFO(
- "IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own.");
- }
- else {
- Utils.LOG_INFO("No Suitable versions of Hydrogen Chloride available, adding our own.");
- }
- FluidUtils.addFluid("hydrogenChloride", "Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("HydrogenChloride");
- }
- }
+ if (LoadedMods.IndustrialCraft2){
+ Utils.LOG_INFO("Adding in GT Fluids for various nuclear related content.");
+
+ FluidUtils.addFluid("hydrofluoricAcid", "Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("HydrofluoricAcid");
- FluidUtils.addFluid("sulfuricLithium", "Sulfuric Lithium Mix", GT_Materials.SulfuricLithium, 4, 280,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("SulfuricLithium");
+ FluidUtils.addFluid("sulfurDioxide", "Sulfur Dioxide", GT_Materials.SulfurDioxide, 4, -100, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurDioxide, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfurDioxide");
- FluidUtils.addFluid("lithiumHydroxide", "Lithium Hydroxide", GT_Materials.LithiumHydroxide, 4, 500,
- GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- GregtechFluidHandler.generateIC2FluidCell("SulfuricApatite");
+ FluidUtils.addFluid("sulfurousAcid", "Sulfurous Acid", GT_Materials.SulfurousAcid, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfurousAcid");
- /*
- * Meta_GT_Proxy.addFluid("sulfuricApatite", "Sulfuric Apatite",
- * GT_Materials.SulfuricApatite, 4, 500,
- * GT_OreDictUnificator.get(OrePrefixes.cell,
- * GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L,
- * new Object[0]), 1000); generateIC2FluidCell("SulfuricApatite");
- *
- * Meta_GT_Proxy.addFluid("sulfuricApatite", "Sulfuric Apatite",
- * GT_Materials.SulfuricApatite, 4, 500,
- * GT_OreDictUnificator.get(OrePrefixes.cell,
- * GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L,
- * new Object[0]), 1000); generateIC2FluidCell("SulfuricApatite");
- *
- * Meta_GT_Proxy.addFluid("sulfuricApatite", "Sulfuric Apatite",
- * GT_Materials.SulfuricApatite, 4, 500,
- * GT_OreDictUnificator.get(OrePrefixes.cell,
- * GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L,
- * new Object[0]), 1000); generateIC2FluidCell("SulfuricApatite");
- */
+ FluidUtils.addFluid("sulfuricApatite", "Sulfuric Apatite Mix", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfuricApatite");
- // Chemical Bath Recipes
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 16), null,
- FluidUtils.getFluidStack("sulfuricacid", 144 * 32),
- FluidUtils.getFluidStack("sulfuricapatite", 144 * 4),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 1), 20 * 20);
+ FluidUtils.addFluid("uraniumHexafluoride", "Uranium Hexafluoride", GT_Materials.UraniumHexaFluoride, 4, 200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.UraniumHexaFluoride, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("UraniumHexaFluoride");
- /*
- * GT_Values.RA.addChemicalRecipe(
- * UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 8),
- * null, FluidUtils.getFluidStack("sulfuricacid", 133*32),
- * FluidUtils.getFluidStack("sulfuriclithium", 133*4),
- * UtilsItems.getItemStackOfAmountFromOreDict("dustSmallLithium",
- * 2), 20*20);
- */
+ FluidUtils.addFluid("uraniumTetrafluoride", "Uranium Tetrafluoride", GT_Materials.UraniumTetraFluoride, 4, 950, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.UraniumTetraFluoride, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("UraniumTetraFluoride");
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 16),
- FluidUtils.getFluidStack("water", 1000), FluidUtils.getFluidStack("lithiumhydroxide", 144 * 4),
- null, 300 * 20);
+ FluidUtils.addFluid("thoriumTetrafluoride", "Thorium Tetrafluoride", GT_Materials.ThoriumTetraFluoride, 4, 1250, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.ThoriumTetraFluoride, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("ThoriumTetraFluoride");
- // Mixer Recipes
- GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, null, null,
- FluidUtils.getFluidStack("oxygen", 288), FluidUtils.getFluidStack("sulfurdioxide", 432), null, 600,
- 60);
- GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null,
- FluidUtils.getFluidStack("hydrofluoricacid", 2000),
- FluidUtils.getFluidStack("uraniumtetrafluoride", 288), null, 3000, 500);
- GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 1), null, null,
- FluidUtils.getFluidStack("uraniumtetrafluoride", 720),
- FluidUtils.getFluidStack("uraniumhexafluoride", 288), null, 5000, 2000);
-
- // Apatite Distillation
+
+ //Check for IHL Hydrogen Chloride
+ if (!LoadedMods.IHL || ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null){
+ if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null){
+ if (LoadedMods.IHL){
+ Utils.LOG_INFO("IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own.");
+ }
+ else {
+ Utils.LOG_INFO("No Suitable versions of Hydrogen Chloride available, adding our own.");
+ }
+ FluidUtils.addFluid("hydrogenChloride", "Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("HydrogenChloride");
+ }
+ }
+
+
+ FluidUtils.addFluid("sulfuricLithium", "Sulfuric Lithium Mix", GT_Materials.SulfuricLithium, 4, 280, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfuricLithium");
+
+ FluidUtils.addFluid("lithiumHydroxide", "Lithium Hydroxide", GT_Materials.LithiumHydroxide, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfuricApatite");
+
+ /*Meta_GT_Proxy.addFluid("sulfuricApatite", "Sulfuric Apatite", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfuricApatite");
+
+ Meta_GT_Proxy.addFluid("sulfuricApatite", "Sulfuric Apatite", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfuricApatite");
+
+ Meta_GT_Proxy.addFluid("sulfuricApatite", "Sulfuric Apatite", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ generateIC2FluidCell("SulfuricApatite");*/
+
+
+ //Chemical Bath Recipes
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 16),
+ null,
+ FluidUtils.getFluidStack("sulfuricacid", 144*32),
+ FluidUtils.getFluidStack("sulfuricapatite", 144*4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 1),
+ 20*20);
+
+ /*GT_Values.RA.addChemicalRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 8),
+ null,
+ FluidUtils.getFluidStack("sulfuricacid", 133*32),
+ FluidUtils.getFluidStack("sulfuriclithium", 133*4),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSmallLithium", 2),
+ 20*20);*/
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 16),
+ FluidUtils.getFluidStack("water", 1000),
+ FluidUtils.getFluidStack("lithiumhydroxide", 144*4),
+ null,
+ 300*20);
+
+
+
+
+
+
+
+
+ //Mixer Recipes
+ GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, null, null, FluidUtils.getFluidStack("oxygen", 288), FluidUtils.getFluidStack("sulfurdioxide", 432), null, 600, 60);
+ GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null, FluidUtils.getFluidStack("hydrofluoricacid", 2000), FluidUtils.getFluidStack("uraniumtetrafluoride", 288), null, 3000, 500);
+ GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 1), null, null, FluidUtils.getFluidStack("uraniumtetrafluoride", 720), FluidUtils.getFluidStack("uraniumhexafluoride", 288), null, 5000, 2000);
+
+
+
+
+
+
+
+ //Apatite Distillation
/*
- * so if you dissolve aparite in sulphuric acid you'll get a mixture
- * of SO2, H2O, HF and HCl
+ * so if you dissolve aparite in sulphuric acid
+ * you'll get a mixture of SO2, H2O, HF and HCl
*/
- final FluidStack[] apatiteOutput = {
- FluidUtils.getFluidStack("sulfurousacid", 3800), FluidUtils.getFluidStack("hydrogenchloride", 1000),
+ FluidStack[] apatiteOutput = {
+ FluidUtils.getFluidStack("sulfurousacid", 3800),
+ FluidUtils.getFluidStack("hydrogenchloride", 1000),
FluidUtils.getFluidStack("hydrofluoricacid", 400)
};
- GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("sulfuricapatite", 5200), apatiteOutput,
- null, 45 * 20, 256);
-
- final FluidStack[] sulfurousacidOutput = {
- FluidUtils.getFluidStack("sulfurdioxide", 500), FluidUtils.getFluidStack("water", 500)
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfuricapatite", 5200),
+ apatiteOutput,
+ null,
+ 45*20,
+ 256);
+
+ FluidStack[] sulfurousacidOutput = {
+ FluidUtils.getFluidStack("sulfurdioxide", 500),
+ FluidUtils.getFluidStack("water", 500)
};
- GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("sulfurousacid", 1000),
- sulfurousacidOutput, null, 10 * 20, 60);
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfurousacid", 1000),
+ sulfurousacidOutput,
+ null,
+ 10*20,
+ 60);
- final FluidStack[] sulfurdioxideOutput = {
- FluidUtils.getFluidStack("oxygen", 144 * 2)
+ FluidStack[] sulfurdioxideOutput = {
+ FluidUtils.getFluidStack("oxygen", 144*2)
};
- GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("sulfurdioxide", 144 * 3),
- sulfurdioxideOutput, ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), 5 * 20, 30);
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfurdioxide", 144*3),
+ sulfurdioxideOutput,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1),
+ 5*20,
+ 30);
}
}
+ private static void generateIC2FluidCell(String fluidNameWithCaps){
+ Utils.LOG_INFO("Adding a Cell for "+fluidNameWithCaps);
+ if (LoadedMods.IndustrialCraft2){
+ Utils.createInternalNameAndFluidCell(fluidNameWithCaps);
+ }
+ }
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
index 20df668ab2..5b4571b057 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
@@ -7,81 +7,74 @@ import net.minecraft.world.IBlockAccess;
public class CasingTextureHandler {
- // private static final TexturesGregtech59 gregtech59 = new
- // TexturesGregtech59();
- // private static final TexturesGregtech58 gregtech58 = new
- // TexturesGregtech58();
+ //private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
+ //private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock();
- public static IIcon getIcon(final int aSide, final int aMeta) { // Texture
- // ID's.
- // case 0 ==
- // ID[57]
- if (aMeta >= 0 && aMeta < 16) {
+ public static IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
+ if ((aMeta >= 0) && (aMeta < 16)) {
switch (aMeta) {
- // Centrifuge
- case 0:
- return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
- // Coke Oven Frame
- case 1:
- return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
- // Coke Oven Casing Tier 1
- case 2:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
- // Coke Oven Casing Tier 2
- case 3:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
- // Material Press Casings
- case 4:
- return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
- // Electrolyzer Casings
- case 5:
- return TexturesGtBlock.Casing_Material_Potin.getIcon();
- // Broken Blue Fusion Casings
- case 6:
- return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon();
- // Maceration Stack Casings
- case 7:
- return TexturesGtBlock.Casing_Material_Tumbaga.getIcon();
- // Broken Pink Fusion Casings
- case 8:
- return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
- // Matter Fabricator Casings
- case 9:
- return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon();
- // Iron Blast Fuance Textures
- case 10:
- return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
- // Multitank Exterior Casing
- case 11:
- return TexturesGtBlock.Casing_Material_Grisium.getIcon();
- // Reactor Casing I
- case 12:
- return TexturesGtBlock.Casing_Material_Stellite.getIcon();
- // Reactor Casing II
- case 13:
- return TexturesGtBlock.Casing_Material_Zeron100.getIcon();
- case 14:
- return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon();
- case 15:
- return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon();
+ //Centrifuge
+ case 0:
+ return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon();
+ //Coke Oven Frame
+ case 1:
+ return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
+ //Coke Oven Casing Tier 1
+ case 2:
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
+ //Coke Oven Casing Tier 2
+ case 3:
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
+ //Material Press Casings
+ case 4:
+ return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
+ //Electrolyzer Casings
+ case 5:
+ return TexturesGtBlock.Casing_Material_Potin.getIcon();
+ //Broken Blue Fusion Casings
+ case 6:
+ return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon();
+ //Maceration Stack Casings
+ case 7:
+ return TexturesGtBlock.Casing_Material_Tumbaga.getIcon();
+ //Broken Pink Fusion Casings
+ case 8:
+ return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
+ //Matter Fabricator Casings
+ case 9:
+ return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon();
+ //Iron Blast Fuance Textures
+ case 10:
+ return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
+ //Multitank Exterior Casing
+ case 11:
+ return TexturesGtBlock.Casing_Material_Grisium.getIcon();
+ //Reactor Casing I
+ case 12:
+ return TexturesGtBlock.Casing_Material_Stellite.getIcon();
+ //Reactor Casing II
+ case 13:
+ return TexturesGtBlock.Casing_Material_Zeron100.getIcon();
+ case 14:
+ return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon();
+ case 15:
+ return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon();
- default:
- return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
+ default:
+ return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
}
}
return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon();
}
- public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- /*
- * if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ return
- * gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide,
- * thisBlock); } return gregtech58.handleCasingsGT58(aWorld, xCoord,
- * yCoord, zCoord, aSide, thisBlock);
- */
- return CasingTextureHandler.gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+
+ public static IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+ return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/
+ return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
index 0a62cece67..8742896f2f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java
@@ -1,69 +1,69 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
import gregtech.api.enums.Textures;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
public class CasingTextureHandler2 {
- public static IIcon getIcon(final int aSide, final int aMeta) { // Texture
- // ID's.
- // case 0 ==
- // ID[57]
- if (aMeta >= 0 && aMeta < 16) {
+ public static IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
+ if ((aMeta >= 0) && (aMeta < 16)) {
switch (aMeta) {
- // Centrifuge
- case 0:
- return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon();
- // Coke Oven Frame
- case 1:
- return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
- // Coke Oven Casing Tier 1
- case 2:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
- // Coke Oven Casing Tier 2
- case 3:
- return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
- // Material Press Casings
- case 4:
- return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
- // Electrolyzer Casings
- case 5:
- return TexturesGtBlock.Casing_Material_Potin.getIcon();
- // Broken Blue Fusion Casings
- case 6:
- return TexturesGtBlock.Casing_Material_IncoloyMA956.getIcon();
- // Maceration Stack Casings
- case 7:
- return TexturesGtBlock.Casing_Material_Tumbaga.getIcon();
- // Broken Pink Fusion Casings
- case 8:
- return TexturesGtBlock.Casing_Material_IncoloyDS.getIcon();
- // Matter Fabricator Casings
- case 9:
- return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon();
- // Iron Blast Fuance Textures
- case 10:
- return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
- // Multitank Exterior Casing
- case 11:
- return Textures.BlockIcons.MACHINE_CASING_GRATE.getIcon();
- // Reactor Casing I
- case 12:
- return TexturesGtBlock.Casing_Material_Stellite.getIcon();
- // Reactor Casing II
- case 13:
- return TexturesGtBlock.Casing_Material_Zeron100.getIcon();
- case 14:
- return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon();
- case 15:
- return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon();
+ //Centrifuge
+ case 0:
+ return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon();
+ //Coke Oven Frame
+ case 1:
+ return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon();
+ //Coke Oven Casing Tier 1
+ case 2:
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
+ //Coke Oven Casing Tier 2
+ case 3:
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
+ //Material Press Casings
+ case 4:
+ return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
+ //Electrolyzer Casings
+ case 5:
+ return TexturesGtBlock.Casing_Material_Potin.getIcon();
+ //Broken Blue Fusion Casings
+ case 6:
+ return TexturesGtBlock.Casing_Material_IncoloyMA956.getIcon();
+ //Maceration Stack Casings
+ case 7:
+ return TexturesGtBlock.Casing_Material_Tumbaga.getIcon();
+ //Broken Pink Fusion Casings
+ case 8:
+ return TexturesGtBlock.Casing_Material_IncoloyDS.getIcon();
+ //Matter Fabricator Casings
+ case 9:
+ return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon();
+ //Iron Blast Fuance Textures
+ case 10:
+ return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon();
+ //Multitank Exterior Casing
+ case 11:
+ return Textures.BlockIcons.MACHINE_CASING_GRATE.getIcon();
+ //Reactor Casing I
+ case 12:
+ return TexturesGtBlock.Casing_Material_Stellite.getIcon();
+ //Reactor Casing II
+ case 13:
+ return TexturesGtBlock.Casing_Material_Zeron100.getIcon();
+ case 14:
+ return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon();
+ case 15:
+ return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon();
- default:
- return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
+ default:
+ return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
}
}
return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon();
}
-
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
index 8d79d38614..c23824913e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
@@ -11,502 +11,431 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public class TexturesCentrifugeMultiblock {
+
+ private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1");
+ private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1");
+ private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2");
+ private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2");
+ private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3");
+ private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3");
+ private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4");
+ private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4");
+ private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
+ private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
+ private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6");
+ private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6");
+ private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7");
+ private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7");
+ private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8");
+ private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8");
+ private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9");
+ private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9");
- private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1");
- private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1");
- private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2");
- private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2");
- private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3");
- private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3");
- private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4");
- private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4");
- private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
- private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
- private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6");
- private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6");
- private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7");
- private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7");
- private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8");
- private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8");
- private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9");
- private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9");
+ private static CustomIcon frontFace_0 = (GT8_1);
+ private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static CustomIcon frontFace_1 = (GT8_2);
+ private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static CustomIcon frontFace_2 = (GT8_3);
+ private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static CustomIcon frontFace_3 = (GT8_4);
+ private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static CustomIcon frontFace_4 = (GT8_5);
+ private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static CustomIcon frontFace_5 = (GT8_6);
+ private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static CustomIcon frontFace_6 = (GT8_7);
+ private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static CustomIcon frontFace_7 = (GT8_8);
+ private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static CustomIcon frontFace_8 = (GT8_9);
+ private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
- private static CustomIcon frontFace_0 = TexturesCentrifugeMultiblock.GT8_1;
- private static CustomIcon frontFaceActive_0 = TexturesCentrifugeMultiblock.GT8_1_Active;
- private static CustomIcon frontFace_1 = TexturesCentrifugeMultiblock.GT8_2;
- private static CustomIcon frontFaceActive_1 = TexturesCentrifugeMultiblock.GT8_2_Active;
- private static CustomIcon frontFace_2 = TexturesCentrifugeMultiblock.GT8_3;
- private static CustomIcon frontFaceActive_2 = TexturesCentrifugeMultiblock.GT8_3_Active;
- private static CustomIcon frontFace_3 = TexturesCentrifugeMultiblock.GT8_4;
- private static CustomIcon frontFaceActive_3 = TexturesCentrifugeMultiblock.GT8_4_Active;
- private static CustomIcon frontFace_4 = TexturesCentrifugeMultiblock.GT8_5;
- private static CustomIcon frontFaceActive_4 = TexturesCentrifugeMultiblock.GT8_5_Active;
- private static CustomIcon frontFace_5 = TexturesCentrifugeMultiblock.GT8_6;
- private static CustomIcon frontFaceActive_5 = TexturesCentrifugeMultiblock.GT8_6_Active;
- private static CustomIcon frontFace_6 = TexturesCentrifugeMultiblock.GT8_7;
- private static CustomIcon frontFaceActive_6 = TexturesCentrifugeMultiblock.GT8_7_Active;
- private static CustomIcon frontFace_7 = TexturesCentrifugeMultiblock.GT8_8;
- private static CustomIcon frontFaceActive_7 = TexturesCentrifugeMultiblock.GT8_8_Active;
- private static CustomIcon frontFace_8 = TexturesCentrifugeMultiblock.GT8_9;
- private static CustomIcon frontFaceActive_8 = TexturesCentrifugeMultiblock.GT8_9_Active;
-
- CustomIcon[] CENTRIFUGE = new CustomIcon[] {
- TexturesCentrifugeMultiblock.frontFace_0, TexturesCentrifugeMultiblock.frontFace_1,
- TexturesCentrifugeMultiblock.frontFace_2, TexturesCentrifugeMultiblock.frontFace_3,
- TexturesCentrifugeMultiblock.frontFace_4, TexturesCentrifugeMultiblock.frontFace_5,
- TexturesCentrifugeMultiblock.frontFace_6, TexturesCentrifugeMultiblock.frontFace_7,
- TexturesCentrifugeMultiblock.frontFace_8
- };
-
- CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[] {
- TexturesCentrifugeMultiblock.frontFaceActive_0, TexturesCentrifugeMultiblock.frontFaceActive_1,
- TexturesCentrifugeMultiblock.frontFaceActive_2, TexturesCentrifugeMultiblock.frontFaceActive_3,
- TexturesCentrifugeMultiblock.frontFaceActive_4, TexturesCentrifugeMultiblock.frontFaceActive_5,
- TexturesCentrifugeMultiblock.frontFaceActive_6, TexturesCentrifugeMultiblock.frontFaceActive_7,
- TexturesCentrifugeMultiblock.frontFaceActive_8
+ CustomIcon[] CENTRIFUGE = new CustomIcon[]{
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
};
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[]{
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
+
+ public IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ return handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
}
- public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (tMeta != 6 && tMeta != 8 && tMeta != 0) {
+
+ public IIcon handleCasingsGT58(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
return CasingTextureHandler.getIcon(aSide, tMeta);
}
- final int tStartIndex = tMeta == 6 ? 1 : 13;
+ int tStartIndex = tMeta == 6 ? 1 : 13;
if (tMeta == 0) {
- if (aSide == 2 || aSide == 3) {
+ if ((aSide == 2) || (aSide == 3)) {
TileEntity tTileEntity;
IMetaTileEntity tMetaTileEntity;
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[0].getIcon();
+ return CENTRIFUGE_ACTIVE[0].getIcon();
}
- return this.CENTRIFUGE[0].getIcon();
+ return CENTRIFUGE[0].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[3].getIcon();
+ return CENTRIFUGE_ACTIVE[3].getIcon();
}
- return this.CENTRIFUGE[3].getIcon();
+ return CENTRIFUGE[3].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[6].getIcon();
+ return CENTRIFUGE_ACTIVE[6].getIcon();
}
- return this.CENTRIFUGE[6].getIcon();
+ return CENTRIFUGE[6].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[1].getIcon();
+ return CENTRIFUGE_ACTIVE[1].getIcon();
}
- return this.CENTRIFUGE[1].getIcon();
+ return CENTRIFUGE[1].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[7].getIcon();
+ return CENTRIFUGE_ACTIVE[7].getIcon();
}
- return this.CENTRIFUGE[7].getIcon();
+ return CENTRIFUGE[7].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[8].getIcon();
+ return CENTRIFUGE_ACTIVE[8].getIcon();
}
- return this.CENTRIFUGE[8].getIcon();
+ return CENTRIFUGE[8].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[5].getIcon();
+ return CENTRIFUGE_ACTIVE[5].getIcon();
}
- return this.CENTRIFUGE[5].getIcon();
+ return CENTRIFUGE[5].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[2].getIcon();
+ return CENTRIFUGE_ACTIVE[2].getIcon();
}
- return this.CENTRIFUGE[2].getIcon();
+ return CENTRIFUGE[2].getIcon();
}
- }
- else if (aSide == 4 || aSide == 5) {
+ } else if ((aSide == 4) || (aSide == 5)) {
TileEntity tTileEntity;
Object tMetaTileEntity;
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[0].getIcon();
+ return CENTRIFUGE_ACTIVE[0].getIcon();
}
- return this.CENTRIFUGE[0].getIcon();
+ return CENTRIFUGE[0].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[3].getIcon();
+ return CENTRIFUGE_ACTIVE[3].getIcon();
}
- return this.CENTRIFUGE[3].getIcon();
+ return CENTRIFUGE[3].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[6].getIcon();
+ return CENTRIFUGE_ACTIVE[6].getIcon();
}
- return this.CENTRIFUGE[6].getIcon();
+ return CENTRIFUGE[6].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[1].getIcon();
+ return CENTRIFUGE_ACTIVE[1].getIcon();
}
- return this.CENTRIFUGE[1].getIcon();
+ return CENTRIFUGE[1].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[7].getIcon();
+ return CENTRIFUGE_ACTIVE[7].getIcon();
}
- return this.CENTRIFUGE[7].getIcon();
+ return CENTRIFUGE[7].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[8].getIcon();
+ return CENTRIFUGE_ACTIVE[8].getIcon();
}
- return this.CENTRIFUGE[8].getIcon();
+ return CENTRIFUGE[8].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[5].getIcon();
+ return CENTRIFUGE_ACTIVE[5].getIcon();
}
- return this.CENTRIFUGE[5].getIcon();
+ return CENTRIFUGE[5].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.CENTRIFUGE_ACTIVE[2].getIcon();
+ return CENTRIFUGE_ACTIVE[2].getIcon();
}
- return this.CENTRIFUGE[2].getIcon();
+ return CENTRIFUGE[2].getIcon();
}
}
return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
}
- final boolean[] tConnectedSides = {
- aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta,
- aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta
- };
+ boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
switch (aSide) {
- case 0:
- if (tConnectedSides[0]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[5] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 1:
- if (tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 2:
- if (tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 3:
- if (tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 4:
- if (tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- case 5:
- if (tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- break;
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
}
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
}
-
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
index eef82777e7..2fdfc0587c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
@@ -11,517 +11,431 @@ import net.minecraft.world.IBlockAccess;
public class TexturesGregtech58 {
- private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE1");
- private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE1");
- private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE2");
- private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE2");
- private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE3");
- private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE3");
- private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE4");
- private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE4");
- private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE5");
- private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE5");
- private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE6");
- private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE6");
- private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE7");
- private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE7");
- private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE8");
- private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE8");
- private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ACTIVE9");
- private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE9");
+ private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1");
+ private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1");
+ private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2");
+ private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2");
+ private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3");
+ private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3");
+ private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4");
+ private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4");
+ private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5");
+ private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5");
+ private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6");
+ private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6");
+ private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7");
+ private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7");
+ private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8");
+ private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8");
+ private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9");
+ private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9");
- private static Textures.BlockIcons.CustomIcon frontFace_0 = TexturesGregtech58.GT8_1;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = TexturesGregtech58.GT8_1_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_1 = TexturesGregtech58.GT8_2;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = TexturesGregtech58.GT8_2_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_2 = TexturesGregtech58.GT8_3;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = TexturesGregtech58.GT8_3_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_3 = TexturesGregtech58.GT8_4;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = TexturesGregtech58.GT8_4_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_4 = TexturesGregtech58.GT8_5;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = TexturesGregtech58.GT8_5_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_5 = TexturesGregtech58.GT8_6;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = TexturesGregtech58.GT8_6_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_6 = TexturesGregtech58.GT8_7;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = TexturesGregtech58.GT8_7_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_7 = TexturesGregtech58.GT8_8;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = TexturesGregtech58.GT8_8_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_8 = TexturesGregtech58.GT8_9;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = TexturesGregtech58.GT8_9_Active;
+ private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active);
- Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] {
- TexturesGregtech58.frontFace_0, TexturesGregtech58.frontFace_1, TexturesGregtech58.frontFace_2,
- TexturesGregtech58.frontFace_3, TexturesGregtech58.frontFace_4, TexturesGregtech58.frontFace_5,
- TexturesGregtech58.frontFace_6, TexturesGregtech58.frontFace_7, TexturesGregtech58.frontFace_8
+ Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[]{
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
};
- Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] {
- TexturesGregtech58.frontFaceActive_0, TexturesGregtech58.frontFaceActive_1,
- TexturesGregtech58.frontFaceActive_2, TexturesGregtech58.frontFaceActive_3,
- TexturesGregtech58.frontFaceActive_4, TexturesGregtech58.frontFaceActive_5,
- TexturesGregtech58.frontFaceActive_6, TexturesGregtech58.frontFaceActive_7,
- TexturesGregtech58.frontFaceActive_8
- };
+ Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[]{
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
+
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ public IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ return handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
}
- public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (tMeta != 6 && tMeta != 8 && tMeta != 0) {
+
+ public IIcon handleCasingsGT58(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
return CasingTextureHandler.getIcon(aSide, tMeta);
}
- final int tStartIndex = tMeta == 6 ? 1 : 13;
+ int tStartIndex = tMeta == 6 ? 1 : 13;
if (tMeta == 0) {
- if (aSide == 2 || aSide == 3) {
+ if ((aSide == 2) || (aSide == 3)) {
TileEntity tTileEntity;
IMetaTileEntity tMetaTileEntity;
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
+ return TURBINE_ACTIVE[0].getIcon();
}
- return this.TURBINE[0].getIcon();
+ return TURBINE[0].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
+ return TURBINE_ACTIVE[3].getIcon();
}
- return this.TURBINE[3].getIcon();
+ return TURBINE[3].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
+ return TURBINE_ACTIVE[6].getIcon();
}
- return this.TURBINE[6].getIcon();
+ return TURBINE[6].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
+ return TURBINE_ACTIVE[1].getIcon();
}
- return this.TURBINE[1].getIcon();
+ return TURBINE[1].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
+ return TURBINE_ACTIVE[7].getIcon();
}
- return this.TURBINE[7].getIcon();
+ return TURBINE[7].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
+ return TURBINE_ACTIVE[8].getIcon();
}
- return this.TURBINE[8].getIcon();
+ return TURBINE[8].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
+ return TURBINE_ACTIVE[5].getIcon();
}
- return this.TURBINE[5].getIcon();
+ return TURBINE[5].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
+ return TURBINE_ACTIVE[2].getIcon();
}
- return this.TURBINE[2].getIcon();
+ return TURBINE[2].getIcon();
}
- }
- else if (aSide == 4 || aSide == 5) {
+ } else if ((aSide == 4) || (aSide == 5)) {
TileEntity tTileEntity;
Object tMetaTileEntity;
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
+ return TURBINE_ACTIVE[0].getIcon();
}
- return this.TURBINE[0].getIcon();
+ return TURBINE[0].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
+ return TURBINE_ACTIVE[3].getIcon();
}
- return this.TURBINE[3].getIcon();
+ return TURBINE[3].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
+ return TURBINE_ACTIVE[6].getIcon();
}
- return this.TURBINE[6].getIcon();
+ return TURBINE[6].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
+ return TURBINE_ACTIVE[1].getIcon();
}
- return this.TURBINE[1].getIcon();
+ return TURBINE[1].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
+ return TURBINE_ACTIVE[7].getIcon();
}
- return this.TURBINE[7].getIcon();
+ return TURBINE[7].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
+ return TURBINE_ACTIVE[8].getIcon();
}
- return this.TURBINE[8].getIcon();
+ return TURBINE[8].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
+ return TURBINE_ACTIVE[5].getIcon();
}
- return this.TURBINE[5].getIcon();
+ return TURBINE[5].getIcon();
}
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
+ return TURBINE_ACTIVE[2].getIcon();
}
- return this.TURBINE[2].getIcon();
+ return TURBINE[2].getIcon();
}
}
return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
}
- final boolean[] tConnectedSides = {
- aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta,
- aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta
- };
+ boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
switch (aSide) {
- case 0:
- if (tConnectedSides[0]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[5] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 1:
- if (tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 2:
- if (tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 3:
- if (tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 4:
- if (tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- case 5:
- if (tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- break;
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
}
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
index 0ec77d236d..84de389827 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
@@ -10,518 +10,433 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public class TexturesGregtech59 {
+
+ private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE1");
+ private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST1");
+ private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE2");
+ private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST2");
+ private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE3");
+ private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST3");
+ private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE4");
+ private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST4");
+ private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5");
+ private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5");
+ private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE6");
+ private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST6");
+ private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE7");
+ private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST7");
+ private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE8");
+ private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST8");
+ private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE9");
+ private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST9");
+
+ private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9);
+ private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active);
+
+ Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[]{
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
+ };
+
+ Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[]{
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
+
+
+ public IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ return handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
- private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE1");
- private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST1");
- private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE2");
- private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST2");
- private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE3");
- private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST3");
- private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE4");
- private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST4");
- private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE5");
- private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST5");
- private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE6");
- private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST6");
- private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE7");
- private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST7");
- private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE8");
- private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST8");
- private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST_ACTIVE9");
- private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon(
- "iconsets/LARGETURBINE_ST9");
-
- private static Textures.BlockIcons.CustomIcon frontFace_0 = TexturesGregtech59.GT8_1;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = TexturesGregtech59.GT8_1_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_1 = TexturesGregtech59.GT8_2;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = TexturesGregtech59.GT8_2_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_2 = TexturesGregtech59.GT8_3;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = TexturesGregtech59.GT8_3_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_3 = TexturesGregtech59.GT8_4;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = TexturesGregtech59.GT8_4_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_4 = TexturesGregtech59.GT8_5;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = TexturesGregtech59.GT8_5_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_5 = TexturesGregtech59.GT8_6;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = TexturesGregtech59.GT8_6_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_6 = TexturesGregtech59.GT8_7;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = TexturesGregtech59.GT8_7_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_7 = TexturesGregtech59.GT8_8;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = TexturesGregtech59.GT8_8_Active;
- private static Textures.BlockIcons.CustomIcon frontFace_8 = TexturesGregtech59.GT8_9;
- private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = TexturesGregtech59.GT8_9_Active;
-
- Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] {
- TexturesGregtech59.frontFace_0, TexturesGregtech59.frontFace_1, TexturesGregtech59.frontFace_2,
- TexturesGregtech59.frontFace_3, TexturesGregtech59.frontFace_4, TexturesGregtech59.frontFace_5,
- TexturesGregtech59.frontFace_6, TexturesGregtech59.frontFace_7, TexturesGregtech59.frontFace_8
- };
-
- Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] {
- TexturesGregtech59.frontFaceActive_0, TexturesGregtech59.frontFaceActive_1,
- TexturesGregtech59.frontFaceActive_2, TexturesGregtech59.frontFaceActive_3,
- TexturesGregtech59.frontFaceActive_4, TexturesGregtech59.frontFaceActive_5,
- TexturesGregtech59.frontFaceActive_6, TexturesGregtech59.frontFaceActive_7,
- TexturesGregtech59.frontFaceActive_8
- };
- public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+public IIcon handleCasingsGT59(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
+ return CasingTextureHandler.getIcon(aSide, tMeta);
}
-
- public IIcon handleCasingsGT59(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord,
- final int aSide, final GregtechMetaCasingBlocks thisBlock) {
- final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- if (tMeta != 6 && tMeta != 8 && tMeta != 0) {
- return CasingTextureHandler.getIcon(aSide, tMeta);
- }
- final int tStartIndex = tMeta == 6 ? 1 : 13;
- if (tMeta == 0) {
- if (aSide == 2 || aSide == 3) {
- TileEntity tTileEntity;
- IMetaTileEntity tMetaTileEntity;
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
- }
- return this.TURBINE[0].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
- }
- return this.TURBINE[3].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
- }
- return this.TURBINE[6].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
- }
- return this.TURBINE[1].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
- }
- return this.TURBINE[7].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
- }
- return this.TURBINE[8].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
- }
- return this.TURBINE[5].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
- }
- return this.TURBINE[2].getIcon();
- }
+ int tStartIndex = tMeta == 6 ? 1 : 13;
+ if (tMeta == 0) {
+ if ((aSide == 2) || (aSide == 3)) {
+ TileEntity tTileEntity;
+ IMetaTileEntity tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[0].getIcon();
+ }
+ return TURBINE[0].getIcon();
}
- else if (aSide == 4 || aSide == 5) {
- TileEntity tTileEntity;
- Object tMetaTileEntity;
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[0].getIcon();
- }
- return this.TURBINE[0].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[3].getIcon();
- }
- return this.TURBINE[3].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[6].getIcon();
- }
- return this.TURBINE[6].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[1].getIcon();
- }
- return this.TURBINE[1].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[7].getIcon();
- }
- return this.TURBINE[7].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[8].getIcon();
- }
- return this.TURBINE[8].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[5].getIcon();
- }
- return this.TURBINE[5].getIcon();
- }
- if (null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))
- && tTileEntity instanceof IGregTechTileEntity
- && ((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide
- && null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())
- && tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) {
- if (((IGregTechTileEntity) tTileEntity).isActive()) {
- return this.TURBINE_ACTIVE[2].getIcon();
- }
- return this.TURBINE[2].getIcon();
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[3].getIcon();
}
+ return TURBINE[3].getIcon();
}
- return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
- }
- final boolean[] tConnectedSides = {
- aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta,
- aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta,
- aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock
- && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta,
- aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock
- && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta
- };
- switch (aSide) {
- case 0:
- if (tConnectedSides[0]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[5] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 1:
- if (tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[6].getIcon();
}
- case 2:
- if (tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 3:
- if (tConnectedSides[3]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[2] && !tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- case 4:
- if (tConnectedSides[4]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
- }
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
- }
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
- }
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
- }
- case 5:
- if (tConnectedSides[2]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
- }
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 6].getIcon();
+ return TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[1].getIcon();
}
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 5].getIcon();
+ return TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[7].getIcon();
}
- if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 2].getIcon();
+ return TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[8].getIcon();
}
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 3].getIcon();
+ return TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[5].getIcon();
}
- if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 4].getIcon();
+ return TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[2].getIcon();
}
- if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 11].getIcon();
+ return TURBINE[2].getIcon();
+ }
+ } else if ((aSide == 4) || (aSide == 5)) {
+ TileEntity tTileEntity;
+ Object tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[0].getIcon();
+ }
+ return TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[3].getIcon();
}
- if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 8].getIcon();
+ return TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[6].getIcon();
}
- if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 9].getIcon();
+ return TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[1].getIcon();
}
- if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 10].getIcon();
+ return TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[7].getIcon();
}
- if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
+ return TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[8].getIcon();
}
- if (!tConnectedSides[0] && !tConnectedSides[1]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 0].getIcon();
+ return TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[5].getIcon();
}
- if (!tConnectedSides[3] && !tConnectedSides[5]) {
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 1].getIcon();
+ return TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[2].getIcon();
}
- break;
+ return TURBINE[2].getIcon();
+ }
}
- return Textures.BlockIcons.CONNECTED_HULLS[tStartIndex + 7].getIcon();
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
}
-
+ boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
+ switch (aSide) {
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
+ }
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+}
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
index 017df30a20..04a7fdceed 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
@@ -13,20 +13,20 @@ public class TexturesGtBlock {
/*
* Handles Custom Textures.
*/
-
+
public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
+ protected IIcon mIcon;
+ protected String mIconName;
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Utils.LOG_WARNING("Constructing a Custom Texture. " + this.mIconName);
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ Utils.LOG_WARNING("Constructing a Custom Texture. " + mIconName);
GregTech_API.sGTBlockIconload.add(this);
}
@Override
public IIcon getIcon() {
- return this.mIcon;
+ return mIcon;
}
@Override
@@ -35,170 +35,131 @@ public class TexturesGtBlock {
}
@Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + mIconName);
+ Utils.LOG_WARNING("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath());
}
@Override
- public void run() {
- this.mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
- Utils.LOG_WARNING("FIND ME _ Processing texture: " + this.getTextureFile().getResourcePath());
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
}
}
-
+
+
/*
- * Add Some Custom Textures below. I am not sure whether or not I need to
- * declare them as such, but better to be safe than sorry. Right?
+ * Add Some Custom Textures below.
+ * I am not sure whether or not I need to declare them as such, but better to be safe than sorry.
+ * Right?
*/
- // Machine Casings
- // Simple
- private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon(
- "TileEntities/machine_top");
- public static final CustomIcon Casing_Machine_Simple_Top = TexturesGtBlock.Internal_Casing_Machine_Simple_Top;
- private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon(
- "TileEntities/machine_bottom");
- public static final CustomIcon Casing_Machine_Simple_Bottom = TexturesGtBlock.Internal_Casing_Machine_Simple_Bottom;
- // Advanced and Ultra
- private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon(
- "TileEntities/high_adv_machine");
- public static final CustomIcon Casing_Machine_Advanced = TexturesGtBlock.Internal_Casing_Machine_Advanced;
- private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon(
- "TileEntities/adv_machine_lesu");
- public static final CustomIcon Casing_Machine_Ultra = TexturesGtBlock.Internal_Casing_Machine_Ultra;
- // Dimensional - Non Overlay
- private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon(
- "TileEntities/adv_machine_dimensional");
- public static final CustomIcon Casing_Machine_Dimensional = TexturesGtBlock.Internal_Casing_Machine_Dimensional;
- private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon(
- "TileEntities/high_adv_machine_dimensional");
- public static final CustomIcon Casing_Machine_Dimensional_Adv = TexturesGtBlock.Internal_Casing_Machine_Dimensional_Adv;
-
- // Material Casings
- private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_TANTALLOY61");
- public static final CustomIcon Casing_Material_Tantalloy61 = TexturesGtBlock.Internal_Casing_Tantalloy61;
- private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL");
- public static final CustomIcon Casing_Material_MaragingSteel = TexturesGtBlock.Internal_Casing_MaragingSteel;
- private static final CustomIcon Internal_Casing_Stellite = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_STELLITE");
- public static final CustomIcon Casing_Material_Stellite = TexturesGtBlock.Internal_Casing_Stellite;
- private static final CustomIcon Internal_Casing_Talonite = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_TALONITE");
- public static final CustomIcon Casing_Material_Talonite = TexturesGtBlock.Internal_Casing_Talonite;
- private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_TUMBAGA");
- public static final CustomIcon Casing_Material_Tumbaga = TexturesGtBlock.Internal_Casing_Tumbaga;
- private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_ZERON100");
- public static final CustomIcon Casing_Material_Zeron100 = TexturesGtBlock.Internal_Casing_Zeron100;
- private static final CustomIcon Internal_Casing_Potin = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_POTIN");
- public static final CustomIcon Casing_Material_Potin = TexturesGtBlock.Internal_Casing_Potin;
-
- private static final CustomIcon Internal_Casing_Grisium = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_GRISIUM");
- public static final CustomIcon Casing_Material_Grisium = TexturesGtBlock.Internal_Casing_Grisium;
- private static final CustomIcon Internal_Casing_Incoloy020 = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_INCOLOY_020");
- public static final CustomIcon Casing_Material_Incoloy020 = TexturesGtBlock.Internal_Casing_Incoloy020;
- private static final CustomIcon Internal_Casing_IncoloyDS = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS");
- public static final CustomIcon Casing_Material_IncoloyDS = TexturesGtBlock.Internal_Casing_IncoloyDS;
- private static final CustomIcon Internal_Casing_IncoloyMA956 = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956");
- public static final CustomIcon Casing_Material_IncoloyMA956 = TexturesGtBlock.Internal_Casing_IncoloyMA956;
- private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon(
- "TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE");
- public static final CustomIcon Casing_Material_ZirconiumCarbide = TexturesGtBlock.Internal_Casing_ZirconiumCarbide;
-
- // Material Machine/Firebox Casings
- private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon(
- "TileEntities/MACHINE_CASING_FIREBOX_STABALLOY");
- public static final CustomIcon Casing_Staballoy_Firebox = TexturesGtBlock.Internal_Casing_Staballoy_Firebox;
- // Misc Casings
- private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon(
- "TileEntities/cover_redstone_conductor");
- public static final CustomIcon Casing_Machine_Redstone_Off = TexturesGtBlock.Internal_Casing_Machine_Redstone_Off;
- private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon(
- "TileEntities/cover_redstone_emitter");
- public static final CustomIcon Casing_Machine_Redstone_On = TexturesGtBlock.Internal_Casing_Machine_Redstone_On;
- // Overlays
- // Fan Textures
- private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon(
- "TileEntities/machine_top_vent_rotating");
- public static final CustomIcon Overlay_Machine_Vent = TexturesGtBlock.Internal_Overlay_Machine_Vent;
- private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon(
- "TileEntities/machine_top_vent_rotating_fast");
- public static final CustomIcon Overlay_Machine_Vent_Fast = TexturesGtBlock.Internal_Overlay_Machine_Vent_Fast;
- private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon(
- "TileEntities/adv_machine_vent_rotating");
- public static final CustomIcon Overlay_Machine_Vent_Adv = TexturesGtBlock.Internal_Overlay_Machine_Vent_Adv;
- // Speaker Texture
- private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon(
- "TileEntities/audio_out");
- public static final CustomIcon Overlay_Machine_Sound = TexturesGtBlock.Internal_Overlay_Machine_Sound;
- private static final CustomIcon Internal_Overlay_Machine_Sound_Active = new CustomIcon(
- "TileEntities/audio_out_active");
- public static final CustomIcon Overlay_Machine_Sound_Active = TexturesGtBlock.Internal_Overlay_Machine_Sound_Active;
- // Diesel Engines
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon(
- "TileEntities/machine_top_dieselmotor");
- public static final CustomIcon Overlay_Machine_Diesel_Vertical = TexturesGtBlock.Internal_Overlay_Machine_Diesel_Vertical;
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon(
- "TileEntities/machine_top_dieselmotor2");
- public static final CustomIcon Overlay_Machine_Diesel_Horizontal = TexturesGtBlock.Internal_Overlay_Machine_Diesel_Horizontal;
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon(
- "TileEntities/machine_top_dieselmotor_active");
- public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = TexturesGtBlock.Internal_Overlay_Machine_Diesel_Vertical_Active;
- private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon(
- "TileEntities/machine_top_dieselmotor2_active");
- public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = TexturesGtBlock.Internal_Overlay_Machine_Diesel_Horizontal_Active;
- // Computer Screens
- private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon(
- "TileEntities/adv_machine_screen_random1");
- public static final CustomIcon Casing_Machine_Screen_1 = TexturesGtBlock.Internal_Casing_Machine_Screen_1;
- private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon(
- "TileEntities/adv_machine_screen_random2");
- public static final CustomIcon Casing_Machine_Screen_2 = TexturesGtBlock.Internal_Casing_Machine_Screen_2;
- private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon(
- "TileEntities/adv_machine_screen_random3");
- public static final CustomIcon Casing_Machine_Screen_3 = TexturesGtBlock.Internal_Casing_Machine_Screen_3;
- private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon(
- "TileEntities/adv_machine_screen_frequency");
- public static final CustomIcon Casing_Machine_Screen_Frequency = TexturesGtBlock.Internal_Casing_Machine_Screen_Frequency;
- private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon(
- "TileEntities/adv_machine_screen_logo");
- public static final CustomIcon Overlay_Machine_Screen_Logo = TexturesGtBlock.Internal_Overlay_Machine_Screen_Logo;
- // Crafting Overlays
- private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon(
- "TileEntities/bronze_top_crafting");
- public static final CustomIcon Overlay_Crafting_Bronze = TexturesGtBlock.Internal_Overlay_Crafting_Bronze;
- private static final CustomIcon Internal_Overlay_Crafting_Steel = new CustomIcon(
- "TileEntities/cover_crafting");
- public static final CustomIcon Overlay_Crafting_Steel = TexturesGtBlock.Internal_Overlay_Crafting_Steel;
- // Dimensional
- private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = new CustomIcon(
- "TileEntities/adv_machine_dimensional_cover_blue");
- public static final CustomIcon Overlay_Machine_Dimensional_Blue = TexturesGtBlock.Internal_Overlay_Machine_Dimensional_Blue;
- private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon(
- "TileEntities/adv_machine_dimensional_cover_orange");
- public static final CustomIcon Overlay_Machine_Dimensional_Orange = TexturesGtBlock.Internal_Overlay_Machine_Dimensional_Orange;
- // Icons
- private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon(
- "TileEntities/adv_machine_matterfab");
- public static final CustomIcon Overlay_MatterFab = TexturesGtBlock.Internal_Overlay_MatterFab;
- private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon(
- "TileEntities/adv_machine_matterfab_active");
- public static final CustomIcon Overlay_MatterFab_Active = TexturesGtBlock.Internal_Overlay_MatterFab_Active;
- private static final CustomIcon Internal_Overlay_Oil = new CustomIcon(
- "TileEntities/adv_machine_oil");
- public static final CustomIcon Overlay_Oil = TexturesGtBlock.Internal_Overlay_Oil;
- private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon(
- "TileEntities/adv_machine_uum");
- public static final CustomIcon Overlay_UU_Matter = TexturesGtBlock.Internal_Overlay_UU_Matter;
+ //Machine Casings
+ //Simple
+ private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top");
+ public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top;
+ private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon("TileEntities/machine_bottom");
+ public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom;
+ //Advanced and Ultra
+ private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine");
+ public static final CustomIcon Casing_Machine_Advanced = Internal_Casing_Machine_Advanced;
+ private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon("TileEntities/adv_machine_lesu");
+ public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra;
+ //Dimensional - Non Overlay
+ private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional");
+ public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional;
+ private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional");
+ public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv;
+
+ //Material Casings
+ private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61");
+ public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61;
+ private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL");
+ public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel;
+ private static final CustomIcon Internal_Casing_Stellite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE");
+ public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite;
+ private static final CustomIcon Internal_Casing_Talonite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TALONITE");
+ public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite;
+ private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TUMBAGA");
+ public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga;
+ private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZERON100");
+ public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100;
+ private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN");
+ public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin;
+
+ private static final CustomIcon Internal_Casing_Grisium = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_GRISIUM");
+ public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium;
+ private static final CustomIcon Internal_Casing_Incoloy020 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_020");
+ public static final CustomIcon Casing_Material_Incoloy020 = Internal_Casing_Incoloy020;
+ private static final CustomIcon Internal_Casing_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS");
+ public static final CustomIcon Casing_Material_IncoloyDS = Internal_Casing_IncoloyDS;
+ private static final CustomIcon Internal_Casing_IncoloyMA956 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956");
+ public static final CustomIcon Casing_Material_IncoloyMA956 = Internal_Casing_IncoloyMA956;
+ private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE");
+ public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide;
+
+ //Material Machine/Firebox Casings
+ private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY");
+ public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox;
+
+ //Misc Casings
+ private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon("TileEntities/cover_redstone_conductor");
+ public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off;
+ private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon("TileEntities/cover_redstone_emitter");
+ public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On;
+
+ //Overlays
+ //Fan Textures
+ private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon("TileEntities/machine_top_vent_rotating");
+ public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent;
+ private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon("TileEntities/machine_top_vent_rotating_fast");
+ public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast;
+ private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon("TileEntities/adv_machine_vent_rotating");
+ public static final CustomIcon Overlay_Machine_Vent_Adv = Internal_Overlay_Machine_Vent_Adv;
+ //Speaker Texture
+ private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon("TileEntities/audio_out");
+ public static final CustomIcon Overlay_Machine_Sound = Internal_Overlay_Machine_Sound;
+ private static final CustomIcon Internal_Overlay_Machine_Sound_Active = new CustomIcon("TileEntities/audio_out_active");
+ public static final CustomIcon Overlay_Machine_Sound_Active = Internal_Overlay_Machine_Sound_Active;
+ //Diesel Engines
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon("TileEntities/machine_top_dieselmotor");
+ public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical;
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon("TileEntities/machine_top_dieselmotor2");
+ public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal;
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon("TileEntities/machine_top_dieselmotor_active");
+ public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = Internal_Overlay_Machine_Diesel_Vertical_Active;
+ private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon("TileEntities/machine_top_dieselmotor2_active");
+ public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = Internal_Overlay_Machine_Diesel_Horizontal_Active;
+ //Computer Screens
+ private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon("TileEntities/adv_machine_screen_random1");
+ public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1;
+ private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon("TileEntities/adv_machine_screen_random2");
+ public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2;
+ private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon("TileEntities/adv_machine_screen_random3");
+ public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3;
+ private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon("TileEntities/adv_machine_screen_frequency");
+ public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency;
+ private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon("TileEntities/adv_machine_screen_logo");
+ public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo;
+ //Crafting Overlays
+ private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting");
+ public static final CustomIcon Overlay_Crafting_Bronze = Internal_Overlay_Crafting_Bronze;
+ private static final CustomIcon Internal_Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting");
+ public static final CustomIcon Overlay_Crafting_Steel = Internal_Overlay_Crafting_Steel;
+ //Dimensional
+ private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = new CustomIcon("TileEntities/adv_machine_dimensional_cover_blue");
+ public static final CustomIcon Overlay_Machine_Dimensional_Blue = Internal_Overlay_Machine_Dimensional_Blue;
+ private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon("TileEntities/adv_machine_dimensional_cover_orange");
+ public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange;
+ //Icons
+ private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab");
+ public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab;
+ private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon("TileEntities/adv_machine_matterfab_active");
+ public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active;
+ private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil");
+ public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil;
+ private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum");
+ public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java
index c9a0387bdb..1b3af3a842 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java
@@ -10,39 +10,50 @@ import net.minecraft.util.ResourceLocation;
public final class TexturesGtTools {
- public final static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected final String mIconName;
-
- public CustomIcon(final String aIconName) {
- this.mIconName = aIconName;
- Utils.LOG_INFO("Constructing a Custom Texture. " + this.mIconName);
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return this.mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return this.mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName);
- // Utils.LOG_INFO("Registering a Custom Texture. "+mIcon.g);
- this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName + "_OVERLAY");
- }
- }
-
public final static CustomIcon SKOOKUM_CHOOCHER = new CustomIcon("iconsets/SKOOKUMCHOOCHER");
+
+
+
+
+
+
+
+
+
+
+
+
+ public final static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected final String mIconName;
+
+ public CustomIcon(final String aIconName) {
+ mIconName = aIconName;
+ Utils.LOG_INFO("Constructing a Custom Texture. " + mIconName);
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + mIconName);
+ //Utils.LOG_INFO("Registering a Custom Texture. "+mIcon.g);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
index 1c514acc74..7dd6ddd2ab 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -1,12 +1,22 @@
package gtPlusPlus.xmod.gregtech.common.items;
+import static gtPlusPlus.core.util.Utils.getTcAspectStack;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.objects.*;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
import gregtech.api.util.GT_FoodStat;
import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.common.covers.*;
+import gregtech.common.covers.GT_Cover_Arm;
+import gregtech.common.covers.GT_Cover_Conveyor;
+import gregtech.common.covers.GT_Cover_Pump;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
@@ -16,788 +26,183 @@ import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32;
import net.minecraft.item.EnumAction;
public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
- public MetaGeneratedGregtechItems INSTANCE;
-
- public MetaGeneratedGregtechItems() {
- super("MU-metaitem.01", new OrePrefixes[] {
- null
- });
- this.INSTANCE = this;
- int tLastID = 0;
-
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- Utils.LOG_INFO(
- "Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)");
- GregtechItemList.Electric_Pump_LuV
- .set(this.addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 1L), Utils.getTcAspectStack(TC_Aspects.ITER, 1L),
- Utils.getTcAspectStack(TC_Aspects.AQUA, 1L)
- }));
- GregtechItemList.Electric_Pump_ZPM
- .set(this.addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L), Utils.getTcAspectStack(TC_Aspects.ITER, 2L),
- Utils.getTcAspectStack(TC_Aspects.AQUA, 2L)
- }));
- GregtechItemList.Electric_Pump_UV
- .set(this.addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L), Utils.getTcAspectStack(TC_Aspects.ITER, 4L),
- Utils.getTcAspectStack(TC_Aspects.AQUA, 4L)
- }));
- GregtechItemList.Electric_Pump_MAX
- .set(this.addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L), Utils.getTcAspectStack(TC_Aspects.ITER, 8L),
- Utils.getTcAspectStack(TC_Aspects.AQUA, 8L)
- }));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_LuV.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[5][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
- }), new GT_Cover_Pump(8196));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_ZPM.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[6][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
- }), new GT_Cover_Pump(32768));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_UV.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[7][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
- }), new GT_Cover_Pump(131072));
- GregTech_API.registerCover(GregtechItemList.Electric_Pump_MAX.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[8][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)
- }), new GT_Cover_Pump(524288));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw",
- // "OMW", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_LuV, Character.valueOf('O'),
- // OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'),
- // OrePrefixes.rotor.get(Materials.Tin), Character.valueOf('S'),
- // OrePrefixes.screw.get(Materials.Tin), Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('P'),
- // OrePrefixes.pipeMedium.get(Materials.Bronze)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw",
- // "OMW", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_ZPM, Character.valueOf('O'),
- // OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'),
- // OrePrefixes.rotor.get(Materials.Bronze), Character.valueOf('S'),
- // OrePrefixes.screw.get(Materials.Bronze), Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.AnyCopper),
- // Character.valueOf('P'),
- // OrePrefixes.pipeMedium.get(Materials.Steel)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw",
- // "OMW", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_UV, Character.valueOf('O'),
- // OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'),
- // OrePrefixes.rotor.get(Materials.Steel), Character.valueOf('S'),
- // OrePrefixes.screw.get(Materials.Steel), Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.Gold),
- // Character.valueOf('P'),
- // OrePrefixes.pipeMedium.get(Materials.StainlessSteel)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw",
- // "OMW", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_MAX, Character.valueOf('O'),
- // OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'),
- // OrePrefixes.rotor.get(Materials.StainlessSteel),
- // Character.valueOf('S'),
- // OrePrefixes.screw.get(Materials.StainlessSteel),
- // Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.Aluminium),
- // Character.valueOf('P'),
- // OrePrefixes.pipeMedium.get(Materials.Titanium)});
- tLastID = 4;
- GregtechItemList.Electric_Motor_LuV.set(this.addItem(tLastID = 4, "Electric Motor (LuV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 1L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 1L)
- }));
- GregtechItemList.Electric_Motor_ZPM.set(this.addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 2L)
- }));
- GregtechItemList.Electric_Motor_UV.set(this.addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 4L)
- }));
- GregtechItemList.Electric_Motor_MAX.set(this.addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW",
- // "RWC", Character.valueOf('I'),
- // OrePrefixes.stick.get(Materials.IronMagnetic),
- // Character.valueOf('R'), OrePrefixes.stick.get(Materials.AnyIron),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt01.get(Materials.AnyCopper),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Tin)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW",
- // "RWC", Character.valueOf('I'),
- // OrePrefixes.stick.get(Materials.SteelMagnetic),
- // Character.valueOf('R'),
- // OrePrefixes.stick.get(Materials.Aluminium),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt01.get(Materials.Electrum),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Silver)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW",
- // "RWC", Character.valueOf('I'),
- // OrePrefixes.stick.get(Materials.SteelMagnetic),
- // Character.valueOf('R'),
- // OrePrefixes.stick.get(Materials.StainlessSteel),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt02.get(Materials.Cupronickel),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Gold)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW",
- // "RWC", Character.valueOf('I'),
- // OrePrefixes.stick.get(Materials.NeodymiumMagnetic),
- // Character.valueOf('R'),
- // OrePrefixes.stick.get(Materials.Titanium),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt02.get(Materials.TungstenSteel),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Nichrome)});
-
- tLastID = 8;
- GregtechItemList.Conveyor_Module_LuV.set(this.addItem(tLastID = 8, "Conveyor Module (LuV)",
- "1 Stack every 20 secs (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 1L), Utils.getTcAspectStack(TC_Aspects.ITER, 1L)
- }));
- GregtechItemList.Conveyor_Module_ZPM.set(
- this.addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L), Utils.getTcAspectStack(TC_Aspects.ITER, 2L)
- }));
- GregtechItemList.Conveyor_Module_UV.set(
- this.addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L), Utils.getTcAspectStack(TC_Aspects.ITER, 4L)
- }));
- GregtechItemList.Conveyor_Module_MAX.set(this.addItem(tLastID = 11, "Conveyor Module (MAX)",
- "1 Stack every 1/5 sec (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L), Utils.getTcAspectStack(TC_Aspects.ITER, 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM",
- // "RRR", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('R'),
- // OrePrefixes.plate.get(Materials.Rubber)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM",
- // "RRR", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.AnyCopper),
- // Character.valueOf('R'),
- // OrePrefixes.plate.get(Materials.Rubber)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM",
- // "RRR", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_UV, Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Gold),
- // Character.valueOf('R'),
- // OrePrefixes.plate.get(Materials.Rubber)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM",
- // "RRR", Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Aluminium),
- // Character.valueOf('R'),
- // OrePrefixes.plate.get(Materials.Rubber)});
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_LuV.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[1][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
- }), new GT_Cover_Conveyor(400));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_ZPM.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[2][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
- }), new GT_Cover_Conveyor(100));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_UV.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[3][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
- }), new GT_Cover_Conveyor(20));
- GregTech_API.registerCover(GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[4][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)
- }), new GT_Cover_Conveyor(4));
- tLastID = 12;
- GregtechItemList.Electric_Piston_LuV
- .set(this.addItem(tLastID = 12, "Electric Piston (LuV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L), Utils.getTcAspectStack(TC_Aspects.MOTUS, 1L)
- }));
- GregtechItemList.Electric_Piston_ZPM
- .set(this.addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L), Utils.getTcAspectStack(TC_Aspects.MOTUS, 2L)
- }));
- GregtechItemList.Electric_Piston_UV
- .set(this.addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L), Utils.getTcAspectStack(TC_Aspects.MOTUS, 4L)
- }));
- GregtechItemList.Electric_Piston_MAX
- .set(this.addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 16L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS",
- // "CMG", Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.Steel), Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Steel), Character.valueOf('G'),
- // OrePrefixes.gearGtSmall.get(Materials.Steel),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV,
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Tin)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS",
- // "CMG", Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.Aluminium),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Aluminium),
- // Character.valueOf('G'),
- // OrePrefixes.gearGtSmall.get(Materials.Aluminium),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM,
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.AnyCopper)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS",
- // "CMG", Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.StainlessSteel),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.StainlessSteel),
- // Character.valueOf('G'),
- // OrePrefixes.gearGtSmall.get(Materials.StainlessSteel),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_UV,
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Gold)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS",
- // "CMG", Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.Titanium),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Titanium),
- // Character.valueOf('G'),
- // OrePrefixes.gearGtSmall.get(Materials.Titanium),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX,
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Aluminium)});
- tLastID = 16;
- GregtechItemList.Robot_Arm_LuV.set(this.addItem(tLastID = 16, "Robot Arm (LuV)",
- "Inserts into specific Slots (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 1L), Utils.getTcAspectStack("COGNITIO", 1L)
- }));
- GregtechItemList.Robot_Arm_ZPM.set(this.addItem(tLastID = 17, "Robot Arm (ZPM)",
- "Inserts into specific Slots (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 2L), Utils.getTcAspectStack("COGNITIO", 2L)
- }));
- GregtechItemList.Robot_Arm_UV.set(this.addItem(tLastID = 18, "Robot Arm (UV)",
- "Inserts into specific Slots (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 4L), Utils.getTcAspectStack("COGNITIO", 4L)
- }));
- GregtechItemList.Robot_Arm_MAX.set(this.addItem(tLastID = 19, "Robot Arm (MAX)",
- "Inserts into specific Slots (as Cover)", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 16L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 8L), Utils.getTcAspectStack("COGNITIO", 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM",
- // "PES", Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Steel), Character.valueOf('M'),
- // GregtechItemList.Electric_Motor_LuV, Character.valueOf('P'),
- // GregtechItemList.Electric_Piston_LuV, Character.valueOf('E'),
- // OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Tin)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM",
- // "PES", Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Aluminium),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM,
- // Character.valueOf('P'), GregtechItemList.Electric_Piston_ZPM,
- // Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Good),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.AnyCopper)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM",
- // "PES", Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.StainlessSteel),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_UV,
- // Character.valueOf('P'), GregtechItemList.Electric_Piston_UV,
- // Character.valueOf('E'),
- // OrePrefixes.circuit.get(Materials.Advanced),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Gold)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM",
- // "PES", Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Titanium),
- // Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX,
- // Character.valueOf('P'), GregtechItemList.Electric_Piston_MAX,
- // Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Elite),
- // Character.valueOf('C'),
- // OrePrefixes.cableGt01.get(Materials.Aluminium)});
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_LuV.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[1][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
- }), new GT_Cover_Arm(400));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_ZPM.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[2][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
- }), new GT_Cover_Arm(100));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_UV.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[3][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
- }), new GT_Cover_Arm(20));
- GregTech_API.registerCover(GregtechItemList.Robot_Arm_MAX.get(1L, new Object[0]),
- new GT_MultiTexture(new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[4][0],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)
- }), new GT_Cover_Arm(4));
- tLastID = 20;
- GregtechItemList.Field_Generator_LuV
- .set(this.addItem(tLastID = 20, "Field Generator (LuV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 1L),
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN, 1L)
- }));
- GregtechItemList.Field_Generator_ZPM
- .set(this.addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L),
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN, 2L)
- }));
- GregtechItemList.Field_Generator_UV
- .set(this.addItem(tLastID = 22, "Field Generator (UV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L),
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN, 4L)
- }));
- GregtechItemList.Field_Generator_MAX
- .set(this.addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 16L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN, 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC",
- // "WCW", Character.valueOf('G'),
- // OrePrefixes.gem.get(Materials.EnderPearl),
- // Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt01.get(Materials.Osmium)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC",
- // "WCW", Character.valueOf('G'),
- // OrePrefixes.gem.get(Materials.EnderEye), Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'),
- // OrePrefixes.wireGt02.get(Materials.Osmium)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC",
- // "WCW", Character.valueOf('G'),
- // OrePrefixes.gem.get(Materials.NetherStar),
- // Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Advanced),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt04.get(Materials.Osmium)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC",
- // "WCW", Character.valueOf('G'),
- // OrePrefixes.gem.get(Materials.NetherStar),
- // Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite),
- // Character.valueOf('W'),
- // OrePrefixes.wireGt08.get(Materials.Osmium)});
- tLastID = 24;
- GregtechItemList.Emitter_LuV.set(this.addItem(tLastID = 24, "Emitter (LuV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 1L),
- Utils.getTcAspectStack(TC_Aspects.LUX, 1L)
- }));
- GregtechItemList.Emitter_ZPM.set(this.addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L),
- Utils.getTcAspectStack(TC_Aspects.LUX, 2L)
- }));
- GregtechItemList.Emitter_UV.set(this.addItem(tLastID = 26, "Emitter (UV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L),
- Utils.getTcAspectStack(TC_Aspects.LUX, 4L)
- }));
- GregtechItemList.Emitter_MAX.set(this.addItem(tLastID = 27, "Emitter (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.LUX, 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS",
- // "CWS", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Brass), Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.Tin)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS",
- // "CWS", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.NetherQuartz),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Electrum),
- // Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good),
- // Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.AnyCopper)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS",
- // "CWS", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Advanced),
- // Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.Gold)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS",
- // "CWS", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.EnderPearl),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Platinum),
- // Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite),
- // Character.valueOf('W'),
- // OrePrefixes.cableGt01.get(Materials.Aluminium)});
- tLastID = 28;
- GregtechItemList.Sensor_LuV.set(this.addItem(tLastID = 28, "Sensor (LuV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 1L),
- Utils.getTcAspectStack(TC_Aspects.SENSUS, 1L)
- }));
- GregtechItemList.Sensor_ZPM.set(this.addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 2L),
- Utils.getTcAspectStack(TC_Aspects.SENSUS, 2L)
- }));
- GregtechItemList.Sensor_UV.set(this.addItem(tLastID = 30, "Sensor (UV)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 4L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 4L),
- Utils.getTcAspectStack(TC_Aspects.SENSUS, 4L)
- }));
- GregtechItemList.Sensor_MAX.set(this.addItem(tLastID = 31, "Sensor (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.SENSUS, 8L)
- }));
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_LuV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ",
- // "CPP", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Brass), Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.Steel), Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Basic)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_ZPM.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ",
- // "CPP", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.NetherQuartz),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Electrum),
- // Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.Aluminium),
- // Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Good)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_UV.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ",
- // "CPP", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.StainlessSteel),
- // Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Advanced)});
- // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_MAX.get(1L,
- // new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE |
- // //GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ",
- // "CPP", Character.valueOf('Q'),
- // OrePrefixes.gem.get(Materials.EnderPearl),
- // Character.valueOf('S'),
- // OrePrefixes.stick.get(Materials.Platinum),
- // Character.valueOf('P'),
- // OrePrefixes.plate.get(Materials.Titanium),
- // Character.valueOf('C'),
- // OrePrefixes.circuit.get(Materials.Elite)});
-
- }
-
- else {
- GregtechItemList.Electric_Pump_MAX.set(this.addItem(tLastID = 3, "Electric Pump (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.ITER, 8L), Utils.getTcAspectStack(TC_Aspects.AQUA, 8L)
- }));
- GregtechItemList.Electric_Motor_MAX.set(this.addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 8L)
- }));
- GregtechItemList.Conveyor_Module_MAX
- .set(this.addItem(tLastID = 11, "Conveyor Module (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L), Utils.getTcAspectStack(TC_Aspects.ITER, 8L)
- }));
- GregtechItemList.Electric_Piston_MAX
- .set(this.addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 16L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 8L)
- }));
- GregtechItemList.Robot_Arm_MAX.set(this.addItem(tLastID = 19, "Robot Arm (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 16L),
- Utils.getTcAspectStack(TC_Aspects.MOTUS, 8L), Utils.getTcAspectStack("COGNITIO", 8L)
- }));
- GregtechItemList.Field_Generator_MAX
- .set(this.addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 16L),
- Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.TUTAMEN, 8L)
- }));
- GregtechItemList.Emitter_MAX.set(this.addItem(tLastID = 27, "Emitter (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.LUX, 8L)
- }));
- GregtechItemList.Sensor_MAX.set(this.addItem(tLastID = 31, "Sensor (MAX)", "", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 8L), Utils.getTcAspectStack(TC_Aspects.MACHINA, 8L),
- Utils.getTcAspectStack(TC_Aspects.SENSUS, 8L)
- }));
-
- }
-
- GregtechItemList.Circuit_IV
- .set(this.addItem(tLastID = 704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[] {
- GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)
- }));
- GregtechItemList.Circuit_LuV.set(
- this.addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[] {
- GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic)
- }));
- GregtechItemList.Circuit_ZPM
- .set(this.addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[] {
- GregtechOrePrefixes.circuit.get(GT_Materials.Quantum)
- }));
- GregtechItemList.Circuit_Board_IV.set(
- this.addItem(tLastID = 710, "IV Circuit Board", "An IV Voltage Rated Circuit Board", new Object[0]));
- GregtechItemList.Circuit_Board_LuV.set(
- this.addItem(tLastID = 711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board", new Object[0]));
- GregtechItemList.Circuit_Board_ZPM.set(this.addItem(tLastID = 712, "ZPM Processor Board",
- "A ZPM Voltage Rated Processor Board", new Object[0]));
- GregtechItemList.Circuit_Parts_Crystal_Chip_IV
- .set(this.addItem(tLastID = 713, "(IV) Energized Crystal Chip", "Needed for Circuits", new Object[0]));
- GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set(
- this.addItem(tLastID = 714, "(LuV) Neutron based Microchip", "Needed for Circuits", new Object[0]));
- GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM
- .set(this.addItem(tLastID = 715, "(ZPM) Quantum Chip", "Needed for Circuits", new Object[0]));
- GregtechItemList.Circuit_Parts_IV
- .set(this.addItem(tLastID = 716, "(IV) Energized Circuit Parts", "Circuit Parts", new Object[0]));
- GregtechItemList.Circuit_Parts_LuV
- .set(this.addItem(tLastID = 717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts", new Object[0]));
- GregtechItemList.Circuit_Parts_ZPM
- .set(this.addItem(tLastID = 718, "(ZPM) Quantum Circuit Parts", "Circuit Parts", new Object[0]));
- GregtechItemList.Circuit_Parts_Wiring_IV
- .set(this.addItem(tLastID = 719, "Etched IV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
- GregtechItemList.Circuit_Parts_Wiring_LuV
- .set(this.addItem(tLastID = 720, "Etched LuV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
- GregtechItemList.Circuit_Parts_Wiring_ZPM
- .set(this.addItem(tLastID = 721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards", new Object[0]));
-
- // Extruder Shape
- GregtechItemList.Shape_Extruder_WindmillShaft.set(this.addItem(tLastID = 40, "Extruder Shape (Shaft)",
- "Extruder Shape for making Windmill Shafts", new Object[0]));
-
- // Batteries
- GregtechItemList.Battery_RE_EV_Sodium
- .set(this.addItem(tLastID = 50, "Quad Cell Sodium Battery", "Reusable", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 2L),
- Utils.getTcAspectStack(TC_Aspects.METALLUM, 2L), Utils.getTcAspectStack(TC_Aspects.POTENTIA, 2L)
- }));
- this.setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true);
-
- GregtechItemList.Battery_RE_EV_Cadmium
- .set(this.addItem(tLastID = 52, "Quad Cell Cadmium Battery", "Reusable", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- Utils.getTcAspectStack(TC_Aspects.METALLUM, 1L), Utils.getTcAspectStack(TC_Aspects.POTENTIA, 1L)
- }));
- this.setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true);
-
- GregtechItemList.Battery_RE_EV_Lithium
- .set(this.addItem(tLastID = 54, "Quad Cell Lithium Battery", "Reusable", new Object[] {
- Utils.getTcAspectStack(TC_Aspects.ELECTRUM, 3L),
- Utils.getTcAspectStack(TC_Aspects.METALLUM, 3L), Utils.getTcAspectStack(TC_Aspects.POTENTIA, 3L)
- }));
- this.setElectricStats(32000 + tLastID, 6400000L, GT_Values.V[4], 4L, -3L, true);
-
- /*
- * GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50,
- * "Quad Cell Acid Battery", "Reusable", new
- * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- * getTcAspectStack(TC_Aspects.METALLUM, 1L),
- * getTcAspectStack(TC_Aspects.POTENTIA, 1L)})); setElectricStats(32000
- * + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);
- *
- * GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50,
- * "Quad Cell Mercury Battery", "Reusable", new
- * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L),
- * getTcAspectStack(TC_Aspects.METALLUM, 1L),
- * getTcAspectStack(TC_Aspects.POTENTIA, 1L)})); setElectricStats(32000
- * + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);
- */
-
- // FOOOOOOOOOOOOOOD
- GregtechItemList.Food_Baked_Raisin_Bread
- .set(this.addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for ImQ009", new Object[] {
- new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]),
- Utils.getTcAspectStack(TC_Aspects.CORPUS, 1L), Utils.getTcAspectStack(TC_Aspects.FAMES, 1L),
- Utils.getTcAspectStack(TC_Aspects.IGNIS, 1L)
- }));
-
- GregtechItemList.Fluid_Cell_144L.set(this.addItem(tLastID = 61, "144L Invar Fluid Cell",
- "Holds exactly one dust worth of liquid.", new Object[] {
- new ItemData(Materials.Invar,
- OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount,
- new MaterialStack[0]),
- Utils.getTcAspectStack(TC_Aspects.VACUOS, 2L), Utils.getTcAspectStack(TC_Aspects.AQUA, 1L)
- }));
- this.setFluidContainerStats(32000 + tLastID, 144L, 64L);
-
- GregtechItemList.Fluid_Cell_36L.set(this.addItem(tLastID = 62, "36L Brass Fluid Cell",
- "Holds exactly one small dust worth of liquid.", new Object[] {
- new ItemData(Materials.Brass,
- OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount,
- new MaterialStack[0]),
- Utils.getTcAspectStack(TC_Aspects.VACUOS, 2L), Utils.getTcAspectStack(TC_Aspects.AQUA, 1L)
- }));
- this.setFluidContainerStats(32000 + tLastID, 36L, 64L);
-
- GregtechItemList.Fluid_Cell_16L.set(this.addItem(tLastID = 63, "16L Bronze Fluid Cell",
- "Holds exactly one tiny dust / nugget worth of liquid.", new Object[] {
- new ItemData(Materials.Bronze,
- OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount,
- new MaterialStack[0]),
- Utils.getTcAspectStack(TC_Aspects.VACUOS, 2L), Utils.getTcAspectStack(TC_Aspects.AQUA, 1L)
- }));
- this.setFluidContainerStats(32000 + tLastID, 16L, 64L);
-
- GregtechItemList.Fluid_Cell_1L.set(this.addItem(tLastID = 64, "1L Wrought Iron Fluid Cell",
- "Holds exactly one litre worth of liquid.", new Object[] {
- new ItemData(Materials.WroughtIron,
- OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount,
- new MaterialStack[0]),
- Utils.getTcAspectStack(TC_Aspects.VACUOS, 2L), Utils.getTcAspectStack(TC_Aspects.AQUA, 1L)
- }));
- this.setFluidContainerStats(32000 + tLastID, 1L, 64L);
-
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- GT_Values.RA.addAssemblerRecipe(
- GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 2L),
- GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 2L),
- GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 2L),
- GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 2L),
- GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
-
- }
- else {
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 8L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 4L),
- GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 8L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 4L),
- GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Brass, 8L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 4L),
- GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 8L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L),
- GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
- }
- }
+ public MetaGeneratedGregtechItems INSTANCE;
+
+ public MetaGeneratedGregtechItems() {
+ super("MU-metaitem.01", new OrePrefixes[]{null});
+ INSTANCE = this;
+ int tLastID = 0;
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ Utils.LOG_INFO("Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)");
+ GregtechItemList.Electric_Pump_LuV.set(addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Electric_Pump_ZPM.set(addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L), getTcAspectStack(TC_Aspects.AQUA, 2L)}));
+ GregtechItemList.Electric_Pump_UV.set(addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L), getTcAspectStack(TC_Aspects.AQUA, 4L)}));
+ GregtechItemList.Electric_Pump_MAX.set(addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), getTcAspectStack(TC_Aspects.AQUA, 8L)}));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(8196));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(32768));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(131072));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_MAX.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Tin), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Tin), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Bronze)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Bronze), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Steel)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Steel), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.StainlessSteel)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.StainlessSteel), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Titanium)});
+ tLastID = 4;
+ GregtechItemList.Electric_Motor_LuV.set(addItem(tLastID = 4, "Electric Motor (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.MOTUS, 1L)}));
+ GregtechItemList.Electric_Motor_ZPM.set(addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 2L)}));
+ GregtechItemList.Electric_Motor_UV.set(addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 4L)}));
+ GregtechItemList.Electric_Motor_MAX.set(addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.IronMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.AnyIron), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.AnyCopper), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.Electrum), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Silver)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Cupronickel), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.NeodymiumMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.TungstenSteel), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Nichrome)});
+
+ tLastID = 8;
+ GregtechItemList.Conveyor_Module_LuV.set(addItem(tLastID = 8, "Conveyor Module (LuV)", "1 Stack every 20 secs (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L)}));
+ GregtechItemList.Conveyor_Module_ZPM.set(addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L)}));
+ GregtechItemList.Conveyor_Module_UV.set(addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L)}));
+ GregtechItemList.Conveyor_Module_MAX.set(addItem(tLastID = 11, "Conveyor Module (MAX)", "1 Stack every 1/5 sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(400));
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(100));
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(20));
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(4));
+ tLastID = 12;
+ GregtechItemList.Electric_Piston_LuV.set(addItem(tLastID = 12, "Electric Piston (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L)}));
+ GregtechItemList.Electric_Piston_ZPM.set(addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 2L)}));
+ GregtechItemList.Electric_Piston_UV.set(addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 4L)}));
+ GregtechItemList.Electric_Piston_MAX.set(addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ tLastID = 16;
+ GregtechItemList.Robot_Arm_LuV.set(addItem(tLastID = 16, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L), Utils.getTcAspectStack("COGNITIO", 1L)}));
+ GregtechItemList.Robot_Arm_ZPM.set(addItem(tLastID = 17, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 2L), getTcAspectStack("COGNITIO", 2L)}));
+ GregtechItemList.Robot_Arm_UV.set(addItem(tLastID = 18, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 4L), getTcAspectStack("COGNITIO", 4L)}));
+ GregtechItemList.Robot_Arm_MAX.set(addItem(tLastID = 19, "Robot Arm (MAX)", "Inserts into specific Slots (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), getTcAspectStack("COGNITIO", 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('P'), GregtechItemList.Electric_Piston_LuV, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('P'), GregtechItemList.Electric_Piston_ZPM, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('P'), GregtechItemList.Electric_Piston_UV, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('P'), GregtechItemList.Electric_Piston_MAX, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(400));
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(100));
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(20));
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_MAX.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(4));
+ tLastID = 20;
+ GregtechItemList.Field_Generator_LuV.set(addItem(tLastID = 20, "Field Generator (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.TUTAMEN, 1L)}));
+ GregtechItemList.Field_Generator_ZPM.set(addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.TUTAMEN, 2L)}));
+ GregtechItemList.Field_Generator_UV.set(addItem(tLastID = 22, "Field Generator (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.TUTAMEN, 4L)}));
+ GregtechItemList.Field_Generator_MAX.set(addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 16L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.TUTAMEN, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.Osmium)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.EnderEye), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Osmium)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Osmium)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium)});
+ tLastID = 24;
+ GregtechItemList.Emitter_LuV.set(addItem(tLastID = 24, "Emitter (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.LUX, 1L)}));
+ GregtechItemList.Emitter_ZPM.set(addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.LUX, 2L)}));
+ GregtechItemList.Emitter_UV.set(addItem(tLastID = 26, "Emitter (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.LUX, 4L)}));
+ GregtechItemList.Emitter_MAX.set(addItem(tLastID = 27, "Emitter (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ tLastID = 28;
+ GregtechItemList.Sensor_LuV.set(addItem(tLastID = 28, "Sensor (LuV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.SENSUS, 1L)}));
+ GregtechItemList.Sensor_ZPM.set(addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.SENSUS, 2L)}));
+ GregtechItemList.Sensor_UV.set(addItem(tLastID = 30, "Sensor (UV)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.SENSUS, 4L)}));
+ GregtechItemList.Sensor_MAX.set(addItem(tLastID = 31, "Sensor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.SENSUS, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite)});
+
+ }
+
+ else {
+ GregtechItemList.Electric_Pump_MAX.set(addItem(tLastID = 3, "Electric Pump (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), getTcAspectStack(TC_Aspects.AQUA, 8L)}));
+ GregtechItemList.Electric_Motor_MAX.set(addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
+ GregtechItemList.Conveyor_Module_MAX.set(addItem(tLastID = 11, "Conveyor Module (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L)}));
+ GregtechItemList.Electric_Piston_MAX.set(addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L)}));
+ GregtechItemList.Robot_Arm_MAX.set(addItem(tLastID = 19, "Robot Arm (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), getTcAspectStack("COGNITIO", 8L)}));
+ GregtechItemList.Field_Generator_MAX.set(addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 16L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.TUTAMEN, 8L)}));
+ GregtechItemList.Emitter_MAX.set(addItem(tLastID = 27, "Emitter (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L)}));
+ GregtechItemList.Sensor_MAX.set(addItem(tLastID = 31, "Sensor (MAX)", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.SENSUS, 8L)}));
+
+ }
+
+ GregtechItemList.Circuit_IV.set(addItem(tLastID = 704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)}));
+ GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic)}));
+ GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Quantum)}));
+ GregtechItemList.Circuit_Board_IV.set(addItem(tLastID = 710, "IV Circuit Board", "An IV Voltage Rated Circuit Board", new Object[0]));
+ GregtechItemList.Circuit_Board_LuV.set(addItem(tLastID = 711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board", new Object[0]));
+ GregtechItemList.Circuit_Board_ZPM.set(addItem(tLastID = 712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_IV.set(addItem(tLastID = 713, "(IV) Energized Crystal Chip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set(addItem(tLastID = 714, "(LuV) Neutron based Microchip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.set(addItem(tLastID = 715, "(ZPM) Quantum Chip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_IV.set(addItem(tLastID = 716, "(IV) Energized Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_LuV.set(addItem(tLastID = 717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_ZPM.set(addItem(tLastID = 718, "(ZPM) Quantum Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_IV.set(addItem(tLastID = 719, "Etched IV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_LuV.set(addItem(tLastID = 720, "Etched LuV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_ZPM.set(addItem(tLastID = 721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+
+
+
+
+ //Extruder Shape
+ GregtechItemList.Shape_Extruder_WindmillShaft.set(addItem(tLastID = 40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts", new Object[0]));
+
+
+ //Batteries
+ GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Sodium Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L), getTcAspectStack(TC_Aspects.POTENTIA, 2L)}));
+ setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true);
+
+ GregtechItemList.Battery_RE_EV_Cadmium.set(addItem(tLastID = 52, "Quad Cell Cadmium Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
+ setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true);
+
+ GregtechItemList.Battery_RE_EV_Lithium.set(addItem(tLastID = 54, "Quad Cell Lithium Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 3L), getTcAspectStack(TC_Aspects.METALLUM, 3L), getTcAspectStack(TC_Aspects.POTENTIA, 3L)}));
+ setElectricStats(32000 + tLastID, 6400000L, GT_Values.V[4], 4L, -3L, true);
+
+ /*GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Acid Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
+ setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);
+
+ GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Mercury Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)}));
+ setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);*/
+
+
+ //FOOOOOOOOOOOOOOD
+ GregtechItemList.Food_Baked_Raisin_Bread.set(addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for ImQ009", new Object[]{new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), getTcAspectStack(TC_Aspects.CORPUS, 1L), getTcAspectStack(TC_Aspects.FAMES, 1L), getTcAspectStack(TC_Aspects.IGNIS, 1L)}));
+
+
+
+ GregtechItemList.Fluid_Cell_144L.set(addItem(tLastID = 61, "144L Invar Fluid Cell", "Holds exactly one dust worth of liquid.", new Object[]{new ItemData(Materials.Invar, OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount, new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ setFluidContainerStats(32000 + tLastID, 144L, 64L);
+
+ GregtechItemList.Fluid_Cell_36L.set(addItem(tLastID = 62, "36L Brass Fluid Cell", "Holds exactly one small dust worth of liquid.", new Object[]{new ItemData(Materials.Brass, OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount, new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ setFluidContainerStats(32000 + tLastID, 36L, 64L);
+
+ GregtechItemList.Fluid_Cell_16L.set(addItem(tLastID = 63, "16L Bronze Fluid Cell", "Holds exactly one tiny dust / nugget worth of liquid.", new Object[]{new ItemData(Materials.Bronze, OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount, new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ setFluidContainerStats(32000 + tLastID, 16L, 64L);
+
+ GregtechItemList.Fluid_Cell_1L.set(addItem(tLastID = 64, "1L Wrought Iron Fluid Cell", "Holds exactly one litre worth of liquid.", new Object[]{new ItemData(Materials.WroughtIron, OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount, new MaterialStack[0]), getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
+ setFluidContainerStats(32000 + tLastID, 1L, 64L);
+
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 2L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 2L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 2L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 2L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
+
+ }
+ else {
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 4L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 4L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Brass, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 4L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
index bea883120d..d5bd4c134c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -9,19 +9,23 @@ import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher;
public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool {
- public static final short SKOOKUM_CHOOCHER = 7734;
- public static MetaGeneratedGregtechTools INSTANCE;
+ public static final short SKOOKUM_CHOOCHER = 7734;
+ public static MetaGeneratedGregtechTools INSTANCE;
public MetaGeneratedGregtechTools() {
super("plusplus.metatool.01");
- MetaGeneratedGregtechTools.INSTANCE = this;
- GregTech_API.registerTool(this.addTool(MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, "Skookum Choocher",
- "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", new TOOL_Gregtech_Choocher(),
- new Object[] {
- GregtechToolDictNames.craftingToolSkookumChoocher, ToolDictNames.craftingToolHardHammer,
- ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
- new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)
- }), GregTech_API.sWrenchList);
+ INSTANCE = this;
+ GregTech_API.registerTool(
+ addTool(
+ SKOOKUM_CHOOCHER, "Skookum Choocher",
+ "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.",
+ new TOOL_Gregtech_Choocher(),
+ new Object[]{GregtechToolDictNames.craftingToolSkookumChoocher,
+ ToolDictNames.craftingToolHardHammer,
+ ToolDictNames.craftingToolWrench,
+ new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L),
+ new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}),
+ GregTech_API.sWrenchList);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
index 14828fd3a3..fcd991583b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java
@@ -1,73 +1,68 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.List;
-
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_LanguageManager;
import gregtech.common.items.behaviors.Behaviour_None;
import gregtech.common.items.behaviors.Behaviour_Wrench;
+
+import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-public class Behaviour_Choocher extends Behaviour_None {
- private boolean isWrench = true;
- private final Behaviour_Wrench wrench = new Behaviour_Wrench(150);
- private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250);
- private final String mTooltip1 = GT_LanguageManager
- .addStringLocalization("gt.behaviour.choochering1", "Current tool mode: ");
- private final String mTooltip2 = GT_LanguageManager
- .addStringLocalization("gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick.");
- private final String mTooltipH = GT_LanguageManager
- .addStringLocalization("gt.behaviour.prospectingEx", "Usable for Prospecting large areas.");
- private final String mTooltipW = GT_LanguageManager
- .addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick.");
+public class Behaviour_Choocher
+extends Behaviour_None {
+ private boolean isWrench = true;
+ private final Behaviour_Wrench wrench = new Behaviour_Wrench(150);
+ private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250);
+ private String mTooltip1 = GT_LanguageManager.addStringLocalization("gt.behaviour.choochering1", "Current tool mode: ");
+ private String mTooltip2 = GT_LanguageManager.addStringLocalization("gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick.");
+ private final String mTooltipH = GT_LanguageManager.addStringLocalization("gt.behaviour.prospectingEx", "Usable for Prospecting large areas.");
+ private final String mTooltipW = GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick.");
public Behaviour_Choocher() {
}
@Override
- public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList,
- final ItemStack aStack) {
-
- if (this.isWrench) {
- aList.add(this.mTooltip1 + "Wrench");
- aList.add(this.mTooltipW);
- }
- else {
- aList.add(this.mTooltip1 + "Prospecting");
- aList.add(this.mTooltipH);
- }
- aList.add(this.mTooltip2);
-
- return aList;
- }
-
- @Override
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer,
- final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX,
- final float hitY, final float hitZ) {
+ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
if (aWorld.isRemote) {
return false;
}
- if (aPlayer.isSneaking()) {
- if (this.isWrench) {
- this.isWrench = false;
+ if (aPlayer.isSneaking()){
+ if (isWrench){
+ isWrench = false;
return false;
}
- this.isWrench = true;
+ isWrench = true;
return false;
}
- else if (!aPlayer.isSneaking()) {
- if (this.isWrench) {
- this.wrench.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ,
- hitZ);
+ else if (!aPlayer.isSneaking()){
+ if (isWrench){
+ wrench.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ);
return false;
}
- this.prospecting.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ);
+ prospecting.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ);
return false;
}
return false;
}
+
+ @Override
+ public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
+
+
+ if (isWrench){
+ aList.add(this.mTooltip1+"Wrench");
+ aList.add(this.mTooltipW);
+ }
+ else {
+ aList.add(this.mTooltip1+"Prospecting");
+ aList.add(this.mTooltipH);
+ }
+ aList.add(this.mTooltip2);
+
+ return aList;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
index b996618ed2..7093a23511 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java
@@ -1,16 +1,19 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.Random;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.ItemData;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.common.items.behaviors.Behaviour_Prospecting;
+
+import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -20,113 +23,99 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidBlock;
-public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting {
- private final int mVanillaCosts;
- private final int mEUCosts;
+public class Behaviour_Prospecting_Ex
+ extends Behaviour_Prospecting {
+ private final int mVanillaCosts;
+ private final int mEUCosts;
+
+ public Behaviour_Prospecting_Ex(int aVanillaCosts, int aEUCosts) {
+ super(aVanillaCosts, aEUCosts);
+ this.mVanillaCosts = aVanillaCosts;
+ this.mEUCosts = aEUCosts;
+ }
- public Behaviour_Prospecting_Ex(final int aVanillaCosts, final int aEUCosts) {
- super(aVanillaCosts, aEUCosts);
- this.mVanillaCosts = aVanillaCosts;
- this.mEUCosts = aEUCosts;
- }
+ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float 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);
- @Override
- public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer,
- final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX,
- final float hitY, final float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- final Block aBlock = aWorld.getBlock(aX, aY, aZ);
- if (aBlock == null) {
- return false;
- }
- final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
- if (tAssotiation != null && tAssotiation.mPrefix.toString().startsWith("ore")) {
- GT_Utility.sendChatToPlayer(aPlayer,
- "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY,
- aZ);
- return true;
- }
- if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)
- || aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass)) {
- if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
- GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX,
- aY, aZ);
- int tX = aX;
- int tY = aY;
- int tZ = aZ;
- int tMetaID = 0;
- final int tQuality = (aItem instanceof GT_MetaGenerated_Tool
- ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0) * 3;
+ ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ return true;
+ }
+ if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)) ||(aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass)) ) {
+ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ);
+ int tX = aX;
+ int tY = aY;
+ int tZ = aZ;
+ int tMetaID = 0;
+ int tQuality = ((aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0)*3;
- int i = 0;
- for (final int j = 6 + tQuality; i < j; i++) {
- tX -= ForgeDirection.getOrientation(aSide).offsetX;
- tY -= ForgeDirection.getOrientation(aSide).offsetY;
- tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
+ int i = 0;
+ for (int j = 6 + tQuality; i < j; i++) {
+ tX -= ForgeDirection.getOrientation(aSide).offsetX;
+ tY -= ForgeDirection.getOrientation(aSide).offsetY;
+ tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Block.");
- break;
- }
- if (tBlock == Blocks.water || tBlock == Blocks.flowing_water || tBlock instanceof IFluidBlock) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Block.");
- break;
- }
- if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) {
- GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Block.");
- break;
- }
- if (tBlock != aBlock) {
- if (i >= 4) {
- break;
- }
- GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Block.");
- break;
- }
- }
- final Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
- i = 0;
- for (final int j = 9 + 2 * tQuality; i < j; i++) {
- tX = aX - 4 - tQuality + tRandom.nextInt(j);
- tY = aY - 4 - tQuality + tRandom.nextInt(j);
- tZ = aZ - 4 - tQuality + tRandom.nextInt(j);
- final Block tBlock = aWorld.getBlock(tX, tY, tZ);
- if (tBlock instanceof GT_Block_Ores) {
- final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
- if (tTileEntity instanceof GT_TileEntity_Ores) {
- final Materials tMaterial = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData
- % 1000];
- if (tMaterial != null && tMaterial != Materials._NULL) {
- GT_Utility.sendChatToPlayer(aPlayer,
- "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- }
- else {
- tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
- tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if (tAssotiation != null && tAssotiation.mPrefix.toString().startsWith("ore")) {
- GT_Utility.sendChatToPlayer(aPlayer,
- "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
- return true;
- }
- }
- }
- GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
- }
- return true;
- }
- return false;
- }
+ Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Block.");
+ break;
+ }
+ if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Block.");
+ break;
+ }
+ if ((tBlock == Blocks.monster_egg) || (!GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "There is an Air Pocket behind this Block.");
+ break;
+ }
+ if (tBlock != aBlock) {
+ if (i >= 4) {
+ break;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Material is changing behind this Block.");
+ break;
+ }
+ }
+ Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
+ i = 0;
+ for (int j = 9 + 2 * tQuality; i < j; i++) {
+ tX = aX - 4 - tQuality + tRandom.nextInt(j);
+ tY = aY - 4 - tQuality + tRandom.nextInt(j);
+ tZ = aZ - 4 - tQuality + tRandom.nextInt(j);
+ Block tBlock = aWorld.getBlock(tX, tY, tZ);
+ if ((tBlock instanceof GT_Block_Ores)) {
+ TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
+ if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ } else {
+ tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
+ tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore.");
+ return true;
+ }
+ }
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "No Ores found.");
+ }
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
index a1093d67d3..0338871482 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
@@ -1,14 +1,16 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
+import static gtPlusPlus.core.lib.CORE.sTesseractGenerators;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.*;
+import gregtech.api.interfaces.tileentity.IDigitalChest;
+import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -20,486 +22,521 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
-
-public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_BasicTank {
- public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
- public static int TESSERACT_ENERGY_COST = 1024;
- public byte isWorking = 0;
- public int oFrequency = 0;
- public int mNeededEnergy = 0;
- public int mFrequency = 0;
-
- public GT_MetaTileEntity_TesseractGenerator(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GT_MetaTileEntity_TesseractGenerator
+extends GT_MetaTileEntity_BasicTank
+{
+ public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ public static int TESSERACT_ENERGY_COST = 1024;
+ public byte isWorking = 0;
+ public int oFrequency = 0;
+ public int mNeededEnergy = 0;
+ public int mFrequency = 0;
+
+ public GT_MetaTileEntity_TesseractGenerator(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 3, "");
}
- public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TesseractGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
- }
+ }
- public boolean addEnergyConsumption(final GT_MetaTileEntity_TesseractTerminal aTerminal) {
- if (!this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- this.mNeededEnergy += aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld()
- ? GT_MetaTileEntity_TesseractGenerator.TESSERACT_ENERGY_COST
- : GT_MetaTileEntity_TesseractGenerator.TESSERACT_ENERGY_COST_DIMENSIONAL;
- return true;
- }
-
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractGenerator(mName, mTier, mDescription, mTextures);
}
@Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
+ public boolean isTransformerUpgradable()
+ {
+ return true;
}
@Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
+ public boolean isOverclockerUpgradable()
+ {
return false;
}
@Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canDrain(aSide, aFluid);
+ public boolean isSimpleMachine()
+ {
+ return false;
}
@Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- if (tTileEntity instanceof ISidedInventory) {
- return ((ISidedInventory) tTileEntity).canExtractItem(aIndex, aStack, aSide);
- }
+ public boolean isFacingValid(byte aFacing)
+ {
return true;
}
@Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canFill(aSide, aFluid);
- }
-
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- if (tTileEntity instanceof ISidedInventory) {
- return ((ISidedInventory) tTileEntity).canInsertItem(aIndex, aStack, aSide);
- }
+ public boolean isEnetInput()
+ {
return true;
}
@Override
- public boolean canTankBeEmptied() {
+ public boolean isEnetOutput()
+ {
return false;
}
@Override
- public boolean canTankBeFilled() {
- return false;
+ public boolean isInputFacing(byte aSide)
+ {
+ return true;
}
@Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.decrStackSize(aIndex, aAmount);
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
}
@Override
- public boolean displaysItemStack() {
+ public boolean isValidSlot(int aIndex)
+ {
return false;
}
@Override
- public boolean displaysStackSize() {
- return false;
+ public long getMinimumStoredEU()
+ {
+ return getBaseMetaTileEntity().getEUCapacity() / 2;
}
@Override
- public boolean doesEmptyContainers() {
- return false;
+ public long maxEUInput()
+ {
+ return 2048;
}
- // To-Do?
@Override
- public boolean doesFillContainers() {
- return false;
+ public long maxEUOutput()
+ {
+ return 0;
}
@Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.drain(aSide, aFluid, doDrain);
+ public long maxEUStore()
+ {
+ return 100000;
}
@Override
- public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ public long maxSteamStore()
+ {
+ return maxEUStore();
}
@Override
- public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.fill(aDirection, aFluid, doFill);
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
}
@Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return new int[0];
- }
- if (tTileEntity instanceof ISidedInventory) {
- return ((ISidedInventory) tTileEntity).getAccessibleSlotsFromSide(aSide);
- }
- final int[] rArray = new int[this.getSizeInventory()];
- for (int i = 0; i < this.getSizeInventory(); i++) {
- rArray[i] = i;
- }
- return rArray;
+ public boolean ownerControl()
+ {
+ return true;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Generates a Tesseract for the attached Inventory"
- };
+ public int getProgresstime()
+ {
+ return (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? 999 : 0;
}
@Override
- public String[] getInfoData() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IGregTechDeviceInformation
- && ((IGregTechDeviceInformation) tTileEntity).isGivingInformation()) {
- return ((IGregTechDeviceInformation) tTileEntity).getInfoData();
- }
- return new String[] {
- "Tesseract Generator", "Freqency:", "" + this.mFrequency,
- CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this && this.isWorking >= 20
- ? "Active" : "Inactive"
- };
+ public int maxProgresstime()
+ {
+ return 1000;
}
@Override
- public String getInventoryName() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return "";
- }
- return tTileEntity.getInventoryName();
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mFrequency", this.mFrequency);
}
@Override
- public int getInventoryStackLimit() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.getInventoryStackLimit();
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mFrequency = aNBT.getInteger("mFrequency");
}
@Override
- public int getMaxItemCount() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- return ((IDigitalChest) tTileEntity).getMaxItemCount();
- }
- return 0;
+ public void onConfigLoad(GT_Config aConfig)
+ {
+ TESSERACT_ENERGY_COST = 1024;
+ TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
}
@Override
- public long getMinimumStoredEU() {
- return this.getBaseMetaTileEntity().getEUCapacity() / 2;
+ public void onServerStart()
+ {
+ sTesseractGenerators.clear();
}
- @Override
- public int getProgresstime() {
- return CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this && this.isWorking >= 20 ? 999
- : 0;
+ public void onServerStop()
+ {
+ sTesseractGenerators.clear();
}
-
+
@Override
- public int getSizeInventory() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.getSizeInventory();
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ){
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()){
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))){
+ case 0:
+ Utils.LOG_INFO("Freq. -1 | " + this.mFrequency);
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ Utils.LOG_INFO("Freq. +1 | " + this.mFrequency);
+ this.mFrequency += 1;
+ default:
+ //Utils.LOG_INFO("Did not click the correct place.");
+ break;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
+ PlayerUtils.messagePlayer(aPlayer, ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : ""));
+ }
+ return true;
}
@Override
- public ItemStack getStackInSlot(final int aIndex) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ this.mFrequency += 64;
+ break;
+ case 2:
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ this.mFrequency += 512;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : ""));
}
- return tTileEntity.getStackInSlot(aIndex);
}
- @Override
- public ItemStack[] getStoredItemData() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- return ((IDigitalChest) tTileEntity).getStoredItemData();
- }
- return null;
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
}
@Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return new FluidTankInfo[0];
+ public String[] getInfoData()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation)tTileEntity).isGivingInformation())) {
+ return ((IGregTechDeviceInformation)tTileEntity).getInfoData();
}
- return tTileEntity.getTankInfo(aSide);
+ return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? "Active" : "Inactive" };
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == aFacing ? new ITexture[] {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)
- } : new ITexture[] {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(Textures.BlockIcons.VOID)
- };
+ public boolean isGivingInformation()
+ {
+ return true;
}
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
+ public boolean isSendingInformation()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) {
+ return ((IGregTechDeviceInformation)tTileEntity).isGivingInformation();
+ }
+ return false;
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
+ public boolean isDigitalChest()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).isDigitalChest();
+ }
+ return false;
}
@Override
- public boolean isDigitalChest() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- return ((IDigitalChest) tTileEntity).isDigitalChest();
+ public ItemStack[] getStoredItemData()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).getStoredItemData();
}
- return false;
+ return null;
}
@Override
- public boolean isEnetInput() {
- return true;
+ public void setItemCount(int aCount)
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ ((IDigitalChest)tTileEntity).setItemCount(aCount);
+ }
}
@Override
- public boolean isEnetOutput() {
- return false;
+ public int getMaxItemCount()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).getMaxItemCount();
+ }
+ return 0;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
}
@Override
- public boolean isGivingInformation() {
- return true;
+ public int[] getAccessibleSlotsFromSide(int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).getAccessibleSlotsFromSide(aSide);
+ }
+ int[] rArray = new int[getSizeInventory()];
+ for (int i = 0; i < getSizeInventory(); i++) {
+ rArray[i] = i;
+ }
+ return rArray;
}
@Override
- public boolean isInputFacing(final byte aSide) {
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).canInsertItem(aIndex, aStack, aSide);
+ }
return true;
}
@Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
return false;
}
- return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).canExtractItem(aIndex, aStack, aSide);
+ }
+ return true;
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ public int getSizeInventory()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
}
@Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- public boolean isSendingInformation() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IGregTechDeviceInformation) {
- return ((IGregTechDeviceInformation) tTileEntity).isGivingInformation();
+ public ItemStack getStackInSlot(int aIndex)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
}
- return false;
+ return tTileEntity.getStackInSlot(aIndex);
}
@Override
- public boolean isSimpleMachine() {
- return false;
+ public void setInventorySlotContents(int aIndex, ItemStack aStack)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
}
@Override
- public boolean isTransformerUpgradable() {
- return true;
+ public ItemStack decrStackSize(int aIndex, int aAmount)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.decrStackSize(aIndex, aAmount);
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- public boolean isValidTesseractGenerator(final String aOwnerName, final boolean aWorkIrrelevant) {
- return this.getBaseMetaTileEntity() != null && !this.getBaseMetaTileEntity().isInvalidTileEntity()
- && this.getBaseMetaTileEntity().isAllowedToWork()
- && (aOwnerName == null || this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))
- && (aWorkIrrelevant || this.isWorking >= 20);
+ public String getInventoryName()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFrequency = aNBT.getInteger("mFrequency");
+ public int getInventoryStackLimit()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
}
@Override
- public long maxEUInput() {
- return 2048;
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canFill(aSide, aFluid);
}
@Override
- public long maxEUOutput() {
- return 0;
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
}
@Override
- public long maxEUStore() {
- return 100000;
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
}
@Override
- public int maxProgresstime() {
- return 1000;
+ public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.fill(aDirection, aFluid, doFill);
}
@Override
- public long maxSteamStore() {
- return this.maxEUStore();
+ public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aDirection, maxDrain, doDrain);
}
@Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TesseractGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aSide, aFluid, doDrain);
}
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- GT_MetaTileEntity_TesseractGenerator.TESSERACT_ENERGY_COST = 1024;
- GT_MetaTileEntity_TesseractGenerator.TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ public boolean addEnergyConsumption(GT_MetaTileEntity_TesseractTerminal aTerminal)
+ {
+ if (!getBaseMetaTileEntity().isAllowedToWork()) {
+ return false;
+ }
+ this.mNeededEnergy += (aTerminal.getBaseMetaTileEntity().getWorld() == getBaseMetaTileEntity().getWorld() ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL);
+ return true;
}
- public void onPostTick() {
- if (this.getBaseMetaTileEntity().isServerSide()) {
- if (this.mFrequency != this.oFrequency) {
+ public boolean isValidTesseractGenerator(String aOwnerName, boolean aWorkIrrelevant)
+ {
+ return (getBaseMetaTileEntity() != null) && (!getBaseMetaTileEntity().isInvalidTileEntity()) && (getBaseMetaTileEntity().isAllowedToWork()) && ((aOwnerName == null) || (getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))) && ((aWorkIrrelevant) || (this.isWorking >= 20));
+ }
+ public void onPostTick()
+ {
+ if (getBaseMetaTileEntity().isServerSide()){
+ if (this.mFrequency != this.oFrequency){
+
Utils.LOG_INFO("mFreq != oFreq");
-
- if (CORE.sTesseractGenerators.get(Integer.valueOf(this.oFrequency)) == this) {
- CORE.sTesseractGenerators.remove(Integer.valueOf(this.oFrequency));
- this.getBaseMetaTileEntity().issueBlockUpdate();
+
+ if (sTesseractGenerators.get(Integer.valueOf(this.oFrequency)) == this)
+ {
+ sTesseractGenerators.remove(Integer.valueOf(this.oFrequency));
+ getBaseMetaTileEntity().issueBlockUpdate();
Utils.LOG_INFO("this Gen == oFreq on map - do block update");
}
Utils.LOG_INFO("mFreq will be set to oFreq");
this.oFrequency = this.mFrequency;
}
- if (this.getBaseMetaTileEntity().isAllowedToWork()
- && this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false)) {
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false)))
+ {
Utils.LOG_INFO("Can Work & Has Energy");
- if (CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == null
- || !CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency))
- .isValidTesseractGenerator(null, true)) {
+ if ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == null) || (!((GT_MetaTileEntity_TesseractGenerator)sTesseractGenerators.get(Integer.valueOf(this.mFrequency))).isValidTesseractGenerator(null, true))) {
Utils.LOG_INFO("storing TE I think to mFreq map?");
- CORE.sTesseractGenerators.put(Integer.valueOf(this.mFrequency), this);
+ sTesseractGenerators.put(Integer.valueOf(this.mFrequency), this);
}
}
- else {
- if (CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) {
+ else
+ {
+ if (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this)
+ {
Utils.LOG_INFO("this gen == mFreq on map - do block update");
- CORE.sTesseractGenerators.remove(Integer.valueOf(this.mFrequency));
- this.getBaseMetaTileEntity().issueBlockUpdate();
+ sTesseractGenerators.remove(Integer.valueOf(this.mFrequency));
+ getBaseMetaTileEntity().issueBlockUpdate();
}
this.isWorking = 0;
}
- if (CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) {
+ if (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this)
+ {
Utils.LOG_INFO("mFreq == this - do work related things");
if (this.isWorking < 20) {
- this.isWorking = (byte) (this.isWorking + 1);
+ this.isWorking = ((byte)(this.isWorking + 1));
}
- if (this.isWorking == 20) {
- this.getBaseMetaTileEntity().issueBlockUpdate();
- this.isWorking = (byte) (this.isWorking + 1);
+ if (this.isWorking == 20)
+ {
+ getBaseMetaTileEntity().issueBlockUpdate();
+ this.isWorking = ((byte)(this.isWorking + 1));
}
}
- else {
+ else
+ {
this.isWorking = 0;
}
this.mNeededEnergy = 0;
@@ -507,93 +544,60 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi
}
@Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer,
- final byte aSide, final float aX, final float aY, final float aZ) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) {
- case 0:
- Utils.LOG_INFO("Freq. -1 | " + this.mFrequency);
- this.mFrequency -= 1;
- break;
- case 1:
- Utils.LOG_INFO("Freq. +1 | " + this.mFrequency);
- this.mFrequency += 1;
- default:
- // Utils.LOG_INFO("Did not click the correct place.");
- break;
- }
- PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
- PlayerUtils.messagePlayer(aPlayer,
- CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null
- && CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this
- ? EnumChatFormatting.RED + " (Occupied)" : "");
- }
- return true;
+ public String[] getDescription()
+ {
+ return new String[] {"Generates a Tesseract for the attached Inventory"};
}
@Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) {
- case 0:
- this.mFrequency -= 64;
- break;
- case 1:
- this.mFrequency += 64;
- break;
- case 2:
- this.mFrequency -= 512;
- break;
- case 3:
- this.mFrequency += 512;
- }
- GT_Utility.sendChatToPlayer(aPlayer,
- "Frequency: " + this.mFrequency
- + (CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null
- && CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this
- ? EnumChatFormatting.RED + " (Occupied)" : ""));
- }
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
@Override
- public void onServerStart() {
- CORE.sTesseractGenerators.clear();
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
- public void onServerStop() {
- CORE.sTesseractGenerators.clear();
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
}
@Override
- public boolean ownerControl() {
- return true;
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == aFacing ? new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)} : new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), new GT_RenderedTexture(Textures.BlockIcons.VOID)};
}
+
+ //To-Do?
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mFrequency", this.mFrequency);
+ public boolean doesFillContainers() {
+ return false;
}
@Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return;
- }
- tTileEntity.setInventorySlotContents(aIndex, aStack);
+ public boolean doesEmptyContainers() {
+ return false;
}
@Override
- public void setItemCount(final int aCount) {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- ((IDigitalChest) tTileEntity).setItemCount(aCount);
- }
+ public boolean canTankBeFilled() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
index 9a1a89cf47..aa8ddad326 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
@@ -17,478 +17,512 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
-
-public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_BasicTank {
- public static boolean sInterDimensionalTesseractAllowed = true;
- public int mFrequency = 0;
- public boolean mDidWork = false;
-
- public GT_MetaTileEntity_TesseractTerminal(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
+public class GT_MetaTileEntity_TesseractTerminal
+extends GT_MetaTileEntity_BasicTank
+{
+ public int mFrequency = 0;
+ public boolean mDidWork = false;
+ public static boolean sInterDimensionalTesseractAllowed = true;
+
+ public GT_MetaTileEntity_TesseractTerminal(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 3, "");
}
- public GT_MetaTileEntity_TesseractTerminal(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TesseractTerminal(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
- }
+ }
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractTerminal(mName, mTier, mDescription, mTextures);
}
@Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
+ public boolean isTransformerUpgradable()
+ {
return false;
}
@Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
+ public boolean isOverclockerUpgradable()
+ {
return false;
}
@Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canDrain(aSide, aFluid);
+ public boolean isSimpleMachine()
+ {
+ return false;
}
@Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canExtractItem(aIndex, aStack, aSide);
+ public boolean isFacingValid(byte aFacing)
+ {
+ return true;
}
-
+
@Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canFill(aSide, aFluid);
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
}
@Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canInsertItem(aIndex, aStack, aSide);
+ public boolean isValidSlot(int aIndex)
+ {
+ return false;
}
-
+
@Override
- public boolean canTankBeEmptied() {
- return false;
+ public long getMinimumStoredEU()
+ {
+ return getBaseMetaTileEntity().getEUCapacity() / 2;
}
@Override
- public boolean canTankBeFilled() {
- return false;
+ public long maxEUInput()
+ {
+ return 2048;
}
@Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.decrStackSize(aIndex, aAmount);
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
}
-
+
@Override
- public boolean displaysItemStack() {
- return false;
+ public long maxEUStore()
+ {
+ return 100000;
}
@Override
- public boolean displaysStackSize() {
- return false;
+ public long maxSteamStore()
+ {
+ return maxEUStore();
}
@Override
- public boolean doesEmptyContainers() {
- return false;
+ public boolean ownerControl()
+ {
+ return true;
}
- // To-Do?
@Override
- public boolean doesFillContainers() {
- return false;
+ public int getProgresstime()
+ {
+ return getTesseract(this.mFrequency, false) != null ? 999 : 0;
}
@Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.drain(aSide, aFluid, doDrain);
+ public int maxProgresstime()
+ {
+ return 1000;
}
@Override
- public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mFrequency", this.mFrequency);
}
@Override
- public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.fill(aDirection, aFluid, doFill);
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mFrequency = aNBT.getInteger("mFrequency");
}
@Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return new int[0];
- }
- return tTileEntity.getAccessibleSlotsFromSide(aSide);
+ public void onConfigLoad(GT_Config aConfig)
+ {
+ sInterDimensionalTesseractAllowed = true;
}
- /*
- * public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX,
- * float aY, float aZ) { if (aSide ==
- * getBaseMetaTileEntity().getFrontFacing()) { float[] tCoords =
- * GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); switch
- * ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] *
- * 2.0F))) { case 0: this.mFrequency -= 1; break; case 1: this.mFrequency +=
- * 1; } GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency
- * + (getTesseract(this.mFrequency, false) == null ? "" : new
- * StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)"
- * ).toString())); } return true; }
- */
+ /*public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ this.mFrequency += 1;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()));
+ }
+ return true;
+ }*/
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ){
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()){
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))){
+ case 0:
+ Utils.LOG_INFO("Freq. -1 | " + this.mFrequency);
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ Utils.LOG_INFO("Freq. +1 | " + this.mFrequency);
+ this.mFrequency += 1;
+ default:
+ //Utils.LOG_INFO("Did not click the correct place.");
+ break;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
+ PlayerUtils.messagePlayer(aPlayer, (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()));
+ }
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ this.mFrequency += 64;
+ break;
+ case 2:
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ this.mFrequency += 512;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()));
+ }
+ }
- @Override
- public String[] getDescription() {
- return new String[] {
- "Accesses Tesseracts remotely"
- };
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
}
- @Override
- public String[] getInfoData() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity.isSendingInformation()) {
- return tTileEntity.getInfoData();
+ public GT_MetaTileEntity_TesseractGenerator getTesseract(int aFrequency, boolean aWorkIrrelevant)
+ {
+ GT_MetaTileEntity_TesseractGenerator rTesseract = (GT_MetaTileEntity_TesseractGenerator)CORE.sTesseractGenerators.get(Integer.valueOf(aFrequency));
+ if (rTesseract == null) {
+ return null;
+ }
+ if (rTesseract.mFrequency != aFrequency)
+ {
+ CORE.sTesseractGenerators.put(Integer.valueOf(aFrequency), null);return null;
}
- return new String[] {
- "Tesseract Generator", "Freqency:", "" + this.mFrequency,
- this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive"
- };
+ if (!rTesseract.isValidTesseractGenerator(getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) {
+ return null;
+ }
+ if ((!sInterDimensionalTesseractAllowed) && (rTesseract.getBaseMetaTileEntity().getWorld() != getBaseMetaTileEntity().getWorld())) {
+ return null;
+ }
+ return rTesseract;
}
@Override
- public String getInventoryName() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return "";
+ public String[] getInfoData()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && (tTileEntity.isSendingInformation())) {
+ return tTileEntity.getInfoData();
}
- return tTileEntity.getInventoryName();
+ return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" };
}
@Override
- public int getInventoryStackLimit() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.getInventoryStackLimit();
+ public boolean isGivingInformation()
+ {
+ return true;
}
@Override
- public int getMaxItemCount() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
+ public boolean isDigitalChest()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
}
- return tTileEntity.getMaxItemCount();
+ return tTileEntity.isDigitalChest();
}
@Override
- public long getMinimumStoredEU() {
- return this.getBaseMetaTileEntity().getEUCapacity() / 2;
+ public ItemStack[] getStoredItemData()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStoredItemData();
}
@Override
- public int getProgresstime() {
- return this.getTesseract(this.mFrequency, false) != null ? 999 : 0;
+ public void setItemCount(int aCount)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setItemCount(aCount);
}
@Override
- public int getSizeInventory() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ public int getMaxItemCount()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
return 0;
}
- return tTileEntity.getSizeInventory();
+ return tTileEntity.getMaxItemCount();
}
@Override
- public ItemStack getStackInSlot(final int aIndex) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
}
- return tTileEntity.getStackInSlot(aIndex);
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
}
@Override
- public ItemStack[] getStoredItemData() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
+ public int[] getAccessibleSlotsFromSide(int aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
}
- return tTileEntity.getStoredItemData();
+ return tTileEntity.getAccessibleSlotsFromSide(aSide);
}
@Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return new FluidTankInfo[0];
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
}
- return tTileEntity.getTankInfo(aSide);
+ return tTileEntity.canInsertItem(aIndex, aStack, aSide);
}
- public GT_MetaTileEntity_TesseractGenerator getTesseract(final int aFrequency, final boolean aWorkIrrelevant) {
- final GT_MetaTileEntity_TesseractGenerator rTesseract = CORE.sTesseractGenerators
- .get(Integer.valueOf(aFrequency));
- if (rTesseract == null) {
- return null;
- }
- if (rTesseract.mFrequency != aFrequency) {
- CORE.sTesseractGenerators.put(Integer.valueOf(aFrequency), null);
- return null;
- }
- if (!rTesseract.isValidTesseractGenerator(this.getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) {
- return null;
- }
- if (!GT_MetaTileEntity_TesseractTerminal.sInterDimensionalTesseractAllowed
- && rTesseract.getBaseMetaTileEntity().getWorld() != this.getBaseMetaTileEntity().getWorld()) {
- return null;
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
}
- return rTesseract;
+ return tTileEntity.canExtractItem(aIndex, aStack, aSide);
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == aFacing ? new ITexture[] {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)
- } : new ITexture[] {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(Textures.BlockIcons.VOID)
- };
+ public int getSizeInventory()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
}
@Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
+ public ItemStack getStackInSlot(int aIndex)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStackInSlot(aIndex);
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
+ public void setInventorySlotContents(int aIndex, ItemStack aStack)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
}
@Override
- public boolean isDigitalChest() {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
+ public ItemStack decrStackSize(int aIndex, int aAmount)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
}
- return tTileEntity.isDigitalChest();
+ return tTileEntity.decrStackSize(aIndex, aAmount);
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
+ public String getInventoryName()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
}
@Override
- public boolean isGivingInformation() {
- return true;
+ public int getInventoryStackLimit()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
}
@Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
return false;
}
- return tTileEntity.isItemValidForSlot(aIndex, aStack);
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ return tTileEntity.canFill(aSide, aFluid);
}
@Override
- public boolean isOverclockerUpgradable() {
- return false;
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
}
@Override
- public boolean isSimpleMachine() {
- return false;
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
}
@Override
- public boolean isTransformerUpgradable() {
- return false;
+ public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.fill(aDirection, aFluid, doFill);
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return false;
+ public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aDirection, maxDrain, doDrain);
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFrequency = aNBT.getInteger("mFrequency");
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aSide, aFluid, doDrain);
}
- @Override
- public long maxEUInput() {
- return 2048;
+ public void onPostTick()
+ {
+ if ((getBaseMetaTileEntity().isServerSide()) && (getBaseMetaTileEntity().isAllowedToWork()))
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, true);
+ if (tTileEntity != null)
+ {
+ tTileEntity.addEnergyConsumption(this);
+ if ((!this.mDidWork) && (getTesseract(this.mFrequency, false) != null))
+ {
+ this.mDidWork = true;
+ getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ }
+ else if (this.mDidWork == true)
+ {
+ this.mDidWork = false;
+ getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ }
}
@Override
- public long maxEUStore() {
- return 100000;
+ public String[] getDescription()
+ {
+ return new String[] {"Accesses Tesseracts remotely"};
}
@Override
- public int maxProgresstime() {
- return 1000;
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
@Override
- public long maxSteamStore() {
- return this.maxEUStore();
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
}
@Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TesseractTerminal(this.mName, this.mTier, this.mDescription, this.mTextures);
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
}
@Override
- public void onConfigLoad(final GT_Config aConfig) {
- GT_MetaTileEntity_TesseractTerminal.sInterDimensionalTesseractAllowed = true;
- }
-
- public void onPostTick() {
- if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, true);
- if (tTileEntity != null) {
- tTileEntity.addEnergyConsumption(this);
- if (!this.mDidWork && this.getTesseract(this.mFrequency, false) != null) {
- this.mDidWork = true;
- this.getBaseMetaTileEntity().issueBlockUpdate();
- }
- }
- else if (this.mDidWork == true) {
- this.mDidWork = false;
- this.getBaseMetaTileEntity().issueBlockUpdate();
- }
- }
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == aFacing ? new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)} : new ITexture[]{new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), new GT_RenderedTexture(Textures.BlockIcons.VOID)};
}
+ //To-Do?
@Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer,
- final byte aSide, final float aX, final float aY, final float aZ) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) {
- case 0:
- Utils.LOG_INFO("Freq. -1 | " + this.mFrequency);
- this.mFrequency -= 1;
- break;
- case 1:
- Utils.LOG_INFO("Freq. +1 | " + this.mFrequency);
- this.mFrequency += 1;
- default:
- // Utils.LOG_INFO("Did not click the correct place.");
- break;
- }
- PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
- PlayerUtils.messagePlayer(aPlayer, this.getTesseract(this.mFrequency, false) == null ? ""
- : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString());
- }
- return true;
+ public boolean doesFillContainers() {
+ return false;
}
@Override
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) {
- final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) {
- case 0:
- this.mFrequency -= 64;
- break;
- case 1:
- this.mFrequency += 64;
- break;
- case 2:
- this.mFrequency -= 512;
- break;
- case 3:
- this.mFrequency += 512;
- }
- GT_Utility.sendChatToPlayer(aPlayer,
- "Frequency: " + this.mFrequency + (this.getTesseract(this.mFrequency, false) == null ? ""
- : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()));
- }
+ public boolean doesEmptyContainers() {
+ return false;
}
@Override
- public boolean ownerControl() {
- return true;
+ public boolean canTankBeFilled() {
+ return false;
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mFrequency", this.mFrequency);
+ public boolean canTankBeEmptied() {
+ return false;
}
@Override
- public void setInventorySlotContents(final int aIndex, final ItemStack aStack) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return;
- }
- tTileEntity.setInventorySlotContents(aIndex, aStack);
+ public boolean displaysItemStack() {
+ return false;
}
@Override
- public void setItemCount(final int aCount) {
- final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false);
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return;
- }
- tTileEntity.setItemCount(aCount);
+ public boolean displaysStackSize() {
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
index fee44a962e..c2cadab478 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
@@ -16,164 +16,129 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
- private int mRunTime = 0;
+public class GT_MetaTileEntity_Boiler_Solar
+ extends GT_MetaTileEntity_Boiler {
+ public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]);
+ }
- public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]);
- }
+ public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
- public GT_MetaTileEntity_Boiler_Solar(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[4][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[2][(i + 1)] = tmp2;
+ ITexture[] tmp3 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[3][(i + 1)] = tmp3;
+ }
+ return rTextures;
+ }
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
- }
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1];
+ }
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
- }
+ public int maxProgresstime() {
+ return 500;
+ }
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return this.mTextures[aSide >= 2 ? (byte) (aSide != aFacing ? 2 : 3) : aSide][aColorIndex + 1];
- }
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
+ }
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- final ITexture[][][] rTextures = new ITexture[4][17][];
- for (byte i = -1; i < 16; i = (byte) (i + 1)) {
- final ITexture[] tmp0 = {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM,
- Dyes.getModulation(i, Dyes._NULL.mRGBa))
- };
- rTextures[0][i + 1] = tmp0;
- final ITexture[] tmp1 = {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP,
- Dyes.getModulation(i, Dyes._NULL.mRGBa)),
- new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)
- };
- rTextures[1][i + 1] = tmp1;
- final ITexture[] tmp2 = {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE,
- Dyes.getModulation(i, Dyes._NULL.mRGBa))
- };
- rTextures[2][i + 1] = tmp2;
- final ITexture[] tmp3 = {
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE,
- Dyes.getModulation(i, Dyes._NULL.mRGBa)),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)
- };
- rTextures[3][i + 1] = tmp3;
- }
- return rTextures;
- }
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
+ }
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mRunTime = aNBT.getInteger("mRunTime");
- }
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ private int mRunTime = 0;
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mRunTime", this.mRunTime);
+ }
- @Override
- public int maxProgresstime() {
- return 500;
- }
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mRunTime = aNBT.getInteger("mRunTime");
+ }
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aTick > 20L) {
- if (this.mTemperature <= 20) {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 45) {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- if (this.mSteam != null) {
- final byte i = aBaseMetaTileEntity.getFrontFacing();
- final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null) {
- final FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i),
- Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null) {
- final int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(),
- tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(),
- aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true),
- true);
- }
- }
- }
- }
- if (aTick % 25L == 0L) {
- if (this.mTemperature > 100) {
- if (this.mFluid == null || !GT_ModHandler.isWater(this.mFluid) || this.mFluid.amount <= 0) {
- this.mHadNoWater = true;
- }
- else {
- if (this.mHadNoWater) {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
- }
- this.mFluid.amount -= 1;
- this.mRunTime += 1;
- int tOutput = 150;
- if (this.mRunTime > 10000) {
- tOutput = Math.max(50, 150 - (this.mRunTime - 10000) / 100);
- }
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(tOutput);
- }
- else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += tOutput;
- }
- else {
- this.mSteam = GT_ModHandler.getSteam(tOutput);
- }
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if (this.mSteam != null && this.mSteam.amount > 16000) {
- this.sendSound((byte) 1);
- this.mSteam.amount = 12000;
- }
- if (this.mProcessingEnergy <= 0 && aBaseMetaTileEntity.isAllowedToWork() && aTick % 256L == 0L
- && !aBaseMetaTileEntity.getWorld().isThundering()) {
- final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining()
- && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
- this.mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4
- || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0
- : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
- }
- if (this.mTemperature < 500 && this.mProcessingEnergy > 0 && aTick % 12L == 0L) {
- this.mProcessingEnergy -= 1;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
- }
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mRunTime", this.mRunTime);
- }
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 20) {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 45) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ if (this.mSteam != null) {
+ byte i = aBaseMetaTileEntity.getFrontFacing();
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ if (aTick % 25L == 0L) {
+ if (this.mTemperature > 100) {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ this.mHadNoWater = true;
+ } else {
+ if (this.mHadNoWater) {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ mRunTime += 1;
+ int tOutput = 150;
+ if(mRunTime > 10000){
+ tOutput = Math.max(50, 150 - ((mRunTime-10000)/100));
+ }
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(tOutput);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += tOutput;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(tOutput);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 16000)) {
+ sendSound((byte) 1);
+ this.mSteam.amount = 12000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
+ mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ }
+ if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) {
+ this.mProcessingEnergy -= 1;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java
index b05e1cb2a0..65a2892710 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java
@@ -1,8 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -12,152 +13,124 @@ import gregtech.api.util.GT_Recipe;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocketFuelGeneratorBase {
-
- public int mEfficiency;
-
- public GregtechMetaTileEntityDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.",
- new ITexture[0]);
- this.onConfigLoad();
- }
-
- public GregtechMetaTileEntityDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- super.getBack(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)
- };
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {
- super.getBackActive(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)
- };
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
- };
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] {
- super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
- };
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
+public class GregtechMetaTileEntityDoubleFuelGeneratorBase
+ extends GregtechRocketFuelGeneratorBase {
- private GT_RenderedTexture getCasingTexture() {
- if (this.mTier <= 4) {
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
- else if (this.mTier == 5) {
+ public int mEfficiency;
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
- }
- else if (this.mTier >= 6) {
+ public GregtechMetaTileEntityDoubleFuelGeneratorBase(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.", new ITexture[0]);
+ onConfigLoad();
+ }
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
- }
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
+ public GregtechMetaTileEntityDoubleFuelGeneratorBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
- @Override
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- super.getFront(aColor)[0], this.getCasingTexture(),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] {
- super.getFrontActive(aColor)[0], this.getCasingTexture(),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
- }
-
- @Override
- public int getFuelValue(final ItemStack aStack) {
- int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
- }
-
- @Override
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityDoubleFuelGeneratorBase(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- super.getSides(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)
- };
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {
- super.getSidesActive(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)
- };
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)
- };
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] {
- super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)
- };
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityDoubleFuelGeneratorBase(this.mName, this.mTier, this.mDescription,
- this.mTextures);
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "RocketEngine.efficiency.tier." + this.mTier, 100 - this.mTier * 8);
- }
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, (100 - this.mTier * 8));
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public int getFuelValue(ItemStack aStack) {
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ private GT_RenderedTexture getCasingTexture(){
+ if (this.mTier <= 4){
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+ else if (this.mTier == 5){
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ }
+ else if (this.mTier >= 6){
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
+ }
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)};
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)};
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)};
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)};
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)};
+ }
+
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)};
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
index 6c0df9ea99..b45cf93bff 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
@@ -1,8 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -13,159 +14,132 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity_BasicGenerator {
+public class GregtechMetaTileEntityGeothermalGenerator
+extends GT_MetaTileEntity_BasicGenerator
+{
public int mEfficiency;
- public GregtechMetaTileEntityGeothermalGenerator(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
+ public GregtechMetaTileEntityGeothermalGenerator(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel", new ITexture[0]);
- this.onConfigLoad();
+ onConfigLoad();
}
- public GregtechMetaTileEntityGeothermalGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GregtechMetaTileEntityGeothermalGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
+ onConfigLoad();
+ }
@Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical)
- };
- }
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()){
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
@Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {
- super.getBackActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active)
- };
+ public int getCapacity() {
+ //return MathUtils.roundToClosestMultiple(32000*(this.mTier/2), 25000);
+ return 5000*this.mTier;
}
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)
- };
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "ThermalGenerator.efficiency.tier." + this.mTier, (100 - this.mTier * 7));
}
@Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] {
- super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)
- };
+ public int getEfficiency() {
+ return this.mEfficiency;
}
@Override
- public int getCapacity() {
- // return MathUtils.roundToClosestMultiple(32000*(this.mTier/2), 25000);
- return 5000 * this.mTier;
+ public int getFuelValue(ItemStack aStack) {
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Generates power from Lava/Pahoehoe at " + this.getEfficiency() + "% Efficiency per tick"
- };
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
}
@Override
- public int getEfficiency() {
- return this.mEfficiency;
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityGeothermalGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
}
@Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
}
@Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] {
- super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical)};
}
@Override
- public int getFuelValue(final ItemStack aStack) {
- int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
}
- public int getPollution() {
- return 100;
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)};
}
@Override
- public GT_Recipe_Map getRecipes() {
- return GT_Recipe_Map.sHotFuels;
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)};
}
@Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)
- };
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
}
@Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {
- super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)
- };
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active)};
}
@Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)
- };
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)};
}
@Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] {
- super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE)
- };
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE)};
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)};
}
+
@Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityGeothermalGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ public String[] getDescription()
+ {
+ return new String[] {"Generates power from Lava/Pahoehoe at " + getEfficiency() + "% Efficiency per tick"};
}
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "ThermalGenerator.efficiency.tier." + this.mTier, 100 - this.mTier * 7);
+ @Override
+ public GT_Recipe_Map getRecipes()
+ {
+ return GT_Recipe_Map.sHotFuels;
}
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
+
+ public int getPollution() {
+ return 100;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
index 95194a5ecb..59e4a1b875 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
@@ -1,8 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -12,150 +13,124 @@ import gregtech.api.util.GT_Recipe;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFuelGeneratorBase {
-
- public int mEfficiency;
-
- public GregtechMetaTileEntityRocketFuelGenerator(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires liquid Fuels.", new ITexture[0]);
- this.onConfigLoad();
- }
-
- public GregtechMetaTileEntityRocketFuelGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- super.getBack(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)
- };
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {
- super.getBackActive(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)
- };
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
- };
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] {
- super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)
- };
- }
-
- @Override
- public int getCapacity() {
- return 32000;
- }
+public class GregtechMetaTileEntityRocketFuelGenerator
+ extends GregtechRocketFuelGeneratorBase {
- private GT_RenderedTexture getCasingTexture() {
- if (this.mTier <= 4) {
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
- else if (this.mTier == 5) {
+ public int mEfficiency;
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
- }
- else if (this.mTier >= 6) {
+ public GregtechMetaTileEntityRocketFuelGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires liquid Fuels.", new ITexture[0]);
+ onConfigLoad();
+ }
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
- }
- return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
- }
+ public GregtechMetaTileEntityRocketFuelGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
- @Override
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- super.getFront(aColor)[0], this.getCasingTexture(),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] {
- super.getFrontActive(aColor)[0], this.getCasingTexture(),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
- }
-
- @Override
- public int getFuelValue(final ItemStack aStack) {
- int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
- }
-
- @Override
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityRocketFuelGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- super.getSides(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)
- };
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {
- super.getSidesActive(aColor)[0], this.getCasingTexture(),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)
- };
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)
- };
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] {
- super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)
- };
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityRocketFuelGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "RocketEngine.efficiency.tier." + this.mTier, 100 - this.mTier * 8);
- }
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, (100 - this.mTier * 8));
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public int getFuelValue(ItemStack aStack) {
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ private GT_RenderedTexture getCasingTexture(){
+ if (this.mTier <= 4){
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+ else if (this.mTier == 5){
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ }
+ else if (this.mTier >= 6){
+
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra);
+ }
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent)};
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)};
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal)};
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast)};
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)};
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)};
+ }
+
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)};
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
index 50303dbfcd..c41c1851fa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
@@ -1,7 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -14,200 +16,159 @@ import net.minecraft.entity.player.InventoryPlayer;
public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGenerator {
- ITexture SolarArray[] = {
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV),
- new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)
- };
-
- public GregtechMetaTileEntitySolarGenerator(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
+ public GregtechMetaTileEntitySolarGenerator(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, "Feasts on the power of the Sun!", new ITexture[0]);
- this.onConfigLoad();
+ onConfigLoad();
}
- public GregtechMetaTileEntitySolarGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GregtechMetaTileEntitySolarGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
+ onConfigLoad();
}
@Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)
- };
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
}
@Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {
- super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)
- };
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, 16000);
}
@Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)
- };
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
}
@Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] {
- super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)
- };
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
}
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SunAbsorber.efficiency.tier." + this.mTier, 100 - this.mTier * 10);
+
}
@Override
- public int getEfficiency() {
- return this.mEfficiency;
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
+
+ if (this.mSolarCharge <= 20) {
+ //Utils.LOG_WARNING("1.");
+ this.mSolarCharge = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 45) {
+ //Utils.LOG_WARNING("2.");
+ this.mSolarCharge -= 1;
+ this.mLossTimer = 0;
+ }
+
+ if (aTick % 10L == 0L) {
+
+ Utils.LOG_WARNING("getUniversalEnergyStored: "+aBaseMetaTileEntity.getUniversalEnergyStored() + " maxEUOutput * 20 + getMinimumStoredEU: " + (maxEUOutput() * 20 + getMinimumStoredEU()));
+
+ if ((this.mSolarCharge > 100) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (!aBaseMetaTileEntity.getWorld().isThundering()) &&
+ aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUStore() - getMinimumStoredEU())) {
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerTick * getEfficiency(), true);
+ }
+ }
+
+ if ((this.mSolarCharge < 500) && (this.mProcessingEnergy != 0) && (aTick % 32L == 0L)) {
+ Utils.LOG_WARNING("Adding Solar Charge. Currently "+mSolarCharge);
+ this.mProcessingEnergy -= 1;
+ this.mSolarCharge += 1;
+ }
+
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 64L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ Utils.LOG_WARNING("Adding Processing Energy. Currently "+mProcessingEnergy);
+ boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
+ mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()){
+ //Utils.LOG_WARNING("6.");
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ }
+ }
}
@Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
+ public void inValidate() {
+
}
@Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] {
- super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]
- };
+ public int getEfficiency() {
+ return this.mEfficiency;
}
@Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, 16000);
+ public long maxEUStore() {
+ return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());
}
+
+ ITexture SolarArray[] = {new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV),
+ new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
+
+
@Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)
- };
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
}
@Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {
- super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)
- };
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
}
@Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)
- };
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
}
@Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] {
- super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)
- };
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
}
@Override
- public void inValidate() {
-
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
}
@Override
- public long maxEUStore() {
- return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 16000 + this.getMinimumStoredEU());
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
}
@Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
}
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "SunAbsorber.efficiency.tier." + this.mTier, 100 - this.mTier * 10);
-
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
}
@Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() < this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
-
- if (this.mSolarCharge <= 20) {
- // Utils.LOG_WARNING("1.");
- this.mSolarCharge = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 45) {
- // Utils.LOG_WARNING("2.");
- this.mSolarCharge -= 1;
- this.mLossTimer = 0;
- }
-
- if (aTick % 10L == 0L) {
-
- Utils.LOG_WARNING("getUniversalEnergyStored: " + aBaseMetaTileEntity.getUniversalEnergyStored()
- + " maxEUOutput * 20 + getMinimumStoredEU: "
- + (this.maxEUOutput() * 20 + this.getMinimumStoredEU()));
-
- if (this.mSolarCharge > 100 && aBaseMetaTileEntity.isAllowedToWork()
- && !aBaseMetaTileEntity.getWorld().isThundering() && aBaseMetaTileEntity
- .getUniversalEnergyStored() < this.maxEUStore() - this.getMinimumStoredEU()) {
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits(
- GregtechMetaSolarGenerator.sEnergyPerTick * this.getEfficiency(), true);
- }
- }
-
- if (this.mSolarCharge < 500 && this.mProcessingEnergy != 0 && aTick % 32L == 0L) {
- Utils.LOG_WARNING("Adding Solar Charge. Currently " + this.mSolarCharge);
- this.mProcessingEnergy -= 1;
- this.mSolarCharge += 1;
- }
-
- if (this.mProcessingEnergy <= 0 && aBaseMetaTileEntity.isAllowedToWork() && aTick % 64L == 0L
- && !aBaseMetaTileEntity.getWorld().isThundering()) {
- Utils.LOG_WARNING("Adding Processing Energy. Currently " + this.mProcessingEnergy);
- final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining()
- && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
- this.mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4
- || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0
- : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- // Utils.LOG_WARNING("6.");
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
- }
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java
index be4a51a02f..5d1befbbad 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java
@@ -8,129 +8,97 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaSuperConductorNodeBase;
-public class GregtechMetaTileEntitySuperCondensor extends GregtechMetaSuperConductorNodeBase {
-
- public int mEfficiency;
-
- public GregtechMetaTileEntitySuperCondensor(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires liquid Nitrogen/Helium", new ITexture[0]);
- this.onConfigLoad();
- }
-
- public GregtechMetaTileEntitySuperCondensor(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- this.onConfigLoad();
- }
-
- @Override
- public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {
- super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[] {
- super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {
- super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[] {
- super.getBottomActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]
- };
- }
-
- @Override
+public class GregtechMetaTileEntitySuperCondensor
+ extends GregtechMetaSuperConductorNodeBase {
+
+ public int mEfficiency;
+
+ public GregtechMetaTileEntitySuperCondensor(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires liquid Nitrogen/Helium", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GregtechMetaTileEntitySuperCondensor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntitySuperCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ @Override
public int getCapacity() {
- return 64000;
- }
+ return 64000;
+ }
- @Override
+ public void onConfigLoad() {
+ this.mEfficiency = 100;
+ }
+
+ @Override
public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override
- public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {
- super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[] {
- super.getFrontActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- };
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
-
- @Override
- public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {
- super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[] {
- super.getSidesActive(aColor)[0],
- new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR),
- Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]
- };
- }
-
- @Override
- public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {
- super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)
- };
- }
-
- @Override
- public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[] {
- super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)
- };
- }
-
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntitySuperCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onConfigLoad() {
- this.mEfficiency = 100;
- }
+ return this.mEfficiency;
+ }
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)};
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)};
+ }
+
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR), Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
index 9df0d03a1b..0d9fadc6df 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
@@ -1,6 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import gregtech.api.enums.GT_Values;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -13,141 +13,117 @@ import net.minecraft.nbt.NBTTagCompound;
public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_TieredMachineBlock {
- public int mRange = 16;
-
- public GregtechMetaTileEntityChunkLoader(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Reprells nasty Creatures. Range: " + (4 + 12 * aTier)
- + " unpowered / " + (16 + 48 * aTier) + " powered");
- }
-
- public GregtechMetaTileEntityChunkLoader(final String aName, final int aTier, final int aInvSlotCount,
- final String aDescription, final ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return 512;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
- aSide != 1 ? null
- : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE)
- : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)
- };
- }
-
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return null;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isInputFacing(final byte aSide) {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- }
-
- @Override
- public long maxAmperesIn() {
- return 2;
- }
-
- @Override
- public long maxEUInput() {
- return GT_Values.V[this.mTier];
- }
-
- @Override
- public long maxEUStore() {
- return 512 + GT_Values.V[this.mTier] * 50;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityChunkLoader(this.mName, this.mTier, this.mInventory.length, this.mDescription,
- this.mTextures);
- }
-
- @Override
- public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) {
- final int[] tCoords = new int[] {
- aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(),
- aBaseMetaTileEntity.getWorld().provider.dimensionId
- };
- GT_SpawnEventHandler.mobReps.add(tCoords);
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
- if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) {
- final int[] tCoords = new int[] {
- aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(),
- aBaseMetaTileEntity.getWorld().provider.dimensionId
- };
- if (aTimer % 600 == 0 && !GT_SpawnEventHandler.mobReps.contains(tCoords)) {
- GT_SpawnEventHandler.mobReps.add(tCoords);
- }
- if (aBaseMetaTileEntity.isUniversalEnergyStored(this.getMinimumStoredEU())
- && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1 << this.mTier * 2, false)) {
- this.mRange = 16 + 48 * this.mTier;
- }
- else {
- this.mRange = 4 + 12 * this.mTier;
- }
- }
- }
-
- @Override
- public void onRemoval() {
- final int[] tCoords = new int[] {
- this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(),
- this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId
- };
- GT_SpawnEventHandler.mobReps.remove(tCoords);
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- }
+ public int mRange = 16;
+
+ public GregtechMetaTileEntityChunkLoader(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 0, "Reprells nasty Creatures. Range: " + (4 + (12 * aTier)) + " unpowered / " + (16 + (48 * aTier)) + " powered");
+ }
+
+ public GregtechMetaTileEntityChunkLoader(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityChunkLoader(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != 1) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)};
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) {
+ int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId};
+ if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) {
+ GT_SpawnEventHandler.mobReps.add(tCoords);
+ }
+ if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1 << (this.mTier * 2), false)) {
+ mRange = 16 + (48 * mTier);
+ } else {
+ mRange = 4 + (12 * mTier);
+ }
+ }
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId};
+ GT_SpawnEventHandler.mobReps.add(tCoords);
+ }
+
+ @Override
+ public void onRemoval() {
+ int[] tCoords = new int[]{this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId};
+ GT_SpawnEventHandler.mobReps.remove(tCoords);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512 + V[mTier] * 50;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return null;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
index 102b79111f..4f893cc556 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
@@ -1,126 +1,200 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.apache.commons.lang3.ArrayUtils;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.ArrayUtils;
+
public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase {
- public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3215;
- public static boolean sRequiresUUA = false;
- private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass"));
- // public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
- private int recipeCounter = 0;
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+ private int recipeCounter = 0;
+ private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass"));
+ //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
- public GregtechMTE_NuclearReactor(final int aID, final String aName, final String aNameRegional) {
+ public GregtechMTE_NuclearReactor(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMTE_NuclearReactor(final String aName) {
+ public GregtechMTE_NuclearReactor(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
- for (int i = -3; i < 3; i++) {
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Nuclear Reactor",
+ "Produces heat from Radioactive beta decay.",
+ "Size(WxHxD): 5x4x5, Controller (Bottom center)",
+ "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)",
+ "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)",
+ "1x Input Hatch (Any bottom layer casing)",
+ "1x Output Hatch (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)",
+ "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
+ "1x Energy Hatch (Any bottom layer casing)",
+ "24x IC2 Reinforced Glass for the walls",
+ "Matter Fabricator Casings for the edges & top (40 at least!)",
+ CORE.GT_Tooltip};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MatterFabricator.png");
+ }
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
+ if (tFluids.length > 0) {
+ for(int i = 0;i<tFluids.length;i++){
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = ((tRecipe.mDuration/**sDurationMultiplier*/) / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration/**sDurationMultiplier*/);
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = tRecipe.mFluidOutputs.clone();
+ ArrayUtils.reverse(mOutputFluids);
+ recipeCounter++;
+ updateSlots();
+ //Utils.LOG_INFO("Recipes Finished: "+recipeCounter);
+ return true;
+ }
+ }
+ else {
+ Utils.LOG_INFO("Invalid Recipe");
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+ for (int i = -3; i < 4; i++) {
for (int j = -3; j < 4; j++) {
- for (int h = 0; h < 3; h++) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
- h, zDir + j);
+ for (int h = 0; h < 4; h++) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (i != -3 && i != 3 && j != -3 && j != 3) {// Reactor
- // Floor/Roof
- // inner 7x7
- if (h == 0 || h == 4) {// Reactor Floor & Roof (Inner
- // 7x7) + muffler x4
- if (!this.addMufflerToMachineList(tTileEntity, 66)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the top layers inner 3x3.");
+ if ((i != -3 && i != 3) && (j != -3 && j != 3)) {// Reactor Floor/Roof inner 7x7
+ if (h == 0 || h == 4) {// Reactor Floor & Roof (Inner 7x7) + muffler x4
+ if ((!addMufflerToMachineList(tTileEntity, 66))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the top layers inner 3x3.");
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
}
- }
- else {// Inside 6 layers, mostly air
- if (i != -1 && i != 1 && j != -1 && j != 1) {// Reactor
- // Floor/Roof
- // inner
- // 5x5
+ } else {// Inside 6 layers, mostly air
+ if ((i != -1 && i != 1) && (j != -1 && j != 1)) {// Reactor Floor/Roof inner 5x5
if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
Utils.LOG_INFO("Make sure the inner 3x3 of the Multiblock is Air.");
return false;
}
}
- else { // carbon moderation rods are at 1,1 & -1,-1
- // & 1,-1 & -1,1
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the top layers inner 3x3.");
+ else { //carbon moderation rods are at 1,1 & -1,-1 & 1,-1 & -1,1
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the top layers inner 3x3.");
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
- }
+ }
}
} // End Inner Workings
else {// Reactor Exterior
if (h == 1) {
- if ((i == -3 || i == 3) && (j == -3 || j == 3)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Block temp = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the corners in the second layer. Block: "+temp.getLocalizedName()
- +" x:"+(aBaseMetaTileEntity.getXCoord()+xDir+i)
- +" y:"+(aBaseMetaTileEntity.getYCoord()+h)
- +" z:"+(aBaseMetaTileEntity.getZCoord()+zDir+j)
- );
+ if ((i == -3 || i == 3) && (j == -3 || j == 3)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the corners in the second layer. Meta");
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
return false;
}
}
- else if ((i != -3 || i != 3) && (j != -3 || j != 3)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
+ else if ((i != -3 || i != 3) && (j != -3 || j != 3)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer.");
return false;
}
@@ -131,23 +205,19 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase
}
}
if (h == 2) {
- if ((i == -3 || i == 3) && (j == -3 || j == 3)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the corners in the third layer.");
+ if ((i == -3 || i == 3) && (j == -3 || j == 3)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the corners in the third layer.");
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
return false;
}
}
- else if ((i != -3 || i != 3) && (j != -3 || j != 3)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
+ else if ((i != -3 || i != 3) && (j != -3 || j != 3)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer.");
return false;
}
@@ -158,15 +228,12 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase
}
}
if (h == 3) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the edges on the top layer.");
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO(
- "Reactor Casings Missing from one of the edges on the top layer.");
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
return false;
}
}
@@ -181,143 +248,38 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- }
- else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
-
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0,
- tFluidList.size());
- if (tFluids.length > 0) {
- for (int i = 0; i < tFluids.length; i++) {
- final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(
- this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[] {
- tFluids[i]
- }, new ItemStack[] {});
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- tRecipe.getOutput(0)
- };
- this.mOutputFluids = tRecipe.mFluidOutputs.clone();
- ArrayUtils.reverse(this.mOutputFluids);
- this.recipeCounter++;
- this.updateSlots();
- // Utils.LOG_INFO("Recipes Finished: "+recipeCounter);
- return true;
- }
- }
- else {
- Utils.LOG_INFO("Invalid Recipe");
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png");
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
}
@Override
- public int getDamageToComponent(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Nuclear Reactor", "Produces heat from Radioactive beta decay.",
- "Size(WxHxD): 5x4x5, Controller (Bottom center)",
- "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)",
- "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)",
- "1x Input Hatch (Any bottom layer casing)", "1x Output Hatch (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
- "1x Energy Hatch (Any bottom layer casing)", "24x IC2 Reinforced Glass for the walls",
- "Reactor Casings for the edges, bottom & top (40 at least!)", CORE.GT_Tooltip
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getDamageToComponent(ItemStack aStack) {
return 0;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[66],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[66]
- };
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GregtechMTE_NuclearReactor(this.mName);
}
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- }
-
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
index 2d9512ce2f..bb7327857a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
@@ -10,242 +7,226 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.util.Utils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_AlloyBlastSmelter extends GT_MetaTileEntity_MultiBlockBase {
- private int mHeatingCapacity = 0;
-
- public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_AlloyBlastSmelter(final String aName) {
- super(aName);
- }
-
- @Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- // this.mHeatingCapacity = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
- return false;
- }
- this.addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 72);
-
- final byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
-
- this.mHeatingCapacity = 20000;
-
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i != 0 || j != 0) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 14) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != 14) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 15) {
- return false;
- }
- }
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (xDir + i != 0 || zDir + j != 0) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
- 0, zDir + j);
- if (!this.addMaintenanceToMachineList(tTileEntity, 72)
- && !this.addInputToMachineList(tTileEntity, 72)
- && !this.addOutputToMachineList(tTileEntity, 72)
- && !this.addEnergyInputToMachineList(tTileEntity, 72)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 15) {
- return false;
- }
- }
- }
- }
- }
- this.mHeatingCapacity += 100 * (GT_Utility.getTier(this.getMaxInputVoltage()) - 2);
- return true;
- }
-
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- }
- else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- }
- else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
- if (tInputList.size() > 1) {
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(
- this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue
- && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- Utils.LOG_WARNING("Found some Valid Inputs.");
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputFluids = new FluidStack[] {
- tRecipe.getFluidOutput(0)
- };
- this.updateSlots();
- return true;
- }
- }
- Utils.LOG_WARNING("Failed to find some Valid Inputs.");
- return false;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 2;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "ElectricBlastFurnace.png");
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- @Override
+public class GregtechMetaTileEntity_AlloyBlastSmelter
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private int mHeatingCapacity = 0;
+
+ public GregtechMetaTileEntity_AlloyBlastSmelter(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_AlloyBlastSmelter(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_AlloyBlastSmelter(this.mName);
+ }
+
+ @Override
public String[] getDescription() {
- return new String[] {
- "Controller Block for the Alloy Blast Smelter", // Outputs 144mb
- // fluid for
- // every
- // inputStack.stackSize;
- // Time to use
- // those hot
- // metals.
- "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)",
- "16x Blast Smelter Heat Containment Coils (two middle Layers, hollow)", "1x Input bus (one of bottom)",
- "1x Output Hatch (one of bottom)", "1x Energy Hatch (one of bottom)",
- "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)",
- "Blast Smelter Casings for the rest"
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 10;
- }
-
- @Override
+ return new String[]{
+ "Controller Block for the Alloy Blast Smelter", //Outputs 144mb fluid for every inputStack.stackSize; Time to use those hot metals.
+ "Size: 3x3x4 (Hollow)",
+ "Controller (front middle at bottom)",
+ "16x Blast Smelter Heat Containment Coils (two middle Layers, hollow)",
+ "1x Input bus (one of bottom)",
+ "1x Output Hatch (one of bottom)",
+ "1x Energy Hatch (one of bottom)",
+ "1x Maintenance Hatch (one of bottom)",
+ "1x Muffler Hatch (top middle)",
+ "Blast Smelter Casings for the rest"};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[72], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[72]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
+ }
+
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[72],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[72]
- };
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_AlloyBlastSmelter(this.mName);
- }
+ return Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 1) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ Utils.LOG_WARNING("Found some Valid Inputs.");
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ Utils.LOG_WARNING("Failed to find some Valid Inputs.");
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ //this.mHeatingCapacity = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
+ return false;
+ }
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 72);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
+
+ this.mHeatingCapacity = 20000;
+
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 14) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != 14) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 15) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 72)) && (!addInputToMachineList(tTileEntity, 72)) && (!addOutputToMachineList(tTileEntity, 72)) && (!addEnergyInputToMachineList(tTileEntity, 72))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 15) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 10;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java
index db857a782d..0838bdefbd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.ArrayUtils;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -21,137 +16,111 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
+
+import java.util.ArrayList;
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_MultiBlockBase {
- private static boolean controller;
- private static boolean isDisabled = false;
- private static ITexture frontFace;
- private static ITexture frontFaceActive;
- private static CustomIcon GT9_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
- private static CustomIcon GT9_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
- // public static double recipesComplete = 0;
-
- ArrayList<ItemStack> tInputList = this.getStoredInputs();
+import org.apache.commons.lang3.ArrayUtils;
- GT_Recipe mLastRecipe;
+public class GregtechMetaTileEntity_IndustrialCentrifuge
+extends GregtechMeta_MultiBlockBase {
+ private static boolean controller;
+ private static boolean isDisabled = false;
+ private static ITexture frontFace;
+ private static ITexture frontFaceActive;
+ private static CustomIcon GT9_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
+ private static CustomIcon GT9_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
+ //public static double recipesComplete = 0;
- public GregtechMetaTileEntity_IndustrialCentrifuge(final int aID, final String aName, final String aNameRegional) {
+ public GregtechMetaTileEntity_IndustrialCentrifuge(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
- GregtechMetaTileEntity_IndustrialCentrifuge.frontFaceActive = new GT_RenderedTexture(
- GregtechMetaTileEntity_IndustrialCentrifuge.GT9_5_Active);
- GregtechMetaTileEntity_IndustrialCentrifuge.frontFace = new GT_RenderedTexture(
- GregtechMetaTileEntity_IndustrialCentrifuge.GT9_5);
+ frontFaceActive = new GT_RenderedTexture(GT9_5_Active);
+ frontFace = new GT_RenderedTexture(GT9_5);
}
- public GregtechMetaTileEntity_IndustrialCentrifuge(final String aName) {
+ public GregtechMetaTileEntity_IndustrialCentrifuge(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- /*
- * if (configSwitches.disableCentrifugeFormation){ EntityPlayerMP player
- * =
- * MinecraftServer.getServer().getConfigurationManager().func_152612_a(
- * this.getBaseMetaTileEntity().getOwnerName()); if
- * (!player.getEntityWorld().isRemote && isDisabled == false)
- * PlayerUtils.messagePlayer(player,
- * "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]"
- * ); isDisabled = true; return false; }
- */
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- // Utils.LOG_WARNING("X:"+xDir+" Y:"+yDir+" Z:"+zDir);
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) { // X-Dir
- for (int j = -1; j < 2; j++) { // Z-Dir
- for (int h = -1; h < 2; h++) { // Y-Dir
- if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
-
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- // Utils.LOG_WARNING("X:"+tTileEntity.getXCoord()+"
- // Y:"+tTileEntity.getYCoord()+"
- // Z:"+tTileEntity.getZCoord());
- if (!this.addMaintenanceToMachineList(tTileEntity, 57)
- && !this.addInputToMachineList(tTileEntity, 57)
- && !this.addOutputToMachineList(tTileEntity, 57)
- && !this.addEnergyInputToMachineList(tTileEntity, 57)) {
-
- // Maintenance Hatch
- if (tTileEntity != null && tTileEntity.getMetaTileEntity() != null) {
- if (tTileEntity.getXCoord() == aBaseMetaTileEntity.getXCoord()
- && tTileEntity.getYCoord() == aBaseMetaTileEntity.getYCoord()
- && tTileEntity.getZCoord() == aBaseMetaTileEntity.getZCoord() + 2) {
- if (tTileEntity
- .getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- Utils.LOG_WARNING("MAINT HATCH IN CORRECT PLACE");
- this.mMaintenanceHatches.add(
- (GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this
- .getCasingTextureIndex();
- }
- else {
- return false;
- }
- }
- else {
- Utils.LOG_WARNING("MAINT HATCH IN WRONG PLACE");
- }
- }
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialCentrifuge(this.mName);
+ }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
- return false;
- }
- tAmount++;
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Industrial Centrifuge",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (Front Center) [Orange]",
+ "1x Maintenance Hatch (Rear Center) [Green]",
+ "The rest can be placed anywhere except the Front [Red]",
+ "1x Input Hatch",
+ "1x Output Hatch",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x [EV] Energy Hatch (Can be higher Tier) [Blue]",
+ "Centrifuge Casings for the rest (16 at least)",
+ CORE.GT_Tooltip};
+ }
- }
- }
- }
- }
- }
- return tAmount >= 16;
+
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? frontFaceActive : frontFace : Textures.BlockIcons.CASING_BLOCKS[57]};
}
+
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- /*
- * if (!isCorrectMachinePart(mInventory[1])) { return false; }
- */
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "IndustrialCentrifuge.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ GT_Recipe mLastRecipe;
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ /*if (!isCorrectMachinePart(mInventory[1])) {
+ return false;
+ }*/
Utils.LOG_WARNING("Centrifuge Debug - 1");
- final GT_Recipe.GT_Recipe_Map map = this.getRecipeMap();
+ GT_Recipe.GT_Recipe_Map map = getRecipeMap();
if (map == null) {
Utils.LOG_WARNING("Centrifuge Debug - False - No recipe map");
return false;
}
Utils.LOG_WARNING("Centrifuge Debug - 2");
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- Utils.LOG_WARNING("Centrifuge Debug - Tier variable: " + tTier);
- final ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- final FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ Utils.LOG_WARNING("Centrifuge Debug - Tier variable: "+tTier);
+ ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]);
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]);
if (tInputList.size() > 0 || tFluids.length > 0) {
- final GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false,
- gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
if (tRecipe != null) {
Utils.LOG_WARNING("Recipe was not invalid");
- this.mLastRecipe = tRecipe;
+ mLastRecipe = tRecipe;
this.mEUt = 0;
this.mOutputItems = null;
this.mOutputFluids = null;
@@ -162,34 +131,29 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_Mu
}
this.mMaxProgresstime = tRecipe.mDuration;
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
- Utils.LOG_WARNING("Centrifuge Debug - 2 - Max Progress Time: " + this.mMaxProgresstime);
+ Utils.LOG_WARNING("Centrifuge Debug - 2 - Max Progress Time: "+this.mMaxProgresstime);
if (tRecipe.mEUt <= 16) {
Utils.LOG_WARNING("Centrifuge Debug - Using < 16eu/t");
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- Utils.LOG_WARNING("Centrifuge Debug - 3.1 - Max Progress Time: " + this.mMaxProgresstime + " EU/t"
- + this.mEUt + " Obscure GT Value " + gregtech.api.enums.GT_Values.V[tTier - 1]);
- }
- else {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ Utils.LOG_WARNING("Centrifuge Debug - 3.1 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt + " Obscure GT Value "+gregtech.api.enums.GT_Values.V[(tTier - 1)]);
+ } else {
Utils.LOG_WARNING("Centrifuge Debug - using > 16eu/t");
this.mEUt = tRecipe.mEUt;
this.mMaxProgresstime = tRecipe.mDuration;
- Utils.LOG_WARNING("Centrifuge Debug - 3.2 - Max Progress Time: " + this.mMaxProgresstime + " EU/t"
- + this.mEUt + " Obscure GT Value " + gregtech.api.enums.GT_Values.V[tTier - 1]);
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
+ Utils.LOG_WARNING("Centrifuge Debug - 3.2 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt + " Obscure GT Value "+gregtech.api.enums.GT_Values.V[(tTier - 1)]);
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
this.mEUt *= 4;
this.mMaxProgresstime /= 2;
- Utils.LOG_WARNING("Centrifuge Debug - 4 - Max Progress Time: " + this.mMaxProgresstime + " EU/t"
- + this.mEUt);
+ Utils.LOG_WARNING("Centrifuge Debug - 4 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt);
}
}
this.mEUt *= 1;
if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- Utils.LOG_WARNING(
- "Centrifuge Debug - 5 - Max Progress Time: " + this.mMaxProgresstime + " EU/t" + this.mEUt);
+ this.mEUt = (-this.mEUt);
+ Utils.LOG_WARNING("Centrifuge Debug - 5 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt);
}
ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
for (int h = 0; h < tRecipe.mOutputs.length; h++) {
@@ -197,34 +161,30 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_Mu
tOut[h].stackSize = 0;
}
FluidStack tFOut = null;
- if (tRecipe.getFluidOutput(0) != null) {
- tFOut = tRecipe.getFluidOutput(0).copy();
- }
+ if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy();
for (int f = 0; f < tOut.length; f++) {
if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
for (int g = 0; g < 1; g++) {
- if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
}
}
}
if (tFOut != null) {
- final int tSize = tFOut.amount;
+ int tSize = tFOut.amount;
tFOut.amount = tSize * 6;
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
this.mMaxProgresstime /= 4;
- if (this.mMaxProgresstime <= 0) {
+ if (this.mMaxProgresstime <= 0){
this.mMaxProgresstime++;
}
- Utils.LOG_WARNING(
- "Centrifuge Debug - 6 - Max Progress Time: " + this.mMaxProgresstime + " EU/t" + this.mEUt);
- final List<ItemStack> overStacks = new ArrayList<ItemStack>();
+ Utils.LOG_WARNING("Centrifuge Debug - 6 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt);
+ List<ItemStack> overStacks = new ArrayList<ItemStack>();
for (int f = 0; f < tOut.length; f++) {
if (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
- final ItemStack tmp = tOut[f].copy();
+ ItemStack tmp = tOut[f].copy();
tmp.stackSize = tmp.getMaxStackSize();
tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
overStacks.add(tmp);
@@ -236,18 +196,14 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_Mu
tmp = overStacks.toArray(tmp);
tOut = ArrayUtils.addAll(tOut, tmp);
}
- final List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (final ItemStack tS : tOut) {
- if (tS.stackSize > 0) {
- tSList.add(tS);
- }
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOut) {
+ if (tS.stackSize > 0) tSList.add(tS);
}
tOut = tSList.toArray(new ItemStack[tSList.size()]);
this.mOutputItems = tOut;
- this.mOutputFluids = new FluidStack[] {
- tFOut
- };
- this.updateSlots();
+ this.mOutputFluids = new FluidStack[]{tFOut};
+ updateSlots();
Utils.LOG_WARNING("Centrifuge: True");
return true;
}
@@ -256,20 +212,11 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_Mu
return false;
}
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
@SuppressWarnings("static-method")
public Block getCasingBlock() {
return ModBlocks.blockCasingsMisc;
}
+
@SuppressWarnings("static-method")
public byte getCasingMeta() {
return 0;
@@ -281,66 +228,89 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_Mu
}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "IndustrialCentrifuge.png");
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ /*if (configSwitches.disableCentrifugeFormation){
+ EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(this.getBaseMetaTileEntity().getOwnerName());
+ if (!player.getEntityWorld().isRemote && isDisabled == false)
+ PlayerUtils.messagePlayer(player, "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]");
+ isDisabled = true;
+ return false;
+ }*/
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ //Utils.LOG_WARNING("X:"+xDir+" Y:"+yDir+" Z:"+zDir);
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) { //X-Dir
+ for (int j = -1; j < 2; j++) { //Z-Dir
+ for (int h = -1; h < 2; h++) { //Y-Dir
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ //Utils.LOG_WARNING("X:"+tTileEntity.getXCoord()+" Y:"+tTileEntity.getYCoord()+" Z:"+tTileEntity.getZCoord());
+ if ((!addMaintenanceToMachineList(tTileEntity, 57)) && (!addInputToMachineList(tTileEntity, 57)) && (!addOutputToMachineList(tTileEntity, 57)) && (!addEnergyInputToMachineList(tTileEntity, 57))) {
+
+ //Maintenance Hatch
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if (tTileEntity.getXCoord() == aBaseMetaTileEntity.getXCoord() && tTileEntity.getYCoord() == aBaseMetaTileEntity.getYCoord() && tTileEntity.getZCoord() == (aBaseMetaTileEntity.getZCoord()+2)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
+ Utils.LOG_WARNING("MAINT HATCH IN CORRECT PLACE");
+ this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
+ ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
+ return false;
+ }
+ }
+ else {
+ Utils.LOG_WARNING("MAINT HATCH IN WRONG PLACE");
+ }
+ }
+
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ return false;
+ }
+ tAmount++;
+
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
}
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Industrial Centrifuge", "Size: 3x3x3 (Hollow)",
- "Controller (Front Center) [Orange]", "1x Maintenance Hatch (Rear Center) [Green]",
- "The rest can be placed anywhere except the Front [Red]", "1x Input Hatch", "1x Output Hatch",
- "1x Input Bus", "1x Output Bus", "1x [EV] Energy Hatch (Can be higher Tier) [Blue]",
- "Centrifuge Casings for the rest (16 at least)", CORE.GT_Tooltip
- };
+ @SuppressWarnings("static-method")
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ return false;
}
@Override
- public int getMaxEfficiency(final ItemStack aStack) {
+ public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
@Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
@Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1],
- aFacing == aSide
- ? aActive ? GregtechMetaTileEntity_IndustrialCentrifuge.frontFaceActive
- : GregtechMetaTileEntity_IndustrialCentrifuge.frontFace
- : Textures.BlockIcons.CASING_BLOCKS[57]
- };
- }
-
- @SuppressWarnings("static-method")
- public boolean ignoreController(final Block tTileEntity) {
- if (!GregtechMetaTileEntity_IndustrialCentrifuge.controller && tTileEntity == GregTech_API.sBlockMachines) {
- return true;
- }
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialCentrifuge(this.mName);
- }
-
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java
index 5d0ceb53e8..c2e2df7a8f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java
@@ -1,284 +1,278 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
+import static gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks.GTID;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_IndustrialCokeOven extends GregtechMeta_MultiBlockBase {
- private int mLevel = 0;
-
- public GregtechMetaTileEntity_IndustrialCokeOven(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
+public class GregtechMetaTileEntity_IndustrialCokeOven
+ extends GregtechMeta_MultiBlockBase {
+ private int mLevel = 0;
- public GregtechMetaTileEntity_IndustrialCokeOven(final String aName) {
- super(aName);
- }
+ public GregtechMetaTileEntity_IndustrialCokeOven(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
- @Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- int xr = aBaseMetaTileEntity.getXCoord();
- int yr = aBaseMetaTileEntity.getYCoord();
- int zr = aBaseMetaTileEntity.getZCoord();
- this.mLevel = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- this.addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir),
- GregtechMetaCasingBlocks.GTID + 1);
+ public GregtechMetaTileEntity_IndustrialCokeOven(String aName) {
+ super(aName);
+ }
- final byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
- switch (tUsedMeta) {
- case 2:
- this.mLevel = 1;
- break;
- case 3:
- this.mLevel = 2;
- break;
- default:
- return false;
- }
- this.mOutputItems = new ItemStack[12 * this.mLevel];
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if (i != 0 || j != 0) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 1) {
- return false;
- }
- }
- }
- }
- for (int i = -1; i < 2; i++) {
- xr = aBaseMetaTileEntity.getXCoord();
- yr = aBaseMetaTileEntity.getYCoord();
- zr = aBaseMetaTileEntity.getZCoord();
- // Utils.LOG_WARNING("STEP 1 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
- for (int j = -1; j < 2; j++) {
- xr = aBaseMetaTileEntity.getXCoord();
- yr = aBaseMetaTileEntity.getYCoord();
- zr = aBaseMetaTileEntity.getZCoord();
- // Utils.LOG_WARNING("STEP 2 - x ["+xr+"] y ["+yr+"] z
- // ["+zr+"]");
- if (xDir + i != 0 || zDir + j != 0) {
- xr = aBaseMetaTileEntity.getXCoord();
- yr = aBaseMetaTileEntity.getYCoord();
- zr = aBaseMetaTileEntity.getZCoord();
- // Utils.LOG_WARNING("STEP 3 - x ["+xr+"] y ["+yr+"] z
- // ["+zr+"]");
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
- 0, zDir + j);
- if (!this.addMaintenanceToMachineList(tTileEntity, GregtechMetaCasingBlocks.GTID + 1)
- && !this.addInputToMachineList(tTileEntity, GregtechMetaCasingBlocks.GTID + 1)
- && !this.addOutputToMachineList(tTileEntity, GregtechMetaCasingBlocks.GTID + 1)
- && !this.addEnergyInputToMachineList(tTileEntity, GregtechMetaCasingBlocks.GTID + 1)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 1) {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialCokeOven(this.mName);
+ }
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- }
- else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ @Override
+ public String[] getDescription() {
+ return new String[]{"Processes Logs and Coal into Charcoal and Coal Coke.",
+ "Controller Block for the Industrial Coke Oven",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (front middle at bottom)",
+ "8x Heat Resistant/Proof Coils (middle Layer, hollow)",
+ "1x Input (one of bottom)",
+ "1x Output (one of bottom)",
+ "1x Energy Hatch (one of bottom)",
+ "1x Maintenance Hatch (one of bottom)",
+ "1x Muffler Hatch (top middle)",
+ "Structural Coke Oven Casings for the rest",
+ CORE.GT_Tooltip};
+ }
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- }
- else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+1], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+1]};
+ }
- final int tValidOutputSlots = this.getValidOutputSlots(this.getRecipeMap(), tInputs);
- Utils.LOG_WARNING("Valid Output Slots: " + tValidOutputSlots);
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "CokeOven.png");
+ }
- // More than or one input
- if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(
- this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if (tRecipe != null && this.mLevel >= tRecipe.mSpecialValue
- && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- tRecipe.getOutput(0)
- };
- this.mOutputFluids = new FluidStack[] {
- tRecipe.getFluidOutput(0)
- };
- this.updateSlots();
- // Utils.LOG_INFO("Coke oven: True");
- return true;
- }
- }
- // Utils.LOG_INFO("Coke oven: False");
- return false;
- }
- /*
- * public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack>
- * tInputList = getStoredInputs(); if (!tInputList.isEmpty()) { byte tTier =
- * (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
- *
- * int j = 0; this.mOutputItems = new ItemStack[12 * this.mLevel]; for (int
- * i = 0; (i < 100) && (j < this.mOutputItems.length); i++) { if (null !=
- * (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack)
- * tInputList.get(i % tInputList.size()), true, null))) { j++; } } if (j >
- * 0) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) *
- * 1000); this.mEfficiencyIncrease = 10000;
- *
- * this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
- * this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1)); }
- * updateSlots(); return true; } return false; }
- */
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes;
+
+ }
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
+ /* @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }*/
- @Override
- public int getAmountOfOutputs() {
- return 24;
- }
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "CokeOven.png");
- }
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
- /*
- * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return
- * true; }
- */
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+
+ int tValidOutputSlots = this.getValidOutputSlots(getRecipeMap(), tInputs);
+ Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots);
+
+ //More than or one input
+ if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mLevel >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ updateSlots();
+ //Utils.LOG_INFO("Coke oven: True");
+ return true;
+ }
+ }
+ //Utils.LOG_INFO("Coke oven: False");
+ return false;
+ }
+ /*public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ if (!tInputList.isEmpty()) {
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
- @Override
- public String[] getDescription() {
- return new String[] {
- "Processes Logs and Coal into Charcoal and Coal Coke.", "Controller Block for the Industrial Coke Oven",
- "Size: 3x3x3 (Hollow)", "Controller (front middle at bottom)",
- "8x Heat Resistant/Proof Coils (middle Layer, hollow)", "1x Input (one of bottom)",
- "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)",
- "1x Muffler Hatch (top middle)", "Structural Coke Oven Casings for the rest", CORE.GT_Tooltip
- };
- }
+ int j = 0;
+ this.mOutputItems = new ItemStack[12 * this.mLevel];
+ for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) {
+ if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) {
+ j++;
+ }
+ }
+ if (j > 0) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
+ this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
+ this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
+ }
+ updateSlots();
+ return true;
+ }
+ return false;
+ }*/
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xr = aBaseMetaTileEntity.getXCoord();
+ int yr = aBaseMetaTileEntity.getYCoord();
+ int zr = aBaseMetaTileEntity.getZCoord();
+ this.mLevel = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), GTID+1);
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes;
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
+ switch (tUsedMeta) {
+ case 2:
+ this.mLevel = 1;
+ break;
+ case 3:
+ this.mLevel = 2;
+ break;
+ default:
+ return false;
+ }
+ this.mOutputItems = new ItemStack[12 * this.mLevel];
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 1) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ xr = aBaseMetaTileEntity.getXCoord();
+ yr = aBaseMetaTileEntity.getYCoord();
+ zr = aBaseMetaTileEntity.getZCoord();
+ //Utils.LOG_WARNING("STEP 1 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
+ for (int j = -1; j < 2; j++) {
+ xr = aBaseMetaTileEntity.getXCoord();
+ yr = aBaseMetaTileEntity.getYCoord();
+ zr = aBaseMetaTileEntity.getZCoord();
+ //Utils.LOG_WARNING("STEP 2 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ xr = aBaseMetaTileEntity.getXCoord();
+ yr = aBaseMetaTileEntity.getYCoord();
+ zr = aBaseMetaTileEntity.getZCoord();
+ //Utils.LOG_WARNING("STEP 3 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, GTID+1)) && (!addInputToMachineList(tTileEntity, GTID+1)) && (!addOutputToMachineList(tTileEntity, GTID+1)) && (!addEnergyInputToMachineList(tTileEntity, GTID+1))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 1) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
- }
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + 1],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + 1]
- };
- }
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
- /*
- * @Override public int getDamageToComponent(ItemStack aStack) { return 0; }
- */
+ /* @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }*/
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
+ @Override
+ public int getAmountOfOutputs() {
+ return 24;
+ }
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialCokeOven(this.mName);
- }
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java
index 16920395f7..1680006afd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java
@@ -1,9 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.*;
-
-import org.apache.commons.lang3.ArrayUtils;
-
+import static gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks.GTID;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -17,154 +14,160 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_IndustrialElectrolyzer extends GregtechMeta_MultiBlockBase {
- ArrayList<ItemStack> tInputList = this.getStoredInputs();
-
- GT_Recipe mLastRecipe;
+import org.apache.commons.lang3.ArrayUtils;
- public GregtechMetaTileEntity_IndustrialElectrolyzer(final int aID, final String aName,
- final String aNameRegional) {
+public class GregtechMetaTileEntity_IndustrialElectrolyzer
+extends GregtechMeta_MultiBlockBase {
+ public GregtechMetaTileEntity_IndustrialElectrolyzer(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_IndustrialElectrolyzer(final String aName) {
+ public GregtechMetaTileEntity_IndustrialElectrolyzer(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addMaintenanceToMachineList(tTileEntity, 62)
- && !this.addMufflerToMachineList(tTileEntity, 62)
- && !this.addInputToMachineList(tTileEntity, 62)
- && !this.addOutputToMachineList(tTileEntity, 62)
- && !this.addEnergyInputToMachineList(tTileEntity, 62)) {
- final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- final byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (tBlock != ModBlocks.blockCasingsMisc || tMeta != 5) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 16;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialElectrolyzer(this.mName);
}
@Override
- public boolean checkRecipe(final ItemStack aStack) { // TODO - Add Check to
- // make sure Fluid
- // output isn't full
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- }
- else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Industrial Electrolyzer",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (front centered)",
+ "1x Input Bus (anywhere)",
+ "1x Output Bus (anywhere)",
+ "1x Input Hatch (anywhere)",
+ "1x Output Hatch (anywhere)",
+ "1x Energy Hatch (anywhere)",
+ "1x Maintenance Hatch (anywhere)",
+ "1x Muffler (anywhere)",
+ "Electrolyzer Casings for the rest (16 at least!)",
+ CORE.GT_Tooltip};
+ }
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- }
- else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+5], new GT_RenderedTexture(aActive ? Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE : Textures.BlockIcons.STEAM_TURBINE_SIDE)};
}
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+5]};
+ }
- final int tValidOutputSlots = this.getValidOutputSlots(this.getRecipeMap(), tInputs);
- Utils.LOG_WARNING("Valid Output Slots: " + tValidOutputSlots);
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "IndustrialElectrolyzer.png");
+ }
- // More than or one input
- if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.findRecipe(
- this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if (tRecipe != null && 7500 >= tRecipe.mSpecialValue
- && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ GT_Recipe mLastRecipe;
- ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
+ @Override
+ public boolean checkRecipe(ItemStack aStack) { //TODO - Add Check to make sure Fluid output isn't full
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+
+ int tValidOutputSlots = this.getValidOutputSlots(getRecipeMap(), tInputs);
+ Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots);
+
+ //More than or one input
+ if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (7500 >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
for (int h = 0; h < tRecipe.mOutputs.length; h++) {
tOut[h] = tRecipe.getOutput(h).copy();
tOut[h].stackSize = 0;
}
- FluidStack tFOut = null;
- if (tRecipe.getFluidOutput(0) != null) {
- tFOut = tRecipe.getFluidOutput(0).copy();
- }
+ FluidStack tFOut = null;
+ if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy();
for (int f = 0; f < tOut.length; f++) {
if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
for (int g = 0; g < 1; g++) {
- if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
}
}
}
if (tFOut != null) {
- final int tSize = tFOut.amount;
+ int tSize = tFOut.amount;
tFOut.amount = tSize * 1;
}
-
- final List<ItemStack> overStacks = new ArrayList<ItemStack>();
+
+ List<ItemStack> overStacks = new ArrayList<ItemStack>();
for (int f = 0; f < tOut.length; f++) {
if (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
- final ItemStack tmp = tOut[f].copy();
+ ItemStack tmp = tOut[f].copy();
tmp.stackSize = tmp.getMaxStackSize();
tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
overStacks.add(tmp);
@@ -176,100 +179,76 @@ public class GregtechMetaTileEntity_IndustrialElectrolyzer extends GregtechMeta_
tmp = overStacks.toArray(tmp);
tOut = ArrayUtils.addAll(tOut, tmp);
}
- final List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (final ItemStack tS : tOut) {
- if (tS.stackSize > 0) {
- tSList.add(tS);
- }
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOut) {
+ if (tS.stackSize > 0) tSList.add(tS);
}
tOut = tSList.toArray(new ItemStack[tSList.size()]);
this.mOutputItems = tOut;
- this.mOutputFluids = new FluidStack[] {
- tFOut
- };
- this.updateSlots();
-
- /*
- * this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0),
- * tRecipe.getOutput(1)}; updateSlots();
- */
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
+ this.mOutputFluids = new FluidStack[]{tFOut};
+ updateSlots();
+
+ /* this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ updateSlots();*/
+ return true;
+ }
+ }
+ return false;
+ }
@Override
- public int getAmountOfOutputs() {
- return 1;
- }
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "IndustrialElectrolyzer.png");
- }
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Industrial Electrolyzer", "Size: 3x3x3 (Hollow)",
- "Controller (front centered)", "1x Input Bus (anywhere)", "1x Output Bus (anywhere)",
- "1x Input Hatch (anywhere)", "1x Output Hatch (anywhere)", "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)", "1x Muffler (anywhere)",
- "Electrolyzer Casings for the rest (16 at least!)", CORE.GT_Tooltip
- };
- }
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 62)) && (!addMufflerToMachineList(tTileEntity, 62)) && (!addInputToMachineList(tTileEntity, 62)) && (!addOutputToMachineList(tTileEntity, 62)) && (!addEnergyInputToMachineList(tTileEntity, 62))) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (((tBlock != ModBlocks.blockCasingsMisc) || (tMeta != 5))) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
+ }
@Override
- public int getMaxEfficiency(final ItemStack aStack) {
+ public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
@Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
@Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + 5], new GT_RenderedTexture(aActive
- ? Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE : Textures.BlockIcons.STEAM_TURBINE_SIDE)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + 5]
- };
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialElectrolyzer(this.mName);
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 20) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
- }
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java
index 787aa61856..68b2f647ee 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.*;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -17,52 +15,182 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
-public class GregtechMetaTileEntity_IndustrialMacerator extends GregtechMeta_MultiBlockBase {
+public class GregtechMetaTileEntity_IndustrialMacerator
+extends GregtechMeta_MultiBlockBase {
private static boolean controller;
- public GregtechMetaTileEntity_IndustrialMacerator(final int aID, final String aName, final String aNameRegional) {
+ public GregtechMetaTileEntity_IndustrialMacerator(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_IndustrialMacerator(final String aName) {
+ public GregtechMetaTileEntity_IndustrialMacerator(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialMacerator(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Industrial Maceration Stack",
+ "Size[WxHxL]: 3x6x3 (Hollow)",
+ "Controller (Center Bottom)",
+ "1x Input Bus (Any bottom layer casing)",
+ "5x Output Bus (Any casing besides bottom layer)",
+ "1x Maintenance Hatch (Any casing)",
+ "1x Energy Hatch (Any casing)",
+ "Maceration Stack Casings for the rest (26 at least!)",
+ CORE.GT_Tooltip};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[64], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_MatterFab_Active : TexturesGtBlock.Overlay_MatterFab)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[64]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MacerationStack.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ }
+
+ /*@Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }*/
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.3f + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 1.2F - tRandom.nextFloat() * 1.6F, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+
+ //Get inputs.
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+
+ //Temp var
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ //Don't check the recipe if someone got around the output bus size check.
+ if (this.mOutputBusses.size() != 5){
+ return false;
+ }
+
+ //Make a recipe instance for the rest of the method.
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
+
+
+ int tValidOutputSlots = this.getValidOutputSlots(getRecipeMap(), tInputs);
+ Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots);
+
+ //More than or one input
+ if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
+ if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) {
+ Utils.LOG_WARNING("Valid Recipe found - size "+tRecipe.mOutputs.length);
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+
+ this.mEUt = (-tRecipe.mEUt);
+ this.mMaxProgresstime = Math.max(1, (tRecipe.mDuration/5));
+ ItemStack[] outputs = new ItemStack[tRecipe.mOutputs.length];
+ for (int i = 0; i < tRecipe.mOutputs.length; i++){
+ if (i==0) {
+ Utils.LOG_WARNING("Adding the default output");
+ outputs[0] = tRecipe.getOutput(i);
+ }
+ else if (getBaseMetaTileEntity().getRandomNumber(7500) < tRecipe.getOutputChance(i)){
+ Utils.LOG_WARNING("Adding a bonus output");
+ outputs[i] = tRecipe.getOutput(i);
+ }
+ else {
+ Utils.LOG_WARNING("Adding null output");
+ outputs[i] = null;
+ }
+ }
+
+ this.mOutputItems = outputs;
+ sendLoopStart((byte) 20);
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
return false;
}
int tAmount = 0;
- GregtechMetaTileEntity_IndustrialMacerator.controller = false;
+ controller = false;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
for (int h = 0; h < 6; h++) {
- if (!(i == 0 && j == 0 && h > 0 && h < 5))// ((h >
- // 0)&&(h<5)) ||
- // (((xDir + i
- // != 0) ||
- // (zDir + j !=
- // 0)) && ((i !=
- // 0) || (j !=
- // 0)))
+ if (!(i == 0 && j == 0 && (h > 0 && h < 5)))//((h > 0)&&(h<5)) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))
{
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addMaintenanceToMachineList(tTileEntity, 64)
- && !this.addInputToMachineList(tTileEntity, 64)
- && !this.addOutputToMachineList(tTileEntity, 64)
- && !this.addEnergyInputToMachineList(tTileEntity, 64)
- && !this.ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 64)) && (!addInputToMachineList(tTileEntity, 64)) && (!addOutputToMachineList(tTileEntity, 64)) && (!addEnergyInputToMachineList(tTileEntity, 64)) && (!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
Utils.LOG_INFO("Returned False 1");
return false;
}
@@ -80,18 +208,17 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends GregtechMeta_Mul
Utils.LOG_INFO("Returned False 3");
return false;
}
- final int height = this.getBaseMetaTileEntity().getYCoord();
+ int height = this.getBaseMetaTileEntity().getYCoord();
if (this.mInputBusses.get(0).getBaseMetaTileEntity().getYCoord() != height) {
- Utils.LOG_INFO("height: " + height + " | Returned False 4");
+ Utils.LOG_INFO("height: "+height+" | Returned False 4");
return false;
}
- final GT_MetaTileEntity_Hatch_OutputBus[] tmpHatches = new GT_MetaTileEntity_Hatch_OutputBus[5];
+ GT_MetaTileEntity_Hatch_OutputBus[] tmpHatches = new GT_MetaTileEntity_Hatch_OutputBus[5];
for (int i = 0; i < this.mOutputBusses.size(); i++) {
- final int hatchNumber = this.mOutputBusses.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height;
+ int hatchNumber = this.mOutputBusses.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height;
if (tmpHatches[hatchNumber] == null) {
tmpHatches[hatchNumber] = this.mOutputBusses.get(i);
- }
- else {
+ } else {
Utils.LOG_INFO("Returned False 5");
return false;
}
@@ -103,181 +230,35 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends GregtechMeta_Mul
return tAmount >= 26;
}
- @Override
- public boolean checkRecipe(final ItemStack aStack) {
-
- // Get inputs.
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- }
- else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
-
- // Temp var
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- // Don't check the recipe if someone got around the output bus size
- // check.
- if (this.mOutputBusses.size() != 5) {
- return false;
- }
-
- // Make a recipe instance for the rest of the method.
- final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(this.getBaseMetaTileEntity(),
- false, 9223372036854775807L, null, tInputs);
-
- final int tValidOutputSlots = this.getValidOutputSlots(this.getRecipeMap(), tInputs);
- Utils.LOG_WARNING("Valid Output Slots: " + tValidOutputSlots);
-
- // More than or one input
- if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
- if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) {
- Utils.LOG_WARNING("Valid Recipe found - size " + tRecipe.mOutputs.length);
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
-
- this.mEUt = -tRecipe.mEUt;
- this.mMaxProgresstime = Math.max(1, tRecipe.mDuration / 5);
- final ItemStack[] outputs = new ItemStack[tRecipe.mOutputs.length];
- for (int i = 0; i < tRecipe.mOutputs.length; i++) {
- if (i == 0) {
- Utils.LOG_WARNING("Adding the default output");
- outputs[0] = tRecipe.getOutput(i);
- }
- else if (this.getBaseMetaTileEntity().getRandomNumber(7500) < tRecipe.getOutputChance(i)) {
- Utils.LOG_WARNING("Adding a bonus output");
- outputs[i] = tRecipe.getOutput(i);
- }
- else {
- Utils.LOG_WARNING("Adding null output");
- outputs[i] = null;
- }
- }
-
- this.mOutputItems = outputs;
- this.sendLoopStart((byte) 20);
- this.updateSlots();
- return true;
- }
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
}
return false;
}
@Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 16;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MacerationStack.png");
- }
-
- /*
- * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return
- * true; }
- */
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Industrial Maceration Stack", "Size[WxHxL]: 3x6x3 (Hollow)",
- "Controller (Center Bottom)", "1x Input Bus (Any bottom layer casing)",
- "5x Output Bus (Any casing besides bottom layer)", "1x Maintenance Hatch (Any casing)",
- "1x Energy Hatch (Any casing)", "Maceration Stack Casings for the rest (26 at least!)", CORE.GT_Tooltip
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
+ public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
@Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
@Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ public int getAmountOfOutputs() {
+ return 16;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[64], new GT_RenderedTexture(
- aActive ? TexturesGtBlock.Overlay_MatterFab_Active : TexturesGtBlock.Overlay_MatterFab)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[64]
- };
- }
-
- public boolean ignoreController(final Block tTileEntity) {
- if (!GregtechMetaTileEntity_IndustrialMacerator.controller && tTileEntity == GregTech_API.sBlockMachines) {
- return true;
- }
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
public boolean isOverclockerUpgradable() {
return true;
}
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialMacerator(this.mName);
- }
-
- @Override
- public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()
- && aBaseMetaTileEntity.getFrontFacing() != 1 && aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0
- && !aBaseMetaTileEntity.getOpacityAtSide((byte) 1)) {
- final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("smoke",
- aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F,
- aBaseMetaTileEntity.getYCoord() + 0.3f + tRandom.nextFloat() * 0.2F,
- aBaseMetaTileEntity.getZCoord() + 1.2F - tRandom.nextFloat() * 1.6F, 0.0D, 0.0D, 0.0D);
- }
- }
-
- @Override
- public void startProcess() {
- this.sendLoopStart((byte) 1);
- }
-
- @Override
- public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
- }
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java
index ee15dcd83c..96095698fa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
+import static gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks.GTID;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -16,200 +14,186 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
-import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_MultiBlockBase {
- public GregtechMetaTileEntity_IndustrialPlatePress(final int aID, final String aName, final String aNameRegional) {
+public class GregtechMetaTileEntity_IndustrialPlatePress
+extends GregtechMeta_MultiBlockBase {
+ public GregtechMetaTileEntity_IndustrialPlatePress(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_IndustrialPlatePress(final String aName) {
+ public GregtechMetaTileEntity_IndustrialPlatePress(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addMaintenanceToMachineList(tTileEntity, 61)
- && !this.addMufflerToMachineList(tTileEntity, 61)
- && !this.addInputToMachineList(tTileEntity, 61)
- && !this.addOutputToMachineList(tTileEntity, 61)
- && !this.addEnergyInputToMachineList(tTileEntity, 61)) {
- final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- final byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (tBlock != ModBlocks.blockCasingsMisc || tMeta != 4) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 16;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialPlatePress(this.mName);
}
@Override
- public boolean checkRecipe(final ItemStack aStack) { // TODO - Add Check to
- // make sure Fluid
- // output isn't full
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
- tInputList.remove(j--);
- }
- else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
- tFluidList.remove(j--);
- }
- else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
-
- final int tValidOutputSlots = this.getValidOutputSlots(this.getRecipeMap(), tInputs);
- Utils.LOG_WARNING("Valid Output Slots: " + tValidOutputSlots);
- // More than or one input
- if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBenderRecipes.findRecipe(this.getBaseMetaTileEntity(),
- false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if (tRecipe != null && 2500 >= tRecipe.mSpecialValue
- && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- tRecipe.getOutput(0), tRecipe.getOutput(1)
- };
- this.updateSlots();
- return true;
- }
- }
- return false;
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Material Press",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (front centered)",
+ "1x Input Bus (anywhere)",
+ "1x Output Bus (anywhere)",
+ "1x Energy Hatch (anywhere)",
+ "1x Maintenance Hatch (anywhere)",
+ "1x Muffler (anywhere)",
+ "Material Press Machine Casings for the rest (16 at least!)",
+ CORE.GT_Tooltip};
}
@Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+4], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+4]};
}
@Override
- public int getAmountOfOutputs() {
- return 1;
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MaterialPress.png");
}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MaterialPress.png");
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Material Press", "Size: 3x3x3 (Hollow)", "Controller (front centered)",
- "1x Input Bus (anywhere)", "1x Output Bus (anywhere)", "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)", "1x Muffler (anywhere)",
- "Material Press Machine Casings for the rest (16 at least!)", CORE.GT_Tooltip
- };
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
}
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
+ @Override
+ public boolean checkRecipe(ItemStack aStack) { //TODO - Add Check to make sure Fluid output isn't full
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+
+ int tValidOutputSlots = this.getValidOutputSlots(getRecipeMap(), tInputs);
+ Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots);
+ //More than or one input
+ if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBenderRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (2500 >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
@Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
@Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
- }
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 61)) && (!addMufflerToMachineList(tTileEntity, 61)) && (!addInputToMachineList(tTileEntity, 61)) && (!addOutputToMachineList(tTileEntity, 61)) && (!addEnergyInputToMachineList(tTileEntity, 61))) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (((tBlock != ModBlocks.blockCasingsMisc) || (tMeta != 4))) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
+ }
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + 4],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[GregtechMetaCasingBlocks.GTID + 4]
- };
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialPlatePress(this.mName);
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 20) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
- }
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java
index dadb82388d..ee49b7fcb9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java
@@ -1,12 +1,12 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.*;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -14,116 +14,167 @@ import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
+
+import java.util.ArrayList;
+
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-public class GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_MultiBlockBase {
+public class GregtechMetaTileEntity_IndustrialSinter
+extends GT_MetaTileEntity_MultiBlockBase {
+
RenderBlocks asdasd = RenderBlocks.getInstance();
-
- public GregtechMetaTileEntity_IndustrialSinter(final int aID, final String aName, final String aNameRegional) {
+
+ public GregtechMetaTileEntity_IndustrialSinter(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_IndustrialSinter(final String aName) {
+ public GregtechMetaTileEntity_IndustrialSinter(String aName) {
super(aName);
}
- private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) {
- return this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex());
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialSinter(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Industrial Sinter Furnace",
+ "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)",
+ "2x Input Bus (side centered)",
+ "2x Output Bus (side centered)",
+ "1x Energy Hatch (top or bottom centered)",
+ "1x Maintenance Hatch (back centered)",
+ "Sinter Furnace Casings for the rest (32 at least!)",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[63], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[63]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "WireFactory.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
}
- private boolean addToMachineList(final IGregTechTileEntity tTileEntity) {
- return this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())
- || this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())
- || this.addOutputToMachineList(tTileEntity, this.getCasingTextureIndex())
- || this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex());
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (ItemStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int controllerX = aBaseMetaTileEntity.getXCoord();
- final int controllerY = aBaseMetaTileEntity.getYCoord();
- final int controllerZ = aBaseMetaTileEntity.getZCoord();
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int controllerX = aBaseMetaTileEntity.getXCoord();
+ int controllerY = aBaseMetaTileEntity.getYCoord();
+ int controllerZ = aBaseMetaTileEntity.getZCoord();
- final byte tSide = this.getBaseMetaTileEntity().getBackFacing();
- if (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)
- && this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2)
- && this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(),
- 3)) {
+ byte tSide = getBaseMetaTileEntity().getBackFacing();
+ if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3)))) {
int tAirCount = 0;
for (byte i = -1; i < 2; i = (byte) (i + 1)) {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
for (byte k = -1; k < 2; k = (byte) (k + 1)) {
- if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) {
- Utils.LOG_INFO("Found Air at: " + (controllerX + i) + " " + (controllerY + k) + " "
- + (controllerZ + k));
- // if (aBaseMetaTileEntity.getWorld().isRemote){
- // asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock,
- // (controllerX+i), (controllerY+k),
- // (controllerZ+k));
- // UtilsRendering.drawBlockInWorld((controllerX+i),
- // (controllerY+k), (controllerZ+k),
- // Color.YELLOW_GREEN);
- // }
+ if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
+ Utils.LOG_INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k));
+ //if (aBaseMetaTileEntity.getWorld().isRemote){
+ //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, (controllerX+i), (controllerY+k), (controllerZ+k));
+ //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.YELLOW_GREEN);
+ //}
tAirCount++;
}
}
}
}
if (tAirCount != 10) {
- Utils.LOG_INFO("False. Air != 10. Air == " + tAirCount);
- // return false;
+ Utils.LOG_INFO("False. Air != 10. Air == "+tAirCount);
+ //return false;
}
for (byte i = 2; i < 6; i = (byte) (i + 1)) {
- // UtilsRendering.drawBlockInWorld((controllerX+i),
- // (controllerY), (controllerZ), Color.LIME_GREEN);
+ //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ), Color.LIME_GREEN);
IGregTechTileEntity tTileEntity;
- if (null != (tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))
- && tTileEntity.getFrontFacing() == this.getBaseMetaTileEntity().getFrontFacing()
- && tTileEntity.getMetaTileEntity() != null
- && tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialSinter) {
- // Utils.LOG_INFO("False 1");
+ if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
+ (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
+ ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialSinter))) {
+ //Utils.LOG_INFO("False 1");
return false;
}
}
- final int tX = this.getBaseMetaTileEntity().getXCoord();
- final int tY = this.getBaseMetaTileEntity().getYCoord();
- final int tZ = this.getBaseMetaTileEntity().getZCoord();
+ int tX = getBaseMetaTileEntity().getXCoord();
+ int tY = getBaseMetaTileEntity().getYCoord();
+ int tZ = getBaseMetaTileEntity().getZCoord();
for (byte i = -1; i < 2; i = (byte) (i + 1)) {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
- if (i != 0 || j != 0) {
+ if ((i != 0) || (j != 0)) {
for (byte k = 0; k < 5; k = (byte) (k + 1)) {
- // UtilsRendering.drawBlockInWorld((controllerX+i),
- // (controllerY+k), (controllerZ+k), Color.ORANGE);
- if ((i == 0 || j == 0) && (k == 1 || k == 2 || k == 3)) {
- // UtilsRendering.drawBlockInWorld((controllerX+i),
- // (controllerY+k), (controllerZ+k),
- // Color.TOMATO);
- if (this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i),
- tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()
- && this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k
- : tSide == 4 ? -k : i), tY + j,
- tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta()) {
- }
- else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(
- tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j,
- tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))
- && !this.addEnergyInputToMachineList(this.getBaseMetaTileEntity()
- .getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i),
- tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) {
+ //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.ORANGE);
+ if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) {
+ //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.TOMATO);
+ if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ }
+ else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!addEnergyInputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) {
Utils.LOG_INFO("False 2");
return false;
}
- }
- else if (this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i),
- tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()
- && this.getBaseMetaTileEntity().getMetaID(
- tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j,
- tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta()) {
- }
+ }
+ else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ }
else {
Utils.LOG_INFO("False 3");
return false;
@@ -139,17 +190,14 @@ public class GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_M
if (this.mInputBusses.size() != 2 || this.mOutputBusses.size() != 2) {
Utils.LOG_INFO("Incorrect amount of Input & Output busses.");
return false;
- }
+ }
this.mMaintenanceHatches.clear();
- final IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 4);
- if (tTileEntity != null && tTileEntity.getMetaTileEntity() != null) {
- if (tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 4);
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this
- .getCasingTextureIndex();
- }
- else {
+ ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back.");
return false;
}
@@ -158,8 +206,7 @@ public class GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_M
Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches.");
return false;
}
- }
- else {
+ } else {
Utils.LOG_INFO("False 5");
return false;
}
@@ -168,52 +215,18 @@ public class GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_M
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (final ItemStack tInput : tInputList) {
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
- final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(),
- false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[] {
- tInput
- });
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[] {
- tInput
- })) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- tRecipe.getOutput(0)
- };
- this.updateSlots();
- return true;
- }
- }
- }
- return false;
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
}
@Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
}
@Override
@@ -221,81 +234,30 @@ public class GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_M
return 1;
}
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
public Block getCasingBlock() {
return ModBlocks.blockCasingsMisc;
}
+
public byte getCasingMeta() {
return 6;
}
+
public byte getCasingTextureIndex() {
return 63;
}
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "WireFactory.png");
- }
-
- @Override
- public int getDamageToComponent(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Industrial Sinter Furnace", "Size: 3x5x3 [WxLxH] (Hollow)",
- "Controller (front centered)", "2x Input Bus (side centered)", "2x Output Bus (side centered)",
- "1x Energy Hatch (top or bottom centered)", "1x Maintenance Hatch (back centered)",
- "Sinter Furnace Casings for the rest (32 at least!)", CORE.GT_Tooltip
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
+ private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
}
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[63],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[63]
- };
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialSinter(this.mName);
+ private boolean addEnergyInputToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addEnergyInputToMachineList(tTileEntity, getCasingTextureIndex())));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java
index f9a633bff5..ca300ba277 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -16,42 +14,117 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+
+import java.util.ArrayList;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_MultiBlockBase {
- public GregtechMetaTileEntity_IndustrialWireMill(final int aID, final String aName, final String aNameRegional) {
+public class GregtechMetaTileEntity_IndustrialWireMill
+extends GregtechMeta_MultiBlockBase {
+ public GregtechMetaTileEntity_IndustrialWireMill(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_IndustrialWireMill(final String aName) {
+ public GregtechMetaTileEntity_IndustrialWireMill(String aName) {
super(aName);
}
- private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) {
- return this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex());
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialWireMill(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Industrial Wire Factory",
+ "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)",
+ "2x Input Bus (side centered)",
+ "2x Output Bus (side centered)",
+ "1x Energy Hatch (top or bottom centered)",
+ "1x Maintenance Hatch (back centered)",
+ "Wire Factory Casings for the rest (32 at least!)",
+ CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[63], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[63]};
}
- private boolean addToMachineList(final IGregTechTileEntity tTileEntity) {
- return this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())
- || this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())
- || this.addOutputToMachineList(tTileEntity, this.getCasingTextureIndex())
- || this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex());
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "WireFactory.png");
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final byte tSide = this.getBaseMetaTileEntity().getBackFacing();
- if (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)
- && this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2)
- && this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(),
- 3)) {
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (ItemStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput});
+ if (tRecipe != null) {
+
+ int tValidOutputSlots = this.getValidOutputSlots(getRecipeMap(), new ItemStack[]{tInput});
+ Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots);
+ //More than or one input
+ if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
+
+ if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ byte tSide = getBaseMetaTileEntity().getBackFacing();
+ if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3)))) {
int tAirCount = 0;
for (byte i = -1; i < 2; i = (byte) (i + 1)) {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
for (byte k = -1; k < 2; k = (byte) (k + 1)) {
- if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) {
+ if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
tAirCount++;
}
}
@@ -63,44 +136,30 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_Mult
}
for (byte i = 2; i < 6; i = (byte) (i + 1)) {
IGregTechTileEntity tTileEntity;
- if (null != (tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))
- && tTileEntity.getFrontFacing() == this.getBaseMetaTileEntity().getFrontFacing()
- && tTileEntity.getMetaTileEntity() != null
- && tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialWireMill) {
- // Utils.LOG_INFO("False 1");
+ if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
+ (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
+ ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialWireMill))) {
+ //Utils.LOG_INFO("False 1");
return false;
}
}
- final int tX = this.getBaseMetaTileEntity().getXCoord();
- final int tY = this.getBaseMetaTileEntity().getYCoord();
- final int tZ = this.getBaseMetaTileEntity().getZCoord();
+ int tX = getBaseMetaTileEntity().getXCoord();
+ int tY = getBaseMetaTileEntity().getYCoord();
+ int tZ = getBaseMetaTileEntity().getZCoord();
for (byte i = -1; i < 2; i = (byte) (i + 1)) {
for (byte j = -1; j < 2; j = (byte) (j + 1)) {
- if (i != 0 || j != 0) {
+ if ((i != 0) || (j != 0)) {
for (byte k = 0; k < 5; k = (byte) (k + 1)) {
- if ((i == 0 || j == 0) && (k == 1 || k == 2 || k == 3)) {
- if (this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i),
- tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()
- && this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k
- : tSide == 4 ? -k : i), tY + j,
- tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta()) {
- }
- else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(
- tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j,
- tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))
- && !this.addEnergyInputToMachineList(this.getBaseMetaTileEntity()
- .getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i),
- tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) {
+ if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) {
+ if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ }
+ else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!addEnergyInputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) {
Utils.LOG_INFO("False 2");
return false;
}
- }
- else if (this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i),
- tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()
- && this.getBaseMetaTileEntity().getMetaID(
- tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j,
- tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta()) {
- }
+ }
+ else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ }
else {
Utils.LOG_INFO("False 3");
return false;
@@ -116,17 +175,14 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_Mult
if (this.mInputBusses.size() != 2 || this.mOutputBusses.size() != 2) {
Utils.LOG_INFO("Incorrect amount of Input & Output busses.");
return false;
- }
+ }
this.mMaintenanceHatches.clear();
- final IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 4);
- if (tTileEntity != null && tTileEntity.getMetaTileEntity() != null) {
- if (tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 4);
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this
- .getCasingTextureIndex();
- }
- else {
+ ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back.");
return false;
}
@@ -135,8 +191,7 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_Mult
Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches.");
return false;
}
- }
- else {
+ } else {
Utils.LOG_INFO("False 5");
return false;
}
@@ -145,61 +200,13 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_Mult
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
- for (final ItemStack tInput : tInputList) {
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
- final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(),
- false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[] {
- tInput
- });
- if (tRecipe != null) {
-
- final int tValidOutputSlots = this.getValidOutputSlots(this.getRecipeMap(), new ItemStack[] {
- tInput
- });
- Utils.LOG_WARNING("Valid Output Slots: " + tValidOutputSlots);
- // More than or one input
- if (tInputList.size() > 0 && tValidOutputSlots >= 1) {
-
- if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[] {
- tInput
- })) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- tRecipe.getOutput(0)
- };
- this.updateSlots();
- return true;
- }
- }
- }
- }
- return false;
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
}
@Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
}
@Override
@@ -207,71 +214,30 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_Mult
return 1;
}
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
public Block getCasingBlock() {
return ModBlocks.blockCasingsMisc;
}
+
public byte getCasingMeta() {
return 6;
}
+
public byte getCasingTextureIndex() {
return 63;
}
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "WireFactory.png");
+ private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
}
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Industrial Wire Factory", "Size: 3x5x3 [WxLxH] (Hollow)",
- "Controller (front centered)", "2x Input Bus (side centered)", "2x Output Bus (side centered)",
- "1x Energy Hatch (top or bottom centered)", "1x Maintenance Hatch (back centered)",
- "Wire Factory Casings for the rest (32 at least!)", CORE.GT_Tooltip
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[63],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[63]
- };
- }
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IndustrialWireMill(this.mName);
+
+ private boolean addEnergyInputToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addEnergyInputToMachineList(tTileEntity, getCasingTextureIndex())));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java
index 1ae8e60885..aa7aecc8c5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java
@@ -23,460 +23,358 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
-public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity {
- private static final ITexture[] FACING_SIDE = {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)
- };
- private static final ITexture[] FACING_FRONT = {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)
- };
- private static final ITexture[] FACING_ACTIVE = {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)
- };
- public int mMaxProgresstime = 0;
- public int mUpdate = 30;
- public int mProgresstime = 0;
- public boolean mMachine = false;
- public ItemStack mOutputItem1;
- public ItemStack mOutputItem2;
-
- public GregtechMetaTileEntity_IronBlastFurnace(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 4);
- }
-
- public GregtechMetaTileEntity_IronBlastFurnace(final String aName) {
- super(aName, 4);
- }
-
- private void addOutputProducts() {
- if (this.mOutputItem1 != null) {
- if (this.mInventory[2] == null) {
- this.mInventory[2] = GT_Utility.copy(new Object[] {
- this.mOutputItem1
- });
- }
- else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
- this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(),
- this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
- }
- }
- if (this.mOutputItem2 != null) {
- if (this.mInventory[3] == null) {
- this.mInventory[3] = GT_Utility.copy(new Object[] {
- this.mOutputItem2
- });
- }
- else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
- this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(),
- this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
- }
- }
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
- return GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()
- && super.allowCoverOnSide(aSide, aCoverID);
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return aIndex > 1;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- if (aIndex < 2) {
- }
- return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
- }
-
- private boolean checkMachine() {
- final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 4; j++) { // This is height
- for (int k = -1; k < 2; k++) {
- if (xDir + i != 0 || j != 0 || zDir + k != 0) {
- if (i != 0 || j == -1 || k != 0) {
- if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j,
- zDir + k) != ModBlocks.blockCasingsMisc
- || this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10) {
- return false;
- }
- }
- else if (!GT_Utility.arrayContains(
- this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[] {
- Blocks.lava, Blocks.flowing_lava, null
- }) && !this.getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k)) {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- private boolean checkRecipe() {
- if (!this.mMachine) {
- return false;
- }
- if (this.mInventory[0] != null && this.mInventory[1] != null && this.mInventory[0].stackSize >= 1) {
- if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron")) {
- if (this.mInventory[1].getItem() == Items.coal && this.mInventory[1].stackSize >= 4
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh,
- 4L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3);
- this.mMaxProgresstime = 36000;
- return true;
- }
- if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")
- && this.mInventory[1].stackSize >= 2
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash,
- 4L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3);
- this.mMaxProgresstime = 4800 * 5;
- return true;
- }
- if (this.mInventory[0].stackSize >= 9
- && (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))
- && this.mInventory[1].stackSize >= 4
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh,
- 4L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 9);
- this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3);
- this.mMaxProgresstime = 64800 * 5;
- return true;
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
- if (this.mInventory[1].getItem() == Items.coal && this.mInventory[1].stackSize >= 2
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh,
- 2L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3);
- this.mMaxProgresstime = 3600 * 5;
- return true;
- }
- if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")
- && this.mInventory[1].stackSize >= 1
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash,
- 2L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 1 * 3);
- this.mMaxProgresstime = 2400 * 5;
- return true;
- }
- if (this.mInventory[0].stackSize >= 9
- && (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))
- && this.mInventory[1].stackSize >= 2
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh,
- 2L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 9);
- this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3);
- this.mMaxProgresstime = 32400 * 5;
- return true;
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
- if (this.mInventory[1].getItem() == Items.coal && this.mInventory[1].stackSize >= 36
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh,
- 4L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 64);
- this.mMaxProgresstime = 64800 * 9;
- return true;
- }
- if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")
- && this.mInventory[1].stackSize >= 18
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 18 * 3);
- this.mMaxProgresstime = 43200 * 5;
- return true;
- }
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")
- || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))
- && this.mInventory[1].stackSize >= 4
- && this.spaceForOutput(
- this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L),
- this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh,
- 4L))) {
- this.getBaseMetaTileEntity().decrStackSize(0, 1);
- this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3);
- this.mMaxProgresstime = 64800 * 5;
- return true;
- }
- }
- }
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- return false;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
+public class GregtechMetaTileEntity_IronBlastFurnace
+ extends MetaTileEntity {
+ private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)};
+ private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off)};
+ private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On)};
+ public int mMaxProgresstime = 0;
+ public int mUpdate = 30;
+ public int mProgresstime = 0;
+ public boolean mMachine = false;
+ public ItemStack mOutputItem1;
+ public ItemStack mOutputItem2;
+
+ public GregtechMetaTileEntity_IronBlastFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 4);
+ }
+
+ public GregtechMetaTileEntity_IronBlastFurnace(String aName) {
+ super(aName, 4);
+ }
+
+ @Override
public String[] getDescription() {
- return new String[] {
- "Sloooowly, Skip the Bronze age, Get some Steel!", "Multiblock: 3x3x5 hollow with opening on top",
- "40 Iron Plated Bricks required", "----", "Even though Iron melts hotter than bronze,",
- "this machine is to help players skip looking", "for tin and copper, which are not as common",
- "as Iron is. This machine takes 5x longer than the bronze", "blast furnace as a result.", "----",
- CORE.GT_Tooltip
- };
- }
-
- @Override
- public int getProgresstime() {
- return this.mProgresstime;
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return aActive ? GregtechMetaTileEntity_IronBlastFurnace.FACING_ACTIVE
- : GregtechMetaTileEntity_IronBlastFurnace.FACING_FRONT;
- }
- return GregtechMetaTileEntity_IronBlastFurnace.FACING_SIDE;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 0;
- }
-
- @Override
- public int increaseProgress(final int aProgress) {
- this.mProgresstime += aProgress;
- return this.mMaxProgresstime - this.mProgresstime;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
+ return new String[]{"Sloooowly, Skip the Bronze age, Get some Steel!",
+ "Multiblock: 3x3x5 hollow with opening on top",
+ "40 Iron Plated Bricks required",
+ "----",
+ "Even though Iron melts hotter than bronze,",
+ "this machine is to help players skip looking",
+ "for tin and copper, which are not as common",
+ "as Iron is. This machine takes 5x longer than the bronze",
+ "blast furnace as a result.",
+ "----",
+ CORE.GT_Tooltip};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return aActive ? FACING_ACTIVE : FACING_FRONT;
+ }
+ return FACING_SIDE;
+ }
+
+ @Override
+ public boolean isSteampowered() {
+ return false;
+ }
- @Override
+ @Override
public boolean isElectric() {
- return false;
- }
+ return false;
+ }
- @Override
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
public boolean isEnetInput() {
- return false;
- }
+ return false;
+ }
- @Override
+ @Override
public boolean isEnetOutput() {
- return false;
- }
+ return false;
+ }
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
- }
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
- @Override
- public boolean isGivingInformation() {
- return false;
- }
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
- @Override
- public boolean isInputFacing(final byte aSide) {
- return false;
- }
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
- @Override
- public boolean isOutputFacing(final byte aSide) {
- return false;
- }
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
- @Override
- public boolean isPneumatic() {
- return false;
- }
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
- @Override
- public boolean isSteampowered() {
- return false;
- }
+ @Override
+ public int getProgresstime() {
+ return this.mProgresstime;
+ }
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mUpdate = 30;
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
- this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
- }
-
- @Override
+ @Override
public int maxProgresstime() {
- return this.mMaxProgresstime;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_IronBlastFurnace(this.mName);
- }
-
- @Override
+ return this.mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ this.mProgresstime += aProgress;
+ return this.mMaxProgresstime - this.mProgresstime;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IronBlastFurnace(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mProgresstime", this.mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
+ if (this.mOutputItem1 != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem1.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem1", tNBT);
+ }
+ if (this.mOutputItem2 != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem2.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem2", tNBT);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mUpdate = 30;
+ this.mProgresstime = aNBT.getInteger("mProgresstime");
+ this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
+ this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ private boolean checkMachine() {
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 4; j++) { //This is height
+ for (int k = -1; k < 2; k++) {
+ if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
+ if ((i != 0) || (j == -1) || (k != 0)) {
+ if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != ModBlocks.blockCasingsMisc) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
+ return false;
+ }
+ } else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
public void onMachineBlockUpdate() {
- this.mUpdate = 30;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) {
- if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) {
- aBaseMetaTileEntity.getWorld().spawnParticle("cloud",
- aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(),
- aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D,
- 0.0D);
- }
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mUpdate-- == 0) {
- this.mMachine = this.checkMachine();
- }
- if (this.mMachine) {
- if (this.mMaxProgresstime > 0) {
- if (++this.mProgresstime >= this.mMaxProgresstime) {
- this.addOutputProducts();
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- try {
- // GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
- // "steel");
- }
- catch (final Exception e) {
- }
- }
- }
- else if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe();
- }
- }
- aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0 && this.mMachine);
- if (aBaseMetaTileEntity.isActive()) {
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
- aBaseMetaTileEntity.getWorld().setBlock(
- aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
- }
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord() + 1,
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
- aBaseMetaTileEntity.getWorld().setBlock(
- aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord() + 1,
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
- }
- }
- else {
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
- aBaseMetaTileEntity.getWorld().setBlock(
- aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
- }
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord() + 1,
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
- aBaseMetaTileEntity.getWorld().setBlock(
- aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1),
- aBaseMetaTileEntity.getYCoord() + 1,
- aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
- }
- }
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- if (this.mOutputItem1 != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem1.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem1", tNBT);
- }
- if (this.mOutputItem2 != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem2.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem2", tNBT);
- }
- }
-
- private boolean spaceForOutput(final ItemStack aStack1, final ItemStack aStack2) {
- if ((this.mInventory[2] == null || aStack1 == null
- || this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()
- && GT_Utility.areStacksEqual(this.mInventory[2], aStack1))
- && (this.mInventory[3] == null || aStack2 == null
- || this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()
- && GT_Utility.areStacksEqual(this.mInventory[3], aStack2))) {
- return true;
- }
- return false;
- }
+ this.mUpdate = 30;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if ((aBaseMetaTileEntity.isClientSide()) &&
+ (aBaseMetaTileEntity.isActive())) {
+ aBaseMetaTileEntity.getWorld().spawnParticle("cloud", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
+ }
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate-- == 0) {
+ this.mMachine = checkMachine();
+ }
+ if (this.mMachine) {
+ if (this.mMaxProgresstime > 0) {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ addOutputProducts();
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ try {
+ // GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");
+ } catch (Exception e) {
+ }
+ }
+ } else if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe();
+ }
+ }
+ aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
+ if (aBaseMetaTileEntity.isActive()) {
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ } else {
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ }
+ }
+ }
+
+ private void addOutputProducts() {
+ if (this.mOutputItem1 != null) {
+ if (this.mInventory[2] == null) {
+ this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
+ this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
+ }
+ }
+ if (this.mOutputItem2 != null) {
+ if (this.mInventory[3] == null) {
+ this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
+ this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
+ }
+ }
+ }
+
+ private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2) {
+ if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
+ (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean checkRecipe() {
+ if (!this.mMachine) {
+ return false;
+ }
+ if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4*3);
+ this.mMaxProgresstime = 36000;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2*3);
+ this.mMaxProgresstime = 4800*5;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 4*3);
+ this.mMaxProgresstime = 64800*5;
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2*3);
+ this.mMaxProgresstime = 3600*5;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 1*3);
+ this.mMaxProgresstime = 2400*5;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 2*3);
+ this.mMaxProgresstime = 32400*5;
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 64);
+ this.mMaxProgresstime = 64800*9;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 18*3);
+ this.mMaxProgresstime = 43200*5;
+ return true;
+ }
+ if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4*3);
+ this.mMaxProgresstime = 64800*5;
+ return true;
+ }
+ }
+ }
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ return false;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex > 1;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aIndex < 2) {
+ }
+ return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 0;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java
index 15a5224791..cb2996ca97 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java
@@ -1,17 +1,17 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.apache.commons.lang3.ArrayUtils;
-
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
@@ -20,220 +20,125 @@ import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.ArrayUtils;
+
public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase {
- public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3215;
- public static boolean sRequiresUUA = false;
- private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass"));
- private int mAmplifierUsed = 0;
- private int mMatterProduced = 0;
- ItemStack scrapPile = ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrap"));
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+ private int mAmplifierUsed = 0;
+ private int mMatterProduced = 0;
+ ItemStack scrapPile = ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrap"));
+ ItemStack scrapBox = ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrapbox"));
+
+ private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass"));
+ FluidStack tempFake = FluidUtils.getFluidStack("uuamplifier", 1);
+ GT_Recipe fakeRecipe;
+
+ public int getAmplifierUsed(){
+ return mAmplifierUsed;
+ }
- ItemStack scrapBox = ItemUtils.getSimpleStack(ItemUtils.getItem("IC2:itemScrapbox"));
- FluidStack tempFake = FluidUtils.getFluidStack("uuamplifier", 1);
- GT_Recipe fakeRecipe;
+ public int getMatterProduced(){
+ return mMatterProduced;
+ }
- public GregtechMetaTileEntity_MassFabricator(final int aID, final String aName, final String aNameRegional) {
+ public GregtechMetaTileEntity_MassFabricator(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_MassFabricator(final String aName) {
+ public GregtechMetaTileEntity_MassFabricator(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
- for (int i = -2; i < 3; i++) {
- for (int j = -2; j < 3; j++) {
- for (int h = 0; h < 4; h++) {
-
- // Utils.LOG_INFO("Logging Variables - xDir:"+xDir+"
- // zDir:"+zDir+" h:"+h+" i:"+i+" j:"+j);
-
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
- h, zDir + j);
- /*
- * if (tTileEntity !=
- * Block.getBlockFromItem(UtilsItems.getItem(
- * "IC2:blockAlloyGlass"))) { Utils.LOG_INFO("h:"+h+" i:"+i+
- * " j:"+j); double tX = tTileEntity.getXCoord(); double tY
- * = tTileEntity.getYCoord(); double tZ =
- * tTileEntity.getZCoord(); Utils.LOG_INFO(
- * "Found Glass at X:"+tX+" Y:"+tY+" Z:"+tZ); //return
- * false; }
- */
- if (i != -2 && i != 2 && j != -2 && j != 2) {// innerer 3x3
- // ohne h�he
- if (h == 0) {// innen boden (kantal coils)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
- Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3.");
- return false;
- }
- }
- else if (h == 3) {// innen decke (ulv casings + input +
- // muffler)
- if (!this.addMufflerToMachineList(tTileEntity, 66)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
- return false;
- }
- }
- }
- else {// innen air
- if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
- Utils.LOG_INFO("Make sure the inner 3x3 of the Multiblock is Air.");
- return false;
- }
- }
- }
- else {// Outer 5x5
- if (h == 0) {// au�en boden (controller, output, energy,
- // maintainance, rest ulv casings)
- if (!this.addMaintenanceToMachineList(tTileEntity, 66)
- && !this.addInputToMachineList(tTileEntity, 66)
- && !this.addOutputToMachineList(tTileEntity, 66)
- && !this.addEnergyInputToMachineList(tTileEntity, 66)) {
- if (xDir + i != 0 || zDir + j != 0) {// no
- // controller
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
- return false;
- }
- }
- }
- }
- else {// au�en �ber boden (ulv casings)
- if (h == 1) {
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Matter Fabricator",
+ "Produces UU-Matter from UU-Amplifier",
+ "Size(WxHxD): 5x4x5, Controller (Bottom center)",
+ "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)",
+ "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)",
+ "1x Input Hatch (Any bottom layer casing)",
+ "1x Output Hatch (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)",
+ "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
+ "1x Energy Hatch (Any bottom layer casing)",
+ "24x IC2 Reinforced Glass for the walls",
+ "Matter Fabricator Casings for the edges & top (40 at least!)",
+ CORE.GT_Tooltip};
+ }
- if ((i == -2 || i == 2) && (j == -2 || j == 2)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the corners in the second layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the corners in the second layer.");
- return false;
- }
- }
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66],
+ new GT_RenderedTexture(aActive ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66]};
+ }
- else if ((i != -2 || i != 2) && (j != -2 || j != 2)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != GregtechMetaTileEntity_MassFabricator.IC2Glass) {
- Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer.");
- return false;
- }
- }
- }
- if (h == 2) {
- if ((i == -2 || i == 2) && (j == -2 || j == 2)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the corners in the third layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the corners in the third layer.");
- return false;
- }
- }
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MatterFab(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MatterFabricator.png");
+ }
- else if ((i != -2 || i != 2) && (j != -2 || j != 2)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != GregtechMetaTileEntity_MassFabricator.IC2Glass) {
- Utils.LOG_INFO("Glass Casings Missing from somewhere in the third layer.");
- return false;
- }
- }
- }
- if (h == 3) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the edges on the top layer.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the edges on the top layer.");
- return false;
- }
- }
- }
- }
- }
- }
- }
- Utils.LOG_INFO("Multiblock Formed.");
- return true;
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
+ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
+ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
+ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
+ Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- //Utils.LOG_INFO("Fabricating Matter.");
- if (this.mInputHatches.size() != 1) {
- Utils.LOG_INFO("Too many input hatches. Found: " + this.mInputHatches.size() + " | Expected: 1");
+ public boolean checkRecipe(ItemStack aStack) {
+ Utils.LOG_INFO("Fabricating Matter.");
+ if (mInputHatches.size() != 1){
+ Utils.LOG_INFO("Too many input hatches. Found: "+mInputHatches.size()+" | Expected: 1");
return false;
}
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
+ ArrayList<ItemStack> tInputList = getStoredInputs();
for (int i = 0; i < tInputList.size() - 1; i++) {
for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
tInputList.remove(j--);
- }
- else {
+ } else {
tInputList.remove(i--);
break;
}
}
}
- }
+ }
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
+
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
for (int i = 0; i < tFluidList.size() - 1; i++) {
for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
tFluidList.remove(j--);
- }
- else {
+ } else {
tFluidList.remove(i--);
break;
}
@@ -241,109 +146,99 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo
}
}
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0,
- tFluidList.size());
-
- for (int scrapSlots = 0; scrapSlots < tInputs.length; scrapSlots++) {
- if (tInputs[scrapSlots].getItem() == this.scrapPile.getItem()) {
- if (tInputs[scrapSlots].stackSize >= 9) {
- Utils.LOG_INFO("Found enough scrap for a special recipe. x" + tInputs[scrapSlots].stackSize);
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
+
+
+ for (int scrapSlots=0;scrapSlots<tInputs.length;scrapSlots++){
+ if (tInputs[scrapSlots].getItem() == scrapPile.getItem()){
+ if (tInputs[scrapSlots].stackSize >= 9 ){
+ Utils.LOG_INFO("Found enough scrap for a special recipe. x"+tInputs[scrapSlots].stackSize);
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
Utils.LOG_INFO("Input fluid empty - Time to generate 1UU-A.");
- if (tHatch.mFluid == null) {
+ if (tHatch.mFluid == null){
tHatch.mFluid = FluidUtils.getFluidStack("uuamplifier", 2);
}
- else {
+ else{
tHatch.mFluid.amount++;
tHatch.mFluid.amount++;
}
tInputs[scrapSlots].stackSize = tInputs[scrapSlots].stackSize - 9;
- Utils.LOG_INFO("Remaining after recipe. x" + tInputs[scrapSlots].stackSize);
+ Utils.LOG_INFO("Remaining after recipe. x"+tInputs[scrapSlots].stackSize);
}
}
- }
+ }
}
}
+
if (tFluids.length > 0) {
Utils.LOG_INFO("Input fluid found");
- for (int i = 0; i < tFluids.length; i++) {
- final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(
- this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[] {
- tFluids[i]
- }, new ItemStack[] {});
+ for(int i = 0;i<tFluids.length;i++){
+ GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
+ if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
if (tRecipe.mEUt <= 16) {
- this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
- this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
- }
- else {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = ((tRecipe.mDuration/**sDurationMultiplier*/) / (1 << tTier - 1));
+ } else {
this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
+ this.mMaxProgresstime = (tRecipe.mDuration/**sDurationMultiplier*/);
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
this.mEUt *= 2;
this.mMaxProgresstime /= 4;
}
}
if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
+ this.mEUt = (-this.mEUt);
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- tRecipe.getOutput(0)
- };
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
this.mOutputFluids = tRecipe.mFluidOutputs.clone();
- ArrayUtils.reverse(this.mOutputFluids);
- this.mMatterProduced++;
- this.mAmplifierUsed++;
- this.updateSlots();
- // Utils.LOG_INFO("Recipes Finished: "+mMatterProduced);
+ ArrayUtils.reverse(mOutputFluids);
+ mMatterProduced++;
+ mAmplifierUsed++;
+ updateSlots();
+ //Utils.LOG_INFO("Recipes Finished: "+mMatterProduced);
return true;
}
}
else {
- // Utils.LOG_INFO("Invalid Recipe");
+ //Utils.LOG_INFO("Invalid Recipe");
return false;
}
}
}
else if (tFluids.length == 0) {
Utils.LOG_INFO("Input fluid not found");
- this.fakeRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(this.getBaseMetaTileEntity(),
- false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[] {
- this.tempFake
- }, new ItemStack[] {});
+ fakeRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tempFake}, new ItemStack[]{});
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
this.mEUt = 32;
- this.mMaxProgresstime = 160 * 20;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
+ this.mMaxProgresstime = (160*20);
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
this.mEUt *= 4;
this.mMaxProgresstime /= 2;
}
if (this.mEUt > 0) {
- this.mEUt = -this.mEUt;
+ this.mEUt = (-this.mEUt);
}
- if (this.fakeRecipe != null) {
+ if (fakeRecipe != null) {
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {
- this.fakeRecipe.getOutput(0)
- };
- this.mOutputFluids = this.fakeRecipe.mFluidOutputs.clone();
- ArrayUtils.reverse(this.mOutputFluids);
- this.mMatterProduced++;
- this.updateSlots();
- // Utils.LOG_INFO("Recipes Finished: "+mMatterProduced);
+ this.mOutputItems = new ItemStack[]{fakeRecipe.getOutput(0)};
+ this.mOutputFluids = fakeRecipe.mFluidOutputs.clone();
+ ArrayUtils.reverse(mOutputFluids);
+ mMatterProduced++;
+ updateSlots();
+ //Utils.LOG_INFO("Recipes Finished: "+mMatterProduced);
return true;
}
}
@@ -355,85 +250,147 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo
}
@Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 10;
- }
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+ for (int i = -2; i < 3; i++) {
+ for (int j = -2; j < 3; j++) {
+ for (int h = 0; h < 4; h++) {
- public int getAmplifierUsed() {
- return this.mAmplifierUsed;
- }
+ //Utils.LOG_INFO("Logging Variables - xDir:"+xDir+" zDir:"+zDir+" h:"+h+" i:"+i+" j:"+j);
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ /*if (tTileEntity != Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass"))) {
+ Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
+ double tX = tTileEntity.getXCoord();
+ double tY = tTileEntity.getYCoord();
+ double tZ = tTileEntity.getZCoord();
+ Utils.LOG_INFO("Found Glass at X:"+tX+" Y:"+tY+" Z:"+tZ);
+ //return false;
+ }*/
+ if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
+ if (h == 0) {// innen boden (kantal coils)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
+ Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3.");
+ return false;
+ }
+ } else if (h == 3) {// innen decke (ulv casings + input + muffler)
+ if ((!addMufflerToMachineList(tTileEntity, 66))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
+ }
+ } else {// innen air
+ if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
+ Utils.LOG_INFO("Make sure the inner 3x3 of the Multiblock is Air.");
+ return false;
+ }
+ }
+ } else {// Outer 5x5
+ if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
+ if ((!addMaintenanceToMachineList(tTileEntity, 66)) && (!addInputToMachineList(tTileEntity, 66)) && (!addOutputToMachineList(tTileEntity, 66)) && (!addEnergyInputToMachineList(tTileEntity, 66))) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {//no controller
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer.");
+ return false;
+ }
+ }
+ }
+ } else {// au�en �ber boden (ulv casings)
+ if (h == 1) {
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MatterFab(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png");
- }
+ if ((i == -2 || i == 2) && (j == -2 || j == 2)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
+ return false;
+ }
+ }
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Matter Fabricator", "Produces UU-Matter from UU-Amplifier",
- "Size(WxHxD): 5x4x5, Controller (Bottom center)",
- "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)",
- "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)",
- "1x Input Hatch (Any bottom layer casing)", "1x Output Hatch (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
- "1x Energy Hatch (Any bottom layer casing)", "24x IC2 Reinforced Glass for the walls",
- "Matter Fabricator Casings for the edges & top (40 at least!)", CORE.GT_Tooltip
- };
- }
+ else if ((i != -2 || i != 2) && (j != -2 || j != 2)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) {
+ Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer.");
+ return false;
+ }
+ }
+ }
+ if (h == 2) {
+ if ((i == -2 || i == 2) && (j == -2 || j == 2)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
+ return false;
+ }
+ }
- public int getMatterProduced() {
- return this.mMatterProduced;
+ else if ((i != -2 || i != 2) && (j != -2 || j != 2)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) {
+ Utils.LOG_INFO("Glass Casings Missing from somewhere in the third layer.");
+ return false;
+ }
+ }
+ }
+ if (h == 3) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ Utils.LOG_INFO("Multiblock Formed.");
+ return true;
}
@Override
- public int getMaxEfficiency(final ItemStack aStack) {
+ public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
@Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[66], new GT_RenderedTexture(
- aActive ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[66]
- };
+ public int getAmountOfOutputs() {
+ return 10;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_MassFabricator(this.mName);
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
@Override
- public void onConfigLoad(final GT_Config aConfig) {
- super.onConfigLoad(aConfig);
- GregtechMetaTileEntity_MassFabricator.sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig,
- "Massfabricator.UUM_Duration_Multiplier", GregtechMetaTileEntity_MassFabricator.sDurationMultiplier);
- GregtechMetaTileEntity_MassFabricator.sUUAperUUM = aConfig.get(ConfigCategories.machineconfig,
- "Massfabricator.UUA_per_UUM", GregtechMetaTileEntity_MassFabricator.sUUAperUUM);
- GregtechMetaTileEntity_MassFabricator.sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig,
- "Massfabricator.UUA_Speed_Bonus", GregtechMetaTileEntity_MassFabricator.sUUASpeedBonus);
- GregtechMetaTileEntity_MassFabricator.sRequiresUUA = aConfig.get(ConfigCategories.machineconfig,
- "Massfabricator.UUA_Requirement", GregtechMetaTileEntity_MassFabricator.sRequiresUUA);
- Materials.UUAmplifier.mChemicalFormula = "Mass Fabricator Eff/Speed Bonus: x"
- + GregtechMetaTileEntity_MassFabricator.sUUASpeedBonus;
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_MassFabricator(this.mName);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java
index b4f272bdf3..069652f40d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
@@ -17,6 +14,10 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.array.Pair;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@@ -24,399 +25,365 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_MultiTank extends GregtechMeta_MultiBlockBase {
- private long fluidStored = 0;
-
- private short multiblockCasingCount = 0;
- private short storageMultiplier = this.getStorageMultiplier();
- private long maximumFluidStorage = this.getMaximumTankStorage();
- private FluidStack internalStorageTank = null;
- public GregtechMetaTileEntity_MultiTank(final int aID, final String aName, final String aNameRegional) {
+public class GregtechMetaTileEntity_MultiTank
+extends GregtechMeta_MultiBlockBase {
+ public GregtechMetaTileEntity_MultiTank(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_MultiTank(final String aName) {
+ private long fluidStored = 0;
+ private short multiblockCasingCount = 0;
+ private short storageMultiplier = getStorageMultiplier();
+ private long maximumFluidStorage = getMaximumTankStorage();
+ private FluidStack internalStorageTank = null;
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mEUt", mEUt);
+ aNBT.setInteger("mProgresstime", mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiency", mEfficiency);
+ aNBT.setInteger("mPollution", mPollution);
+ aNBT.setInteger("mRuntime", mRuntime);
+ aNBT.setLong("mFluidStored", fluidStored);
+ aNBT.setShort("mStorageMultiplier", storageMultiplier);
+ aNBT.setLong("mMaxFluidStored", maximumFluidStorage);
+ aNBT.setShort("mCasingCount", multiblockCasingCount);
+
+ if (mOutputItems != null) for (int i = 0; i < mOutputItems.length; i++)
+ if (mOutputItems[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputItems[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem" + i, tNBT);
+ }
+ if (mOutputFluids != null) for (int i = 0; i < mOutputFluids.length; i++)
+ if (mOutputFluids[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputFluids[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputFluids" + i, tNBT);
+ }
+
+ aNBT.setBoolean("mWrench", mWrench);
+ aNBT.setBoolean("mScrewdriver", mScrewdriver);
+ aNBT.setBoolean("mSoftHammer", mSoftHammer);
+ aNBT.setBoolean("mHardHammer", mHardHammer);
+ aNBT.setBoolean("mSolderingTool", mSolderingTool);
+ aNBT.setBoolean("mCrowbar", mCrowbar);
+ }
+
+ private short getStorageMultiplier(){
+ int tempstorageMultiplier = (1*multiblockCasingCount);
+ if (tempstorageMultiplier <= 0){
+ return 1;
+ }
+ return (short) tempstorageMultiplier;
+ }
+
+ private long getMaximumTankStorage(){
+ int multiplier = getStorageMultiplier();
+ Utils.LOG_WARNING("x = "+multiplier+" * 96000");
+ long tempTankStorageMax = (96000*multiplier);
+ Utils.LOG_WARNING("x = "+tempTankStorageMax);
+ if (tempTankStorageMax <= 0){
+ return 96000;
+ }
+ return tempTankStorageMax;
+ }
+
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mEUt = aNBT.getInteger("mEUt");
+ mProgresstime = aNBT.getInteger("mProgresstime");
+ mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ if (mMaxProgresstime > 0) mRunningOnLoad = true;
+ mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ mEfficiency = aNBT.getInteger("mEfficiency");
+ mPollution = aNBT.getInteger("mPollution");
+ mRuntime = aNBT.getInteger("mRuntime");
+ fluidStored = aNBT.getLong("mFluidStored");
+ storageMultiplier = aNBT.getShort("mStorageMultiplier");
+ maximumFluidStorage = aNBT.getLong("mMaxFluidStored");
+ multiblockCasingCount = aNBT.getShort("mCasingCount");
+ mOutputItems = new ItemStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
+ mOutputFluids = new FluidStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputFluids.length; i++)
+ mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
+ mWrench = aNBT.getBoolean("mWrench");
+ mScrewdriver = aNBT.getBoolean("mScrewdriver");
+ mSoftHammer = aNBT.getBoolean("mSoftHammer");
+ mHardHammer = aNBT.getBoolean("mHardHammer");
+ mSolderingTool = aNBT.getBoolean("mSolderingTool");
+ mCrowbar = aNBT.getBoolean("mCrowbar");
+ }
+
+ public GregtechMetaTileEntity_MultiTank(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- Utils.LOG_INFO("Must be hollow.");
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 19; h++) {
- if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity
- .getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if (!this.addMaintenanceToMachineList(tTileEntity, 68)
- && !this.addInputToMachineList(tTileEntity, 68)
- && !this.addOutputToMachineList(tTileEntity, 68)
- && !this.addEnergyInputToMachineList(tTileEntity, 68)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- if (h < 3) {
- Utils.LOG_INFO("Casing Expected.");
- return false;
- }
- else if (h >= 3) {
- // Utils.LOG_WARNING("Your Multitank can be
- // 20 blocks tall.");
- }
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
- if (h < 3) {
- Utils.LOG_INFO("Wrong Meta.");
- return false;
- }
- else if (h >= 3) {
- // Utils.LOG_WARNING("Your Multitank can be
- // 20 blocks tall.");
- }
- }
- if (h < 3) {
- tAmount++;
- }
- else if (h >= 3) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air
- || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)
- .getUnlocalizedName().contains("residual")) {
- Utils.LOG_INFO("Found air");
- }
- else {
- Utils.LOG_INFO("Layer " + (h + 2) + " is complete. Adding " + 64000 * 9
- + "L storage to the tank.");
- tAmount++;
- }
- }
- }
- }
- }
- }
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_MultiTank(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Multitank",
+ "Size: 3xHx3 (Block behind controller must be air)",
+ "Structure must be at least 4 blocks tall, maximum 20.",
+ "Each casing within the structure adds 96000L storage.",
+ "Controller (front centered)",
+ "1x Input hatch (anywhere)",
+ "1x Output hatch (anywhere)",
+ "1x Energy Hatch (anywhere)",
+ "1x Maintenance Hatch (anywhere)",
+ "Multitank Exterior Casings for the rest (16 at least!)",
+ "Stored Fluid: "+fluidStored};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[68], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)};
}
- this.multiblockCasingCount = (short) tAmount;
- Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
- Utils.LOG_INFO("Casings Count: " + tAmount + " Valid Multiblock: " + (tAmount >= 16) + " Tank Storage Capacity:"
- + this.getMaximumTankStorage() + "L");
- return tAmount >= 16;
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[68]};
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- Utils.LOG_INFO("Okay");
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
- final ArrayList<ItemStack> tInputList = this.getStoredInputs();
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ Utils.LOG_INFO("Okay");
+
+
+
+ ArrayList<ItemStack> tInputList = getStoredInputs();
for (int i = 0; i < tInputList.size() - 1; i++) {
for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
- if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
tInputList.remove(j--);
- }
- else {
+ } else {
tInputList.remove(i--);
break;
}
}
}
}
- final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
- final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
for (int i = 0; i < tFluidList.size() - 1; i++) {
for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
- if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
tFluidList.remove(j--);
- }
- else {
+ } else {
tFluidList.remove(i--);
break;
}
}
}
}
- final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1);
-
- if (tFluids.length >= 2) {
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1);
+
+ if (tFluids.length >= 2){
Utils.LOG_INFO("Bad");
return false;
}
-
- final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>>();
+
+ ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>>();
int slotInputCount = 0;
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
boolean containsFluid = false;
- if (GregtechMeta_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
+ if (isValidMetaTileEntity(tHatch)) {
slotInputCount++;
- for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
- if (tHatch.canTankBeEmptied()) {
- containsFluid = true;
- }
+ for (int i=0; i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) {
+ if (tHatch.canTankBeEmptied()){containsFluid=true;}
}
rList.add(new Pair<GT_MetaTileEntity_Hatch_Input, Boolean>(tHatch, containsFluid));
}
}
- if (tFluids.length <= 0 || slotInputCount > 1) {
+ if (tFluids.length <= 0 || slotInputCount > 1){
Utils.LOG_INFO("Bad");
return false;
}
-
- Utils.LOG_INFO("Okay - 2");
- if (this.internalStorageTank == null) {
- if (rList.get(0).getKey().mFluid != null && rList.get(0).getKey().mFluid.amount > 0) {
- Utils.LOG_INFO(
- "Okay - 1" + " rList.get(0).getKey().mFluid.amount: " + rList.get(0).getKey().mFluid.amount
- + " internalStorageTank:" + this.internalStorageTank.amount);
- this.internalStorageTank = rList.get(0).getKey().mFluid;
- this.internalStorageTank.amount = rList.get(0).getKey().mFluid.amount;
+
+ Utils.LOG_INFO("Okay - 2");
+ if (internalStorageTank == null){
+ if (rList.get(0).getKey().mFluid != null && rList.get(0).getKey().mFluid.amount > 0){
+ Utils.LOG_INFO("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+internalStorageTank.amount);
+ internalStorageTank = rList.get(0).getKey().mFluid;
+ internalStorageTank.amount = rList.get(0).getKey().mFluid.amount;
rList.get(0).getKey().mFluid.amount = 0;
- Utils.LOG_INFO(
- "Okay - 1.1" + " rList.get(0).getKey().mFluid.amount: " + rList.get(0).getKey().mFluid.amount
- + " internalStorageTank:" + this.internalStorageTank.amount);
+ Utils.LOG_INFO("Okay - 1.1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+internalStorageTank.amount);
return true;
}
Utils.LOG_INFO("No Fluid in hatch.");
- return false;
+ return false;
}
- else if (this.internalStorageTank.isFluidEqual(rList.get(0).getKey().mFluid)) {
- Utils.LOG_INFO("Storing " + rList.get(0).getKey().mFluid.amount + "L");
- Utils.LOG_INFO("Contains " + this.internalStorageTank.amount + "L");
-
+ else if (internalStorageTank.isFluidEqual(rList.get(0).getKey().mFluid)){
+ Utils.LOG_INFO("Storing "+rList.get(0).getKey().mFluid.amount+"L");
+ Utils.LOG_INFO("Contains "+internalStorageTank.amount+"L");
+
int tempAdd = 0;
tempAdd = rList.get(0).getKey().getFluidAmount();
- rList.get(0).getKey().mFluid = null;
- Utils.LOG_INFO("adding " + tempAdd);
- this.internalStorageTank.amount = this.internalStorageTank.amount + tempAdd;
- Utils.LOG_INFO("Tank now Contains " + this.internalStorageTank.amount + "L of "
- + this.internalStorageTank.getFluid().getName() + ".");
-
- if (this.mOutputHatches.get(0).mFluid == null || this.mOutputHatches.isEmpty()) {
- Utils.LOG_INFO("Okay - 3");
- final int tempCurrentStored = this.internalStorageTank.amount;
- int tempSubtract = 0;
- int tempResult = 0;
- final int tempHatchSize = this.mOutputHatches.get(0).getCapacity();
- final FluidStack tempOutputFluid = this.internalStorageTank;
- if (tempHatchSize > tempCurrentStored) {
- Utils.LOG_INFO("Okay - 3.1.1" + " hatchCapacity: " + tempHatchSize + " tempCurrentStored:"
- + tempCurrentStored);
- tempOutputFluid.amount = tempHatchSize;
- tempSubtract = tempHatchSize;
- tempResult = tempCurrentStored - tempSubtract;
- Utils.LOG_INFO(
- "Okay - 3.1.2" + " result: " + tempResult + " tempCurrentStored:" + tempCurrentStored);
- this.mOutputHatches.get(0).mFluid = tempOutputFluid;
- this.internalStorageTank.amount = tempResult;
- }
- else if (tempCurrentStored >= 5000) {
- Utils.LOG_INFO("Okay - 3.2");
- tempOutputFluid.amount = tempCurrentStored;
- tempSubtract = tempOutputFluid.amount;
- tempResult = tempCurrentStored - tempSubtract;
- this.mOutputHatches.get(0).mFluid = tempOutputFluid;
- this.internalStorageTank.amount = tempResult;
- }
- Utils.LOG_INFO("Tank");
- return true;
- }
- else if (this.mOutputHatches.get(0).mFluid.isFluidEqual(this.internalStorageTank)) {
- Utils.LOG_INFO("Okay - 4");
- final int tempCurrentStored = this.internalStorageTank.amount;
- int tempSubtract = 0;
- int tempResult = 0;
- final int tempHatchSize = this.mOutputHatches.get(0).getCapacity();
- final FluidStack tempOutputFluid = this.internalStorageTank;
- if (tempHatchSize > tempCurrentStored) {
- tempOutputFluid.amount = tempHatchSize;
- tempSubtract = tempOutputFluid.amount;
- tempResult = tempCurrentStored - tempSubtract;
- this.mOutputHatches.get(0).mFluid = tempOutputFluid;
- this.internalStorageTank.amount = tempResult;
- }
- else if (tempCurrentStored >= 5000) {
- tempOutputFluid.amount = tempCurrentStored;
- tempSubtract = tempOutputFluid.amount;
- tempResult = tempCurrentStored - tempSubtract;
- this.mOutputHatches.get(0).mFluid = tempOutputFluid;
- this.internalStorageTank.amount = tempResult;
+ rList.get(0).getKey().mFluid = null;
+ Utils.LOG_INFO("adding "+tempAdd);
+ internalStorageTank.amount = internalStorageTank.amount + tempAdd;
+ Utils.LOG_INFO("Tank now Contains "+internalStorageTank.amount+"L of "+internalStorageTank.getFluid().getName()+".");
+
+ if (mOutputHatches.get(0).mFluid == null || mOutputHatches.isEmpty()){
+ Utils.LOG_INFO("Okay - 3");
+ int tempCurrentStored = internalStorageTank.amount;
+ int tempSubtract = 0;
+ int tempResult = 0;
+ int tempHatchSize = mOutputHatches.get(0).getCapacity();
+ FluidStack tempOutputFluid = internalStorageTank;
+ if (tempHatchSize > tempCurrentStored){
+ Utils.LOG_INFO("Okay - 3.1.1"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored:"+tempCurrentStored);
+ tempOutputFluid.amount = tempHatchSize;
+ tempSubtract = tempHatchSize;
+ tempResult = tempCurrentStored - tempSubtract;
+ Utils.LOG_INFO("Okay - 3.1.2"+" result: "+tempResult +" tempCurrentStored:"+tempCurrentStored);
+ mOutputHatches.get(0).mFluid = tempOutputFluid;
+ internalStorageTank.amount = tempResult;
+ }
+ else if (tempCurrentStored >= 5000){
+ Utils.LOG_INFO("Okay - 3.2");
+ tempOutputFluid.amount = tempCurrentStored;
+ tempSubtract = tempOutputFluid.amount;
+ tempResult = tempCurrentStored - tempSubtract;
+ mOutputHatches.get(0).mFluid = tempOutputFluid;
+ internalStorageTank.amount = tempResult;
+ }
+ Utils.LOG_INFO("Tank");
+ return true;
}
+ else if (mOutputHatches.get(0).mFluid.isFluidEqual(internalStorageTank)){
+ Utils.LOG_INFO("Okay - 4");
+ int tempCurrentStored = internalStorageTank.amount;
+ int tempSubtract = 0;
+ int tempResult = 0;
+ int tempHatchSize = mOutputHatches.get(0).getCapacity();
+ FluidStack tempOutputFluid = internalStorageTank;
+ if (tempHatchSize > tempCurrentStored){
+ tempOutputFluid.amount = tempHatchSize;
+ tempSubtract = tempOutputFluid.amount;
+ tempResult = tempCurrentStored - tempSubtract;
+ mOutputHatches.get(0).mFluid = tempOutputFluid;
+ internalStorageTank.amount = tempResult;
+ }
+ else if (tempCurrentStored >= 5000){
+ tempOutputFluid.amount = tempCurrentStored;
+ tempSubtract = tempOutputFluid.amount;
+ tempResult = tempCurrentStored - tempSubtract;
+ mOutputHatches.get(0).mFluid = tempOutputFluid;
+ internalStorageTank.amount = tempResult;
+ }
+ Utils.LOG_INFO("Tank");
+ return true;
+ }
Utils.LOG_INFO("Tank");
- return true;
- }
- Utils.LOG_INFO("Tank");
return true;
}
else {
- Utils.LOG_INFO("Tank Contains " + this.internalStorageTank.amount + "L of "
- + this.internalStorageTank.getFluid().getName() + ".");
+ Utils.LOG_INFO("Tank Contains "+internalStorageTank.amount+"L of "+internalStorageTank.getFluid().getName()+".");
}
- // this.getBaseMetaTileEntity().(tFluids[0].amount, true);
+ //this.getBaseMetaTileEntity().(tFluids[0].amount, true);
Utils.LOG_INFO("Tank");
return false;
}
@Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
- }
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "VacuumFreezer.png");
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Multitank", "Size: 3xHx3 (Block behind controller must be air)",
- "Structure must be at least 4 blocks tall, maximum 20.",
- "Each casing within the structure adds 96000L storage.", "Controller (front centered)",
- "1x Input hatch (anywhere)", "1x Output hatch (anywhere)", "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)", "Multitank Exterior Casings for the rest (16 at least!)",
- "Stored Fluid: " + this.fluidStored
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- private long getMaximumTankStorage() {
- final int multiplier = this.getStorageMultiplier();
- Utils.LOG_WARNING("x = " + multiplier + " * 96000");
- final long tempTankStorageMax = 96000 * multiplier;
- Utils.LOG_WARNING("x = " + tempTankStorageMax);
- if (tempTankStorageMax <= 0) {
- return 96000;
- }
- return tempTankStorageMax;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
- return 0;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- private short getStorageMultiplier() {
- final int tempstorageMultiplier = 1 * this.multiblockCasingCount;
- if (tempstorageMultiplier <= 0) {
- return 1;
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ Utils.LOG_INFO("Must be hollow.");
+ return false;
}
- return (short) tempstorageMultiplier;
- }
-
- @Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[68], new GT_RenderedTexture(aActive
- ? TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)
- };
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 19; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 68)) && (!addInputToMachineList(tTileEntity, 68)) && (!addOutputToMachineList(tTileEntity, 68)) && (!addEnergyInputToMachineList(tTileEntity, 68))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ if (h < 3){
+ Utils.LOG_INFO("Casing Expected.");
+ return false;
+ }
+ else if (h >= 3){
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
+ }
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) {
+ if (h < 3){
+ Utils.LOG_INFO("Wrong Meta.");
+ return false;
+ }
+ else if (h >= 3){
+ //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall.");
+ }
+ }
+ if (h < 3){
+ tAmount++;
+ }
+ else if (h >= 3){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){
+ Utils.LOG_INFO("Found air");
+ }
+ else {
+ Utils.LOG_INFO("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank.");
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ }
}
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[68]
- };
+ multiblockCasingCount = (short) tAmount;
+ Utils.LOG_INFO("Your Multitank can be 20 blocks tall.");
+ Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+getMaximumTankStorage()+"L");
+ return tAmount >= 16;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return aFacing > 1;
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mEUt = aNBT.getInteger("mEUt");
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- if (this.mMaxProgresstime > 0) {
- this.mRunningOnLoad = true;
- }
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiency = aNBT.getInteger("mEfficiency");
- this.mPollution = aNBT.getInteger("mPollution");
- this.mRuntime = aNBT.getInteger("mRuntime");
- this.fluidStored = aNBT.getLong("mFluidStored");
- this.storageMultiplier = aNBT.getShort("mStorageMultiplier");
- this.maximumFluidStorage = aNBT.getLong("mMaxFluidStored");
- this.multiblockCasingCount = aNBT.getShort("mCasingCount");
- this.mOutputItems = new ItemStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputItems.length; i++) {
- this.mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
- }
- this.mOutputFluids = new FluidStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- this.mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
- }
- this.mWrench = aNBT.getBoolean("mWrench");
- this.mScrewdriver = aNBT.getBoolean("mScrewdriver");
- this.mSoftHammer = aNBT.getBoolean("mSoftHammer");
- this.mHardHammer = aNBT.getBoolean("mHardHammer");
- this.mSolderingTool = aNBT.getBoolean("mSolderingTool");
- this.mCrowbar = aNBT.getBoolean("mCrowbar");
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_MultiTank(this.mName);
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mEUt", this.mEUt);
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
- aNBT.setInteger("mEfficiency", this.mEfficiency);
- aNBT.setInteger("mPollution", this.mPollution);
- aNBT.setInteger("mRuntime", this.mRuntime);
- aNBT.setLong("mFluidStored", this.fluidStored);
- aNBT.setShort("mStorageMultiplier", this.storageMultiplier);
- aNBT.setLong("mMaxFluidStored", this.maximumFluidStorage);
- aNBT.setShort("mCasingCount", this.multiblockCasingCount);
-
- if (this.mOutputItems != null) {
- for (int i = 0; i < this.mOutputItems.length; i++) {
- if (this.mOutputItems[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItems[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputItem" + i, tNBT);
- }
- }
- }
- if (this.mOutputFluids != null) {
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- if (this.mOutputFluids[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputFluids[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputFluids" + i, tNBT);
- }
- }
- }
-
- aNBT.setBoolean("mWrench", this.mWrench);
- aNBT.setBoolean("mScrewdriver", this.mScrewdriver);
- aNBT.setBoolean("mSoftHammer", this.mSoftHammer);
- aNBT.setBoolean("mHardHammer", this.mHardHammer);
- aNBT.setBoolean("mSolderingTool", this.mSolderingTool);
- aNBT.setBoolean("mCrowbar", this.mCrowbar);
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java
index 1006f68da7..45635ea74d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java
@@ -17,144 +17,131 @@ import net.minecraftforge.common.util.ForgeDirection;
public class GregtechMetaTileEntity_PowerSubStationController extends GT_MetaTileEntity_MultiBlockBase {
- private final int recipeCounter = 0;
+ private int recipeCounter = 0;
- public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName,
- final String aNameRegional) {
+ public GregtechMetaTileEntity_PowerSubStationController(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMetaTileEntity_PowerSubStationController(final String aName) {
+ public GregtechMetaTileEntity_PowerSubStationController(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Power Sub-Station",
+ "Stores quite a lot of power.",
+ "Size(WxHxD): 1x5x1, Controller (One above the Bottom)",
+ CORE.GT_Tooltip};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[67],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[67]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MatterFabricator.png");
+ }
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
for (int i = -2; i < 3; i++) {
for (int j = -2; j < 3; j++) {
for (int h = 0; h < 4; h++) {
- // Utils.LOG_INFO("Logging Variables - xDir:"+xDir+"
- // zDir:"+zDir+" h:"+h+" i:"+i+" j:"+j);
-
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
- h, zDir + j);
- /*
- * if (tTileEntity !=
- * Block.getBlockFromItem(UtilsItems.getItem(
- * "IC2:blockAlloyGlass"))) { Utils.LOG_INFO("h:"+h+" i:"+i+
- * " j:"+j); double tX = tTileEntity.getXCoord(); double tY
- * = tTileEntity.getYCoord(); double tZ =
- * tTileEntity.getZCoord(); Utils.LOG_INFO(
- * "Found Glass at X:"+tX+" Y:"+tY+" Z:"+tZ); //return
- * false; }
- */
- if (i != -2 && i != 2 && j != -2 && j != 2) {// innerer 3x3
- // ohne h�he
- if (h == 0 && i != 0 && j != 0) {// innen boden (kantal
- // coils)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO(
- "Matter Generation Coils missings from the bottom layer, inner 3x3. - Wrong Block");
- Utils.LOG_INFO("Found: "
- + aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName()
- + " at x:" + (xDir + i) + " y:" + h + " z:" + (zDir + j));
- // tTileEntity.getWorld().setBlock(xDir+i, h,
- // zDir+j, Blocks.diamond_block);
- // Utils.LOG_INFO("Changed into :
- // "+aBaseMetaTileEntity.getBlockOffset(xDir +
- // i, h, zDir + j).getUnlocalizedName());
+ //Utils.LOG_INFO("Logging Variables - xDir:"+xDir+" zDir:"+zDir+" h:"+h+" i:"+i+" j:"+j);
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ /*if (tTileEntity != Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass"))) {
+ Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
+ double tX = tTileEntity.getXCoord();
+ double tY = tTileEntity.getYCoord();
+ double tZ = tTileEntity.getZCoord();
+ Utils.LOG_INFO("Found Glass at X:"+tX+" Y:"+tY+" Z:"+tZ);
+ //return false;
+ }*/
+ if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
+ if (h == 0 && i != 0 && j != 0) {// innen boden (kantal coils)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3. - Wrong Block");
+ Utils.LOG_INFO("Found: "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName()+" at x:"+(xDir + i)+" y:" +h+" z:"+(zDir + j));
+ //tTileEntity.getWorld().setBlock(xDir+i, h, zDir+j, Blocks.diamond_block);
+ //Utils.LOG_INFO("Changed into : "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName());
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 4) {
- Utils.LOG_INFO(
- "Matter Generation Coils missings from the bottom layer, inner 3x3. - Wrong Meta");
+ Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3. - Wrong Meta");
return false;
}
- }
- else if (h == 3 && i != 0 && j != 0) {// innen decke
- // (ulv casings
- // + input +
- // muffler)
- // if(j == 0 && i == 0) {
-
- if (!this.addMufflerToMachineList(tTileEntity, 66)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Found: "
- + aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)
- .getUnlocalizedName()
- + " at x:" + (xDir + i) + " y:" + h + " z:" + (zDir + j));
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 4) {
- Utils.LOG_INFO("Found: "
- + aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)
- .getUnlocalizedName()
- + " at x:" + (xDir + i) + " y:" + h + " z:" + (zDir + j));
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
- return false;
- }
+ }
+ else if (h == 3 && i != 0 && j != 0) {// innen decke (ulv casings + input + muffler)
+ //if(j == 0 && i == 0) {
+
+ if ((!addMufflerToMachineList(tTileEntity, 66))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Found: "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName()+" at x:"+(xDir + i)+" y:" +h+" z:"+(zDir + j));
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 4) {
+ Utils.LOG_INFO("Found: "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName()+" at x:"+(xDir + i)+" y:" +h+" z:"+(zDir + j));
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
+ }
+ //}
+
+ } /*else {// top air
+ if ((i != -2 && i != 2) && (j != -2 && j != 2) && h == 3) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Matter Generation Coils missings from the top layer, inner 3x3. - Wrong Block");
+ Utils.LOG_INFO("Found: "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName()+" at x:"+(xDir + i)+" y:" +h+" z:"+(zDir + j));
+ //tTileEntity.getWorld().setBlock(xDir+i, h, zDir+j, Blocks.diamond_block);
+ //Utils.LOG_INFO("Changed into : "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName());
+ return false;
}
- // }
-
- } /*
- * else {// top air if ((i != -2 && i != 2) && (j !=
- * -2 && j != 2) && h == 3) { if
- * (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- * zDir + j) != ModBlocks.blockCasingsMisc) {
- * Utils.LOG_INFO(
- * "Matter Generation Coils missings from the top layer, inner 3x3. - Wrong Block"
- * ); Utils.LOG_INFO("Found: "
- * +aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- * zDir + j).getUnlocalizedName()+" at x:"+(xDir +
- * i)+" y:" +h+" z:"+(zDir + j));
- * //tTileEntity.getWorld().setBlock(xDir+i, h,
- * zDir+j, Blocks.diamond_block); //Utils.LOG_INFO(
- * "Changed into : "
- * +aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- * zDir + j).getUnlocalizedName()); return false; }
- * if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i,
- * h, zDir + j) != 4) { Utils.LOG_INFO(
- * "Matter Generation Coils missings from the top layer, inner 3x3. - Wrong Meta"
- * ); return false; } } }
- */
- }
- else {// Outer 5x5
- if (h == 0) {// au�en boden (controller, output, energy,
- // maintainance, rest ulv casings)
- if (!this.addEnergyInputToMachineList(tTileEntity, 66)
- && !this.addDynamoToMachineList(tTileEntity, 66)) {
- if (xDir + i != 0 || zDir + j != 0) {// no
- // controller
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
- zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Found: "
- + aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)
- .getUnlocalizedName()
- + " at x:" + (xDir + i) + " y:" + h + " z:" + (zDir + j));
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the edges of the bottom layer. "
- + aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)
- .getLocalizedName());
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 4) {
+ Utils.LOG_INFO("Matter Generation Coils missings from the top layer, inner 3x3. - Wrong Meta");
+ return false;
+ }
+ }
+ }*/
+ } else {// Outer 5x5
+ if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
+ if ((!addEnergyInputToMachineList(tTileEntity, 66) && (!addDynamoToMachineList(tTileEntity, 66)))) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {//no controller
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Found: "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName()+" at x:"+(xDir + i)+" y:" +h+" z:"+(zDir + j));
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer. "+(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()));
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 4) {
- Utils.LOG_INFO(
- "Matter Fabricator Casings Missing from one of the edges of the bottom layer. 2");
+ Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer. 2");
return false;
}
}
}
- }
- else {
-
+ } else {
+
}
}
}
@@ -165,77 +152,38 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GT_MetaTil
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 1;
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png");
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
}
@Override
- public int getDamageToComponent(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
return 0;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Power Sub-Station", "Stores quite a lot of power.",
- "Size(WxHxD): 1x5x1, Controller (One above the Bottom)", CORE.GT_Tooltip
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getDamageToComponent(ItemStack aStack) {
return 0;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[67],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE
- : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)
- };
- }
- return new ITexture[] {
- Textures.BlockIcons.CASING_BLOCKS[67]
- };
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
- return true;
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
@Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GregtechMetaTileEntity_PowerSubStationController(this.mName);
}
- @Override
- public void onConfigLoad(final GT_Config aConfig) {
- super.onConfigLoad(aConfig);
- }
-
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
index eede58d65b..7508391f93 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
@@ -12,108 +12,130 @@ import gtPlusPlus.core.util.fluid.FluidUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
-public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank {
+public class GT_MetaTileEntity_TieredTank
+extends GT_MetaTileEntity_BasicTank {
- private NBTTagCompound mRecipeStuff = new NBTTagCompound();
- private String mFluidName;
- private int mFluidAmount;
+ private NBTTagCompound mRecipeStuff = new NBTTagCompound();
+ private String mFluidName;
+ private int mFluidAmount;
- public GT_MetaTileEntity_TieredTank(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Stores " + (int) (Math.pow(2, aTier) * 32000) + "L of fluid");
+ public GT_MetaTileEntity_TieredTank(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid");
}
- public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TieredTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
}
@Override
- public boolean canTankBeEmptied() {
- return true;
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
}
@Override
- public boolean canTankBeFilled() {
- return true;
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER)};
}
- @Override
- public boolean displaysItemStack() {
+
+ private boolean setVars(){
+ //Utils.LOG_INFO("setting Vars.");
+ if (mFluidName.equals("") || !mFluidName.equals(null)){
+ if (mFluid != null) mFluidName = mFluid.getFluid().getName();
+ }
+ else{
+ if (mFluid != null){
+ if (!mFluidName.equalsIgnoreCase(mFluid.getFluid().getName())){
+ mFluidName = mFluid.getFluid().getName();
+ }
+ }
+ else {
+ // Leave Values Blank.
+ return false;
+ }
+ }
+
+ if (mFluidAmount <= 0){
+ if (mFluid != null) mFluidAmount = mFluid.amount;
+ }
+ else {
+ if (mFluid != null){
+ if (mFluidAmount != mFluid.amount){
+ mFluidAmount = mFluid.amount;
+ }
+ }
+ else {
+ // Leave Values Blank.
+ return false;
+ }
+ }
return true;
}
+
@Override
- public boolean displaysStackSize() {
- return false;
- }
+ public String[] getDescription() {
+
+ setVars();
- @Override
- public boolean doesEmptyContainers() {
- return true;
+
+ if ((mFluidName.equals("Empty")||mFluidName.equals("")) || mFluidAmount <= 0){
+ return new String[] {mDescription, CORE.GT_Tooltip};
+ }
+ return new String[] {mDescription, "Stored Fluid: "+mFluidName, "Stored Amount: "+mFluidAmount+"l", CORE.GT_Tooltip};
}
+
@Override
- public boolean doesFillContainers() {
- return true;
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ setVars();
+ mRecipeStuff.setString("mFluidName", mFluidName);
+ mRecipeStuff.setInteger("mFluidAmount", mFluidAmount);
+ aNBT.setTag("GT.CraftingComponents", mRecipeStuff);
}
@Override
- public int getCapacity() {
- return (int) (Math.pow(2, this.mTier) * 32000);
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
+ mFluidName = mRecipeStuff.getString("mFluidName");
+ mFluidAmount = mRecipeStuff.getInteger("mFluidAmount");
+ mFluid = FluidUtils.getFluidStack(mFluidName, mFluidAmount);
+ setItemNBT(aNBT);
}
@Override
- public String[] getDescription() {
-
- this.setVars();
-
- if (this.mFluidName.equals("Empty") || this.mFluidName.equals("") || this.mFluidAmount <= 0) {
- return new String[] {
- this.mDescription, CORE.GT_Tooltip
- };
- }
- return new String[] {
- this.mDescription, "Stored Fluid: " + this.mFluidName, "Stored Amount: " + this.mFluidAmount + "l",
- CORE.GT_Tooltip
- };
+ public void setItemNBT(NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ mRecipeStuff.setString("mFluidName", mFluidName);
+ mRecipeStuff.setInteger("mFluidAmount", mFluidAmount);
+ aNBT.setTag("GT.CraftingComponents", mRecipeStuff);
}
- @Override
- public String[] getInfoData() {
- if (this.mFluid == null) {
- return new String[] {
- GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", "No Fluid",
- Integer.toString(0) + "L", Integer.toString(this.getCapacity()) + "L"
- };
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()){
+ return true;
}
- return new String[] {
- GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", this.mFluid.getLocalizedName(),
- Integer.toString(this.mFluid.amount) + "L", Integer.toString(this.getCapacity()) + "L"
- };
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
}
@Override
- public int getTankPressure() {
- return 100;
+ public boolean isSimpleMachine() {
+ return true;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == 1 ? new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE)
- } : new ITexture[] {
- Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1],
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER)
- };
+ public boolean isFacingValid(byte aFacing) {
+ return true;
}
@Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
}
@Override
@@ -122,114 +144,84 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank {
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ public boolean doesFillContainers() {
return true;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
+ public boolean doesEmptyContainers() {
return true;
}
@Override
- public boolean isGivingInformation() {
+ public boolean canTankBeFilled() {
return true;
}
@Override
- public boolean isSimpleMachine() {
+ public boolean canTankBeEmptied() {
return true;
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
- this.mFluidName = this.mRecipeStuff.getString("mFluidName");
- this.mFluidAmount = this.mRecipeStuff.getInteger("mFluidAmount");
- this.mFluid = FluidUtils.getFluidStack(this.mFluidName, this.mFluidAmount);
- this.setItemNBT(aNBT);
+ public boolean displaysItemStack() {
+ return true;
}
@Override
- public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TieredTank(this.mName, this.mTier, this.mDescription, this.mTextures);
+ public boolean displaysStackSize() {
+ return false;
}
@Override
- public void onMachineBlockUpdate() {
- this.getBaseMetaTileEntity().markDirty();
- super.onMachineBlockUpdate();
+ public String[] getInfoData() {
+
+ if (mFluid == null) {
+ return new String[]{
+ GT_Values.VOLTAGE_NAMES[mTier]+" Fluid Tank",
+ "Stored Fluid:",
+ "No Fluid",
+ Integer.toString(0) + "L",
+ Integer.toString(getCapacity()) + "L"};
+ }
+ return new String[]{
+ GT_Values.VOLTAGE_NAMES[mTier]+" Fluid Tank",
+ "Stored Fluid:",
+ mFluid.getLocalizedName(),
+ Integer.toString(mFluid.amount) + "L",
+ Integer.toString(getCapacity()) + "L"};
}
@Override
- public void onRemoval() {
- this.getBaseMetaTileEntity().markDirty();
- super.onRemoval();
+ public boolean isGivingInformation() {
+ return true;
}
@Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TieredTank(mName, mTier, mDescription, mTextures);
}
@Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- this.setVars();
- this.mRecipeStuff.setString("mFluidName", this.mFluidName);
- this.mRecipeStuff.setInteger("mFluidAmount", this.mFluidAmount);
- aNBT.setTag("GT.CraftingComponents", this.mRecipeStuff);
+ public int getCapacity() {
+ return (int) (Math.pow(2, mTier) * 32000);
}
@Override
- public void setItemNBT(final NBTTagCompound aNBT) {
- super.setItemNBT(aNBT);
- this.mRecipeStuff.setString("mFluidName", this.mFluidName);
- this.mRecipeStuff.setInteger("mFluidAmount", this.mFluidAmount);
- aNBT.setTag("GT.CraftingComponents", this.mRecipeStuff);
+ public int getTankPressure() {
+ return 100;
}
- private boolean setVars() {
- // Utils.LOG_INFO("setting Vars.");
- if (this.mFluidName.equals("") || !this.mFluidName.equals(null)) {
- if (this.mFluid != null) {
- this.mFluidName = this.mFluid.getFluid().getName();
- }
- }
- else {
- if (this.mFluid != null) {
- if (!this.mFluidName.equalsIgnoreCase(this.mFluid.getFluid().getName())) {
- this.mFluidName = this.mFluid.getFluid().getName();
- }
- }
- else {
- // Leave Values Blank.
- return false;
- }
- }
+ @Override
+ public void onMachineBlockUpdate() {
+ this.getBaseMetaTileEntity().markDirty();
+ super.onMachineBlockUpdate();
+ }
- if (this.mFluidAmount <= 0) {
- if (this.mFluid != null) {
- this.mFluidAmount = this.mFluid.amount;
- }
- }
- else {
- if (this.mFluid != null) {
- if (this.mFluidAmount != this.mFluid.amount) {
- this.mFluidAmount = this.mFluid.amount;
- }
- }
- else {
- // Leave Values Blank.
- return false;
- }
- }
- return true;
+ @Override
+ public void onRemoval() {
+ this.getBaseMetaTileEntity().markDirty();
+ super.onRemoval();
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
index 0c25018391..53750e3221 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
@@ -1,11 +1,13 @@
package gtPlusPlus.xmod.gregtech.common.tools;
-import java.util.List;
-
import gregtech.api.GregTech_API;
import gregtech.api.damagesources.GT_DamageSources;
+import gregtech.api.interfaces.IToolStats;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
@@ -13,70 +15,61 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
-import net.minecraft.util.*;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EntityDamageSource;
+import net.minecraft.util.IChatComponent;
import net.minecraftforge.event.world.BlockEvent;
-public abstract class TOOL_Gregtech_Base implements Interface_ToolStats {
- public static final Enchantment[] FORTUNE_ENCHANTMENT = {
- Enchantment.fortune
- };
- public static final Enchantment[] LOOTING_ENCHANTMENT = {
- Enchantment.looting
- };
- public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0];
- public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0];
+public abstract class TOOL_Gregtech_Base
+implements Interface_ToolStats {
+ public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune};
+ public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting};
+ public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0];
+ public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0];
@Override
- public boolean canBlock() {
- return false;
+ public int getToolDamagePerBlockBreak() {
+ return 100;
}
@Override
- public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer,
- final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune,
- final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- return 0;
+ public int getToolDamagePerDropConversion() {
+ return 100;
}
@Override
- public int getBaseQuality() {
- return 0;
+ public int getToolDamagePerContainerCraft() {
+ return 800;
}
@Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
+ public int getToolDamagePerEntityAttack() {
+ return 200;
}
@Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
+ public float getSpeedMultiplier() {
+ return 1.0F;
}
@Override
- public String getCraftingSound() {
- return null;
+ public float getMaxDurabilityMultiplier() {
+ return 1.0F;
}
@Override
- public DamageSource getDamageSource(final EntityLivingBase aPlayer, final Entity aEntity) {
- return GT_DamageSources.getCombatDamage(aPlayer instanceof EntityPlayer ? "player" : "mob", aPlayer,
- aEntity instanceof EntityLivingBase ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null);
- }
-
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new EntityDamageSource(aPlayer instanceof EntityPlayer ? "player" : "mob", aPlayer)
- .func_151519_b(aEntity);
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) {
+ return aOriginalHurtResistance;
}
@Override
- public int[] getEnchantmentLevels(final ItemStack aStack) {
- return TOOL_Gregtech_Base.ZERO_ENCHANTMENT_LEVELS;
+ public String getMiningSound() {
+ return null;
}
@Override
- public Enchantment[] getEnchantments(final ItemStack aStack) {
- return TOOL_Gregtech_Base.ZERO_ENCHANTMENTS;
+ public String getCraftingSound() {
+ return null;
}
@Override
@@ -85,99 +78,100 @@ public abstract class TOOL_Gregtech_Base implements Interface_ToolStats {
}
@Override
- public int getHurtResistanceTime(final int aOriginalHurtResistance, final Entity aEntity) {
- return aOriginalHurtResistance;
+ public String getBreakingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
}
@Override
- public float getMagicDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack,
- final EntityPlayer aPlayer) {
- return aOriginalDamage;
+ public int getBaseQuality() {
+ return 0;
}
@Override
- public float getMaxDurabilityMultiplier() {
- return 1.0F;
+ public boolean canBlock() {
+ return false;
}
@Override
- public String getMiningSound() {
- return null;
+ public boolean isCrowbar() {
+ return false;
}
@Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack,
- final EntityPlayer aPlayer) {
- return aOriginalDamage;
+ public boolean isWrench() {
+ return false;
}
@Override
- public float getSpeedMultiplier() {
- return 1.0F;
+ public boolean isWeapon() {
+ return false;
}
@Override
- public int getToolDamagePerBlockBreak() {
- return 100;
+ public boolean isRangedWeapon() {
+ return false;
}
@Override
- public int getToolDamagePerContainerCraft() {
- return 800;
+ public boolean isMiningTool() {
+ return true;
}
-
- @Override
- public int getToolDamagePerDropConversion() {
- return 100;
+
+ public boolean isChainsaw(){
+ return false;
}
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 200;
+
+
+ public boolean isGrafter(){
+ return false;
}
- public boolean isChainsaw() {
- return false;
+
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity) {
+ return GT_DamageSources.getCombatDamage((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, (aEntity instanceof EntityLivingBase) ? getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null);
}
- @Override
- public boolean isCrowbar() {
- return false;
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity);
}
@Override
- public boolean isGrafter() {
- return false;
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
+ return 0;
}
@Override
- public boolean isMiningTool() {
- return true;
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
}
@Override
- public boolean isRangedWeapon() {
- return false;
+ public Enchantment[] getEnchantments(ItemStack aStack) {
+ return ZERO_ENCHANTMENTS;
}
@Override
- public boolean isWeapon() {
- return false;
+ public int[] getEnchantmentLevels(ItemStack aStack) {
+ return ZERO_ENCHANTMENT_LEVELS;
}
@Override
- public boolean isWrench() {
- return false;
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) {
+ aPlayer.triggerAchievement(AchievementList.openInventory);
+ aPlayer.triggerAchievement(AchievementList.mineWood);
+ aPlayer.triggerAchievement(AchievementList.buildWorkBench);
+ }
+
+ public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) {
}
@Override
- public void onStatsAddedToTool(final Gregtech_MetaTool aItem, final int aID) {
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
}
@Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- aPlayer.triggerAchievement(AchievementList.openInventory);
- aPlayer.triggerAchievement(AchievementList.mineWood);
- aPlayer.triggerAchievement(AchievementList.buildWorkBench);
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
index 45849ebed8..d2338c264e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tools;
-import java.util.Arrays;
-import java.util.List;
-
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
@@ -11,6 +8,10 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher;
+
+import java.util.Arrays;
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -20,210 +21,179 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.AchievementList;
-import net.minecraft.util.*;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
import net.minecraftforge.event.world.BlockEvent;
-public class TOOL_Gregtech_Choocher extends TOOL_Gregtech_Base {
-
- public static final List<String> mEffectiveList = Arrays.asList(new String[] {
- EntityIronGolem.class.getName(), "EntityTowerGuardian"
- });
-
+public class TOOL_Gregtech_Choocher
+ extends TOOL_Gregtech_Base {
+
+ public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"});
+
+
@Override
- public boolean canBlock() {
- return true;
- }
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ String tName = aEntity.getClass().getName();
+ tName = tName.substring(tName.lastIndexOf(".") + 1);
+ return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage;
+ }
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 50;
+ }
- @Override
- public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer,
- final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune,
- final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) {
- int rConversions = 0;
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null,
- new ItemStack[] {
- new ItemStack(aBlock, 1, aMetaData)
- });
- if (tRecipe == null || aBlock.hasTileEntity(aMetaData)) {
- for (final ItemStack tDrop : aDrops) {
- tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null,
- new ItemStack[] {
- GT_Utility.copyAmount(1L, new Object[] {
- tDrop
- })
- });
- if (tRecipe != null) {
- final ItemStack tHammeringOutput = tRecipe.getOutput(0);
- if (tHammeringOutput != null) {
- rConversions += tDrop.stackSize;
- tDrop.stackSize *= tHammeringOutput.stackSize;
- tHammeringOutput.stackSize = tDrop.stackSize;
- GT_Utility.setStack(tDrop, tHammeringOutput);
- }
- }
- }
- }
- else {
- aDrops.clear();
- aDrops.add(tRecipe.getOutput(0));
- rConversions++;
- }
- return rConversions;
- }
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
- @Override
- public float getBaseDamage() {
- return 4.0F;
- }
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 400;
+ }
- @Override
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 100;
+ }
+
+ @Override
public int getBaseQuality() {
- return 0;
- }
+ return 0;
+ }
- @Override
- public String getBreakingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
+ @Override
+ public float getBaseDamage() {
+ return 4.0F;
+ }
- @Override
- public ItemStack getBrokenItem(final ItemStack aStack) {
- return null;
- }
+ @Override
+ public float getSpeedMultiplier() {
+ return 0.85F;
+ }
- @Override
- public String getCraftingSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(1));
- }
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.2F;
+ }
- @Override
- public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE
- + " has been Choochered by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName()
- + EnumChatFormatting.WHITE);
- }
+ @Override
+ public String getCraftingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(1));
+ }
- @Override
+ @Override
public String getEntityHitSound() {
- return GregTech_API.sSoundList.get(Integer.valueOf(2));
- }
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(2));
+ }
- @Override
- public IIconContainer getIcon(final boolean aIsToolHead, final ItemStack aStack) {
- // Utils.LOG_INFO("Texture:
- // "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile());
- return TexturesGtTools.SKOOKUM_CHOOCHER;
- }
-
- @Override
- public float getMaxDurabilityMultiplier() {
- return 1.2F;
- }
+ @Override
+ public String getBreakingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
- @Override
+ @Override
public String getMiningSound() {
- return null;
- }
+ return null;
+ }
- @Override
- public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack,
- final EntityPlayer aPlayer) {
- String tName = aEntity.getClass().getName();
- tName = tName.substring(tName.lastIndexOf(".") + 1);
- return TOOL_Gregtech_Choocher.mEffectiveList.contains(tName) || tName.contains("Golem") ? aOriginalDamage * 2.0F
- : aOriginalDamage;
- }
+ @Override
+ public boolean canBlock() {
+ return true;
+ }
+
+ @Override
+ public boolean isWrench(){
+ return true;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
- @Override
- public short[] getRGBa(final boolean aIsToolHead, final ItemStack aStack) {
+ @Override
+ public boolean isWeapon() {
+ return true;
+ }
+
+ @Override
+ public boolean isMinableBlock(Block aBlock, byte aMetaData) {
+ String tTool = aBlock.getHarvestTool(aMetaData);
+ return ((tTool != null) && ((tTool.equals("sword")) || (tTool.equals("wrench")) || (tTool.equals("hammer")) || (tTool.equals("pickaxe")))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.glass) || (aBlock.getMaterial() == Material.piston) || (aBlock == Blocks.hopper) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce) || (GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge);
+ }
+
+ @Override
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
+ int rConversions = 0;
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)});
+ if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) {
+ for (ItemStack tDrop : aDrops) {
+ tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})});
+ if (tRecipe != null) {
+ ItemStack tHammeringOutput = tRecipe.getOutput(0);
+ if (tHammeringOutput != null) {
+ rConversions += tDrop.stackSize;
+ tDrop.stackSize *= tHammeringOutput.stackSize;
+ tHammeringOutput.stackSize = tDrop.stackSize;
+ GT_Utility.setStack(tDrop, tHammeringOutput);
+ }
+ }
+ }
+ } else {
+ aDrops.clear();
+ aDrops.add(tRecipe.getOutput(0));
+ rConversions++;
+ }
+ return rConversions;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ //Utils.LOG_INFO("Texture: "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile());
+ return TexturesGtTools.SKOOKUM_CHOOCHER;
+ }
+
+ @Override
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
return GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa;
}
- @Override
- public float getSpeedMultiplier() {
- return 0.85F;
- }
+ /*@Override
+ public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) {
+ aItem.addItemBehavior(aID, new Behaviour_Choocher());
+ }*/
- @Override
- public int getToolDamagePerBlockBreak() {
- return 50;
- }
+ @Override
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) {
+ super.onToolCrafted(aStack, aPlayer);
+ aPlayer.triggerAchievement(AchievementList.buildSword);
+ try {
+ GT_Mod.instance.achievements.issueAchievement(aPlayer, "tools");
+ GT_Mod.instance.achievements.issueAchievement(aPlayer, "unitool");
+ } catch (Exception e) {
+ }
+ }
- @Override
- public int getToolDamagePerContainerCraft() {
- return 400;
- }
+ @Override
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " has been Choochered by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
+ }
@Override
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- @Override
- public int getToolDamagePerEntityAttack() {
- return 100;
- }
-
- @Override
- public boolean isCrowbar() {
- return false;
+ public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {
+ aItem.addItemBehavior(aID, new Behaviour_Choocher());
}
@Override
public boolean isGrafter() {
return false;
}
-
- @Override
- public boolean isMinableBlock(final Block aBlock, final byte aMetaData) {
- final String tTool = aBlock.getHarvestTool(aMetaData);
- return tTool != null
- && (tTool.equals("sword") || tTool.equals("wrench") || tTool.equals("hammer")
- || tTool.equals("pickaxe"))
- || aBlock.getMaterial() == Material.rock || aBlock.getMaterial() == Material.glass
- || aBlock.getMaterial() == Material.piston || aBlock == Blocks.hopper || aBlock == Blocks.dispenser
- || aBlock == Blocks.dropper || aBlock.getMaterial() == Material.ice
- || aBlock.getMaterial() == Material.packedIce
- || GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData))
- || aBlock.getMaterial() == Material.sand || aBlock.getMaterial() == Material.grass
- || aBlock.getMaterial() == Material.ground || aBlock.getMaterial() == Material.snow
- || aBlock.getMaterial() == Material.clay || aBlock.getMaterial() == Material.leaves
- || aBlock.getMaterial() == Material.vine || aBlock.getMaterial() == Material.wood
- || aBlock.getMaterial() == Material.cactus || aBlock.getMaterial() == Material.circuits
- || aBlock.getMaterial() == Material.gourd || aBlock.getMaterial() == Material.web
- || aBlock.getMaterial() == Material.cloth || aBlock.getMaterial() == Material.carpet
- || aBlock.getMaterial() == Material.plants || aBlock.getMaterial() == Material.cake
- || aBlock.getMaterial() == Material.tnt || aBlock.getMaterial() == Material.sponge;
- }
-
- /*
- * @Override public void onStatsAddedToTool(Gregtech_MetaTool aItem, int
- * aID) { aItem.addItemBehavior(aID, new Behaviour_Choocher()); }
- */
-
- @Override
- public boolean isWeapon() {
- return true;
- }
-
- @Override
- public boolean isWrench() {
- return true;
- }
-
- @Override
- public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) {
- aItem.addItemBehavior(aID, new Behaviour_Choocher());
- }
-
- @Override
- public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) {
- super.onToolCrafted(aStack, aPlayer);
- aPlayer.triggerAchievement(AchievementList.buildSword);
- try {
- GT_Mod.achievements.issueAchievement(aPlayer, "tools");
- GT_Mod.achievements.issueAchievement(aPlayer, "unitool");
- }
- catch (final Exception e) {
- }
- }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
index cc6f07f494..39b7fb41bd 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
@@ -1,21 +1,34 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import cpw.mods.fml.common.event.FMLInterModComms;
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2;
+import cpw.mods.fml.common.event.FMLInterModComms;
+import cpw.mods.fml.common.registry.GameRegistry;
public class Gregtech_Blocks {
- // Register default Tile Entity
- private static void registerDefailtGtTe() {
+ public static void run(){
+
+ //Casing Blocks
+ ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
+ ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2();
+ //ModBlocks.blockMetaTileEntity = new GregtechBlockMachines();
+ //registerDefailtGtTe();
+
+
+
+
+ }
+
+ //Register default Tile Entity
+ private static void registerDefailtGtTe(){
Utils.LOG_INFO("Registering new GT TileEntities.");
- final BaseMetaTileEntity tBaseMetaTileEntity = Meta_GT_Proxy.constructBaseMetaTileEntity();
+ BaseMetaTileEntity tBaseMetaTileEntity = Meta_GT_Proxy.constructBaseMetaTileEntity();
Utils.LOG_INFO("Testing BaseMetaTileEntity.");
if (tBaseMetaTileEntity == null) {
@@ -24,18 +37,7 @@ public class Gregtech_Blocks {
}
Utils.LOG_INFO("Registering the BaseMetaTileEntityEx.");
GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntityEx");
- FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial",
- tBaseMetaTileEntity.getClass().getName());
- }
-
- public static void run() {
-
- // Casing Blocks
- ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
- ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2();
- // ModBlocks.blockMetaTileEntity = new GregtechBlockMachines();
- // registerDefailtGtTe();
-
+ FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", tBaseMetaTileEntity.getClass().getName());
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
index 076188e33b..b34aead51e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
@@ -1,6 +1,9 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.ToolDictNames;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.util.Utils;
@@ -12,94 +15,78 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import net.minecraft.item.ItemStack;
public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrator, Runnable {
- public ProcessingToolHeadChoocher() {
- GregtechOrePrefixes.toolSkookumChoocher.add(this);
- }
-
- public void materialsLoops() {
- final Materials[] i = Materials.values();
- final int size = i.length;
- Utils.LOG_WARNING("Materials to attempt tool gen. with: " + size);
- int used = 0;
- Materials aMaterial = null;
- for (int r = 0; r < size; r++) {
- aMaterial = i[r];
- if (aMaterial != Materials.Stone && aMaterial != Materials.Flint && aMaterial != Materials.Rubber
- && aMaterial != Materials._NULL) {
- if (!aMaterial.contains(SubTag.WOOD) && !aMaterial.contains(SubTag.BOUNCY)
- && !aMaterial.contains(SubTag.NO_SMASHING) && !aMaterial.contains(SubTag.TRANSPARENT)
- && !aMaterial.contains(SubTag.FLAMMABLE) && !aMaterial.contains(SubTag.MAGICAL)
- && !aMaterial.contains(SubTag.NO_SMELTING)) {
- Utils.LOG_WARNING("Found " + aMaterial.name() + " as a valid Skookum Choocher Material.");
- // Input 1
- final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
- final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L);
- final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
- final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L);
- final ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L);
-
- if (null != plate && null != ingot && null != hammerhead && null != longrod && null != screw) {
- RecipeUtils.recipeBuilder(hammerhead, ToolDictNames.craftingToolScrewdriver.name(), plate,
- ingot, plate, plate, longrod, screw, null,
- MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(
- MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, 1, aMaterial, null, null));
- used++;
- }
- else {
- Utils.LOG_WARNING("" + aMaterial.name() + " could not be used for all input compoenents. [3x"
- + aMaterial.name() + " plates, 2x" + aMaterial.name() + " ingots, 1x" + aMaterial.name()
- + " Hard Hammer Head.");
- }
- // GT_ModHandler.addCraftingRecipe(,
- // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS |
- // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H",
- // "PIP", " I ", Character.valueOf('I'),
- // OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'),
- // OrePrefixes.plate.get(aMaterial), Character.valueOf('H'),
- // OrePrefixes.toolHeadHammer.get(aMaterial)});
- }
- else {
- Utils.LOG_WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material.");
- }
- }
- else {
- Utils.LOG_WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material.");
- }
+ public ProcessingToolHeadChoocher() {
+ GregtechOrePrefixes.toolSkookumChoocher.add(this);
+ }
- }
-
- Utils.LOG_INFO("Materials used for tool gen: " + used);
- }
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) {
+ if (aMaterial != Materials.Rubber)
+ if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) {
+ GT_ModHandler.addCraftingRecipe(MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial)});
+ }
+ }
+ }
@Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
+ public void registerOre(GregtechOrePrefixes aPrefix,
+ GT_Materials aMaterial, String aOreDictName, String aModName,
+ ItemStack aStack) {
// TODO Auto-generated method stub
-
+
}
-
- @Override
- public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
- if (aMaterial != Materials.Stone && aMaterial != Materials.Flint) {
- if (aMaterial != Materials.Rubber) {
- if (!aMaterial.contains(SubTag.WOOD) && !aMaterial.contains(SubTag.BOUNCY)
- && !aMaterial.contains(SubTag.NO_SMASHING)) {
- GT_ModHandler.addCraftingRecipe(
- MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null),
- GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "IhI", "III", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial)
- });
+
+ public void materialsLoops(){
+ Materials[] i = Materials.values();
+ int size = i.length;
+ Utils.LOG_WARNING("Materials to attempt tool gen. with: "+size);
+ int used = 0;
+ Materials aMaterial = null;
+ for (int r=0;r<size;r++){
+ aMaterial = i[r];
+ if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) {
+ if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))&& (!aMaterial.contains(SubTag.TRANSPARENT))&& (!aMaterial.contains(SubTag.FLAMMABLE))&& (!aMaterial.contains(SubTag.MAGICAL))&& (!aMaterial.contains(SubTag.NO_SMELTING))) {
+ Utils.LOG_WARNING("Found "+aMaterial.name()+" as a valid Skookum Choocher Material.");
+ //Input 1
+ ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
+ ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L);
+ ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L);
+ ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L);
+ ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L);
+
+ if (null != plate && null != ingot && null != hammerhead && null != longrod && null != screw){
+ RecipeUtils.recipeBuilder(
+ hammerhead, ToolDictNames.craftingToolScrewdriver.name(), plate,
+ ingot, plate, plate,
+ longrod, screw, null,
+ MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, 1, aMaterial, null, null));
+ used++;
+ }
+ else {
+ Utils.LOG_WARNING(""+aMaterial.name()+" could not be used for all input compoenents. [3x"+aMaterial.name()+" plates, 2x"+aMaterial.name()+" ingots, 1x"+aMaterial.name()+" Hard Hammer Head.");
+ }
+ //GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
+ }
+ else {
+ Utils.LOG_WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
}
+ }
+ else {
+ Utils.LOG_WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
}
+
+
}
+
+ Utils.LOG_INFO("Materials used for tool gen: "+used);
}
@Override
public void run() {
Utils.LOG_INFO("Generating Skookum Choochers of all GT Materials.");
- this.materialsLoops();
+ materialsLoops();
}
-
+
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
index 783370f612..41e0511ace 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
@@ -3,7 +3,8 @@ package gtPlusPlus.xmod.gregtech.loaders;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures.ItemIcons.CustomIcon;
public class Processing_Textures_Items {
-
+
public static final CustomIcon itemSkookumChoocher = new CustomIcon("iconsets/SKOOKUMCHOOCHER");
-
+
}
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
index a7965327fe..42f3829045 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import java.util.ArrayList;
-
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gtPlusPlus.core.lib.CORE;
@@ -9,97 +7,97 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
+
+import java.util.ArrayList;
+
import net.minecraft.item.ItemStack;
-public class RecipeGen_BlastSmelter implements Runnable {
+public class RecipeGen_BlastSmelter implements Runnable{
+
+ final Material toGenerate;
+
+ public RecipeGen_BlastSmelter(final Material M){
+ this.toGenerate = M;
+ }
+
+ @Override
+ public void run() {
+ generateARecipe(toGenerate);
+ }
- public static void generateARecipe(final Material M) {
+ public static void generateARecipe(final Material M){
- // Add a Blast Smelting Recipe, Let's go!
+ //Add a Blast Smelting Recipe, Let's go!
ItemStack tStack;
if (null != (tStack = M.getDust(1))) {
- // Prepare some Variables
+ //Prepare some Variables
ItemStack[] components;
ArrayList<MaterialStack> tMaterial = new ArrayList<MaterialStack>();
- short counter = 0;
- int inputStackCount = 0;
- int fluidAmount = 0;
- final boolean doTest = true;
- tMaterial = M.getComposites();
+ short counter=0;
+ int inputStackCount=0;
+ int fluidAmount=0;
+ boolean doTest = true;
+ tMaterial = M.getComposites();
- // This Bad boy here is what dictates unique recipes. Fuck life,
- // right?
+ //This Bad boy here is what dictates unique recipes. Fuck life, right?
ItemStack circuitGT = ItemUtils.getGregtechCircuit(0);
- // Set a duration
+
+ //Set a duration
int duration = 0;
- if (M.getMeltingPointK() > 150) {
+ if (M.getMeltingPointK() > 150){
duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK();
}
else {
- duration = (int) Math.max(M.getMass() / 50L, 1L) * 150;
+ duration = (int) Math.max(M.getMass() / 50L, 1L) * 150;
}
- int mMaterialListSize = 0;
- if (M.getComposites() != null) {
- for (final gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()) {
- if (ternkfsdf != null) {
- mMaterialListSize++;
- }
+
+ int mMaterialListSize=0;
+ if (M.getComposites() != null){
+ for (gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()){
+ if (ternkfsdf != null)
+ mMaterialListSize++;
}
}
else {
- mMaterialListSize = 1;
- }
+ mMaterialListSize = 1;
+ }
+
+ Utils.LOG_WARNING("Size: "+mMaterialListSize);
- Utils.LOG_WARNING("Size: " + mMaterialListSize);
- // Make a simple one Material Materialstack[] and log it for
- // validity.
+ //Make a simple one Material Materialstack[] and log it for validity.
circuitGT = ItemUtils.getGregtechCircuit(1);
- final ItemStack[] tItemStackTest = new ItemStack[] {
- circuitGT, tStack
- };
+ ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, tStack};
inputStackCount = 1;
- fluidAmount = 144 * inputStackCount;
- Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName() + ". Gives "
- + fluidAmount + "L of molten metal.");
- for (int das = 0; das < tItemStackTest.length; das++) {
- if (tItemStackTest[das] != null) {
- Utils.LOG_WARNING("tMaterial[" + das + "]: " + tItemStackTest[das].getDisplayName() + " Meta: "
- + tItemStackTest[das].getItemDamage() + ", Amount: " + tItemStackTest[das].stackSize);
- }
+ fluidAmount = 144*inputStackCount;
+ Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal.");
+ for (int das=0;das<tItemStackTest.length;das++){
+ if (tItemStackTest[das] != null)
+ Utils.LOG_WARNING("tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize);
}
+
+ boolean hasMoreInputThanACircuit = (tItemStackTest.length > 1);
- final boolean hasMoreInputThanACircuit = tItemStackTest.length > 1;
-
- // Generate Recipes for all singular materials that can be made
- // molten.
- if (hasMoreInputThanACircuit) {
+ //Generate Recipes for all singular materials that can be made molten.
+ if (hasMoreInputThanACircuit){
if (M.requiresBlastFurnace()) {
- if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration, 240)) {
+ if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration, 240)){
Utils.LOG_WARNING("Success.");
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144),
- M.getIngot(1), duration, 120)) {
+ if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration, 120)){
Utils.LOG_INFO("Success, Also added a Fluid solidifier recipe.");
- if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100,
- duration, 120)) {
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration, 120)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
- if (GT_Values.RA
- .addFluidExtractionRecipe(
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
- "nugget" + M.getUnlocalizedName(), 1),
- null, M.getFluid(16), 100, duration / 9, 120)) {
+ if (GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1), null, M.getFluid(16), 100, duration/9, 120)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
- if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100,
- duration / 4, 120)) {
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
- if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100,
- duration / 9, 120)) {
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
}
@@ -110,117 +108,103 @@ public class RecipeGen_BlastSmelter implements Runnable {
}
}
else {
- if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration / 2, 120)) {
+ if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration/2, 120)){
Utils.LOG_WARNING("Success.");
- if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144),
- M.getIngot(1), duration / 2, 60)) {
+ if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration/2, 60)){
Utils.LOG_INFO("Success, Also added a Fluid solidifier recipe.");
- if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100,
- duration / 2, 60)) {
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration/2, 60)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
- final ItemStack tempitem = ItemUtils
- .getItemStackOfAmountFromOreDictNoBroken("nugget" + M.getUnlocalizedName(), 1);
- if (tempitem != null) {
- if (GT_Values.RA.addFluidExtractionRecipe(tempitem, null, M.getFluid(16), 100,
- duration / 2 / 9, 60)) {
+ ItemStack tempitem = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1);
+ if (tempitem != null){
+ if (GT_Values.RA.addFluidExtractionRecipe(tempitem, null, M.getFluid(16), 100, duration/2/9, 60)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
- }
- if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100,
- duration / 2 / 4, 60)) {
+ }
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
- if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100,
- duration / 2 / 9, 60)) {
+ if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/2/9, 60)){
Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe.");
}
}
- }
+ }
else {
Utils.LOG_WARNING("Failed.");
- }
- }
+ }
+ }
- if (tMaterial != null) {
- // Reset the Variables for compounds if last recipe was a
- // success.
- inputStackCount = 0;
- counter = 0;
+ if (tMaterial != null){
+ //Reset the Variables for compounds if last recipe was a success.
+ inputStackCount=0;
+ counter=0;
- // If this Material has some kind of compound list, proceed
- if (mMaterialListSize > 1) {
- final gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize];
- circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize);
- // Just double checking
- if (tempStack.length > 1) {
- // Builds me a MaterialStack[] from the MaterialList of
- // M.
- int ooo = 0;
- for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()) {
- if (xMaterial != null) {
- if (xMaterial.getStackMaterial() != null) {
- Utils.LOG_WARNING("FOUND: " + xMaterial.getStackMaterial().getLocalizedName());
- Utils.LOG_WARNING("ADDING: " + xMaterial.getStackMaterial().getLocalizedName());
- }
- tempStack[ooo] = xMaterial;
- }
+
+ //If this Material has some kind of compound list, proceed
+ if (mMaterialListSize > 1){
+ gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize];
+ circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize);
+ //Just double checking
+ if (tempStack.length > 1){
+
+ //Builds me a MaterialStack[] from the MaterialList of M.
+ int ooo=0;
+ for (gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){
+ if (xMaterial != null){
+ if (xMaterial.getStackMaterial() != null){
+ Utils.LOG_WARNING("FOUND: "+xMaterial.getStackMaterial().getLocalizedName());
+ Utils.LOG_WARNING("ADDING: "+xMaterial.getStackMaterial().getLocalizedName());
+ }
+ tempStack[ooo] = xMaterial;
+ }
ooo++;
}
- // Builds me an ItemStack[] of the materials. - Without
- // a circuit - this gets a good count for the 144L fluid
- // multiplier
+ //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier
components = new ItemStack[9];
- inputStackCount = 0;
- for (int irc = 0; irc < M.getComposites().size(); irc++) {
- if (M.getComposites().get(irc) != null) {
- final int r = (int) M.vSmallestRatio[irc];
- inputStackCount = inputStackCount + r;
+ inputStackCount=0;
+ for (int irc=0;irc<M.getComposites().size();irc++){
+ if (M.getComposites().get(irc) != null){
+ int r = (int) M.vSmallestRatio[irc];
+ inputStackCount = inputStackCount+r;
components[irc] = M.getComposites().get(irc).getDustStack(r);
- }
+ }
}
- // Adds a circuit
- if (mMaterialListSize < 9 && mMaterialListSize != 0) {
- final ItemStack[] components_NoCircuit = components;
- // Builds me an ItemStack[] of the materials. - With
- // a circuit
- components = new ItemStack[components_NoCircuit.length + 1];
- for (int fr = 0; fr < components.length; fr++) {
- if (fr == 0) {
+
+ //Adds a circuit
+ if (mMaterialListSize < 9 && mMaterialListSize != 0){
+ ItemStack[] components_NoCircuit = components;
+ //Builds me an ItemStack[] of the materials. - With a circuit
+ components = new ItemStack[components_NoCircuit.length+1];
+ for (int fr=0;fr<components.length;fr++){
+ if (fr==0){
components[0] = circuitGT;
}
else {
- components[fr] = components_NoCircuit[fr - 1];
- }
+ components[fr] = components_NoCircuit[fr-1];
+ }
}
- Utils.LOG_INFO("Should have added a circuit. mMaterialListSize: " + mMaterialListSize
- + " | circuit: " + components[0].getDisplayName());
+ Utils.LOG_INFO("Should have added a circuit. mMaterialListSize: "+mMaterialListSize+" | circuit: "+components[0].getDisplayName());
}
else {
- Utils.LOG_INFO("Did not add a circuit. mMaterialListSize: " + mMaterialListSize);
+ Utils.LOG_INFO("Did not add a circuit. mMaterialListSize: "+mMaterialListSize);
}
- // Set Fluid output
- fluidAmount = 144 * inputStackCount;
+ //Set Fluid output
+ fluidAmount = 144*inputStackCount;
- Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName()
- + " using it's compound dusts. This material has " + inputStackCount + " parts. Gives "
- + fluidAmount + "L of molten metal.");
- Utils.LOG_INFO("tMaterial.length: " + components.length + ".");
- for (int das = 0; das < components.length; das++) {
- if (components[das] != null) {
- Utils.LOG_INFO("tMaterial[" + das + "]: " + components[das].getDisplayName() + " Meta: "
- + components[das].getItemDamage() + ", Amount: " + components[das].stackSize);
- }
+ Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal.");
+ Utils.LOG_INFO("tMaterial.length: "+components.length+".");
+ for (int das=0;das<components.length;das++){
+ if (components[das] != null)
+ Utils.LOG_INFO("tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize);
}
- // Adds Recipe
+ //Adds Recipe
if (M.requiresBlastFurnace()) {
- if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration,
- 500)) {
+ if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration, 500)){
Utils.LOG_WARNING("Success.");
}
else {
@@ -228,31 +212,19 @@ public class RecipeGen_BlastSmelter implements Runnable {
}
}
else {
- if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration,
- 240)) {
+ if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration, 240)){
Utils.LOG_WARNING("Success.");
- }
+ }
else {
Utils.LOG_WARNING("Failed.");
- }
+ }
}
}
}
}
else {
- Utils.LOG_WARNING("doTest: " + doTest + " | tMaterial != null: " + (tMaterial != null));
+ Utils.LOG_WARNING("doTest: "+doTest+" | tMaterial != null: "+(tMaterial != null));
}
}
}
-
- final Material toGenerate;
-
- public RecipeGen_BlastSmelter(final Material M) {
- this.toGenerate = M;
- }
-
- @Override
- public void run() {
- RecipeGen_BlastSmelter.generateARecipe(this.toGenerate);
- }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT.java
index 8044c78a39..be2dbff77a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
import gregtech.api.objects.MaterialStack;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.lib.CORE;
@@ -8,173 +10,157 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
-public class RecipeGen_BlastSmelterGT implements Runnable {
+public class RecipeGen_BlastSmelterGT implements Runnable{
+
+ public RecipeGen_BlastSmelterGT(){
+
+ }
+
+ @Override
+ public void run() {
+ generateRecipes();
+ }
- public static void generateRecipes() {
+ public static void generateRecipes(){
- final Materials[] GregMaterials = Materials.values();
+ Materials[] GregMaterials = Materials.values();
- for (final Materials M : GregMaterials) {
+ for (Materials M : GregMaterials){
if (M.equals(Materials.Iridium) || M.equals(Materials.Osmium) || M.equals(Materials.Osmiridium)
- || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
- || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
- || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
- || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
- || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
- || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)) {
-
- // Add a Blast Smelting Recipe, Let's go!
+ || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
+ || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
+ || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
+ || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)
+ ){
+
+
+ //Add a Blast Smelting Recipe, Let's go!
ItemStack tStack;
- if (null != (tStack = GT_OreDictUnificator.get(OrePrefixes.ingot, M.mSmeltInto, 1L))
- && !M.contains(SubTag.NO_SMELTING) && M.contains(SubTag.METAL)) {
+ if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.ingot, M.mSmeltInto, 1L))) && (!M.contains(SubTag.NO_SMELTING) && (M.contains(SubTag.METAL)))) {
- // Prepare some Variables
+ //Prepare some Variables
ItemStack[] components;
MaterialStack[] tMaterial;
- short counter = 0;
- int inputStackCount = 0;
- int fluidAmount = 0;
+ short counter=0;
+ int inputStackCount=0;
+ int fluidAmount=0;
boolean doTest = true;
- // This Bad boy here is what dictates unique recipes. Fuck
- // life, right?
+ //This Bad boy here is what dictates unique recipes. Fuck life, right?
ItemStack circuitGT = ItemUtils.getGregtechCircuit(0);
- // Set a duration
+
+ //Set a duration
int duration = 0;
- if (M.mBlastFurnaceTemp > 150) {
+ if (M.mBlastFurnaceTemp > 150){
duration = (int) Math.max(M.getMass() / 50L, 1L) * M.mBlastFurnaceTemp;
}
else {
- duration = (int) Math.max(M.getMass() / 50L, 1L) * 150;
+ duration = (int) Math.max(M.getMass() / 50L, 1L) * 150;
}
- // Make a simple one Material Materialstack[] and log it for
- // validity.
- tMaterial = new MaterialStack[] {
- new MaterialStack(M, 1)
- };
+
+ //Make a simple one Material Materialstack[] and log it for validity.
+ tMaterial = new MaterialStack[]{new MaterialStack(M, 1)};
circuitGT = ItemUtils.getGregtechCircuit(1);
- final ItemStack[] tItemStackTest = new ItemStack[] {
- circuitGT, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust" + M, 1)
- };
+ ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)};
inputStackCount = 1;
- fluidAmount = 144 * inputStackCount;
- Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for " + M + ". Gives " + fluidAmount
- + "L of molten metal.");
- Utils.LOG_WARNING("tMaterial.length: " + tMaterial.length + ".");
- for (int das = 0; das < tItemStackTest.length; das++) {
- if (tItemStackTest[das] != null) {
- Utils.LOG_WARNING("tMaterial[" + das + "]: " + tItemStackTest[das].getDisplayName()
- + " Meta: " + tItemStackTest[das].getItemDamage() + ", Amount: "
- + tItemStackTest[das].stackSize);
- }
+ fluidAmount = 144*inputStackCount;
+ Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M+". Gives "+fluidAmount+"L of molten metal.");
+ Utils.LOG_WARNING("tMaterial.length: "+tMaterial.length+".");
+ for (int das=0;das<tItemStackTest.length;das++){
+ if (tItemStackTest[das] != null)
+ Utils.LOG_WARNING("tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize);
}
- // Generate Recipes for all singular materials that can be
- // made molten.
+ //Generate Recipes for all singular materials that can be made molten.
if (M.mBlastFurnaceRequired) {
- doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration,
- 240);
+ doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240);
}
else {
- doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100,
- duration / 2, 120);
+ doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120);
}
- if (doTest) {
- // Reset the Variables for compounds if last recipe was
- // a success.
- inputStackCount = 0;
- counter = 0;
+ if (doTest){
+ //Reset the Variables for compounds if last recipe was a success.
+ inputStackCount=0;
+ counter=0;
+
- int mMaterialListSize = 0;
- for (final MaterialStack ternkfsdf : M.mMaterialList) {
+ int mMaterialListSize=0;
+ for (MaterialStack ternkfsdf:M.mMaterialList){
mMaterialListSize++;
}
- Utils.LOG_WARNING("Size: " + mMaterialListSize);
- // If this Material has some kind of compound list,
- // proceed
- if (mMaterialListSize > 1) {
- final MaterialStack[] tempStack = new MaterialStack[mMaterialListSize];
+ Utils.LOG_WARNING("Size: "+mMaterialListSize);
+ //If this Material has some kind of compound list, proceed
+ if (mMaterialListSize > 1){
+ MaterialStack[] tempStack = new MaterialStack[mMaterialListSize];
circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize);
- // Just double checking
- if (tempStack.length > 1) {
-
- // Builds me a MaterialStack[] from the
- // MaterialList of M.
- int ooo = 0;
- for (final MaterialStack xMaterial : M.mMaterialList) {
- Utils.LOG_WARNING("FOUND: " + xMaterial.mMaterial);
- Utils.LOG_WARNING("ADDING: " + xMaterial.mMaterial);
+ //Just double checking
+ if (tempStack.length > 1){
+
+ //Builds me a MaterialStack[] from the MaterialList of M.
+ int ooo=0;
+ for (MaterialStack xMaterial : M.mMaterialList){
+ Utils.LOG_WARNING("FOUND: "+xMaterial.mMaterial);
+ Utils.LOG_WARNING("ADDING: "+xMaterial.mMaterial);
tempStack[ooo] = M.mMaterialList.get(ooo);
ooo++;
}
- // Builds me an ItemStack[] of the materials. -
- // Without a circuit - this gets a good count
- // for the 144L fluid multiplier
+ //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier
components = new ItemStack[tempStack.length];
- for (final MaterialStack aOutputPart : tempStack) {
- if (aOutputPart != null) {
- Utils.LOG_WARNING("Finding dust: " + aOutputPart.mMaterial);
- final ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
- "dust" + aOutputPart.mMaterial, (int) aOutputPart.mAmount);
- if (rStack != null) {
- Utils.LOG_WARNING("Found dust: " + aOutputPart.mMaterial);
+ for (MaterialStack aOutputPart : tempStack){
+ if (aOutputPart != null){
+ Utils.LOG_WARNING("Finding dust: "+aOutputPart.mMaterial);
+ ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount);
+ if (rStack != null){
+ Utils.LOG_WARNING("Found dust: "+aOutputPart.mMaterial);
components[counter] = rStack;
- inputStackCount = inputStackCount + rStack.stackSize;
+ inputStackCount = inputStackCount+rStack.stackSize;
}
- }
- counter++;
+ }
+ counter++;
}
- if (mMaterialListSize > 0 && mMaterialListSize < 9) {
- final ItemStack[] components_NoCircuit = components;
- // Builds me an ItemStack[] of the
- // materials. - With a circuit
- components = new ItemStack[components_NoCircuit.length + 1];
- for (int fr = 0; fr < components.length; fr++) {
- if (fr == 0) {
+
+ if (mMaterialListSize > 0 && mMaterialListSize < 9){
+ ItemStack[] components_NoCircuit = components;
+ //Builds me an ItemStack[] of the materials. - With a circuit
+ components = new ItemStack[components_NoCircuit.length+1];
+ for (int fr=0;fr<components.length;fr++){
+ if (fr==0){
components[0] = circuitGT;
}
else {
- components[fr] = components_NoCircuit[fr - 1];
- }
+ components[fr] = components_NoCircuit[fr-1];
+ }
}
}
- /*
- * //Add a shapeless recipe for each dust this
- * way - Compat mode. ItemStack outputStack =
- * tStack; outputStack.stackSize =
- * mMaterialListSize;
- * RecipeUtils.buildShapelessRecipe(outputStack,
- * components);
- */
-
- // Set Fluid output
- fluidAmount = 144 * inputStackCount;
-
- Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for " + M
- + " using it's compound dusts. This material has " + inputStackCount
- + " parts. Gives " + fluidAmount + "L of molten metal.");
- Utils.LOG_WARNING("tMaterial.length: " + components.length + ".");
- for (int das = 0; das < components.length; das++) {
- if (components[das] != null) {
- Utils.LOG_WARNING("tMaterial[" + das + "]: " + components[das].getDisplayName()
- + " Meta: " + components[das].getItemDamage() + ", Amount: "
- + components[das].stackSize);
- }
+ /*//Add a shapeless recipe for each dust this way - Compat mode.
+ ItemStack outputStack = tStack;
+ outputStack.stackSize = mMaterialListSize;
+ RecipeUtils.buildShapelessRecipe(outputStack, components);*/
+
+
+
+ //Set Fluid output
+ fluidAmount = 144*inputStackCount;
+
+
+ Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal.");
+ Utils.LOG_WARNING("tMaterial.length: "+components.length+".");
+ for (int das=0;das<components.length;das++){
+ if (components[das] != null)
+ Utils.LOG_WARNING("tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize);
}
if (M.mBlastFurnaceRequired) {
- CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration,
- 500);
+ CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 500);
}
else {
- CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration,
- 240);
+ CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 240);
}
}
}
@@ -183,13 +169,4 @@ public class RecipeGen_BlastSmelterGT implements Runnable {
}
}
}
-
- public RecipeGen_BlastSmelterGT() {
-
- }
-
- @Override
- public void run() {
- RecipeGen_BlastSmelterGT.generateRecipes();
- }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index 01512a0abc..c0122cbcf5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -7,22 +7,37 @@ import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import net.minecraft.item.ItemStack;
-public class RecipeGen_DustGeneration implements Runnable {
+public class RecipeGen_DustGeneration implements Runnable{
- public static void generateRecipes(final Material material) {
+ final Material toGenerate;
+
+ public RecipeGen_DustGeneration(final Material M){
+ this.toGenerate = M;
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(toGenerate);
+ }
+
+ public static void generateRecipes(final Material material){
final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16;
- Utils.LOG_WARNING("Generating Shaped Crafting recipes for " + material.getLocalizedName()); // TODO
- // Ring Recipe
+ Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
+ //Ring Recipe
- if (RecipeUtils.addShapedGregtechRecipe("craftingToolWrench", null, null, null, material.getRod(1), null, null,
- null, null, material.getRing(1))) {
- Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Success");
+ if (RecipeUtils.addShapedGregtechRecipe(
+ "craftingToolWrench", null, null,
+ null, material.getRod(1), null,
+ null, null, null,
+ material.getRing(1))){
+ Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed");
}
+
final ItemStack normalDust = material.getDust(1);
final ItemStack smallDust = material.getSmallDust(1);
final ItemStack tinyDust = material.getTinyDust(1);
@@ -30,87 +45,101 @@ public class RecipeGen_DustGeneration implements Runnable {
final ItemStack[] inputStacks = material.getMaterialComposites();
final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
- if (RecipeUtils.recipeBuilder(tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust,
- tinyDust, normalDust)) {
- Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+ if (RecipeUtils.recipeBuilder(
+ tinyDust, tinyDust, tinyDust,
+ tinyDust, tinyDust, tinyDust,
+ tinyDust, tinyDust, tinyDust,
+ normalDust)){
+ Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
}
- if (RecipeUtils.recipeBuilder(normalDust, null, null, null, null, null, null, null, null,
- material.getTinyDust(9))) {
- Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success");
+ if (RecipeUtils.recipeBuilder(
+ normalDust, null, null,
+ null, null, null,
+ null, null, null,
+ material.getTinyDust(9))){
+ Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed");
}
- if (RecipeUtils.recipeBuilder(smallDust, smallDust, null, smallDust, smallDust, null, null, null, null,
- normalDust)) {
- Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+
+ if (RecipeUtils.recipeBuilder(
+ smallDust, smallDust, null,
+ smallDust, smallDust, null,
+ null, null, null,
+ normalDust)){
+ Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
}
- if (RecipeUtils.recipeBuilder(null, normalDust, null, null, null, null, null, null, null,
- material.getSmallDust(4))) {
- Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Success");
+
+ if (RecipeUtils.recipeBuilder(
+ null, normalDust, null,
+ null, null, null,
+ null, null, null,
+ material.getSmallDust(4))){
+ Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Is this a composite?
- if (inputStacks != null) {
- // Is this a composite?
- Utils.LOG_INFO("mixer length: " + inputStacks.length);
- if (inputStacks.length != 0 && inputStacks.length <= 4) {
- // Log Input items
+ //Is this a composite?
+ if (inputStacks != null){
+ //Is this a composite?
+ Utils.LOG_INFO("mixer length: "+inputStacks.length);
+ if (inputStacks.length != 0 && inputStacks.length <= 4){
+ //Log Input items
Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
final long[] inputStackSize = material.vSmallestRatio;
- Utils.LOG_INFO("mixer is stacksizeVar null? " + (inputStackSize != null));
- // Is smallest ratio invalid?
- if (inputStackSize != null) {
- // set stack sizes on an input ItemStack[]
- for (short x = 0; x < inputStacks.length; x++) {
- if (inputStacks[x] != null && inputStackSize[x] != 0) {
+ Utils.LOG_INFO("mixer is stacksizeVar null? "+(inputStackSize != null));
+ //Is smallest ratio invalid?
+ if (inputStackSize != null){
+ //set stack sizes on an input ItemStack[]
+ for (short x=0;x<inputStacks.length;x++){
+ if (inputStacks[x] != null && inputStackSize[x] != 0)
inputStacks[x].stackSize = (int) inputStackSize[x];
- }
}
- // Relog input values, with stack sizes
- Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
-
- // Get us four ItemStacks to input into the mixer
+ //Relog input values, with stack sizes
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+
+ //Get us four ItemStacks to input into the mixer
ItemStack input1, input2, input3, input4;
- input1 = inputStacks.length >= 1 ? (input1 = inputStacks[0] == null ? null : inputStacks[0]) : null;
- input2 = inputStacks.length >= 2 ? (input2 = inputStacks[1] == null ? null : inputStacks[1]) : null;
- input3 = inputStacks.length >= 3 ? (input3 = inputStacks[2] == null ? null : inputStacks[2]) : null;
- input4 = inputStacks.length >= 4 ? (input4 = inputStacks[3] == null ? null : inputStacks[3]) : null;
-
- // Add mixer Recipe
- if (GT_Values.RA.addMixerRecipe(input1, input2, input3, input4, null, null, outputStacks,
- (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) {
- Utils.LOG_INFO("Dust Mixer Recipe: " + material.getLocalizedName() + " - Success");
+ input1 = (inputStacks.length >= 1) ? (input1 = (inputStacks[0] == null) ? null : inputStacks[0]) : null;
+ input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null;
+ input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null;
+ input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null;
+
+ //Add mixer Recipe
+ if (GT_Values.RA.addMixerRecipe(
+ input1, input2,
+ input3, input4,
+ null, null,
+ outputStacks,
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ 6 * material.vVoltageMultiplier))
+ {
+ Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_INFO("Dust Mixer Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
}
}
}
}
+
+
+
+
+
}
-
- final Material toGenerate;
-
- public RecipeGen_DustGeneration(final Material M) {
- this.toGenerate = M;
- }
-
- @Override
- public void run() {
- RecipeGen_DustGeneration.generateRecipes(this.toGenerate);
- }
}
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
index 626dbbe004..f0ebec9c67 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
@@ -7,25 +7,20 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import net.minecraft.item.ItemStack;
-public class RecipeGen_Extruder implements Runnable {
+public class RecipeGen_Extruder implements Runnable{
- public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput,
- int aDuration, final int aEUt) {
- if (aInput == null || aShape == null || aOutput == null) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[] {
- aInput, aShape
- }, new ItemStack[] {
- aOutput
- }, null, null, null, aDuration, aEUt, 0);
- return true;
+ final Material toGenerate;
+
+ public RecipeGen_Extruder(final Material M){
+ this.toGenerate = M;
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(toGenerate);
}
- public static void generateRecipes(final Material material) {
+ public static void generateRecipes(final Material material){
final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16;
final ItemStack itemIngot = material.getIngot(1);
@@ -38,69 +33,96 @@ public class RecipeGen_Extruder implements Runnable {
final ItemStack shape_Rod = ItemList.Shape_Extruder_Rod.get(0);
final ItemStack shape_Bolt = ItemList.Shape_Extruder_Bolt.get(0);
- Utils.LOG_WARNING("Generating Extruder recipes for " + material.getLocalizedName());
+ Utils.LOG_WARNING("Generating Extruder recipes for "+material.getLocalizedName());
- // Plate Recipe
- if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Plate, plate_Single, 10, 4 * tVoltageMultiplier)) {
- Utils.LOG_WARNING("Extruder Plate Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Plate Recipe
+ if (addExtruderRecipe(
+ itemIngot,
+ shape_Plate,
+ plate_Single,
+ 10, 4 * tVoltageMultiplier)){
+ Utils.LOG_WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Extruder Plate Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Ring Recipe
- if (!material.isRadioactive) {
- if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Ring, material.getRing(4),
- (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) {
- Utils.LOG_WARNING("Extruder Ring Recipe: " + material.getLocalizedName() + " - Success");
+ //Ring Recipe
+ if (!material.isRadioactive){
+ if (addExtruderRecipe(
+ itemIngot,
+ shape_Ring,
+ material.getRing(4),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ 6 * material.vVoltageMultiplier)){
+ Utils.LOG_WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Extruder Ring Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- // Gear Recipe
- if (!material.isRadioactive) {
- if (RecipeGen_Extruder.addExtruderRecipe(material.getIngot(8), shape_Gear, itemGear,
- (int) Math.max(material.getMass() * 5L, 1), 8 * material.vVoltageMultiplier)) {
- Utils.LOG_WARNING("Extruder Gear Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Gear Recipe
+ if (!material.isRadioactive){
+ if (addExtruderRecipe(
+ material.getIngot(8),
+ shape_Gear,
+ itemGear,
+ (int) Math.max(material.getMass() * 5L, 1),
+ 8 * material.vVoltageMultiplier)){
+ Utils.LOG_WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Extruder Gear Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- // Rod Recipe
- if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Rod, material.getRod(2),
- (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) {
- Utils.LOG_WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Rod Recipe
+ if (addExtruderRecipe(
+ itemIngot,
+ shape_Rod,
+ material.getRod(2),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ 6 * material.vVoltageMultiplier)){
+ Utils.LOG_WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Bolt Recipe
- if (!material.isRadioactive) {
- if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Bolt, material.getBolt(8),
- (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) {
- Utils.LOG_WARNING("Extruder Bolt Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Bolt Recipe
+ if (!material.isRadioactive){
+ if (addExtruderRecipe(
+ itemIngot,
+ shape_Bolt,
+ material.getBolt(8),
+ (int) Math.max(material.getMass() * 2L * 1, 1),
+ 6 * material.vVoltageMultiplier)){
+ Utils.LOG_WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Extruder Bolt Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- }
+ }
- final Material toGenerate;
- public RecipeGen_Extruder(final Material M) {
- this.toGenerate = M;
+ public static boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) {
+ if ((aInput == null) || (aShape == null) || (aOutput == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
+ return true;
}
- @Override
- public void run() {
- RecipeGen_Extruder.generateRecipes(this.toGenerate);
- }
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
index 96d7fdd5f2..0502156525 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java
@@ -8,53 +8,20 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import net.minecraft.item.ItemStack;
-public class RecipeGen_Plates implements Runnable {
+public class RecipeGen_Plates implements Runnable{
- public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration,
- final int aEUt) {
- if (aInput1 == null || aOutput1 == null) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) {
- return false;
- }
- new GT_Recipe(aEUt, aDuration, aInput1, aOutput1);
- return true;
- }
-
- public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput,
- int aDuration, final int aEUt) {
- if (aInput == null || aShape == null || aOutput == null) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[] {
- aInput, aShape
- }, new ItemStack[] {
- aOutput
- }, null, null, null, aDuration, aEUt, 0);
- return true;
+ final Material toGenerate;
+
+ public RecipeGen_Plates(final Material M){
+ this.toGenerate = M;
}
-
- public static boolean addForgeHammerRecipe(final ItemStack aInput1, final ItemStack aOutput1, final int aDuration,
- final int aEUt) {
- if (aInput1 == null || aOutput1 == null) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[] {
- aInput1
- }, new ItemStack[] {
- aOutput1
- }, null, null, null, aDuration, aEUt, 0);
- return true;
+
+ @Override
+ public void run() {
+ generateRecipes(toGenerate);
}
-
- public static void generateRecipes(final Material material) {
+
+ public static void generateRecipes(final Material material){
final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16;
final ItemStack ingotStackOne = material.getIngot(1);
@@ -64,59 +31,100 @@ public class RecipeGen_Plates implements Runnable {
final ItemStack plate_SingleTwo = material.getPlate(2);
final ItemStack plate_Double = material.getPlateDouble(1);
- Utils.LOG_WARNING("Generating Plate recipes for " + material.getLocalizedName());
-
- // Forge Hammer
- if (RecipeGen_Plates.addForgeHammerRecipe(ingotStackTwo, plate_Single, (int) Math.max(material.getMass(), 1L),
- 16)) {
- Utils.LOG_WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Success");
+ Utils.LOG_WARNING("Generating Plate recipes for "+material.getLocalizedName());
+
+ //Forge Hammer
+ if (addForgeHammerRecipe(
+ ingotStackTwo,
+ plate_Single,
+ (int) Math.max(material.getMass(), 1L),
+ 16)){
+ Utils.LOG_WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Bender
- if (RecipeGen_Plates.addBenderRecipe(ingotStackOne, plate_Single, (int) Math.max(material.getMass() * 1L, 1L),
- 24)) {
- Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success");
+ //Bender
+ if (addBenderRecipe(
+ ingotStackOne,
+ plate_Single,
+ (int) Math.max(material.getMass() * 1L, 1L),
+ 24)){
+ Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Alloy Smelter
- if (GT_Values.RA.addAlloySmelterRecipe(ingotStackTwo, shape_Mold, plate_Single,
- (int) Math.max(material.getMass() * 2L, 1L), 2 * tVoltageMultiplier)) {
- Utils.LOG_WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Success");
+ //Alloy Smelter
+ if (GT_Values.RA.addAlloySmelterRecipe(
+ ingotStackTwo,
+ shape_Mold,
+ plate_Single,
+ (int) Math.max(material.getMass() * 2L, 1L),
+ 2 * tVoltageMultiplier)){
+ Utils.LOG_WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Making Double Plates
- if (RecipeGen_Plates.addBenderRecipe(ingotStackTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L),
- 96)) {
- Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Making Double Plates
+ if (addBenderRecipe(
+ ingotStackTwo,
+ plate_Double,
+ (int) Math.max(material.getMass() * 2L, 1L),
+ 96)){
+ Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
}
- if (RecipeGen_Plates.addBenderRecipe(plate_SingleTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L),
- 96)) {
- Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success");
+ if (addBenderRecipe(
+ plate_SingleTwo,
+ plate_Double,
+ (int) Math.max(material.getMass() * 2L, 1L),
+ 96)){
+ Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed");
- }
+ Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed");
+ }
}
- final Material toGenerate;
+ public static boolean addBenderRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
+ if ((aInput1 == null) || (aOutput1 == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) {
+ return false;
+ }
+ new GT_Recipe(aEUt, aDuration, aInput1, aOutput1);
+ return true;
+ }
- public RecipeGen_Plates(final Material M) {
- this.toGenerate = M;
+ public static boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) {
+ if ((aInput == null) || (aShape == null) || (aOutput == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
+ return true;
}
- @Override
- public void run() {
- RecipeGen_Plates.generateRecipes(this.toGenerate);
+ public static boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
+ if ((aInput1 == null) || (aOutput1 == null)) {
+ return false;
+ }
+ if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0);
+ return true;
}
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
index 1667f8abe3..6eaa164342 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
@@ -6,152 +6,191 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import net.minecraft.item.ItemStack;
-public class RecipeGen_ShapedCrafting implements Runnable {
-
- public static void generateRecipes(final Material material) {
- Utils.LOG_WARNING("Generating Shaped Crafting recipes for " + material.getLocalizedName()); // TODO
-
- // Plates
-
- // Single Plate Shaped/Shapeless
- GT_ModHandler.addCraftingRecipe(material.getPlate(1),
- gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS
- | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "h", "B", "I", Character.valueOf('I'), material.getIngot(1), Character.valueOf('B'),
- material.getIngot(1)
- });
-
- GT_ModHandler.addShapelessCraftingRecipe(material.getPlate(1), new Object[] {
- gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getIngot(1), material.getIngot(1)
- });
-
- // Double Plate Shaped/Shapeless
- GT_ModHandler.addCraftingRecipe(material.getPlateDouble(1),
- gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS
- | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "I", "B", "h", Character.valueOf('I'), material.getPlate(1), Character.valueOf('B'),
- material.getPlate(1)
- });
-
- GT_ModHandler.addShapelessCraftingRecipe(material.getPlateDouble(1), new Object[] {
- gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getPlate(1), material.getPlate(1)
- });
-
- // Ring Recipe
- if (!material.isRadioactive) {
- if (RecipeUtils.recipeBuilder("craftingToolHardHammer", null, null, null, material.getRod(1), null, null,
- null, null, material.getRing(1))) {
- Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Success");
+public class RecipeGen_ShapedCrafting implements Runnable{
+
+ final Material toGenerate;
+
+ public RecipeGen_ShapedCrafting(final Material M){
+ this.toGenerate = M;
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(toGenerate);
+ }
+
+ public static void generateRecipes(final Material material){
+ Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
+
+ //Plates
+
+ //Single Plate Shaped/Shapeless
+ GT_ModHandler.addCraftingRecipe(
+ material.getPlate(1),
+ gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"h", "B", "I",
+ Character.valueOf('I'),
+ material.getIngot(1),
+ Character.valueOf('B'),
+ material.getIngot(1)});
+
+ GT_ModHandler.addShapelessCraftingRecipe(
+ material.getPlate(1),
+ new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
+ material.getIngot(1),
+ material.getIngot(1)});
+
+ //Double Plate Shaped/Shapeless
+ GT_ModHandler.addCraftingRecipe(
+ material.getPlateDouble(1),
+ gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"I", "B", "h",
+ Character.valueOf('I'),
+ material.getPlate(1),
+ Character.valueOf('B'),
+ material.getPlate(1)});
+
+ GT_ModHandler.addShapelessCraftingRecipe(
+ material.getPlateDouble(1),
+ new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
+ material.getPlate(1),
+ material.getPlate(1)});
+
+ //Ring Recipe
+ if (!material.isRadioactive){
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolHardHammer", null, null,
+ null, material.getRod(1), null,
+ null, null, null,
+ material.getRing(1))){
+ Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- // Framebox Recipe
- if (!material.isRadioactive) {
+
+ //Framebox Recipe
+ if (!material.isRadioactive){
final ItemStack stackStick = material.getRod(1);
- if (RecipeUtils.recipeBuilder(stackStick, stackStick, stackStick, stackStick, "craftingToolWrench",
- stackStick, stackStick, stackStick, stackStick, material.getFrameBox(2))) {
- Utils.LOG_WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Success");
+ if (RecipeUtils.recipeBuilder(
+ stackStick, stackStick, stackStick,
+ stackStick, "craftingToolWrench", stackStick,
+ stackStick, stackStick, stackStick,
+ material.getFrameBox(2))){
+ Utils.LOG_WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- // Add a shapeless recipe for each dust this way - Compat mode.
- /*
- * ItemStack[] inputStacks = material.getMaterialComposites(); ItemStack
- * outputStacks =
- * material.getDust(material.smallestStackSizeWhenProcessing);
- *
- * if (inputStacks.length > 0){
- * Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); long[]
- * inputStackSize = material.vSmallestRatio; if (inputStackSize !=
- * null){ for (short x=0;x<inputStacks.length;x++){ if (inputStacks[x]
- * != null && inputStackSize[x] != 0) inputStacks[x].stackSize = (int)
- * inputStackSize[x]; }
- * Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); if
- * (RecipeUtils.buildShapelessRecipe( outputStacks, inputStacks )){
- * Utils.LOG_WARNING("Shapeless Crafting Recipe: "
- * +material.getLocalizedName()+" - Success"); } else {
- * Utils.LOG_WARNING("Shapeless Crafting Recipe: "
- * +material.getLocalizedName()+" - Failed"); } } }
- */
-
- // Shaped Recipe - Bolts
- if (!material.isRadioactive) {
- if (RecipeUtils.recipeBuilder("craftingToolSaw", null, null, null, material.getRod(1), null, null, null,
- null, material.getBolt(2))) {
- Utils.LOG_WARNING("Bolt Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Add a shapeless recipe for each dust this way - Compat mode.
+ /*ItemStack[] inputStacks = material.getMaterialComposites();
+ ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing);
+
+ if (inputStacks.length > 0){
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ long[] inputStackSize = material.vSmallestRatio;
+ if (inputStackSize != null){
+ for (short x=0;x<inputStacks.length;x++){
+ if (inputStacks[x] != null && inputStackSize[x] != 0)
+ inputStacks[x].stackSize = (int) inputStackSize[x];
+ }
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ if (RecipeUtils.buildShapelessRecipe(
+ outputStacks,
+ inputStacks
+ )){
+ Utils.LOG_WARNING("Shapeless Crafting Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Utils.LOG_WARNING("Shapeless Crafting Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+ }
+ }*/
+
+
+ //Shaped Recipe - Bolts
+ if (!material.isRadioactive){
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolSaw", null, null,
+ null, material.getRod(1), null,
+ null, null, null,
+ material.getBolt(2))){
+ Utils.LOG_WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Bolt Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- // Shaped Recipe - Ingot to Rod
- if (RecipeUtils.recipeBuilder("craftingToolFile", null, null, null, material.getIngot(1), null, null, null,
- null, material.getRod(1))) {
- Utils.LOG_WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Shaped Recipe - Ingot to Rod
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolFile", null, null,
+ null, material.getIngot(1), null,
+ null, null, null,
+ material.getRod(1))){
+ Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Shaped Recipe - Long Rod to two smalls
- if (RecipeUtils.recipeBuilder("craftingToolSaw", null, null, material.getLongRod(1), null, null, null, null,
- null, material.getRod(2))) {
- Utils.LOG_WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success");
+
+ //Shaped Recipe - Long Rod to two smalls
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolSaw", null, null,
+ material.getLongRod(1), null, null,
+ null, null, null,
+ material.getRod(2))){
+ Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Two small to long rod
- if (RecipeUtils.recipeBuilder(material.getRod(1), "craftingToolHardHammer", material.getRod(1), null, null,
- null, null, null, null, material.getLongRod(1))) {
- Utils.LOG_WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Success");
+ //Two small to long rod
+ if (RecipeUtils.recipeBuilder(
+ material.getRod(1), "craftingToolHardHammer", material.getRod(1),
+ null, null, null,
+ null, null, null,
+ material.getLongRod(1))){
+ Utils.LOG_WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed");
}
- // Rotor Recipe
- if (!material.isRadioactive) {
- if (RecipeUtils.recipeBuilder(material.getPlate(1), "craftingToolHardHammer", material.getPlate(1),
- material.getScrew(1), material.getRing(1), "craftingToolFile", material.getPlate(1),
- "craftingToolScrewdriver", material.getPlate(1), material.getRotor(1))) {
- Utils.LOG_WARNING("Rotor Recipe: " + material.getLocalizedName() + " - Success");
+ //Rotor Recipe
+ if (!material.isRadioactive){
+ if (RecipeUtils.recipeBuilder(
+ material.getPlate(1), "craftingToolHardHammer", material.getPlate(1),
+ material.getScrew(1), material.getRing(1), "craftingToolFile",
+ material.getPlate(1), "craftingToolScrewdriver", material.getPlate(1),
+ material.getRotor(1))){
+ Utils.LOG_WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Rotor Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Failed");
}
}
- // Screws
- if (!material.isRadioactive) {
- if (RecipeUtils.recipeBuilder("craftingToolFile", material.getBolt(1), null, material.getBolt(1), null,
- null, null, null, null, material.getScrew(1))) {
- Utils.LOG_WARNING("Screw Recipe: " + material.getLocalizedName() + " - Success");
+ //Screws
+ if (!material.isRadioactive){
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolFile", material.getBolt(1), null,
+ material.getBolt(1), null, null,
+ null, null, null,
+ material.getScrew(1))){
+ Utils.LOG_WARNING("Screw Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Screw Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_WARNING("Screw Recipe: "+material.getLocalizedName()+" - Failed");
}
}
}
-
- final Material toGenerate;
-
- public RecipeGen_ShapedCrafting(final Material M) {
- this.toGenerate = M;
- }
-
- @Override
- public void run() {
- RecipeGen_ShapedCrafting.generateRecipes(this.toGenerate);
- }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 2100d4ec69..b9a8ac7a1e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -13,125 +13,93 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
- @Override
- public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aOutput, final int aChance, int aDuration,
- final int aEUt) {
- if (aInput == null || aOutput == null) {
- Utils.LOG_INFO("Fail - Input or Output was null.");
- return false;
- }
- if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
- aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
- }
- if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
- aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) {
- Utils.LOG_INFO("Recipe did not register.");
- return false;
- }
-
- for (int das = 0; das < aInput.length; das++) {
- if (aInput[das] != null) {
- Utils.LOG_INFO("tMaterial[" + das + "]: " + aInput[das].getDisplayName() + ", Amount: "
- + aInput[das].stackSize);
- }
- }
-
- Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, new ItemStack[] {
- null
- }, null, new int[] {
- aChance
- }, null, new FluidStack[] {
- aOutput
- }, aDuration, aEUt, 0);
- return true;
- }
@Override
- public boolean addCokeOvenRecipe(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, int aDuration, final int aEUt) {
+ public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) {
try {
try {
RECIPEHANDLER_CokeOven.debug1();
- if (aInput1 == null || aOutput == null || aFluidOutput == null) {
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString()
- + " aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aOutput:" + aOutput.toString() + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ if (((aInput1 == null) /*&& (aFluidInput == null)*/) || ((aOutput == null) || (aFluidOutput == null))) {
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Something was null, returning false");
return false;
}
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
+ } catch (NullPointerException e){e.getStackTrace();}
try {
RECIPEHANDLER_CokeOven.debug2(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
- if (aOutput != null
- && (aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0) {
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString()
- + " aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aOutput:" + aOutput.toString() + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) {
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Something was null, returning false");
return false;
}
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
+ } catch (NullPointerException e){e.getStackTrace();}
try {
RECIPEHANDLER_CokeOven.debug3(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
- if (aFluidOutput == null && (aDuration = GregTech_API.sRecipeFile.get("cokeoven",
- aFluidOutput.getFluid().getName(), aDuration)) <= 0) {
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString()
- + " aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aOutput:" + aOutput.toString() + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ if ((aFluidOutput == null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Something was null, returning false");
return false;
}
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
+ } catch (NullPointerException e){e.getStackTrace();}
try {
RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
- if (aFluidInput == null) {
- Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] {
- aInput1, aInput2
- }, new ItemStack[] {
- aOutput
- }, null, null, null, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
+ if (aFluidInput == null){
+ Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
else {
- Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] {
- aInput1, aInput2
- }, new ItemStack[] {
- aOutput
- }, null, null, new FluidStack[] {
- aFluidInput
- }, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
return true;
- }
- catch (final NullPointerException e) {
+ } catch (NullPointerException e){
return false;
}
+ } catch (Throwable e){
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Failed.");
+ e.getStackTrace();
+ return false;
}
- catch (final Throwable e) {
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:"
- + aOutput.toString() + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ }
+
+ @Override
+ public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) {
+ try {
+ try {
+ //RECIPEHANDLER_MatterFabricator.debug1();
+ if (aFluidOutput == null) {
+ //Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ try{
+
+ //RECIPEHANDLER_MatterFabricator.debug4(aFluidInput, aFluidOutput, aDuration, aEUt);
+ if (aFluidInput == null){
+ //Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ else {
+ //Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
+
+ return true;
+
+ } catch (NullPointerException e){
+ return false;
+ }
+ } catch (Throwable e){
+ //Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Failed.");
e.getStackTrace();
return false;
@@ -139,245 +107,177 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
@Override
- public boolean addDehydratorRecipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[] aOutput,
- int aDuration, final int aEUt) {
- Utils.LOG_INFO("Trying to add a Dehydrator recipe.");
+ public boolean addMatterFabricatorRecipe(ItemStack aInputStack, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) {
try {
- if (aInput == null || aFluid == null || aOutput == null) {
+ try {if (aFluidOutput == null || aInputStack == null) {return false;}} catch (NullPointerException e){}
+ try{
+ if (aFluidInput == null){
+ Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[]{aInputStack}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ else {
+ Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[]{aInputStack}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
+ return true;
+ } catch (NullPointerException e){return false;}
+ } catch (Throwable e){return false;}
+ }
+
+
+ @Override
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) {
+ if (aInput1 == null) {
+ Utils.LOG_INFO("Fuel Input is Invalid.");
+ return false;
+ }
+ //new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
+ return true;
+ }
+
+ /*@Override
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt) {
+ if ((aItemA == null) || (aItemB == null) || (aOutputItems == null)) {
+ return false;
+ }
+ for (ItemStack tStack : aOutputItems) {
+ if (tStack != null) {
+ if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
+ return false;
+ }
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null, aDuration, aEUt, 0);
+ RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt) {
+ if ((aItemA == null) || (aItemB == null) || (aOutputItems == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
+ return false;
+ }
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null, aDuration, aEUt, 0);
+ RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, null, null, aOutputItems, aDuration, aEUt);
+ return true;
+ }
+
+
+
+ @Override
+ public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt){
+ if ((aFluid == null) || (aOutputFluid == null || aOutputItems == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(), aDuration)) <= 0) {
+ return false;
+ }
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, null, aOutputItems, null, new FluidStack[]{aFluid}, new FluidStack[]{aOutputFluid}, aDuration, aEUt, 0);
+ RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt);
+ return true;
+}*/
+
+
+ @Override
+ public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ Utils.LOG_INFO("Trying to add a Dehydrator recipe.");
+ try{
+ if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
return false;
}
if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) {
return false;
}
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[] {
- aInput
- }, aOutput, null, new FluidStack[] {
- aFluid
- }, null, aDuration, aEUt, 0);
- // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null,
- // aOutput, aDuration, aEUt);
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ //RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, aOutput, aDuration, aEUt);
return true;
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- return false;
- }
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;}
}
+
+
+
@Override
- public boolean addDehydratorRecipe(final ItemStack[] aInput, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack[] aOutputItems, final int[] aChances, int aDuration,
- final int aEUt) throws IndexOutOfBoundsException {
+ public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt) throws IndexOutOfBoundsException{
Utils.LOG_INFO("Trying to add a Dehydrator recipe.");
- try {
- if (aInput[0] != null) {
- Utils.LOG_INFO("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize);
+ try{
+ if (aInput[0] != null){
+ Utils.LOG_INFO("Recipe requires input: "+aInput[0].getDisplayName()+" x"+aInput[0].stackSize);
}
- if (aInput.length > 1) {
- if (aInput[1] != null) {
- Utils.LOG_INFO("Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize);
+ if (aInput.length > 1){
+ if (aInput[1] != null){
+ Utils.LOG_INFO("Recipe requires input: "+aInput[1].getDisplayName()+" x"+aInput[1].stackSize);
}
}
- if (aFluidInput != null) {
- Utils.LOG_INFO("Recipe requires input: " + aFluidInput.getFluid().getName() + " " + aFluidInput.amount
- + "mbst");
+ if (aFluidInput != null){
+ Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mbst");
}
- if (aInput[0] == null && aFluidInput == null || aOutputItems == null && aFluidOutput == null) {
+ if (((aInput[0] == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) {
return false;
}
- if (aOutputItems != null
- && (aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0) {
+ if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) {
return false;
}
- if (aOutputItems != null) {
- Utils.LOG_INFO("Recipe will output: " + ItemUtils.getArrayStackNames(aOutputItems));
+ if (aOutputItems != null){
+ Utils.LOG_INFO("Recipe will output: "+ItemUtils.getArrayStackNames(aOutputItems));
}
- if (aFluidOutput != null && (aDuration = GregTech_API.sRecipeFile.get("dehydrator",
- aFluidOutput.getFluid().getName(), aDuration)) <= 0) {
+ if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
return false;
}
- if (aFluidOutput != null) {
- Utils.LOG_INFO("Recipe will output: " + aFluidOutput.getFluid().getName());
+ if (aFluidOutput != null){
+ Utils.LOG_INFO("Recipe will output: "+aFluidOutput.getFluid().getName());
}
- if (aInput.length == 1) {
+
+
+ if (aInput.length == 1){
Utils.LOG_INFO("Dehydrator recipe only has a single input item.");
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
- aChances, new FluidStack[] {
- aFluidInput
- }, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
else {
Utils.LOG_INFO("Dehydrator recipe has two input items.");
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null,
- aChances, new FluidStack[] {
- aFluidInput
- }, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
}
return true;
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- return false;
- }
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;}
}
- /*
- * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack
- * aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack
- * aOutputFluid, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB
- * == null) || (aOutputItems == null)) { return false; } for (ItemStack
- * tStack : aOutputItems) { if (tStack != null) { if ((aDuration =
- * GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) {
- * return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null,
- * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB,
- * aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; } }
- * return false; }
- *
- * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack
- * aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt) { if ((aItemA
- * == null) || (aItemB == null) || (aOutputItems == null)) { return false; }
- * if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA,
- * aDuration)) <= 0) { return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null,
- * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB,
- * null, null, aOutputItems, aDuration, aEUt); return true; }
- *
- *
- *
- * @Override public boolean addDehydratorRecipe(FluidStack aFluid,
- * FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int
- * aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems ==
- * null)) { return false; } if ((aDuration =
- * GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(),
- * aDuration)) <= 0) { return false; }
- * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true,
- * null, aOutputItems, null, new FluidStack[]{aFluid}, new
- * FluidStack[]{aOutputFluid}, aDuration, aEUt, 0);
- * RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid,
- * aOutputItems, aDuration, aEUt); return true; }
- */
- @Override
- public boolean addFuel(final ItemStack aInput1, final ItemStack aOutput1, final int aEU, final int aType) {
- if (aInput1 == null) {
- Utils.LOG_INFO("Fuel Input is Invalid.");
- return false;
- }
- // new GregtechRecipe(aInput1, aOutput1,
- // GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
- return true;
- }
-
- @Override
- public boolean addMatterFabricatorRecipe(final FluidStack aFluidInput, final FluidStack aFluidOutput,
- final int aDuration, final int aEUt) {
- try {
- try {
- // RECIPEHANDLER_MatterFabricator.debug1();
- if (aFluidOutput == null) {
- // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+"
- // aDuration:"+aDuration+" aEU/t:"+aEUt);
- Utils.LOG_WARNING("Something was null, returning false");
- return false;
- }
-
- }
- catch (final NullPointerException e) {
- e.getStackTrace();
- }
- try {
- // RECIPEHANDLER_MatterFabricator.debug4(aFluidInput,
- // aFluidOutput, aDuration, aEUt);
- if (aFluidInput == null) {
- // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
- // null, new FluidStack[]{aFluidOutput}, aDuration, aEUt,
- // 0);
- Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null,
- new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
- }
- else {
- // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true,
- // new FluidStack[]{aFluidInput}, new
- // FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null,
- new FluidStack[] {
- aFluidInput
- }, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
- }
- RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
- return true;
- }
- catch (final NullPointerException e) {
- return false;
- }
- }
- catch (final Throwable e) {
- // Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+"
- // aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+"
- // aEU/t:"+aEUt);
- Utils.LOG_WARNING("Failed.");
- e.getStackTrace();
+ @Override
+ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt) {
+ if ((aInput == null) || (aOutput == null)) {
+ Utils.LOG_INFO("Fail - Input or Output was null.");
return false;
}
- }
-
- @Override
- public boolean addMatterFabricatorRecipe(final ItemStack aInputStack, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final int aDuration, final int aEUt) {
- try {
- try {
- if (aFluidOutput == null || aInputStack == null) {
- return false;
- }
- }
- catch (final NullPointerException e) {
- }
- try {
- if (aFluidInput == null) {
- Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[] {
- aInputStack
- }, null, null, null, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
- }
- else {
- Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[] {
- aInputStack
- }, null, null, new FluidStack[] {
- aFluidInput
- }, new FluidStack[] {
- aFluidOutput
- }, aDuration, aEUt, 0);
- }
- RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt);
- return true;
- }
- catch (final NullPointerException e) {
- return false;
- }
+
+
+ if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
+ aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
}
- catch (final Throwable e) {
+ if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
+ aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) {
+ Utils.LOG_INFO("Recipe did not register.");
return false;
}
+
+ for (int das=0;das<aInput.length;das++){
+ if (aInput[das] != null)
+ Utils.LOG_INFO("tMaterial["+das+"]: "+aInput[das].getDisplayName()+", Amount: "+aInput[das].stackSize);
+ }
+
+ Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, new ItemStack[]{null}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
+ return true;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
index 5ba404c506..01b62e23ca 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
@@ -6,62 +6,41 @@ import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_CokeOven {
- public static void debug1() {
+ public static void debug1(){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Walking Through CokeOven Recipe Creation.");
Utils.LOG_WARNING("My name is Ralph and I will be your humble host.");
}
-
- public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
+ public static void debug2(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
Utils.LOG_WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
}
-
- public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
+ public static void debug3(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
- Utils.LOG_WARNING(
- "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
}
-
- public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
+ public static void debug4(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
- Utils.LOG_WARNING(
- "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
}
-
- public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
- Utils.LOG_INFO("Successfully added a Coke Oven recipe for: " + aOutput.getDisplayName() + " & "
- + aFluidOutput.getFluid().getName() + ", Using " + aInput1.getDisplayName() + " & "
- + aInput2.getDisplayName() + " & liquid " + aFluidInput.getFluid().getName() + ". This takes "
- + aDuration / 20 + " seconds for " + aEUt + "eu/t.");
+ public static void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
}
-
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
index ee41b1f8fe..0a5094412f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
@@ -7,95 +7,75 @@ import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_Dehydrator {
- public static void debug1() {
+ public static void debug1(){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Walking Through Chemical Dehydrator Recipe Creation.");
Utils.LOG_WARNING("My name is Willus and I will be your humble host.");
}
-
- public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
+ public static void debug2(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
Utils.LOG_WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
}
-
- public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
+ public static void debug3(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
- Utils.LOG_WARNING(
- "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
}
-
- public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) {
+ public static void debug4(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
- Utils.LOG_WARNING(
- "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
- Utils.LOG_WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:"
- + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
}
-
- public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput,
- final FluidStack aFluidOutput, final ItemStack[] aOutput, final int aDuration, final int aEUt) {
-
+ public static void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutput, int aDuration, int aEUt){
+
String inputAname;
String inputBname;
String inputFluidname;
String outputFluidName;
-
- if (aInput1 != null) {
+
+ if (aInput1 != null){
inputAname = aInput1.getDisplayName();
}
else {
inputAname = "null";
}
-
- if (aInput2 != null) {
+
+ if (aInput2 != null){
inputBname = aInput2.getDisplayName();
}
else {
inputBname = "null";
}
-
- if (aFluidInput != null) {
+
+ if (aFluidInput != null){
inputFluidname = aFluidInput.getFluid().getName();
}
else {
inputFluidname = "null";
}
-
- if (aFluidOutput != null) {
+
+ if (aFluidOutput != null){
outputFluidName = aFluidOutput.getFluid().getName();
}
else {
outputFluidName = "null";
}
-
- Utils.LOG_INFO("Successfully added a Chemical Dehydrator recipe for: " + ItemUtils.getArrayStackNames(aOutput)
- + " & " + outputFluidName + ", Using " + inputAname + " & " + inputBname + " & liquid " + inputFluidname
- + ". This takes " + aDuration / 20 + " seconds for " + aEUt + "eu/t.");
+
+ Utils.LOG_INFO("Successfully added a Chemical Dehydrator recipe for: "+ItemUtils.getArrayStackNames(aOutput)+" & "+outputFluidName+", Using "+inputAname+" & "+inputBname+" & liquid "+inputFluidname+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
}
-
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
index e9df8334be..ff9f87d805 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
@@ -5,66 +5,51 @@ import net.minecraftforge.fluids.FluidStack;
public class RECIPEHANDLER_MatterFabricator {
- public static void debug1() {
+ public static void debug1(){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Walking Through Matter Fabrication Recipe Creation.");
Utils.LOG_WARNING("My name is Ralph and I will be your humble host.");
}
-
- public static void debug2(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration,
- final int aEUt) {
+ public static void debug2(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
Utils.LOG_WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
- Utils.LOG_WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
}
-
- public static void debug3(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration,
- final int aEUt) {
+ public static void debug3(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
- Utils.LOG_WARNING(
- "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
- Utils.LOG_WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
}
-
- public static void debug4(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration,
- final int aEUt) {
+ public static void debug4(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("Taking a step forward.");
- Utils.LOG_WARNING(
- "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
- Utils.LOG_WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
Utils.LOG_WARNING("Passed.");
- Utils.LOG_WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString()
- + " aDuration:" + aDuration + " aEU/t:" + aEUt);
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
}
-
- public static void debug5(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration,
- final int aEUt) {
+ public static void debug5(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){
String a = "nothing";
String b = "";
-
- if (aFluidInput != null) {
+
+ if (aFluidInput != null){
a = aFluidInput.getFluid().getName();
}
- if (aFluidOutput != null) {
+ if (aFluidOutput != null){
b = aFluidOutput.getFluid().getName();
}
-
- Utils.LOG_INFO("Successfully added a Matter Fabrication recipe for: " + b + ", Using " + " liquid " + a
- + ". This takes " + aDuration / 20 + " seconds for " + aEUt + "eu/t.");
+
+ Utils.LOG_INFO("Successfully added a Matter Fabrication recipe for: "+b+", Using "+" liquid "+a+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
Utils.LOG_WARNING("==================================================================================");
}
-
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
index 332eca6a4f..0b71b612f4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
@@ -6,36 +6,30 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal;
-public class Gregtech4Content {
+public class Gregtech4Content
+{
- // ID Range 828, 829, 833 - 850
-
- public static void run() {
- if (LoadedMods.Gregtech) {
- Gregtech4Content.workbenches();
- Gregtech4Content.tesseracts();
+ //ID Range 828, 829, 833 - 850
+
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
+ workbenches();
+ tesseracts();
}
}
- private static void tesseracts() {
- // Gregtech 4 Workbenches
- Utils.LOG_INFO("Gregtech 4 Content | Registering Tesseracts.");
- GregtechItemList.GT4_Tesseract_Generator
- .set(new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4)
- .getStackForm(1L));
- GregtechItemList.GT4_Tesseract_Terminal
- .set(new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4)
- .getStackForm(1L));
- }
-
- private static void workbenches() {
- // Gregtech 4 Workbenches
+ private static void workbenches(){
+ //Gregtech 4 Workbenches
Utils.LOG_INFO("Gregtech 4 Content | Registering Workbenches.");
- // Free //GregtechItemList.GT4_Workbench_Bronze.set(new
- // GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze",
- // "Bronze Workbench", 0).getStackForm(1L));
- // Free //GregtechItemList.GT4_Workbench_Advanced.set(new
- // GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced",
- // "Advanced Workbench", 1).getStackForm(1L));
+ //Free //GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze", "Bronze Workbench", 0).getStackForm(1L));
+ //Free //GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced", "Advanced Workbench", 1).getStackForm(1L));
+ }
+
+ private static void tesseracts(){
+ //Gregtech 4 Workbenches
+ Utils.LOG_INFO("Gregtech 4 Content | Registering Tesseracts.");
+ GregtechItemList.GT4_Tesseract_Generator.set(new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4).getStackForm(1L));
+ GregtechItemList.GT4_Tesseract_Terminal.set(new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4).getStackForm(1L));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
index 8ce163f4d3..ad0db9f927 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
@@ -1,402 +1,335 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import java.util.ArrayList;
-
-import gregtech.api.enums.*;
+import static gtPlusPlus.core.lib.LoadedMods.Gregtech;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.material.*;
+import gtPlusPlus.core.material.ALLOY;
+import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.*;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntityFluid;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntity_Cable;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntity_SuperConductor;
+
+import java.util.ArrayList;
+
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class GregtechConduits {
/**
- *
- * The Voltage Tiers. Use this Array instead of the old named Voltage
- * Variables public static final long[] V = new long[] {0=8, 1=32, 2=128,
- * 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE,
- * Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE,
- * Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
- *
+ *
+ * The Voltage Tiers. Use this Array instead of the old named Voltage Variables
+ * public static final long[] V = new long[] {0=8, 1=32, 2=128, 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
+ *
*/
- private static int BasePipeID = 30700;
-
- private static void generateGTFluidPipes(final Materials material, final int startID, final int transferRatePerSec,
- final int heatResistance, final boolean isGasProof) {
- final int transferRatePerTick = transferRatePerSec / 20;
- final long mass = material.getMass();
- final long voltage = material.mMeltingPoint >= 2800 ? 64 : 16;
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material),
- new GT_MetaPipeEntity_Fluid(startID, "GT_Pipe_" + material.mDefaultLocalName + "_Tiny",
- "Tiny " + material.mDefaultLocalName + " Fluid Pipe", 0.25F, material, transferRatePerTick * 2,
- heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material),
- new GT_MetaPipeEntity_Fluid(startID + 1, "GT_Pipe_" + material.mDefaultLocalName + "_Small",
- "Small " + material.mDefaultLocalName + " Fluid Pipe", 0.375F, material,
- transferRatePerTick * 4, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material),
- new GT_MetaPipeEntity_Fluid(startID + 2, "GT_Pipe_" + material.mDefaultLocalName + "",
- "" + material.mDefaultLocalName + " Fluid Pipe", 0.5F, material, transferRatePerTick * 6,
- heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(material),
- new GT_MetaPipeEntity_Fluid(startID + 3, "GT_Pipe_" + material.mDefaultLocalName + "_Large",
- "Large " + material.mDefaultLocalName + " Fluid Pipe", 0.75F, material, transferRatePerTick * 8,
- heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(material),
- new GT_MetaPipeEntity_Fluid(startID + 4, "GT_Pipe_" + material.mDefaultLocalName + "_Huge",
- "Huge " + material.mDefaultLocalName + " Fluid Pipe", 1.0F, material, transferRatePerTick * 10,
- heatResistance, isGasProof).getStackForm(1L));
- GregtechConduits.generatePipeRecipes(material.mDefaultLocalName, mass, voltage);
- }
-
- private static void generateNonGTFluidPipes(final GT_Materials material, final Material myMaterial,
- final int startID, final int transferRatePerSec, final int heatResistance, final boolean isGasProof) {
- final int transferRatePerTick = transferRatePerSec / 20;
- long mass;
- long voltage;
- if (myMaterial != null) {
- mass = myMaterial.getMass();
- voltage = myMaterial.vVoltageMultiplier;
- if (myMaterial.getLocalizedName().equals(ALLOY.POTIN.getLocalizedName())) {
- voltage = 4;
- }
- }
- else {
- mass = ELEMENT.getInstance().IRON.getMass();
- voltage = 8;
- }
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material),
- new GregtechMetaPipeEntityFluid(startID, "GT_Pipe_" + material.mDefaultLocalName + "_Tiny",
- "Tiny " + material.mDefaultLocalName + " Fluid Pipe", 0.25F, material, transferRatePerTick * 2,
- heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material),
- new GregtechMetaPipeEntityFluid(startID + 1, "GT_Pipe_" + material.mDefaultLocalName + "_Small",
- "Small " + material.mDefaultLocalName + " Fluid Pipe", 0.375F, material,
- transferRatePerTick * 4, heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material),
- new GregtechMetaPipeEntityFluid(startID + 2, "GT_Pipe_" + material.mDefaultLocalName + "",
- "" + material.mDefaultLocalName + " Fluid Pipe", 0.5F, material, transferRatePerTick * 6,
- heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(material),
- new GregtechMetaPipeEntityFluid(startID + 3, "GT_Pipe_" + material.mDefaultLocalName + "_Large",
- "Large " + material.mDefaultLocalName + " Fluid Pipe", 0.75F, material, transferRatePerTick * 8,
- heatResistance, isGasProof).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(material),
- new GregtechMetaPipeEntityFluid(startID + 4, "GT_Pipe_" + material.mDefaultLocalName + "_Huge",
- "Huge " + material.mDefaultLocalName + " Fluid Pipe", 1.0F, material, transferRatePerTick * 10,
- heatResistance, isGasProof).getStackForm(1L));
- GregtechConduits.generatePipeRecipes(material.mDefaultLocalName, mass, voltage);
-
- }
-
- private static void generatePipeRecipes(final String materialName, final long Mass, final long vMulti) {
-
- String output = materialName.substring(0, 1).toUpperCase() + materialName.substring(1);
- output = output.replace("-", "").replace("_", "").replace(" ", "");
-
- if (output.equals("VoidMetal")) {
- output = "Void";
- }
-
- Utils.LOG_INFO("Generating " + output + " pipes & respective recipes.");
-
- final ItemStack pipeIngot = ItemUtils.getItemStackOfAmountFromOreDict("ingot" + output, 1).copy();
- final ItemStack pipePlate = ItemUtils.getItemStackOfAmountFromOreDict("plate" + output, 1).copy();
-
- // Check all pipes are not null
- Utils.LOG_INFO("Generated pipeTiny from " + materialName + "? "
- + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 1) != null ? true : false));
- Utils.LOG_INFO("Generated pipeSmall from " + materialName + "? "
- + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1) != null ? true : false));
- Utils.LOG_INFO("Generated pipeNormal from " + materialName + "? "
- + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1) != null ? true : false));
- Utils.LOG_INFO("Generated pipeLarge from " + materialName + "? "
- + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1) != null ? true : false));
- Utils.LOG_INFO("Generated pipeHuge from " + materialName + "? "
- + (ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1) != null ? true : false));
-
- int eut = 128;
- int time = 0;
- final int bonusMulti = 5 * 20;
-
- time = (int) Math.max(Mass * 8L, 1);
- eut = (int) (10 * vMulti);
-
- // Add the Three Shaped Recipes First
- RecipeUtils.recipeBuilder(pipePlate, "craftingToolWrench", pipePlate, pipePlate, null, pipePlate, pipePlate,
- "craftingToolHardHammer", pipePlate,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 6));
-
- RecipeUtils.recipeBuilder(pipePlate, pipePlate, pipePlate, "craftingToolWrench", null, "craftingToolHardHammer",
- pipePlate, pipePlate, pipePlate,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 2));
-
- RecipeUtils.recipeBuilder(pipePlate, "craftingToolHardHammer", pipePlate, pipePlate, null, pipePlate, pipePlate,
- "craftingToolWrench", pipePlate,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1));
-
- GT_Values.RA.addExtruderRecipe(ItemUtils.getSimpleStack(pipeIngot, 1), ItemList.Shape_Extruder_Pipe_Tiny.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 2), time, eut);
-
- GT_Values.RA.addExtruderRecipe(ItemUtils.getSimpleStack(pipeIngot, 1),
- ItemList.Shape_Extruder_Pipe_Small.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1), time += bonusMulti, eut);
-
- GT_Values.RA.addExtruderRecipe(ItemUtils.getSimpleStack(pipeIngot, 3),
- ItemList.Shape_Extruder_Pipe_Medium.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1), time += bonusMulti, eut);
-
- GT_Values.RA.addExtruderRecipe(ItemUtils.getSimpleStack(pipeIngot, 6),
- ItemList.Shape_Extruder_Pipe_Large.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1), time += bonusMulti, eut);
-
- GT_Values.RA.addExtruderRecipe(ItemUtils.getSimpleStack(pipeIngot, 12),
- ItemList.Shape_Extruder_Pipe_Huge.get(0),
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1), time += bonusMulti, eut);
-
- if (eut < 512 && !output.equals("Void")) {
- final ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble" + output, 1)
- .copy();
- if (pipePlateDouble != null) {
- RecipeUtils.recipeBuilder(pipePlateDouble, "craftingToolHardHammer", pipePlateDouble, pipePlateDouble,
- null, pipePlateDouble, pipePlateDouble, "craftingToolWrench", pipePlateDouble,
- ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1));
- }
- else {
- Utils.LOG_INFO("Failed to add a recipe for " + materialName
- + " Huge pipes. Double plates probably do not exist.");
- }
- }
-
- }
-
- private static ItemStack getOredictStack(final String oredictName, final int amount) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- if (!oreDictList.isEmpty()) {
- final ItemStack returnValue = oreDictList.get(0).copy();
- returnValue.stackSize = amount;
- return returnValue;
- }
- return ItemUtils.getSimpleStack(ModItems.AAA_Broken, amount);
- }
-
- private static void makeSuperConductors(final GT_Materials aMaterial, final int aStartID, final long aLossInsulated,
- final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable,
- final boolean aAutoInsulated) {
- Utils.LOG_WARNING("Gregtech5u Content | Registered " + aMaterial.name() + " as a new Super Conductor.");
- GregtechConduits.registerOre(GregtechOrePrefixes.type2, aMaterial,
- new GregtechMetaPipeEntity_SuperConductor(aStartID + 5,
- "wire." + aMaterial.name().toLowerCase() + ".16",
- "16x " + aMaterial.mDefaultLocalName + " Wire", 1.0F, aMaterial, aLoss, 16L * aAmperage,
- aVoltage, false, !aAutoInsulated).getStackForm(1L));
-
- }
-
- private static void makeWires(final Materials aMaterial, final int aStartID, final long aLossInsulated,
- final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable,
- final boolean aAutoInsulated) {
- Utils.LOG_WARNING(
- "Gregtech5u Content | Registered " + aMaterial.name() + " as a new material for Wire & Cable.");
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt01, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 0, "wire." + aMaterial.name().toLowerCase() + ".01",
- "1x " + aMaterial.mDefaultLocalName + " Wire", 0.125F, aMaterial, aLoss, 1L * aAmperage,
- aVoltage, false, !aAutoInsulated).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt02, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 1, "wire." + aMaterial.name().toLowerCase() + ".02",
- "2x " + aMaterial.mDefaultLocalName + " Wire", 0.25F, aMaterial, aLoss, 2L * aAmperage,
- aVoltage, false, !aAutoInsulated).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt04, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 2, "wire." + aMaterial.name().toLowerCase() + ".04",
- "4x " + aMaterial.mDefaultLocalName + " Wire", 0.375F, aMaterial, aLoss, 4L * aAmperage,
- aVoltage, false, !aAutoInsulated).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt08, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 3, "wire." + aMaterial.name().toLowerCase() + ".08",
- "8x " + aMaterial.mDefaultLocalName + " Wire", 0.5F, aMaterial, aLoss, 8L * aAmperage, aVoltage,
- false, !aAutoInsulated).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt12, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 4, "wire." + aMaterial.name().toLowerCase() + ".12",
- "12x " + aMaterial.mDefaultLocalName + " Wire", 0.75F, aMaterial, aLoss, 12L * aAmperage,
- aVoltage, false, !aAutoInsulated).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.wireGt16, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 5, "wire." + aMaterial.name().toLowerCase() + ".16",
- "16x " + aMaterial.mDefaultLocalName + " Wire", 1.0F, aMaterial, aLoss, 16L * aAmperage,
- aVoltage, false, !aAutoInsulated).getStackForm(1L));
- if (aInsulatable) {
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt01, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 6, "cable." + aMaterial.name().toLowerCase() + ".01",
- "1x " + aMaterial.mDefaultLocalName + " Cable", 0.25F, aMaterial, aLossInsulated,
- 1L * aAmperage, aVoltage, true, false).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt02, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 7, "cable." + aMaterial.name().toLowerCase() + ".02",
- "2x " + aMaterial.mDefaultLocalName + " Cable", 0.375F, aMaterial, aLossInsulated,
- 2L * aAmperage, aVoltage, true, false).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt04, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 8, "cable." + aMaterial.name().toLowerCase() + ".04",
- "4x " + aMaterial.mDefaultLocalName + " Cable", 0.5F, aMaterial, aLossInsulated,
- 4L * aAmperage, aVoltage, true, false).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt08, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 9, "cable." + aMaterial.name().toLowerCase() + ".08",
- "8x " + aMaterial.mDefaultLocalName + " Cable", 0.75F, aMaterial, aLossInsulated,
- 8L * aAmperage, aVoltage, true, false).getStackForm(1L));
- GT_OreDictUnificator.registerOre(OrePrefixes.cableGt12, aMaterial,
- new GregtechMetaPipeEntity_Cable(aStartID + 10, "cable." + aMaterial.name().toLowerCase() + ".12",
- "12x " + aMaterial.mDefaultLocalName + " Cable", 1.0F, aMaterial, aLossInsulated,
- 12L * aAmperage, aVoltage, true, false).getStackForm(1L));
- }
- }
+ private static int BasePipeID = 30700;
- private static boolean registerOre(final GregtechOrePrefixes aPrefix, final Object aMaterial,
- final ItemStack aStack) {
- return GT_OreDictUnificator.registerOre(aPrefix.get(aMaterial), aStack);
- }
- public static void run() {
- if (LoadedMods.Gregtech) {
+ public static void run()
+ {
+ if (Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Custom Cables/Wires/Pipes.");
- GregtechConduits.run1();
+ run1();
}
}
- private static void run1() {
- if (LoadedMods.Big_Reactors) {
- GregtechConduits.wireFactory("Blutonium", 8196, 30600, 8, 32, 2);
- GregtechConduits.wireFactory("Cyanite", 512, 30615, 2, 16, 4);
- GregtechConduits.wireFactory("Yellorium", 2048, 30630, 4, 16, 2);
- }
- if (LoadedMods.EnderIO) {
- GregtechConduits.wireFactory("RedstoneAlloy", 32, 30645, 1, 4, 1);
- }
-
- GregtechConduits.superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8);
- if (LoadedMods.Thaumcraft) {
- GregtechConduits.superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8);
- }
-
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Staballoy, ALLOY.STABALLOY, GregtechConduits.BasePipeID,
- 6250, 7500, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Tantalloy60, ALLOY.TANTALLOY_60,
- GregtechConduits.BasePipeID + 5, 5000, 4250, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Tantalloy61, ALLOY.TANTALLOY_61,
- GregtechConduits.BasePipeID + 10, 6000, 5800, true);
- if (LoadedMods.Thaumcraft) {
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Void, null, GregtechConduits.BasePipeID + 15, 250,
- 25000, true);
- }
- GregtechConduits.generateGTFluidPipes(Materials.Europium, GregtechConduits.BasePipeID + 20, 12000, 7500, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Potin, ALLOY.POTIN, GregtechConduits.BasePipeID + 25, 375,
- 2000, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.MaragingSteel300, ALLOY.MARAGING300,
- GregtechConduits.BasePipeID + 30, 7000, 2500, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.MaragingSteel350, ALLOY.MARAGING350,
- GregtechConduits.BasePipeID + 35, 8000, 2500, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Inconel690, ALLOY.INCONEL_690,
- GregtechConduits.BasePipeID + 40, 7500, 4800, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.Inconel792, ALLOY.INCONEL_792,
- GregtechConduits.BasePipeID + 45, 8000, 5500, true);
- GregtechConduits.generateNonGTFluidPipes(GT_Materials.HastelloyX, ALLOY.HASTELLOY_X,
- GregtechConduits.BasePipeID + 50, 10000, 4200, true);
-
- }
-
- private static void superConductorFactory(final GT_Materials Material, final int Voltage, final int ID,
- final long insulatedLoss, final long uninsulatedLoss, final long Amps) {
- final GT_Materials T = Material;
+ private static void run1(){
+ if (LoadedMods.Big_Reactors){
+ wireFactory("Blutonium", 8196, 30600, 8, 32, 2);
+ wireFactory("Cyanite", 512, 30615, 2, 16, 4);
+ wireFactory("Yellorium", 2048, 30630, 4, 16, 2);
+ }
+ if (LoadedMods.EnderIO){
+ wireFactory("RedstoneAlloy", 32, 30645, 1, 4, 1);
+ }
+
+ superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8);
+ if (LoadedMods.Thaumcraft){
+ superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8);}
+
+ generateNonGTFluidPipes(GT_Materials.Staballoy, ALLOY.STABALLOY, BasePipeID, 6250, 7500, true);
+ generateNonGTFluidPipes(GT_Materials.Tantalloy60, ALLOY.TANTALLOY_60, BasePipeID+5, 5000, 4250, true);
+ generateNonGTFluidPipes(GT_Materials.Tantalloy61, ALLOY.TANTALLOY_61, BasePipeID+10, 6000, 5800, true);
+ if (LoadedMods.Thaumcraft){
+ generateNonGTFluidPipes(GT_Materials.Void, null, BasePipeID+15, 250, 25000, true);}
+ generateGTFluidPipes(Materials.Europium, BasePipeID+20, 12000, 7500, true);
+ generateNonGTFluidPipes(GT_Materials.Potin, ALLOY.POTIN, BasePipeID+25, 375, 2000, true);
+ generateNonGTFluidPipes(GT_Materials.MaragingSteel300, ALLOY.MARAGING300, BasePipeID+30, 7000, 2500, true);
+ generateNonGTFluidPipes(GT_Materials.MaragingSteel350, ALLOY.MARAGING350, BasePipeID+35, 8000, 2500, true);
+ generateNonGTFluidPipes(GT_Materials.Inconel690, ALLOY.INCONEL_690, BasePipeID+40, 7500, 4800, true);
+ generateNonGTFluidPipes(GT_Materials.Inconel792, ALLOY.INCONEL_792, BasePipeID+45, 8000, 5500, true);
+ generateNonGTFluidPipes(GT_Materials.HastelloyX, ALLOY.HASTELLOY_X, BasePipeID+50, 10000, 4200, true);
+
+ }
+
+ private static void wireFactory(String Material, int Voltage, int ID, long insulatedLoss, long uninsulatedLoss, long Amps){
+ Materials T = Materials.valueOf(Material);
int V = 0;
- if (Voltage == 8) {
+ if (Voltage == 8){
V = 0;
}
- else if (Voltage == 32) {
+ else if (Voltage == 32){
V = 1;
}
- else if (Voltage == 128) {
+ else if (Voltage == 128){
V = 2;
}
- else if (Voltage == 512) {
+ else if (Voltage == 512){
V = 3;
}
- else if (Voltage == 2048) {
+ else if (Voltage == 2048){
V = 4;
}
- else if (Voltage == 8196) {
+ else if (Voltage == 8196){
V = 5;
}
- else if (Voltage == 32768) {
+ else if (Voltage == 32768){
V = 6;
}
- else if (Voltage == 131072) {
+ else if (Voltage == 131072){
V = 7;
}
- else if (Voltage == 524288) {
+ else if (Voltage == 524288){
V = 8;
}
- else if (Voltage == Integer.MAX_VALUE) {
+ else if (Voltage == Integer.MAX_VALUE){
V = 9;
}
else {
- Utils.LOG_ERROR(
- "Failed to set voltage on " + Material.name() + ". Invalid voltage of " + Voltage + "V set.");
- Utils.LOG_ERROR(Material.name() + " has defaulted to 8v.");
+ Utils.LOG_ERROR("Failed to set voltage on "+Material+". Invalid voltage of "+Voltage+"V set.");
+ Utils.LOG_ERROR(Material+" has defaulted to 8v.");
V = 0;
}
- // makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
- GregtechConduits.makeSuperConductors(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
- // makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L,
- // gregtech.api.enums.GT_Values.V[V], true, false);
+ //makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
+ makeWires(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
+ //makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L, gregtech.api.enums.GT_Values.V[V], true, false);
+ }
+
+ private static void makeWires(Materials aMaterial, int aStartID, long aLossInsulated, long aLoss, long aAmperage, long aVoltage, boolean aInsulatable, boolean aAutoInsulated)
+ {
+ Utils.LOG_WARNING("Gregtech5u Content | Registered "+aMaterial.name() +" as a new material for Wire & Cable.");
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 0, "wire." + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Wire", 0.125F, aMaterial, aLoss, 1L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 1, "wire." + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Wire", 0.25F, aMaterial, aLoss, 2L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 2, "wire." + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Wire", 0.375F, aMaterial, aLoss, 4L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 3, "wire." + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Wire", 0.5F, aMaterial, aLoss, 8L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 4, "wire." + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Wire", 0.75F, aMaterial, aLoss, 12L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt16, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 5, "wire." + aMaterial.name().toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Wire", 1.0F, aMaterial, aLoss, 16L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ if (aInsulatable)
+ {
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 6, "cable." + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Cable", 0.25F, aMaterial, aLossInsulated, 1L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 7, "cable." + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Cable", 0.375F, aMaterial, aLossInsulated, 2L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 8, "cable." + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Cable", 0.5F, aMaterial, aLossInsulated, 4L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 9, "cable." + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Cable", 0.75F, aMaterial, aLossInsulated, 8L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 10, "cable." + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Cable", 1.0F, aMaterial, aLossInsulated, 12L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ }
}
- private static void wireFactory(final String Material, final int Voltage, final int ID, final long insulatedLoss,
- final long uninsulatedLoss, final long Amps) {
- final Materials T = Materials.valueOf(Material);
+ private static void superConductorFactory(GT_Materials Material, int Voltage, int ID, long insulatedLoss, long uninsulatedLoss, long Amps){
+ GT_Materials T = Material;
int V = 0;
- if (Voltage == 8) {
+ if (Voltage == 8){
V = 0;
}
- else if (Voltage == 32) {
+ else if (Voltage == 32){
V = 1;
}
- else if (Voltage == 128) {
+ else if (Voltage == 128){
V = 2;
}
- else if (Voltage == 512) {
+ else if (Voltage == 512){
V = 3;
}
- else if (Voltage == 2048) {
+ else if (Voltage == 2048){
V = 4;
}
- else if (Voltage == 8196) {
+ else if (Voltage == 8196){
V = 5;
}
- else if (Voltage == 32768) {
+ else if (Voltage == 32768){
V = 6;
}
- else if (Voltage == 131072) {
+ else if (Voltage == 131072){
V = 7;
}
- else if (Voltage == 524288) {
+ else if (Voltage == 524288){
V = 8;
}
- else if (Voltage == Integer.MAX_VALUE) {
+ else if (Voltage == Integer.MAX_VALUE){
V = 9;
}
else {
- Utils.LOG_ERROR("Failed to set voltage on " + Material + ". Invalid voltage of " + Voltage + "V set.");
- Utils.LOG_ERROR(Material + " has defaulted to 8v.");
+ Utils.LOG_ERROR("Failed to set voltage on "+Material.name()+". Invalid voltage of "+Voltage+"V set.");
+ Utils.LOG_ERROR(Material.name()+" has defaulted to 8v.");
V = 0;
}
- // makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
- GregtechConduits.makeWires(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
- // makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L,
- // gregtech.api.enums.GT_Values.V[V], true, false);
+ //makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
+ makeSuperConductors(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
+ //makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L, gregtech.api.enums.GT_Values.V[V], true, false);
+ }
+
+ private static void makeSuperConductors(GT_Materials aMaterial, int aStartID, long aLossInsulated, long aLoss, long aAmperage, long aVoltage, boolean aInsulatable, boolean aAutoInsulated)
+ {
+ Utils.LOG_WARNING("Gregtech5u Content | Registered "+aMaterial.name() +" as a new Super Conductor.");
+ registerOre(GregtechOrePrefixes.type2, aMaterial, new GregtechMetaPipeEntity_SuperConductor(aStartID + 5, "wire." + aMaterial.name().toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Wire", 1.0F, aMaterial, aLoss, 16L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+
+ }
+
+ private static boolean registerOre(GregtechOrePrefixes aPrefix, Object aMaterial, ItemStack aStack) {
+ return GT_OreDictUnificator.registerOre(aPrefix.get(aMaterial), aStack);
+ }
+
+
+ private static void generateGTFluidPipes(Materials material, int startID, int transferRatePerSec, int heatResistance, boolean isGasProof){
+ int transferRatePerTick = transferRatePerSec/20;
+ long mass = material.getMass();
+ long voltage = material.mMeltingPoint >= 2800 ? 64 : 16;
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material), new GT_MetaPipeEntity_Fluid(startID, "GT_Pipe_"+material.mDefaultLocalName+"_Tiny", "Tiny "+material.mDefaultLocalName+" Fluid Pipe", 0.25F, material, transferRatePerTick*2, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material), new GT_MetaPipeEntity_Fluid(startID+1, "GT_Pipe_"+material.mDefaultLocalName+"_Small", "Small "+material.mDefaultLocalName+" Fluid Pipe", 0.375F, material, transferRatePerTick*4, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material), new GT_MetaPipeEntity_Fluid(startID+2, "GT_Pipe_"+material.mDefaultLocalName+"", ""+material.mDefaultLocalName+" Fluid Pipe", 0.5F, material, transferRatePerTick*6, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(material), new GT_MetaPipeEntity_Fluid(startID+3, "GT_Pipe_"+material.mDefaultLocalName+"_Large", "Large "+material.mDefaultLocalName+" Fluid Pipe", 0.75F, material, transferRatePerTick*8, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(material), new GT_MetaPipeEntity_Fluid(startID+4, "GT_Pipe_"+material.mDefaultLocalName+"_Huge", "Huge "+material.mDefaultLocalName+" Fluid Pipe", 1.0F, material, transferRatePerTick*10, heatResistance, isGasProof).getStackForm(1L));
+ generatePipeRecipes(material.mDefaultLocalName, mass, voltage);
+ }
+
+ private static void generateNonGTFluidPipes(GT_Materials material, Material myMaterial, int startID, int transferRatePerSec, int heatResistance, boolean isGasProof){
+ int transferRatePerTick = transferRatePerSec/20;
+ long mass;
+ long voltage;
+ if (myMaterial != null){
+ mass = myMaterial.getMass();
+ voltage = myMaterial.vVoltageMultiplier;
+ if (myMaterial.getLocalizedName().equals(ALLOY.POTIN.getLocalizedName())){
+ voltage = 4;
+ }
+ }
+ else {
+ mass = ELEMENT.getInstance().IRON.getMass();
+ voltage = 8;
+ }
+
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material), new GregtechMetaPipeEntityFluid(startID, "GT_Pipe_"+material.mDefaultLocalName+"_Tiny", "Tiny "+material.mDefaultLocalName+" Fluid Pipe", 0.25F, material, transferRatePerTick*2, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material), new GregtechMetaPipeEntityFluid(startID+1, "GT_Pipe_"+material.mDefaultLocalName+"_Small", "Small "+material.mDefaultLocalName+" Fluid Pipe", 0.375F, material, transferRatePerTick*4, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material), new GregtechMetaPipeEntityFluid(startID+2, "GT_Pipe_"+material.mDefaultLocalName+"", ""+material.mDefaultLocalName+" Fluid Pipe", 0.5F, material, transferRatePerTick*6, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(material), new GregtechMetaPipeEntityFluid(startID+3, "GT_Pipe_"+material.mDefaultLocalName+"_Large", "Large "+material.mDefaultLocalName+" Fluid Pipe", 0.75F, material, transferRatePerTick*8, heatResistance, isGasProof).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(material), new GregtechMetaPipeEntityFluid(startID+4, "GT_Pipe_"+material.mDefaultLocalName+"_Huge", "Huge "+material.mDefaultLocalName+" Fluid Pipe", 1.0F, material, transferRatePerTick*10, heatResistance, isGasProof).getStackForm(1L));
+ generatePipeRecipes(material.mDefaultLocalName, mass, voltage);
+
+ }
+
+ private static void generatePipeRecipes(String materialName, long Mass, long vMulti){
+
+ String output = materialName.substring(0, 1).toUpperCase() + materialName.substring(1);
+ output = output.replace("-", "").replace("_", "").replace(" ", "");
+
+ if (output.equals("VoidMetal")){
+ output = "Void";
+ }
+
+ Utils.LOG_INFO("Generating "+output+" pipes & respective recipes.");
+
+ ItemStack pipeIngot = ItemUtils.getItemStackOfAmountFromOreDict("ingot"+output, 1).copy();
+ ItemStack pipePlate = ItemUtils.getItemStackOfAmountFromOreDict("plate"+output, 1).copy();
+
+ //Check all pipes are not null
+ Utils.LOG_INFO("Generated pipeTiny from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false));
+ Utils.LOG_INFO("Generated pipeSmall from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false));
+ Utils.LOG_INFO("Generated pipeNormal from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false));
+ Utils.LOG_INFO("Generated pipeLarge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false));
+ Utils.LOG_INFO("Generated pipeHuge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false));
+
+ int eut = 128;
+ int time = 0;
+ int bonusMulti = 5*20;
+
+ time = (int) Math.max(Mass * 8L, 1);
+ eut = (int) (10 * vMulti);
+
+
+ //Add the Three Shaped Recipes First
+ RecipeUtils.recipeBuilder(
+ pipePlate, "craftingToolWrench", pipePlate,
+ pipePlate, null, pipePlate,
+ pipePlate, "craftingToolHardHammer", pipePlate,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 6));
+
+ RecipeUtils.recipeBuilder(
+ pipePlate, pipePlate, pipePlate,
+ "craftingToolWrench", null, "craftingToolHardHammer",
+ pipePlate, pipePlate, pipePlate,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 2));
+
+ RecipeUtils.recipeBuilder(
+ pipePlate, "craftingToolHardHammer", pipePlate,
+ pipePlate, null, pipePlate,
+ pipePlate, "craftingToolWrench", pipePlate,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1));
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 1),
+ ItemList.Shape_Extruder_Pipe_Tiny.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 2),
+ time, eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 1),
+ ItemList.Shape_Extruder_Pipe_Small.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1),
+ time+=bonusMulti, eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 3),
+ ItemList.Shape_Extruder_Pipe_Medium.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1),
+ time+=bonusMulti, eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 6),
+ ItemList.Shape_Extruder_Pipe_Large.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1),
+ time+=bonusMulti, eut);
+
+ GT_Values.RA.addExtruderRecipe(
+ ItemUtils.getSimpleStack(pipeIngot, 12),
+ ItemList.Shape_Extruder_Pipe_Huge.get(0),
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1),
+ time+=bonusMulti, eut);
+
+ if (eut < 512 && !output.equals("Void")){
+ ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy();
+ if (pipePlateDouble != null)
+ RecipeUtils.recipeBuilder(
+ pipePlateDouble, "craftingToolHardHammer", pipePlateDouble,
+ pipePlateDouble, null, pipePlateDouble,
+ pipePlateDouble, "craftingToolWrench", pipePlateDouble,
+ ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1));
+ else
+ Utils.LOG_INFO("Failed to add a recipe for "+materialName+" Huge pipes. Double plates probably do not exist.");
+ }
+
+
+ }
+
+ private static ItemStack getOredictStack(String oredictName, int amount){
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()){
+ ItemStack returnValue = oreDictList.get(0).copy();
+ returnValue.stackSize = amount;
+ return returnValue;
+ }
+ return ItemUtils.getSimpleStack(ModItems.AAA_Broken, amount);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
index 28602499e3..33dfb60e3f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
@@ -7,62 +7,93 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-public class GregtechDehydrator {
- public static void run() {
- if (LoadedMods.Gregtech) {
+public class GregtechDehydrator
+{
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Chemical Dehydrators.");
- GregtechDehydrator.run1();
+ run1();
}
}
- private static void run1() {
+ private static void run1()
+ {
/*
- *
- * public GT_MetaTileEntity_BasicMachine_GT_Recipe( int aID, String
- * aName, String aNameRegional, int aTier, String aDescription,
- * 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) {
- *
+
+ public GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ int aID, String aName, String aNameRegional, int aTier,
+ String aDescription,
+ 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) {
+
*/
- GregtechItemList.GT_Dehydrator_EV
- .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(813, "advancedmachine.dehydrator.tier.01",
- "Chemical Dehydrator I", 4, "This dehydrates your Grapes into Raisins. " + CORE.GT_Tooltip,
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png",
- "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L));
- GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(814,
- "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5,
- "A hangover is the way your body reacts to dehydration. " + CORE.GT_Tooltip,
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "",
- false, false, 0, "UNBOXINATOR", null).getStackForm(1L));
- GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(815,
- "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6,
- "You could probably make space icecream with this.. " + CORE.GT_Tooltip,
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "",
- false, false, 0, "UNBOXINATOR", null).getStackForm(1L));
- GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(816,
- "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7,
- "You can definitely make space icecream with this.. " + CORE.GT_Tooltip,
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "",
- false, false, 0, "UNBOXINATOR", null).getStackForm(1L));
+ GregtechItemList.GT_Dehydrator_EV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4,
+ "This dehydrates your Grapes into Raisins. "+CORE.GT_Tooltip,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ 2, 9,
+ 10000,
+ 2, 5,
+ "Dehydrator.png", "",
+ false, false,
+ 0,
+ "UNBOXINATOR",
+ null).getStackForm(1L));
+ GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5,
+ "A hangover is the way your body reacts to dehydration. "+CORE.GT_Tooltip,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ 2, 9,
+ 10000,
+ 2, 5,
+ "Dehydrator.png", "",
+ false, false,
+ 0,
+ "UNBOXINATOR",
+ null).getStackForm(1L));
+ GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6,
+ "You could probably make space icecream with this.. "+CORE.GT_Tooltip,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ 2, 9,
+ 10000,
+ 2, 5,
+ "Dehydrator.png", "",
+ false, false,
+ 0,
+ "UNBOXINATOR",
+ null).getStackForm(1L));
+ GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7,
+ "You can definitely make space icecream with this.. "+CORE.GT_Tooltip,
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes,
+ 2, 9,
+ 10000,
+ 2, 5,
+ "Dehydrator.png", "",
+ false, false,
+ 0,
+ "UNBOXINATOR",
+ null).getStackForm(1L));
+
+ //GregtechItemList.GT_Dehydrator_EV.set(new GregtechMetaTileEntitySolarGenerator(813, "dehydrator.tier.01", "Extreme Voltage Chemical Dehydrator", 4).getStackForm(1L));
+ //GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(814, "dehydrator.tier.02", "Insane Voltage Chemical Dehydrator", 5).getStackForm(1L));
+ //GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(815, "dehydrator.tier.03", "Ludicrous Voltage Chemical Dehydrator", 6).getStackForm(1L));
+ //GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(816, "dehydrator.tier.04", "ZPM Voltage Chemical Dehydrator", 7).getStackForm(1L));
+
+
- // GregtechItemList.GT_Dehydrator_EV.set(new
- // GregtechMetaTileEntitySolarGenerator(813, "dehydrator.tier.01",
- // "Extreme Voltage Chemical Dehydrator", 4).getStackForm(1L));
- // GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(814,
- // "dehydrator.tier.02", "Insane Voltage Chemical Dehydrator",
- // 5).getStackForm(1L));
- // GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(815,
- // "dehydrator.tier.03", "Ludicrous Voltage Chemical Dehydrator",
- // 6).getStackForm(1L));
- // GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(816,
- // "dehydrator.tier.04", "ZPM Voltage Chemical Dehydrator",
- // 7).getStackForm(1L));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
index 47b445b42d..01ecf1650d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
@@ -8,154 +10,73 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOreDictNames;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaEnergyBuffer;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.creative.GregtechMetaCreativeEnergyBuffer;
-public class GregtechEnergyBuffer {
-
- // Misc Items
- // public static Item itemBufferCore;
-
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+public class GregtechEnergyBuffer
+{
+
+ //Misc Items
+ //public static Item itemBufferCore;
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Energy Buffer Blocks.");
- GregtechEnergyBuffer.run1();
+ run1();
}
-
+
}
- private static void run1() {
-
- // itemBufferCore = new
- // Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID
- // + ":itemBufferCore");
+ private static void run1()
+ {
+
+ //itemBufferCore = new Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemBufferCore");
- // Registry
- // GameRegistry.registerItem(itemBufferCore, "itemBufferCore");
- // LanguageRegistry.addName(itemBufferCore, "Buffer Core");
- // OreDictionary.registerOre("itemBufferCore", itemBufferCore);
+ //Registry
+ //GameRegistry.registerItem(itemBufferCore, "itemBufferCore");
+ //LanguageRegistry.addName(itemBufferCore, "Buffer Core");
+ //OreDictionary.registerOre("itemBufferCore", itemBufferCore);
+
- // Energy Buffers
- GregtechItemList.Energy_Buffer_1by1_ULV.set(new GregtechMetaEnergyBuffer(770, "energybuffer.01.tier.00",
- "Ultra Low Voltage Energy Buffer", 0, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_LV
- .set(new GregtechMetaEnergyBuffer(771, "energybuffer.01.tier.01", "Low Voltage Energy Buffer", 1, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_MV.set(
- new GregtechMetaEnergyBuffer(772, "energybuffer.01.tier.02", "Medium Voltage Energy Buffer", 2, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_HV.set(
- new GregtechMetaEnergyBuffer(773, "energybuffer.01.tier.03", "High Voltage Energy Buffer", 3, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_EV.set(
- new GregtechMetaEnergyBuffer(774, "energybuffer.01.tier.04", "Extreme Voltage Energy Buffer", 4, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_IV.set(
- new GregtechMetaEnergyBuffer(775, "energybuffer.01.tier.05", "Insane Voltage Energy Buffer", 5, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_LuV.set(new GregtechMetaEnergyBuffer(776, "energybuffer.01.tier.06",
- "Ludicrous Voltage Energy Buffer", 6, "", 1).getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_ZPM
- .set(new GregtechMetaEnergyBuffer(777, "energybuffer.01.tier.07", "ZPM Voltage Energy Buffer", 7, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_UV.set(
- new GregtechMetaEnergyBuffer(778, "energybuffer.01.tier.08", "Ultimate Voltage Energy Buffer", 8, "", 1)
- .getStackForm(1L));
- GregtechItemList.Energy_Buffer_1by1_MAX
- .set(new GregtechMetaEnergyBuffer(779, "energybuffer.01.tier.09", "MAX Voltage Energy Buffer", 9, "", 1)
- .getStackForm(1L));
+ //Energy Buffers
+ GregtechItemList.Energy_Buffer_1by1_ULV.set(new GregtechMetaEnergyBuffer(770, "energybuffer.01.tier.00", "Ultra Low Voltage Energy Buffer", 0, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_LV.set(new GregtechMetaEnergyBuffer(771, "energybuffer.01.tier.01", "Low Voltage Energy Buffer", 1, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_MV.set(new GregtechMetaEnergyBuffer(772, "energybuffer.01.tier.02", "Medium Voltage Energy Buffer", 2, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_HV.set(new GregtechMetaEnergyBuffer(773, "energybuffer.01.tier.03", "High Voltage Energy Buffer", 3, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_EV.set(new GregtechMetaEnergyBuffer(774, "energybuffer.01.tier.04", "Extreme Voltage Energy Buffer", 4, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_IV.set(new GregtechMetaEnergyBuffer(775, "energybuffer.01.tier.05", "Insane Voltage Energy Buffer", 5, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_LuV.set(new GregtechMetaEnergyBuffer(776, "energybuffer.01.tier.06", "Ludicrous Voltage Energy Buffer", 6, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_ZPM.set(new GregtechMetaEnergyBuffer(777, "energybuffer.01.tier.07", "ZPM Voltage Energy Buffer", 7, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_UV.set(new GregtechMetaEnergyBuffer(778, "energybuffer.01.tier.08", "Ultimate Voltage Energy Buffer", 8, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_MAX.set(new GregtechMetaEnergyBuffer(779, "energybuffer.01.tier.09", "MAX Voltage Energy Buffer", 9, "", 1).getStackForm(1L));
// Creative Buffer Has Special ID
- GregtechItemList.Energy_Buffer_CREATIVE.set(new GregtechMetaCreativeEnergyBuffer(750, "energybuffer.01.tier.xx",
- "512V Creative Energy Buffer", 3, "", 0).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_CREATIVE
+ .set(new GregtechMetaCreativeEnergyBuffer(750,
+ "energybuffer.01.tier.xx",
+ "512V Creative Energy Buffer", 3, "", 0)
+ .getStackForm(1L));
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Lead), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Tin), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.AnyCopper), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Gold), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Aluminium), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Tungsten), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'),
- OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'),
- GregtechOreDictNames.buffer_core
- });
- /*
- * GT_ModHandler.addCraftingRecipe(
- * GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
- * GT_ModHandler.RecipeBits.DISMANTLEABLE |
- * GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- * GT_ModHandler.RecipeBits.REVERSIBLE |
- * GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW",
- * Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'),
- * OrePrefixes.wireGt08.get(Materials.Superconductor),
- * Character.valueOf('T'), GregtechOreDictNames.buffer_core });
- */
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Lead), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tin), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.AnyCopper), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Gold), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Aluminium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tungsten), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
+ /*GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
+ "WTW", "WMW", Character.valueOf('M'),
+ ItemList.Hull_MAX, Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Superconductor),
+ Character.valueOf('T'), GregtechOreDictNames.buffer_core });*/
+
+
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java
index 9f0d7419b0..844ba03ec9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
@@ -14,56 +16,52 @@ import net.minecraft.item.ItemStack;
public class GregtechGeothermalThermalGenerator {
- public static void run() {
- if (LoadedMods.Gregtech) {
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Geothermal Engines.");
- GregtechGeothermalThermalGenerator.run1();
+ run1();
}
}
- private static void run1() {
- GregtechItemList.Geothermal_Engine_EV.set(new GregtechMetaTileEntityGeothermalGenerator(830,
- "advancedgenerator.geothermalFuel.tier.01", "Basic Geothermal Engine", 4).getStackForm(1L));
- GregtechItemList.Geothermal_Engine_IV.set(new GregtechMetaTileEntityGeothermalGenerator(831,
- "advancedgenerator.geothermalFuel.tier.02", "Turbo Geothermal Engine", 5).getStackForm(1L));
- GregtechItemList.Geothermal_Engine_LuV.set(new GregtechMetaTileEntityGeothermalGenerator(832,
- "advancedgenerator.geothermalFuel.tier.03", "Vulcan Geothermal Engine", 6).getStackForm(1L));
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
- ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
- Character.valueOf('C'), GregtechOrePrefixes.circuit.get(Materials.Ultimate),
- Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Aluminium), Character.valueOf('G'),
- ALLOY.TANTALLOY_61.getGear(1)
- });
+ private static void run1(){
+ GregtechItemList.Geothermal_Engine_EV.set(new GregtechMetaTileEntityGeothermalGenerator(830, "advancedgenerator.geothermalFuel.tier.01", "Basic Geothermal Engine", 4).getStackForm(1L));
+ GregtechItemList.Geothermal_Engine_IV.set(new GregtechMetaTileEntityGeothermalGenerator(831, "advancedgenerator.geothermalFuel.tier.02", "Turbo Geothermal Engine", 5).getStackForm(1L));
+ GregtechItemList.Geothermal_Engine_LuV.set(new GregtechMetaTileEntityGeothermalGenerator(832, "advancedgenerator.geothermalFuel.tier.03", "Vulcan Geothermal Engine", 6).getStackForm(1L));
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Geothermal_Engine_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"CEC", "GMG", "PWP",
+ Character.valueOf('M'), ItemList.Hull_EV,
+ Character.valueOf('P'), ItemList.Electric_Piston_EV,
+ Character.valueOf('E'), ItemList.Electric_Motor_EV,
+ Character.valueOf('C'), GregtechOrePrefixes.circuit.get(Materials.Ultimate),
+ Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Aluminium),
+ Character.valueOf('G'), ALLOY.TANTALLOY_61.getGear(1)});
+
GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
- ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
- Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic),
- Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Platinum), Character.valueOf('G'),
- ALLOY.STELLITE.getGear(1)
- });
-
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"CEC", "GMG", "PWP",
+ Character.valueOf('M'), ItemList.Hull_IV,
+ Character.valueOf('P'), ItemList.Electric_Piston_IV,
+ Character.valueOf('E'), ItemList.Electric_Motor_IV,
+ Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic),
+ Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Platinum),
+ Character.valueOf('G'), ALLOY.STELLITE.getGear(1)});
+
final ItemStack INGREDIENT_1 = RECIPE_CONSTANTS.electricPiston_LuV;
final ItemStack INGREDIENT_2 = RECIPE_CONSTANTS.electricMotor_LuV;
GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
- GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), Character.valueOf('W'),
- OrePrefixes.cableGt04.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1)
- });
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"CEC", "GMG", "PWP",
+ Character.valueOf('M'), ItemList.Hull_LuV,
+ Character.valueOf('P'), INGREDIENT_1,
+ Character.valueOf('E'), INGREDIENT_2,
+ Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic),
+ Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Tungsten),
+ Character.valueOf('G'), ALLOY.ZERON_100.getGear(1)});
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java
index 49cba18f68..0e08c4b135 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java
@@ -4,20 +4,21 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_AlloyBlastSmelter;
-public class GregtechIndustrialBlastSmelter {
+public class GregtechIndustrialBlastSmelter{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Blast Smelter Multiblock.");
- GregtechIndustrialBlastSmelter.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Electrolyzer Multiblock
- GregtechItemList.Industrial_AlloyBlastSmelter.set(new GregtechMetaTileEntity_AlloyBlastSmelter(810,
- "industrialsalloyamelter.controller.tier.single", "Blast Smelter").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_AlloyBlastSmelter.set(new GregtechMetaTileEntity_AlloyBlastSmelter(810, "industrialsalloyamelter.controller.tier.single", "Blast Smelter").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
index 605d52fd6c..226e0a44e1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialCentrifuge;
-public class GregtechIndustrialCentrifuge {
+public class GregtechIndustrialCentrifuge
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Centrifuge Multiblock.");
- GregtechIndustrialCentrifuge.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Centrifuge Multiblock
- GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaTileEntity_IndustrialCentrifuge(790,
- "industrialcentrifuge.controller.tier.single", "Industrial Centrifuge").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaTileEntity_IndustrialCentrifuge(790, "industrialcentrifuge.controller.tier.single", "Industrial Centrifuge").getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
index 6fd76963c5..fd17cb5a40 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialCokeOven;
-public class GregtechIndustrialCokeOven {
+public class GregtechIndustrialCokeOven
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Coke Oven Multiblock.");
- GregtechIndustrialCokeOven.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Centrifuge Multiblock
- GregtechItemList.Industrial_CokeOven.set(new GregtechMetaTileEntity_IndustrialCokeOven(791,
- "industrialcokeoven.controller.tier.single", "Industrial Coke Oven").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_CokeOven.set(new GregtechMetaTileEntity_IndustrialCokeOven(791, "industrialcokeoven.controller.tier.single", "Industrial Coke Oven").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
index 87394bf26e..9282148bb2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialElectrolyzer;
-public class GregtechIndustrialElectrolyzer {
+public class GregtechIndustrialElectrolyzer
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Electrolyzer Multiblock.");
- GregtechIndustrialElectrolyzer.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Electrolyzer Multiblock
- GregtechItemList.Industrial_Electrolyzer.set(new GregtechMetaTileEntity_IndustrialElectrolyzer(796,
- "industrialelectrolyzer.controller.tier.single", "Industrial Electrolyzer").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_Electrolyzer.set(new GregtechMetaTileEntity_IndustrialElectrolyzer(796, "industrialelectrolyzer.controller.tier.single", "Industrial Electrolyzer").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
index 5a05996d98..aaecc281c6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialMacerator;
-public class GregtechIndustrialMacerator {
+public class GregtechIndustrialMacerator
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Maceration Stack Multiblock.");
- GregtechIndustrialMacerator.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Electrolyzer Multiblock
- GregtechItemList.Industrial_MacerationStack.set(new GregtechMetaTileEntity_IndustrialMacerator(797,
- "industrialmacerator.controller.tier.single", "Maceration Stack Controller").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_MacerationStack.set(new GregtechMetaTileEntity_IndustrialMacerator(797, "industrialmacerator.controller.tier.single", "Maceration Stack Controller").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
index 40c1fa632a..6093d2b534 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_MassFabricator;
-public class GregtechIndustrialMassFabricator {
+public class GregtechIndustrialMassFabricator
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Mass Fabricator Multiblock.");
- GregtechIndustrialMassFabricator.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Electrolyzer Multiblock
- GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntity_MassFabricator(799,
- "industrialmassfab.controller.tier.single", "Matter Fabrication CPU").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntity_MassFabricator(799, "industrialmassfab.controller.tier.single", "Matter Fabrication CPU").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java
index bbaaa2e336..8477ba2e31 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java
@@ -4,24 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_MultiTank;
-public class GregtechIndustrialMultiTank {
+public class GregtechIndustrialMultiTank
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Multitank controller blocks.");
- GregtechIndustrialMultiTank.run1();
+ run1();
}
}
- private static void run1() {
- GregtechItemList.Industrial_MultiTank
- .set(new GregtechMetaTileEntity_MultiTank(827, "multitank.controller.tier.single", "Gregtech Multitank")
- .getStackForm(1L));
- // GregtechItemList.Industrial_MultiTankDense.set(new
- // GregtechMetaTileEntityMultiTankDense(828,
- // "multitankdense.controller.tier.single", "Gregtech Dense
- // Multitank").getStackForm(1L));
-
+ private static void run1()
+ {
+ GregtechItemList.Industrial_MultiTank.set(new GregtechMetaTileEntity_MultiTank(827, "multitank.controller.tier.single", "Gregtech Multitank").getStackForm(1L));
+ //GregtechItemList.Industrial_MultiTankDense.set(new GregtechMetaTileEntityMultiTankDense(828, "multitankdense.controller.tier.single", "Gregtech Dense Multitank").getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
index 37eb067bcd..4aab06b1d3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialPlatePress;
-public class GregtechIndustrialPlatePress {
+public class GregtechIndustrialPlatePress
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Press Multiblock.");
- GregtechIndustrialPlatePress.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Centrifuge Multiblock
- GregtechItemList.Industrial_PlatePress.set(new GregtechMetaTileEntity_IndustrialPlatePress(792,
- "industrialbender.controller.tier.single", "Industrial Material Press").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_PlatePress.set(new GregtechMetaTileEntity_IndustrialPlatePress(792, "industrialbender.controller.tier.single", "Industrial Material Press").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
index aa8d173120..15339bd2e3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IndustrialWireMill;
-public class GregtechIndustrialWiremill {
+public class GregtechIndustrialWiremill
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Wire Factory Multiblock.");
- GregtechIndustrialWiremill.run1();
+ run1();
}
}
- private static void run1() {
- // Industrial Electrolyzer Multiblock
- GregtechItemList.Industrial_WireFactory.set(new GregtechMetaTileEntity_IndustrialWireMill(798,
- "industrialwiremill.controller.tier.single", "Wire Factory Controller").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_WireFactory.set(new GregtechMetaTileEntity_IndustrialWireMill(798, "industrialwiremill.controller.tier.single", "Wire Factory Controller").getStackForm(1L));
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
index 45eb14b93d..9f08fed763 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
@@ -4,18 +4,22 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_IronBlastFurnace;
-public class GregtechIronBlastFurnace {
+public class GregtechIronBlastFurnace
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Iron Blast Furnace.");
- GregtechIronBlastFurnace.run1();
+ run1();
}
}
- private static void run1() {
- GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntity_IronBlastFurnace(768,
- "ironmachine.blastfurnace", "Iron Plated Blast Furnace").getStackForm(1L));
+ private static void run1()
+ {
+ GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntity_IronBlastFurnace(768, "ironmachine.blastfurnace", "Iron Plated Blast Furnace").getStackForm(1L));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java
index e8ace322f5..77d03f6fef 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java
@@ -4,21 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMTE_NuclearReactor;
-public class GregtechLFTR {
+public class GregtechLFTR
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Liquid Fluorine Thorium Reactor [LFTR].");
- GregtechLFTR.run1();
+ run1();
}
}
- private static void run1() {
- // LFTR
- GregtechItemList.ThoriumReactor
- .set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]")
- .getStackForm(1L));
-
+ private static void run1()
+ {
+ //LFTR
+ GregtechItemList.ThoriumReactor.set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]").getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
index 180ec36e6b..c38c7eb21d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_PowerSubStationController;
-public class GregtechPowerSubStation {
+public class GregtechPowerSubStation
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Power Substation Node.");
- GregtechPowerSubStation.run1();
+ run1();
}
}
- private static void run1() {
- // Steam Condensors
- GregtechItemList.PowerSubStation.set(new GregtechMetaTileEntity_PowerSubStationController(812,
- "substation.01.input.single", "Power Substation Node").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Steam Condensors
+ GregtechItemList.PowerSubStation.set(new GregtechMetaTileEntity_PowerSubStationController(812, "substation.01.input.single", "Power Substation Node").getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
index 37a68d9854..f75a44bf8b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
@@ -14,56 +16,52 @@ import net.minecraft.item.ItemStack;
public class GregtechRocketFuelGenerator {
- public static void run() {
- if (LoadedMods.Gregtech) {
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Rocket Engines.");
- GregtechRocketFuelGenerator.run1();
+ run1();
}
}
- private static void run1() {
- GregtechItemList.Rocket_Engine_EV.set(new GregtechMetaTileEntityRocketFuelGenerator(793,
- "advancedgenerator.rocketFuel.tier.01", "Basic Rocket Engine", 4).getStackForm(1L));
- GregtechItemList.Rocket_Engine_IV.set(new GregtechMetaTileEntityRocketFuelGenerator(794,
- "advancedgenerator.rocketFuel.tier.02", "Advanced Rocket Engine", 5).getStackForm(1L));
- GregtechItemList.Rocket_Engine_LuV.set(new GregtechMetaTileEntityRocketFuelGenerator(795,
- "advancedgenerator.rocketFuel.tier.03", "Turbo Rocket Engine", 6).getStackForm(1L));
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'),
- ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV,
- Character.valueOf('C'), GregtechOrePrefixes.circuit.get(Materials.Ultimate),
- Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Aluminium), Character.valueOf('G'),
- ALLOY.TANTALLOY_61.getGear(1)
- });
+ private static void run1(){
+ GregtechItemList.Rocket_Engine_EV.set(new GregtechMetaTileEntityRocketFuelGenerator(793, "advancedgenerator.rocketFuel.tier.01", "Basic Rocket Engine", 4).getStackForm(1L));
+ GregtechItemList.Rocket_Engine_IV.set(new GregtechMetaTileEntityRocketFuelGenerator(794, "advancedgenerator.rocketFuel.tier.02", "Advanced Rocket Engine", 5).getStackForm(1L));
+ GregtechItemList.Rocket_Engine_LuV.set(new GregtechMetaTileEntityRocketFuelGenerator(795, "advancedgenerator.rocketFuel.tier.03", "Turbo Rocket Engine", 6).getStackForm(1L));
+ GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"PCP", "EME", "GWG",
+ Character.valueOf('M'), ItemList.Hull_EV,
+ Character.valueOf('P'), ItemList.Electric_Piston_EV,
+ Character.valueOf('E'), ItemList.Electric_Motor_EV,
+ Character.valueOf('C'), GregtechOrePrefixes.circuit.get(Materials.Ultimate),
+ Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Aluminium),
+ Character.valueOf('G'), ALLOY.TANTALLOY_61.getGear(1)});
+
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'),
- ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV,
- Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic),
- Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Platinum), Character.valueOf('G'),
- ALLOY.STELLITE.getGear(1)
- });
-
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"PCP", "EME", "GWG",
+ Character.valueOf('M'), ItemList.Hull_IV,
+ Character.valueOf('P'), ItemList.Electric_Piston_IV,
+ Character.valueOf('E'), ItemList.Electric_Motor_IV,
+ Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic),
+ Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Platinum),
+ Character.valueOf('G'), ALLOY.STELLITE.getGear(1)});
+
final ItemStack INGREDIENT_1 = RECIPE_CONSTANTS.electricPiston_LuV;
final ItemStack INGREDIENT_2 = RECIPE_CONSTANTS.electricMotor_LuV;
GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'),
- INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'),
- GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), Character.valueOf('W'),
- OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'),
- ALLOY.ZERON_100.getGear(1)
- });
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"PCP", "EME", "GWG",
+ Character.valueOf('M'), ItemList.Hull_LuV,
+ Character.valueOf('P'), INGREDIENT_1,
+ Character.valueOf('E'), INGREDIENT_2,
+ Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic),
+ Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Tungsten),
+ Character.valueOf('G'), ALLOY.ZERON_100.getGear(1)});
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
index 634c7c7bf6..e0632c1f0a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
@@ -1,133 +1,53 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaSafeBlock;
-public class GregtechSafeBlock {
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+public class GregtechSafeBlock
+{
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Lockable Safe Blocks.");
- GregtechSafeBlock.run1();
+ run1();
}
-
+
}
- private static void run1() {
+ private static void run1()
+ {
+
+ GregtechItemList.GT_Safe_ULV.set(new GregtechMetaSafeBlock(780, "protection.playersafe.tier.00", "Ultra Low Voltage Player Safe", 0).getStackForm(1L));
+ GregtechItemList.GT_Safe_LV.set(new GregtechMetaSafeBlock(781, "protection.playersafe.tier.01", "Low Voltage Player Safe", 1).getStackForm(1L));
+ GregtechItemList.GT_Safe_MV.set(new GregtechMetaSafeBlock(782, "protection.playersafe.tier.02", "Medium Voltage Player Safe", 2).getStackForm(1L));
+ GregtechItemList.GT_Safe_HV.set(new GregtechMetaSafeBlock(783, "protection.playersafe.tier.03", "High Voltage Player Safe", 3).getStackForm(1L));
+ GregtechItemList.GT_Safe_EV.set(new GregtechMetaSafeBlock(784, "protection.playersafe.tier.04", "Extreme Voltage Player Safe", 4).getStackForm(1L));
+ GregtechItemList.GT_Safe_IV.set(new GregtechMetaSafeBlock(785, "protection.playersafe.tier.05", "Insane Voltage Player Safe", 5).getStackForm(1L));
+ GregtechItemList.GT_Safe_LuV.set(new GregtechMetaSafeBlock(786, "protection.playersafe.tier.06", "Ludicrous Voltage Player Safe", 6).getStackForm(1L));
+ GregtechItemList.GT_Safe_ZPM.set(new GregtechMetaSafeBlock(787, "protection.playersafe.tier.07", "ZPM Voltage Player Safe", 7).getStackForm(1L));
+ GregtechItemList.GT_Safe_UV.set(new GregtechMetaSafeBlock(788, "protection.playersafe.tier.08", "Ultimate Voltage Player Safe", 8).getStackForm(1L));
+ GregtechItemList.GT_Safe_MAX.set(new GregtechMetaSafeBlock(789, "protection.playersafe.tier.09", "MAX Voltage Player Safe", 9).getStackForm(1L));
- GregtechItemList.GT_Safe_ULV
- .set(new GregtechMetaSafeBlock(780, "protection.playersafe.tier.00", "Ultra Low Voltage Player Safe", 0)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_LV
- .set(new GregtechMetaSafeBlock(781, "protection.playersafe.tier.01", "Low Voltage Player Safe", 1)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_MV
- .set(new GregtechMetaSafeBlock(782, "protection.playersafe.tier.02", "Medium Voltage Player Safe", 2)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_HV
- .set(new GregtechMetaSafeBlock(783, "protection.playersafe.tier.03", "High Voltage Player Safe", 3)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_EV
- .set(new GregtechMetaSafeBlock(784, "protection.playersafe.tier.04", "Extreme Voltage Player Safe", 4)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_IV
- .set(new GregtechMetaSafeBlock(785, "protection.playersafe.tier.05", "Insane Voltage Player Safe", 5)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_LuV
- .set(new GregtechMetaSafeBlock(786, "protection.playersafe.tier.06", "Ludicrous Voltage Player Safe", 6)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_ZPM
- .set(new GregtechMetaSafeBlock(787, "protection.playersafe.tier.07", "ZPM Voltage Player Safe", 7)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_UV
- .set(new GregtechMetaSafeBlock(788, "protection.playersafe.tier.08", "Ultimate Voltage Player Safe", 8)
- .getStackForm(1L));
- GregtechItemList.GT_Safe_MAX
- .set(new GregtechMetaSafeBlock(789, "protection.playersafe.tier.09", "MAX Voltage Player Safe", 9)
- .getStackForm(1L));
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('V'), ItemList.Circuit_Basic, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('V'), ItemList.Circuit_Basic, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('V'), ItemList.Circuit_Good, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('V'), ItemList.Circuit_Good, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('V'), ItemList.Circuit_Advanced, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('V'), ItemList.Circuit_Advanced, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('V'), ItemList.Circuit_Elite, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('V'), ItemList.Circuit_Elite, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'), ItemList.Circuit_Master, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('V'), ItemList.Circuit_Master, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('V'),
- ItemList.Circuit_Basic, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('V'),
- ItemList.Circuit_Basic, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('V'),
- ItemList.Circuit_Good, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_HV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('V'),
- ItemList.Circuit_Good, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_EV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('V'),
- ItemList.Circuit_Advanced, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_IV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('V'),
- ItemList.Circuit_Advanced, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('V'),
- ItemList.Circuit_Elite, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('V'),
- ItemList.Circuit_Elite, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_UV.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'),
- ItemList.Circuit_Master, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('V'),
- ItemList.Circuit_Master, Character.valueOf('C'), OreDictNames.craftingChest,
- Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)
- });
+
+
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
index 1a065258d4..9aec3dbb7e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
@@ -1,46 +1,36 @@
package gtPlusPlus.xmod.gregtech.registration.gregtech;
-import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySolarGenerator;
-public class GregtechSolarGenerators {
- public static void run() {
- if (LoadedMods.Gregtech && configSwitches.enableMachine_SolarGenerators) {
+public class GregtechSolarGenerators
+{
+ public static void run()
+ {
+ if (LoadedMods.Gregtech && configSwitches.enableMachine_SolarGenerators){
Utils.LOG_INFO("Gregtech5u Content | Registering Solar Generator Blocks.");
- GregtechSolarGenerators.run1();
+ run1();
}
-
+
}
- private static void run1() {
-
- GregtechItemList.GT_Solar_ULV.set(new GregtechMetaTileEntitySolarGenerator(800, "sunabsorber.tier.00",
- "Ultra Low Voltage Solar Generator", 0).getStackForm(1L));
- GregtechItemList.GT_Solar_LV.set(
- new GregtechMetaTileEntitySolarGenerator(801, "sunabsorber.tier.01", "Low Voltage Solar Generator", 1)
- .getStackForm(1L));
- GregtechItemList.GT_Solar_MV.set(new GregtechMetaTileEntitySolarGenerator(802, "sunabsorber.tier.02",
- "Medium Voltage Solar Generator", 2).getStackForm(1L));
- GregtechItemList.GT_Solar_HV.set(
- new GregtechMetaTileEntitySolarGenerator(803, "sunabsorber.tier.03", "High Voltage Solar Generator", 3)
- .getStackForm(1L));
- GregtechItemList.GT_Solar_EV.set(new GregtechMetaTileEntitySolarGenerator(804, "sunabsorber.tier.04",
- "Extreme Voltage Solar Generator", 4).getStackForm(1L));
- GregtechItemList.GT_Solar_IV.set(new GregtechMetaTileEntitySolarGenerator(805, "sunabsorber.tier.05",
- "Insane Voltage Solar Generator", 5).getStackForm(1L));
- GregtechItemList.GT_Solar_LuV.set(new GregtechMetaTileEntitySolarGenerator(806, "sunabsorber.tier.06",
- "Ludicrous Voltage Solar Generator", 6).getStackForm(1L));
- GregtechItemList.GT_Solar_ZPM.set(
- new GregtechMetaTileEntitySolarGenerator(807, "sunabsorber.tier.07", "ZPM Voltage Solar Generator", 7)
- .getStackForm(1L));
- GregtechItemList.GT_Solar_UV.set(new GregtechMetaTileEntitySolarGenerator(808, "sunabsorber.tier.08",
- "Ultimate Voltage Solar Generator", 8).getStackForm(1L));
- GregtechItemList.GT_Solar_MAX.set(
- new GregtechMetaTileEntitySolarGenerator(809, "sunabsorber.tier.09", "MAX Voltage Solar Generator", 9)
- .getStackForm(1L));
+ private static void run1()
+ {
+
+ GregtechItemList.GT_Solar_ULV.set(new GregtechMetaTileEntitySolarGenerator(800, "sunabsorber.tier.00", "Ultra Low Voltage Solar Generator", 0).getStackForm(1L));
+ GregtechItemList.GT_Solar_LV.set(new GregtechMetaTileEntitySolarGenerator(801, "sunabsorber.tier.01", "Low Voltage Solar Generator", 1).getStackForm(1L));
+ GregtechItemList.GT_Solar_MV.set(new GregtechMetaTileEntitySolarGenerator(802, "sunabsorber.tier.02", "Medium Voltage Solar Generator", 2).getStackForm(1L));
+ GregtechItemList.GT_Solar_HV.set(new GregtechMetaTileEntitySolarGenerator(803, "sunabsorber.tier.03", "High Voltage Solar Generator", 3).getStackForm(1L));
+ GregtechItemList.GT_Solar_EV.set(new GregtechMetaTileEntitySolarGenerator(804, "sunabsorber.tier.04", "Extreme Voltage Solar Generator", 4).getStackForm(1L));
+ GregtechItemList.GT_Solar_IV.set(new GregtechMetaTileEntitySolarGenerator(805, "sunabsorber.tier.05", "Insane Voltage Solar Generator", 5).getStackForm(1L));
+ GregtechItemList.GT_Solar_LuV.set(new GregtechMetaTileEntitySolarGenerator(806, "sunabsorber.tier.06", "Ludicrous Voltage Solar Generator", 6).getStackForm(1L));
+ GregtechItemList.GT_Solar_ZPM.set(new GregtechMetaTileEntitySolarGenerator(807, "sunabsorber.tier.07", "ZPM Voltage Solar Generator", 7).getStackForm(1L));
+ GregtechItemList.GT_Solar_UV.set(new GregtechMetaTileEntitySolarGenerator(808, "sunabsorber.tier.08", "Ultimate Voltage Solar Generator", 8).getStackForm(1L));
+ GregtechItemList.GT_Solar_MAX.set(new GregtechMetaTileEntitySolarGenerator(809, "sunabsorber.tier.09", "MAX Voltage Solar Generator", 9).getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
index 222413f144..a3b92daea0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaCondensor;
-public class GregtechSteamCondenser {
+public class GregtechSteamCondenser
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Steam Condensor.");
- GregtechSteamCondenser.run1();
+ run1();
}
}
- private static void run1() {
- // Steam Condensors
- GregtechItemList.Condensor_MAX.set(
- new GregtechMetaCondensor(769, "steamcondensor.01.tier.single", "Steam Condensor").getStackForm(1L));
-
+ private static void run1()
+ {
+ //Steam Condensors
+ GregtechItemList.Condensor_MAX.set(new GregtechMetaCondensor(769, "steamcondensor.01.tier.single", "Steam Condensor").getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
index dda2083c5a..fc7927d3f2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
@@ -4,20 +4,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySuperCondensor;
-public class GregtechSuperConductionPoint {
+public class GregtechSuperConductionPoint
+{
- public static void run() {
- if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Super Conductor Input Node.");
- GregtechSuperConductionPoint.run1();
+ run1();
}
}
- private static void run1() {
- // Steam Condensors
- GregtechItemList.SuperConductorInputNode.set(new GregtechMetaTileEntitySuperCondensor(811,
- "superconductor.01.input.single", "Power Phase Shifting Station", 8).getStackForm(1L));
-
+ private static void run1()
+ {
+ //Steam Condensors
+ GregtechItemList.SuperConductorInputNode.set(new GregtechMetaTileEntitySuperCondensor(811, "superconductor.01.input.single", "Power Phase Shifting Station", 8).getStackForm(1L));
+
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java
index b70af43b0b..d18e12a519 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java
@@ -5,46 +5,28 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredTank;
-public class GregtechTieredFluidTanks {
- public static void run() {
- if (LoadedMods.Gregtech) {
+public class GregtechTieredFluidTanks
+{
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
Utils.LOG_INFO("Gregtech5u Content | Registering Portable Fluid Tanks.");
- GregtechTieredFluidTanks.run1();
+ run1();
}
-
+
}
- private static void run1() {
+ private static void run1() {
int ID = 817;
- GregtechItemList.GT_FluidTank_ULV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.00", "Ultra Low Voltage Fluid Tank", 0)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_LV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.01", "Low Voltage Fluid Tank", 1)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_MV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.02", "Medium Voltage Fluid Tank", 2)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_HV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.03", "High Voltage Fluid Tank", 3)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_EV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.04", "Extreme Voltage Fluid Tank", 4)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_IV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.05", "Insane Voltage Fluid Tank", 5)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_LuV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.06", "Ludicrous Voltage Fluid Tank", 6)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_ZPM
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.07", "ZPM Voltage Fluid Tank", 7)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_UV
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.08", "Ultimate Voltage Fluid Tank", 8)
- .getStackForm(1L));
- GregtechItemList.GT_FluidTank_MAX
- .set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.09", "MAX Voltage Fluid Tank", 9)
- .getStackForm(1L));
+ GregtechItemList.GT_FluidTank_ULV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.00", "Ultra Low Voltage Fluid Tank", 0).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_LV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.01", "Low Voltage Fluid Tank", 1).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_MV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.02", "Medium Voltage Fluid Tank", 2).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_HV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.03", "High Voltage Fluid Tank", 3).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_EV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.04", "Extreme Voltage Fluid Tank", 4).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_IV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.05", "Insane Voltage Fluid Tank", 5).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_LuV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.06", "Ludicrous Voltage Fluid Tank", 6).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_ZPM.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.07", "ZPM Voltage Fluid Tank", 7).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_UV.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.08", "Ultimate Voltage Fluid Tank", 8).getStackForm(1L));
+ GregtechItemList.GT_FluidTank_MAX.set(new GT_MetaTileEntity_TieredTank(ID++, "fluidtank.tier.09", "MAX Voltage Fluid Tank", 9).getStackForm(1L));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java b/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
index 6c0c045c21..2428f0a943 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
@@ -6,21 +6,22 @@ import gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler;
public class HANDLER_GC {
- public static void init() {
- if (LoadedMods.Growthcraft) {
+
+ //Run me during Pre-Init
+ public static void preInit(){
+ if (LoadedMods.Growthcraft){
+ Register_Booze.preInit();
}
}
- public static void postInit() {
- if (LoadedMods.Growthcraft) {
- FishTrapHandler.pamsHarvestCraftCompat();
+ public static void init(){
+ if (LoadedMods.Growthcraft){
}
}
- // Run me during Pre-Init
- public static void preInit() {
- if (LoadedMods.Growthcraft) {
- Register_Booze.preInit();
+ public static void postInit(){
+ if (LoadedMods.Growthcraft){
+ FishTrapHandler.pamsHarvestCraftCompat();
}
}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java b/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
index ed3ca5d73f..88174aac4e 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
@@ -1,10 +1,11 @@
package gtPlusPlus.xmod.growthcraft.booze;
-import cpw.mods.fml.common.registry.GameRegistry;
import growthcraft.api.cellar.Booze;
import growthcraft.api.cellar.CellarRegistry;
import growthcraft.cellar.block.BlockFluidBooze;
-import growthcraft.cellar.item.*;
+import growthcraft.cellar.item.ItemBoozeBottle;
+import growthcraft.cellar.item.ItemBoozeBucketDEPRECATED;
+import growthcraft.cellar.item.ItemBucketBooze;
import growthcraft.cellar.utils.BoozeRegistryHelper;
import growthcraft.hops.GrowthCraftHops;
import gtPlusPlus.core.lib.LoadedMods;
@@ -13,62 +14,51 @@ import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
public class Register_Booze {
+
+ public static BlockFluidBooze[] jackDanielsWhiskeyFluids;
+ public static Item jackDaniels;
+ public static Item jackDanielsSeeds;
+ public static Item jackDanielsWhiskey;
+ public static Item jackDanielsWhiskeyBucket_deprecated;
+ public static ItemBucketBooze[] jackDanielsWhiskeyBuckets;
+ public static Fluid[] jackDanielsWhiskeyBooze;
+ //private static int internalColour = FluidRegistry.getFluid("fluidJackDaniels").getColor();
+ private static int internalColour = 0000000;
- public static BlockFluidBooze[] jackDanielsWhiskeyFluids;
- public static Item jackDaniels;
- public static Item jackDanielsSeeds;
- public static Item jackDanielsWhiskey;
- public static Item jackDanielsWhiskeyBucket_deprecated;
- public static ItemBucketBooze[] jackDanielsWhiskeyBuckets;
- public static Fluid[] jackDanielsWhiskeyBooze;
- // private static int internalColour =
- // FluidRegistry.getFluid("fluidJackDaniels").getColor();
- private static int internalColour = 0000000;
-
- // Run me during Pre-Init
- public static void preInit() {
- if (LoadedMods.Growthcraft) {
- Register_Booze.start();
+ //Run me during Pre-Init
+ public static void preInit(){
+ if (LoadedMods.Growthcraft){
+ start();
}
}
-
- private static void start() {
- Register_Booze.jackDaniels = GrowthCraftHops.hops;
- Register_Booze.jackDanielsSeeds = GrowthCraftHops.hopSeeds;
-
- Register_Booze.jackDanielsWhiskeyBooze = new Booze[5];
- Register_Booze.jackDanielsWhiskeyFluids = new BlockFluidBooze[Register_Booze.jackDanielsWhiskeyBooze.length];
- Register_Booze.jackDanielsWhiskeyBuckets = new ItemBucketBooze[Register_Booze.jackDanielsWhiskeyBooze.length];
- BoozeRegistryHelper.initializeBooze(Register_Booze.jackDanielsWhiskeyBooze,
- Register_Booze.jackDanielsWhiskeyFluids, Register_Booze.jackDanielsWhiskeyBuckets,
- "grc.jackDanielsWhiskey", Register_Booze.internalColour);
-
- Register_Booze.jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, Register_Booze.jackDanielsWhiskeyBooze)
- .setColor(Register_Booze.internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] {
- Potion.digSpeed.id
- }, new int[] {
- 3600
- });
- Register_Booze.jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(
- Register_Booze.jackDanielsWhiskeyBooze).setColor(Register_Booze.internalColour);
-
- // GameRegistry.registerItem(jackDaniels, "grc.jackDaniels");
- // GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds");
- GameRegistry.registerItem(Register_Booze.jackDanielsWhiskey, "grc.jackDanielsWhiskey");
- GameRegistry.registerItem(Register_Booze.jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket");
-
- BoozeRegistryHelper.registerBooze(Register_Booze.jackDanielsWhiskeyBooze,
- Register_Booze.jackDanielsWhiskeyFluids, Register_Booze.jackDanielsWhiskeyBuckets,
- Register_Booze.jackDanielsWhiskey, "grc.jackDanielsWhiskey",
- Register_Booze.jackDanielsWhiskeyBucket_deprecated);
-
- CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat,
- Register_Booze.jackDanielsWhiskeyBooze[4], 200, 60, 0.4F);
- CellarRegistry.instance().brew().addBrewing(Register_Booze.jackDanielsWhiskeyBooze[4],
- Register_Booze.jackDaniels, Register_Booze.jackDanielsWhiskeyBooze[0], 350, 60, 0.1F);
-
+
+ private static void start(){
+ jackDaniels = GrowthCraftHops.hops;
+ jackDanielsSeeds = GrowthCraftHops.hopSeeds;
+
+ jackDanielsWhiskeyBooze = new Booze[5];
+ jackDanielsWhiskeyFluids = new BlockFluidBooze[jackDanielsWhiskeyBooze.length];
+ jackDanielsWhiskeyBuckets = new ItemBucketBooze[jackDanielsWhiskeyBooze.length];
+ BoozeRegistryHelper.initializeBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, "grc.jackDanielsWhiskey", internalColour);
+
+ jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, jackDanielsWhiskeyBooze).setColor(internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] { Potion.digSpeed.id }, new int[] { 3600 });
+ jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(jackDanielsWhiskeyBooze).setColor(internalColour);
+
+
+ //GameRegistry.registerItem(jackDaniels, "grc.jackDaniels");
+ //GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds");
+ GameRegistry.registerItem(jackDanielsWhiskey, "grc.jackDanielsWhiskey");
+ GameRegistry.registerItem(jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket");
+
+ BoozeRegistryHelper.registerBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, jackDanielsWhiskey, "grc.jackDanielsWhiskey", jackDanielsWhiskeyBucket_deprecated);
+
+ CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat, jackDanielsWhiskeyBooze[4], 200, 60, 0.4F);
+ CellarRegistry.instance().brew().addBrewing(jackDanielsWhiskeyBooze[4], jackDaniels, jackDanielsWhiskeyBooze[0], 350, 60, 0.1F);
+
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
index 5e35a360c3..7f62c7fe53 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
@@ -9,185 +9,160 @@ import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
public class FishTrapHandler {
+
+ private static final String[] fishTypes = {"fish", "junk", "treasure"};
- private static final String[] fishTypes = {
- "fish", "junk", "treasure"
- };
-
- final static String prefix = "food";
-
- final static String suffix = "raw";
- final static String seaweed = "cropSeaweed";
- final static String greenheartFish = "Greenheartfish";
- private static final String[] harvestcraftFish = {
- "Anchovy", "Bass", "Carp", "Catfish", "Charr", "Clam", "Crab", "Crayfish", "Eel", "Frog", "Grouper",
- "Herring", "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia",
- "Trout", "Tuna", "Turtle", "Walleye"
- };
- protected static void addFish(final String lootType, final ItemStack lootStack, final int lootChance) {
- if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1")) {
- if (lootType == FishTrapHandler.fishTypes[0]) {
+ protected static void addFish(String lootType, ItemStack lootStack, int lootChance){
+ if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1")){
+ if (lootType == fishTypes[0]){
Growthcraft_Old.addTrapFish(lootStack, lootChance);
- Utils.LOG_INFO("Added " + lootStack.getDisplayName() + " as an extra Fish for Growthcraft Fishtraps.");
+ Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as an extra Fish for Growthcraft Fishtraps.");
}
- else if (lootType == FishTrapHandler.fishTypes[1]) {
+ else if (lootType == fishTypes[1]){
Growthcraft_Old.addTrapJunk(lootStack, lootChance);
- Utils.LOG_INFO("Added " + lootStack.getDisplayName() + " as extra Junk for Growthcraft Fishtraps.");
+ Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Junk for Growthcraft Fishtraps.");
}
- else if (lootType == FishTrapHandler.fishTypes[2]) {
+ else if (lootType == fishTypes[2]){
Growthcraft_Old.addTrapTreasure(lootStack, lootChance);
- Utils.LOG_INFO("Added " + lootStack.getDisplayName() + " as extra Treasure for Growthcraft Fishtraps.");
+ Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Treasure for Growthcraft Fishtraps.");
}
else {
return;
}
}
-
+
else {
- Utils.LOG_INFO("Extra Fish loot for Growthcraft Fishtraps disabled. Found V."
- + LoadedMods.getModVersion("Growthcraft"));
+ Utils.LOG_INFO("Extra Fish loot for Growthcraft Fishtraps disabled. Found V."+LoadedMods.getModVersion("Growthcraft"));
}
-
+
}
-
- private static void addGregtechCentrifugeRecipe(final ItemStack input) {
- if (LoadedMods.Gregtech) {
- GT_Values.RA.addCentrifugeRecipe(input, null, null, FluidUtils.getFluidStack("methane", 96), null, null,
- null, null, null, null, null, 19 * 20, 5);
+
+ final static String prefix = "food";
+ final static String suffix = "raw";
+ final static String seaweed = "cropSeaweed";
+ final static String greenheartFish = "Greenheartfish";
+ private static final String[] harvestcraftFish = {
+ "Anchovy", "Bass", "Carp", "Catfish", "Charr", "Clam", "Crab", "Crayfish", "Eel", "Frog", "Grouper", "Herring",
+ "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"};
+ public static void pamsHarvestCraftCompat(){
+ for (int i = 0; i < harvestcraftFish.length; i++){
+ String itemName = prefix+harvestcraftFish[i]+suffix;
+ int lootChance = getLootChance(harvestcraftFish[i]);
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null){
+ addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance);
+ addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
+ addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
+ addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
+ }
}
- }
-
- private static void addGregtechFluidRecipe(final ItemStack input) {
- if (LoadedMods.Gregtech) {
- GT_Values.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 0, 64 / 4, 4); // 4eu/t
- // total
- // eu
- // used
- // =
- // 64
- // so
- // time
- // =
- // 64/4
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(greenheartFish, 1) != null){
+ addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1), getLootChance(greenheartFish));
+ addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
+ addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
+ addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1));
}
- }
-
- private static void addGregtechMaceratorRecipe(final ItemStack input) {
- if (LoadedMods.Gregtech) {
- GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0);
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1) != null){
+ addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed));
}
}
-
- private static int getLootChance(final String name) {
- if (name == FishTrapHandler.harvestcraftFish[0]) {
+
+ private static int getLootChance(String name){
+ if (name == harvestcraftFish[0]){
return 20;
}
- else if (name == FishTrapHandler.harvestcraftFish[1]) {
+ else if (name == harvestcraftFish[1]){
return 10;
}
- else if (name == FishTrapHandler.harvestcraftFish[2]) {
+ else if (name == harvestcraftFish[2]){
return 15;
}
- else if (name == FishTrapHandler.harvestcraftFish[3]) {
+ else if (name == harvestcraftFish[3]){
return 55;
}
- else if (name == FishTrapHandler.harvestcraftFish[4]) {
+ else if (name == harvestcraftFish[4]){
return 5;
}
- else if (name == FishTrapHandler.harvestcraftFish[5]) {
+ else if (name == harvestcraftFish[5]){
return 8;
}
- else if (name == FishTrapHandler.harvestcraftFish[6]) {
+ else if (name == harvestcraftFish[6]){
return 11;
}
- else if (name == FishTrapHandler.harvestcraftFish[7]) {
+ else if (name == harvestcraftFish[7]){
return 11;
}
- else if (name == FishTrapHandler.harvestcraftFish[8]) {
+ else if (name == harvestcraftFish[8]){
return 15;
}
- else if (name == FishTrapHandler.harvestcraftFish[9]) {
+ else if (name == harvestcraftFish[9]){
return 1;
}
- else if (name == FishTrapHandler.harvestcraftFish[10]) {
+ else if (name == harvestcraftFish[10]){
return 5;
}
- else if (name == FishTrapHandler.harvestcraftFish[11]) {
+ else if (name == harvestcraftFish[11]){
return 10;
}
- else if (name == FishTrapHandler.harvestcraftFish[12]) {
+ else if (name == harvestcraftFish[12]){
return 25;
}
- else if (name == FishTrapHandler.harvestcraftFish[13]) {
+ else if (name == harvestcraftFish[13]){
return 15;
}
- else if (name == FishTrapHandler.harvestcraftFish[14]) {
+ else if (name == harvestcraftFish[14]){
return 20;
- } // "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia",
- // "Trout", "Tuna", "Turtle", "Walleye"};
- else if (name == FishTrapHandler.harvestcraftFish[15]) {
+ } //"Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"};
+ else if (name == harvestcraftFish[15]){
return 22;
}
- else if (name == FishTrapHandler.harvestcraftFish[16]) {
+ else if (name == harvestcraftFish[16]){
return 10;
}
- else if (name == FishTrapHandler.harvestcraftFish[17]) {
+ else if (name == harvestcraftFish[17]){
return 35;
}
- else if (name == FishTrapHandler.harvestcraftFish[18]) {
+ else if (name == harvestcraftFish[18]){
return 3;
}
- else if (name == FishTrapHandler.harvestcraftFish[19]) {
+ else if (name == harvestcraftFish[19]){
return 20;
}
- else if (name == FishTrapHandler.harvestcraftFish[20]) {
+ else if (name == harvestcraftFish[20]){
return 4;
}
- else if (name == FishTrapHandler.harvestcraftFish[21]) {
+ else if (name == harvestcraftFish[21]){
return 40;
}
- else if (name == FishTrapHandler.harvestcraftFish[22]) {
+ else if (name == harvestcraftFish[22]){
return 30;
}
- else if (name == FishTrapHandler.harvestcraftFish[23]) {
+ else if (name == harvestcraftFish[23]){
return 5;
}
- else if (name == FishTrapHandler.harvestcraftFish[24]) {
+ else if (name == harvestcraftFish[24]){
return 8;
}
else {
return 25;
}
}
-
- public static void pamsHarvestCraftCompat() {
- for (int i = 0; i < FishTrapHandler.harvestcraftFish.length; i++) {
- final String itemName = FishTrapHandler.prefix + FishTrapHandler.harvestcraftFish[i]
- + FishTrapHandler.suffix;
- final int lootChance = FishTrapHandler.getLootChance(FishTrapHandler.harvestcraftFish[i]);
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null) {
- FishTrapHandler.addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance);
- FishTrapHandler.addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
- FishTrapHandler.addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
- FishTrapHandler.addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1));
- }
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(FishTrapHandler.greenheartFish, 1) != null) {
- FishTrapHandler.addFish("fish",
- ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1),
- FishTrapHandler.getLootChance(FishTrapHandler.greenheartFish));
- FishTrapHandler.addGregtechMaceratorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1));
- FishTrapHandler.addGregtechCentrifugeRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1));
- FishTrapHandler.addGregtechFluidRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1));
- }
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(FishTrapHandler.seaweed, 1) != null) {
- FishTrapHandler.addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.seaweed, 1),
- FishTrapHandler.getLootChance(FishTrapHandler.seaweed));
+
+ private static void addGregtechCentrifugeRecipe(ItemStack input){
+ if (LoadedMods.Gregtech){
+ GT_Values.RA.addCentrifugeRecipe(input, null, null, FluidUtils.getFluidStack("methane", 96), null, null, null, null, null, null, null, 19*20, 5);
+ }
+ }
+
+ private static void addGregtechMaceratorRecipe(ItemStack input){
+ if (LoadedMods.Gregtech){
+ GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0);
}
}
-
+
+ private static void addGregtechFluidRecipe(ItemStack input){
+ if (LoadedMods.Gregtech){
+ GT_Values.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 0, (64/4), 4); //4eu/t total eu used = 64 so time = 64/4
+ }
+ }
+
}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
index 02c468ef3a..d7521fc579 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
@@ -6,18 +6,18 @@ import net.minecraft.item.ItemStack;
public class Growthcraft_Old {
- public static void addTrapFish(final ItemStack loot, final int lootChance) {
- FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
+ public static void addTrapJunk(ItemStack loot, int lootChance){
+ FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
}
- public static void addTrapJunk(final ItemStack loot, final int lootChance) {
- FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
+ public static void addTrapTreasure(ItemStack loot, int lootChance){
+ FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
}
- public static void addTrapTreasure(final ItemStack loot, final int lootChance) {
- FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
+ public static void addTrapFish(ItemStack loot, int lootChance){
+ FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
index 2e32eacab6..97f37a8628 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
@@ -4,25 +4,25 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.ic2.item.IC2_Items;
import gtPlusPlus.xmod.ic2.recipe.RECIPE_IC2;
-public class HANDLER_IC2 {
+public class HANDLER_IC2{
- public static void init() {
- if (LoadedMods.IndustrialCraft2) {
+ public static void preInit() {
+ if (LoadedMods.IndustrialCraft2){
+ IC2_Items.register();
+ //new BlockRTG(InternalName.beer);
+ }
+ }
- }
+ public static void init() {
+ if (LoadedMods.IndustrialCraft2){
+
+ }
}
public static void postInit() {
- if (LoadedMods.IndustrialCraft2) {
+ if (LoadedMods.IndustrialCraft2){
RECIPE_IC2.initRecipes();
- }
- }
-
- public static void preInit() {
- if (LoadedMods.IndustrialCraft2) {
- IC2_Items.register();
- // new BlockRTG(InternalName.beer);
- }
+ }
}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
index 215b1dd0a3..9d238e4c97 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
@@ -1,13 +1,5 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.commons.lang3.mutable.MutableObject;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.xmod.ic2.block.kieticgenerator.tileentity.TileEntityKineticWindGenerator;
import gtPlusPlus.xmod.ic2.item.IC2_Items;
@@ -18,20 +10,34 @@ import ic2.core.block.BlockMultiID;
import ic2.core.block.TileEntityBlock;
import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric;
import ic2.core.init.InternalName;
-import net.minecraft.block.Block;
+
+import java.util.List;
+import java.util.Random;
+
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-public class BlockRTG extends BlockMultiID {
- public BlockRTG(final InternalName internalName1) {
+import org.apache.commons.lang3.mutable.MutableObject;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class BlockRTG
+extends BlockMultiID
+{
+ public BlockRTG(InternalName internalName1)
+ {
super(internalName1, Material.iron, ItemGenerators.class);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(3.0F);
- this.setStepSound(Block.soundTypeMetal);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setHardness(3.0F);
+ setStepSound(soundTypeMetal);
IC2_Items.blockRTG = new ItemStack(this, 1, 0);
IC2_Items.blockKineticGenerator = new ItemStack(this, 1, 1);
@@ -41,29 +47,14 @@ public class BlockRTG extends BlockMultiID {
}
@Override
- public int damageDropped(final int meta) {
- switch (meta) {
- case 2:
- return 2;
- }
- return 0;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack stack) {
- return stack.getItemDamage() == 5 ? EnumRarity.uncommon : EnumRarity.common;
- }
-
- @Override
- public void getSubBlocks(final Item j, final CreativeTabs tabs, final List itemList) {
- final Item item = Item.getItemFromBlock(this);
+ public void getSubBlocks(Item j, CreativeTabs tabs, List itemList) {
+ Item item = Item.getItemFromBlock(this);
if (!item.getHasSubtypes()) {
itemList.add(new ItemStack(this));
- }
- else {
- for (int i = 0; i < 16; i++) {
- final ItemStack is = new ItemStack(this, 1, i);
+ } else {
+ for (int i = 0; i < 16; i++)
+ {
+ ItemStack is = new ItemStack(this, 1, i);
if (is.getItem().getUnlocalizedName(is) == null) {
break;
}
@@ -72,96 +63,114 @@ public class BlockRTG extends BlockMultiID {
}
}
+
+ @Override
+ public String getTextureFolder(int id)
+ {
+ return "generator";
+ }
+
+ @Override
+ public int damageDropped(int meta)
+ {
+ switch (meta)
+ {
+ case 2:
+ return 2;
+ }
+ return 0;
+ }
+
@Override
- public Class<? extends TileEntity> getTeClass(final int meta, final MutableObject<Class<?>[]> ctorArgTypes,
- final MutableObject<Object[]> ctorArgs) {
- try {
- switch (meta) {
- case 0:
- return TileEntityRTG.class;
- case 1:
- return TileEntityKineticWindGenerator.class;
+ public Class<? extends TileEntity> getTeClass(int meta, MutableObject<Class<?>[]> ctorArgTypes, MutableObject<Object[]> ctorArgs)
+ {
+ try
+ {
+ switch (meta)
+ {
+ case 0:
+ return TileEntityRTG.class;
+ case 1:
+ return TileEntityKineticWindGenerator.class;
}
}
- catch (final Exception e) {
+ catch (Exception e)
+ {
throw new RuntimeException(e);
}
return null;
}
/*
- *
- * { case 0: return TileEntityGenerator.class; case 1: return
- * TileEntityGeoGenerator.class; case 2: return
- * TileEntityWaterGenerator.class; case 3: return
- * TileEntitySolarGenerator.class; case 4: return
- * TileEntityWindGenerator.class; case 5: return
- * TileEntityNuclearReactorElectric.class; case 6: return
- * TileEntityRTGenerator.class; case 7: return
- * TileEntitySemifluidGenerator.class; case 8: return
- * TileEntityStirlingGenerator.class; case 9: return
- * TileEntityKineticGenerator.class; }
- *
- * (non-Javadoc)
*
- * @see
- * net.minecraft.block.Block#randomDisplayTick(net.minecraft.world.World,
- * int, int, int, java.util.Random)
+ * {
+ case 0:
+ return TileEntityGenerator.class;
+ case 1:
+ return TileEntityGeoGenerator.class;
+ case 2:
+ return TileEntityWaterGenerator.class;
+ case 3:
+ return TileEntitySolarGenerator.class;
+ case 4:
+ return TileEntityWindGenerator.class;
+ case 5:
+ return TileEntityNuclearReactorElectric.class;
+ case 6:
+ return TileEntityRTGenerator.class;
+ case 7:
+ return TileEntitySemifluidGenerator.class;
+ case 8:
+ return TileEntityStirlingGenerator.class;
+ case 9:
+ return TileEntityKineticGenerator.class;
+ }
+ *
+ * (non-Javadoc)
+ * @see net.minecraft.block.Block#randomDisplayTick(net.minecraft.world.World, int, int, int, java.util.Random)
*/
@Override
- public String getTextureFolder(final int id) {
- return "generator";
- }
-
- @Override
- public boolean onBlockActivated(final World world, final int i, final int j, final int k,
- final EntityPlayer entityplayer, final int side, final float a, final float b, final float c) {
- if (entityplayer.getCurrentEquippedItem() != null
- && entityplayer.getCurrentEquippedItem().isItemEqual(Ic2Items.reactorChamber)) {
- return false;
- }
- return super.onBlockActivated(world, i, j, k, entityplayer, side, a, b, c);
- }
-
- @Override
- public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random random) {
+ public void randomDisplayTick(World world, int x, int y, int z, Random random)
+ {
if (!IC2.platform.isRendering()) {
return;
}
- final int meta = world.getBlockMetadata(x, y, z);
- if (meta == 0 && this.isActive(world, x, y, z)) {
- final TileEntityBlock te = (TileEntityBlock) this.getOwnTe(world, x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ if ((meta == 0) && (isActive(world, x, y, z)))
+ {
+ TileEntityBlock te = (TileEntityBlock)getOwnTe(world, x, y, z);
if (te == null) {
return;
}
- final int l = te.getFacing();
- final float f = x + 0.5F;
- final float f1 = y + 0.0F + random.nextFloat() * 6.0F / 16.0F;
- final float f2 = z + 0.5F;
- final float f3 = 0.52F;
- final float f4 = random.nextFloat() * 0.6F - 0.3F;
- switch (l) {
- case 4:
- world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- break;
- case 5:
- world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
- break;
- case 2:
- world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
- break;
- case 3:
- world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
+ int l = te.getFacing();
+ float f = x + 0.5F;
+ float f1 = y + 0.0F + random.nextFloat() * 6.0F / 16.0F;
+ float f2 = z + 0.5F;
+ float f3 = 0.52F;
+ float f4 = random.nextFloat() * 0.6F - 0.3F;
+ switch (l)
+ {
+ case 4:
+ world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ break;
+ case 5:
+ world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
+ break;
+ case 2:
+ world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
+ break;
+ case 3:
+ world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
}
}
- else if (meta == 5) {
- final TileEntityNuclearReactorElectric te = (TileEntityNuclearReactorElectric) this.getOwnTe(world, x, y,
- z);
+ else if (meta == 5)
+ {
+ TileEntityNuclearReactorElectric te = (TileEntityNuclearReactorElectric)getOwnTe(world, x, y, z);
if (te == null) {
return;
}
@@ -171,14 +180,28 @@ public class BlockRTG extends BlockMultiID {
}
puffs = world.rand.nextInt(puffs);
for (int n = 0; n < puffs; n++) {
- world.spawnParticle("smoke", x + random.nextFloat(), y + 0.95F, z + random.nextFloat(), 0.0D, 0.0D,
- 0.0D);
+ world.spawnParticle("smoke", x + random.nextFloat(), y + 0.95F, z + random.nextFloat(), 0.0D, 0.0D, 0.0D);
}
puffs -= world.rand.nextInt(4) + 3;
for (int n = 0; n < puffs; n++) {
- world.spawnParticle("flame", x + random.nextFloat(), y + 1.0F, z + random.nextFloat(), 0.0D, 0.0D,
- 0.0D);
+ world.spawnParticle("flame", x + random.nextFloat(), y + 1.0F, z + random.nextFloat(), 0.0D, 0.0D, 0.0D);
}
}
}
+
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float a, float b, float c)
+ {
+ if ((entityplayer.getCurrentEquippedItem() != null) && (entityplayer.getCurrentEquippedItem().isItemEqual(Ic2Items.reactorChamber))) {
+ return false;
+ }
+ return super.onBlockActivated(world, i, j, k, entityplayer, side, a, b, c);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack stack)
+ {
+ return stack.getItemDamage() == 5 ? EnumRarity.uncommon : EnumRarity.common;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
index cac4cbf9db..cea09bdd5c 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.CONTAINER_RTG;
import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.GUI_RTG;
import ic2.core.ContainerBase;
@@ -12,65 +10,77 @@ import ic2.core.block.invslot.InvSlotConsumableId;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TileEntityRTG extends TileEntityRTGenerator {
+public class TileEntityRTG
+extends TileEntityRTGenerator
+{
public final InvSlotConsumable fuelSlot;
- public TileEntityRTG() {
- this.fuelSlot = new InvSlotConsumableId(this, "fuelSlot", 0, 12, new Item[] {
- Ic2Items.RTGPellets.getItem()
- });
+ public TileEntityRTG()
+ {
+ this.fuelSlot = new InvSlotConsumableId(this, "fuelSlot", 0, 12, new Item[] { Ic2Items.RTGPellets.getItem() });
}
@Override
- public boolean delayActiveUpdate() {
- return true;
+ public int gaugeFuelScaled(int i)
+ {
+ return i;
}
@Override
- public boolean gainEnergy() {
- int counter = 0;
- for (int i = 0; i < this.fuelSlot.size(); i++) {
- if (this.fuelSlot.get(i) != null) {
- counter++;
- }
- }
- if (counter == 0) {
- return false;
- }
- this.storage += (int) Math.pow(2.0D, counter - 1);
- return true;
- }
+ public boolean gainEnergy()
+ {
+ int counter = 0;
+ for (int i = 0; i < this.fuelSlot.size(); i++) {
+ if (this.fuelSlot.get(i) != null) {
+ counter++;
+ }
+ }
+ if (counter == 0) {
+ return false;
+ }
+ this.storage += (int)Math.pow(2.0D, counter - 1);
+ return true;
+ }
@Override
- public boolean gainFuel() {
+ public boolean gainFuel()
+ {
return false;
}
@Override
- public int gaugeFuelScaled(final int i) {
- return i;
+ public boolean needsFuel()
+ {
+ return true;
}
@Override
- @SideOnly(Side.CLIENT)
- public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin) {
- return new GUI_RTG(new CONTAINER_RTG(entityPlayer, this));
+ public String getInventoryName()
+ {
+ return "RTG";
}
-
+
@Override
- public ContainerBase<TileEntityRTGenerator> getGuiContainer(final EntityPlayer entityPlayer) {
+ public ContainerBase<TileEntityRTGenerator> getGuiContainer(EntityPlayer entityPlayer)
+ {
return new CONTAINER_RTG(entityPlayer, this);
}
@Override
- public String getInventoryName() {
- return "RTG";
+ @SideOnly(Side.CLIENT)
+ public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin)
+ {
+ return new GUI_RTG(new CONTAINER_RTG(entityPlayer, this));
}
@Override
- public boolean needsFuel() {
+ public boolean delayActiveUpdate()
+ {
return true;
}
+
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
index 8336cad6f4..e9c7b5cc81 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
@@ -1,29 +1,34 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator.gui;
-import java.util.List;
-
import gtPlusPlus.xmod.ic2.block.RTGGenerator.TileEntityRTG;
import ic2.core.block.generator.container.ContainerRTGenerator;
import ic2.core.slot.SlotInvSlot;
+
+import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
-public class CONTAINER_RTG extends ContainerRTGenerator {
- public CONTAINER_RTG(final EntityPlayer entityPlayer, final TileEntityRTG tileEntity1) {
+public class CONTAINER_RTG
+extends ContainerRTGenerator
+{
+ public CONTAINER_RTG(EntityPlayer entityPlayer, TileEntityRTG tileEntity1)
+ {
super(entityPlayer, tileEntity1);
for (int i = 0; i < 4; i++) {
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + i * 18, 18));
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + i * 18, 18));
}
for (int i = 4; i < 8; i++) {
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 4) * 18, 36));
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 4) * 18, 36));
}
for (int i = 8; i < 12; i++) {
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 8) * 18, 54));
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 8) * 18, 54));
}
}
@Override
- public List<String> getNetworkedFields() {
- final List<String> ret = super.getNetworkedFields();
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = super.getNetworkedFields();
ret.add("storage");
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
index d7cdc17fe8..0d5f701b7a 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
@@ -1,9 +1,5 @@
package gtPlusPlus.xmod.ic2.block.RTGGenerator.gui;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.xmod.ic2.block.RTGGenerator.TileEntityRTG;
import ic2.core.IC2;
import ic2.core.block.generator.gui.GuiRTGenerator;
@@ -11,41 +7,46 @@ import ic2.core.util.GuiTooltipHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-@SideOnly(Side.CLIENT)
-public class GUI_RTG extends GuiRTGenerator {
- private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain,
- "textures/gui/GUIRTGenerator.png");
- public CONTAINER_RTG container;
-
- public String name;
-
- public GUI_RTG(final CONTAINER_RTG container1) {
- super(container1);
-
- this.container = container1;
- this.name = "RTG Mach II";
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(GUI_RTG.background);
- final int j = (this.width - this.xSize) / 2;
- final int k = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
-
- final int i1 = ((TileEntityRTG) this.container.base).gaugeStorageScaled(31);
- this.drawTexturedModalRect(j + 119, k + 40, 179, 3, i1, 8);
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 4,
- 4210752);
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
- GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop,
- StatCollector.translateToLocalFormatted("ic2.generic.text.bufferEU", new Object[] {
- Double.valueOf(((TileEntityRTG) this.container.base).storage)
- }), 117, 38, 150, 48);
- }
+@SideOnly(Side.CLIENT)
+public class GUI_RTG
+ extends GuiRTGenerator
+{
+ public CONTAINER_RTG container;
+ public String name;
+
+ public GUI_RTG(CONTAINER_RTG container1)
+ {
+ super(container1);
+
+ this.container = container1;
+ this.name = "RTG Mach II";
+ }
+
+ @Override
+protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 4, 4210752);
+
+ GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocalFormatted("ic2.generic.text.bufferEU", new Object[] { Double.valueOf(((TileEntityRTG)this.container.base).storage) }), 117, 38, 150, 48);
+ }
+
+ @Override
+protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(background);
+ int j = (this.width - this.xSize) / 2;
+ int k = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
+
+ int i1 = ((TileEntityRTG)this.container.base).gaugeStorageScaled(31);
+ drawTexturedModalRect(j + 119, k + 40, 179, 3, i1, 8);
+ }
+
+ private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain, "textures/gui/GUIRTGenerator.png");
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
index d4597cecab..74d94011ea 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
@@ -1,8 +1,5 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator;
-import org.apache.commons.lang3.mutable.MutableObject;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import ic2.core.block.BlockMultiID;
import ic2.core.block.kineticgenerator.tileentity.TileEntityManualKineticGenerator;
@@ -15,53 +12,65 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-public class IC2_BlockKineticGenerator extends BlockMultiID {
- public IC2_BlockKineticGenerator(final InternalName internalName1) {
- super(internalName1, Material.iron, ItemKineticGenerator.class);
-
- this.setHardness(3.0F);
- this.setStepSound(Block.soundTypeMetal);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
-
- GameRegistry.registerTileEntity(TileEntityWindKineticGenerator.class, "Advanced Kinetic Wind Generator");
-
- }
-
- @Override
- public int damageDropped(final int meta) {
- return meta;
- }
-
- @Override
- public Class<? extends TileEntity> getTeClass(final int meta, final MutableObject<Class<?>[]> ctorArgTypes,
- final MutableObject<Object[]> ctorArgs) {
- try {
- switch (meta) {
- case 0:
- return TileEntityWindKineticGenerator.class;
- }
- }
- catch (final Exception e) {
- throw new RuntimeException(e);
- }
- return null;
- }
+import org.apache.commons.lang3.mutable.MutableObject;
- @Override
- public String getTextureFolder(final int id) {
- return "kineticgenerator";
- }
+import cpw.mods.fml.common.registry.GameRegistry;
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z,
- final EntityPlayer entityPlayer, final int side, final float a, final float b, final float c) {
- if (entityPlayer.isSneaking()) {
- return false;
- }
- final TileEntity te = this.getOwnTe(world, x, y, z);
- if (te != null && te instanceof TileEntityManualKineticGenerator) {
- return ((TileEntityManualKineticGenerator) te).playerKlicked(entityPlayer);
- }
- return super.onBlockActivated(world, x, y, z, entityPlayer, side, a, b, c);
- }
+public class IC2_BlockKineticGenerator
+ extends BlockMultiID
+{
+ public IC2_BlockKineticGenerator(InternalName internalName1)
+ {
+ super(internalName1, Material.iron, ItemKineticGenerator.class);
+
+ setHardness(3.0F);
+ setStepSound(Block.soundTypeMetal);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+
+ GameRegistry.registerTileEntity(TileEntityWindKineticGenerator.class, "Advanced Kinetic Wind Generator");
+
+ }
+
+ @Override
+public String getTextureFolder(int id)
+ {
+ return "kineticgenerator";
+ }
+
+ @Override
+public int damageDropped(int meta)
+ {
+ return meta;
+ }
+
+ @Override
+public Class<? extends TileEntity> getTeClass(int meta, MutableObject<Class<?>[]> ctorArgTypes, MutableObject<Object[]> ctorArgs)
+ {
+ try
+ {
+ switch (meta)
+ {
+ case 0:
+ return TileEntityWindKineticGenerator.class;
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ return null;
+ }
+
+ @Override
+public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float a, float b, float c)
+ {
+ if (entityPlayer.isSneaking()) {
+ return false;
+ }
+ TileEntity te = getOwnTe(world, x, y, z);
+ if ((te != null) && ((te instanceof TileEntityManualKineticGenerator))) {
+ return ((TileEntityManualKineticGenerator)te).playerKlicked(entityPlayer);
+ }
+ return super.onBlockActivated(world, x, y, z, entityPlayer, side, a, b, c);
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
index 7d61881016..f356441921 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
@@ -1,48 +1,48 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator;
+import ic2.core.block.TileEntityBlock;
+
import java.io.DataInput;
import java.io.IOException;
-import ic2.core.block.TileEntityBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
-public abstract class IC2_TEComponent {
- protected final TileEntityBlock parent;
-
- public IC2_TEComponent(final TileEntityBlock parent) {
- this.parent = parent;
- }
-
- public boolean enableWorldTick() {
- return false;
- }
-
- public abstract String getDefaultName();
-
- public void onContainerUpdate(final String name, final EntityPlayerMP player) {
- }
-
- public void onLoaded() {
- }
-
- public void onNeighborUpdate(final Block srcBlock) {
- }
-
- public void onNetworkUpdate(final DataInput is) throws IOException {
- }
-
- public void onUnloaded() {
- }
-
- public void onWorldTick() {
- }
-
- public void readFromNbt(final NBTTagCompound nbt) {
- }
-
- public NBTTagCompound writeToNbt() {
- return null;
- }
+public abstract class IC2_TEComponent
+{
+ protected final TileEntityBlock parent;
+
+ public IC2_TEComponent(TileEntityBlock parent)
+ {
+ this.parent = parent;
+ }
+
+ public abstract String getDefaultName();
+
+ public void readFromNbt(NBTTagCompound nbt) {}
+
+ public NBTTagCompound writeToNbt()
+ {
+ return null;
+ }
+
+ public void onLoaded() {}
+
+ public void onUnloaded() {}
+
+ public void onNeighborUpdate(Block srcBlock) {}
+
+ public void onContainerUpdate(String name, EntityPlayerMP player) {}
+
+ public void onNetworkUpdate(DataInput is)
+ throws IOException
+ {}
+
+ public boolean enableWorldTick()
+ {
+ return false;
+ }
+
+ public void onWorldTick() {}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
index 7d65a042ec..b3ceea52d4 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
@@ -1,24 +1,27 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.container;
-import java.util.List;
-
import ic2.core.ContainerFullInv;
import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
import ic2.core.slot.SlotInvSlot;
-import net.minecraft.entity.player.EntityPlayer;
-public class ContainerKineticWindgenerator extends ContainerFullInv<TileEntityWindKineticGenerator> {
- public ContainerKineticWindgenerator(final EntityPlayer entityPlayer,
- final TileEntityWindKineticGenerator tileEntity1) {
- super(entityPlayer, tileEntity1, 166);
+import java.util.List;
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.rotorSlot, 0, 80, 26));
- }
+import net.minecraft.entity.player.EntityPlayer;
- @Override
- public List<String> getNetworkedFields() {
- final List<String> ret = super.getNetworkedFields();
- ret.add("windStrength");
- return ret;
- }
+public class ContainerKineticWindgenerator
+ extends ContainerFullInv<TileEntityWindKineticGenerator>
+{
+ public ContainerKineticWindgenerator(EntityPlayer entityPlayer, TileEntityWindKineticGenerator tileEntity1)
+ {
+ super(entityPlayer, tileEntity1, 166);
+
+ addSlotToContainer(new SlotInvSlot(tileEntity1.rotorSlot, 0, 80, 26));
+ }
+
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = super.getNetworkedFields();
+ ret.add("windStrength");
+ return ret;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
index 3380b83c39..f677e7fcfb 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
@@ -1,77 +1,76 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.gui;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import ic2.core.IC2;
import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator;
+import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
import ic2.core.util.GuiTooltipHelper;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-@SideOnly(Side.CLIENT)
-public class GuiKineticWindGenerator extends GuiContainer {
- private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain,
- "textures/gui/GUIWindKineticGenerator.png");
- public ContainerWindKineticGenerator container;
-
- public String name;
-
- public GuiKineticWindGenerator(final ContainerWindKineticGenerator container1) {
- super(container1);
-
- this.container = container1;
- this.name = StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.name");
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(GuiKineticWindGenerator.background);
- final int j = (this.width - this.xSize) / 2;
- final int k = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
- if (this.container.base.guiisoverload() && this.container.base.checkrotor()) {
- this.drawTexturedModalRect(j + 44, k + 20, 176, 0, 30, 26);
- this.drawTexturedModalRect(j + 102, k + 20, 176, 0, 30, 26);
- }
- }
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6,
- 4210752);
- if (this.container.base.checkrotor()) {
- if (!this.container.base.rotorspace()) {
- this.fontRendererObj.drawString(
- StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 20, 52, 2157374);
- }
- else if (this.container.base.checkrotor() && !this.container.base.guiisminWindStrength()) {
- this.fontRendererObj.drawString(
- StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374);
- this.fontRendererObj.drawString(
- StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak2"), 24, 69, 2157374);
- }
- else {
- this.fontRendererObj.drawString(
- StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.output", new Object[] {
- Integer.valueOf(this.container.base.getKuOutput())
- }), 55, 52, 2157374);
- this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 70, 2157374);
- if (this.container.base.guiisoverload()) {
- GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop,
- StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 20, 79, 45);
- GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop,
- StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload2"), 102, 20, 131,
- 45);
- }
- }
- }
- else {
- this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"),
- 27, 52, 2157374);
- }
- }
+@SideOnly(Side.CLIENT)
+public class GuiKineticWindGenerator
+ extends GuiContainer
+{
+ public ContainerWindKineticGenerator container;
+ public String name;
+
+ public GuiKineticWindGenerator(ContainerWindKineticGenerator container1)
+ {
+ super(container1);
+
+ this.container = container1;
+ this.name = StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.name");
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 4210752);
+ if (((TileEntityWindKineticGenerator)this.container.base).checkrotor())
+ {
+ if (!((TileEntityWindKineticGenerator)this.container.base).rotorspace())
+ {
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 20, 52, 2157374);
+ }
+ else if ((((TileEntityWindKineticGenerator)this.container.base).checkrotor()) && (!((TileEntityWindKineticGenerator)this.container.base).guiisminWindStrength()))
+ {
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374);
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak2"), 24, 69, 2157374);
+ }
+ else
+ {
+ this.fontRendererObj.drawString(StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.output", new Object[] { Integer.valueOf(((TileEntityWindKineticGenerator)this.container.base).getKuOutput()) }), 55, 52, 2157374);
+ this.fontRendererObj.drawString(((TileEntityWindKineticGenerator)this.container.base).getRotorhealth() + " %", 46, 70, 2157374);
+ if (((TileEntityWindKineticGenerator)this.container.base).guiisoverload())
+ {
+ GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 20, 79, 45);
+ GuiTooltipHelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload2"), 102, 20, 131, 45);
+ }
+ }
+ }
+ else {
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374);
+ }
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(background);
+ int j = (this.width - this.xSize) / 2;
+ int k = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
+ if ((((TileEntityWindKineticGenerator)this.container.base).guiisoverload()) && (((TileEntityWindKineticGenerator)this.container.base).checkrotor()))
+ {
+ drawTexturedModalRect(j + 44, k + 20, 176, 0, 30, 26);
+ drawTexturedModalRect(j + 102, k + 20, 176, 0, 30, 26);
+ }
+ }
+
+ private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain, "textures/gui/GUIWindKineticGenerator.png");
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
index 1dc9d39acf..f094c8f928 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
@@ -1,19 +1,22 @@
package gtPlusPlus.xmod.ic2.block.kieticgenerator.tileentity;
-import java.util.List;
-import java.util.Vector;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.energy.tile.IKineticSource;
import ic2.api.item.IKineticRotor;
import ic2.api.item.IKineticRotor.GearboxType;
-import ic2.core.*;
+import ic2.core.ContainerBase;
+import ic2.core.IC2;
+import ic2.core.IHasGui;
+import ic2.core.WorldData;
import ic2.core.block.invslot.InvSlotConsumableKineticRotor;
import ic2.core.block.kineticgenerator.container.ContainerWindKineticGenerator;
import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
+import ic2.core.network.NetworkManager;
import ic2.core.util.Util;
+
+import java.util.List;
+import java.util.Vector;
+
import net.minecraft.block.Block;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
@@ -22,321 +25,368 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.ChunkCache;
import net.minecraftforge.common.util.ForgeDirection;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TileEntityKineticWindGenerator extends TileEntityWindKineticGenerator implements IKineticSource, IHasGui {
- private static final double efficiencyRollOffExponent = 2.0D;
- private static final int nominalRotationPeriod = 500;
- public final InvSlotConsumableKineticRotor rotorSlot;
- private double windStrength;
- private int obstructedCrossSection;
- private int crossSection;
- private int updateTicker;
- private float rotationSpeed;
-
- public TileEntityKineticWindGenerator() {
- this.updateTicker = IC2.random.nextInt(this.getTickRate());
+public class TileEntityKineticWindGenerator
+extends TileEntityWindKineticGenerator
+implements IKineticSource, IHasGui
+{
+ public final InvSlotConsumableKineticRotor rotorSlot;
+ private double windStrength;
+ private int obstructedCrossSection;
+ private int crossSection;
+ private int updateTicker;
+ private float rotationSpeed;
+ private static final double efficiencyRollOffExponent = 2.0D;
+ private static final int nominalRotationPeriod = 500;
+
+ public TileEntityKineticWindGenerator()
+ {
+ this.updateTicker = IC2.random.nextInt(getTickRate());
this.rotorSlot = new InvSlotConsumableKineticRotor(this, "rotorslot", 0, null, 1, null, GearboxType.WIND);
}
- @Override
- public double calcWindStrength() {
- double windStr = WorldData.get(this.worldObj).windSim.getWindAt(this.yCoord);
-
- windStr *= 1.0D - Math.pow(this.obstructedCrossSection / this.crossSection, 2.0D);
-
- return Math.max(0.0D, windStr);
- }
-
- @Override
- public boolean checkrotor() {
- return !this.rotorSlot.isEmpty();
- }
+
+ public void update2Entity()
+ {
+ super.updateEntity();
- @Override
- public int checkSpace(int length, final boolean onlyrotor) {
- int box = this.getRotorDiameter() / 2;
- int lentemp = 0;
- if (onlyrotor) {
- length = 1;
- lentemp = length + 1;
+ assert (IC2.platform.isSimulating());
+ if (this.updateTicker++ % getTickRate() != 0) {
+ return;
}
- if (!onlyrotor) {
- box *= 2;
+ boolean needsInvUpdate = false;
+ if (!this.rotorSlot.isEmpty())
+ {
+ if (checkSpace(1, true) == 0)
+ {
+ if (getActive() != true) {
+ setActive(true);
+ }
+ needsInvUpdate = true;
+ }
+ else
+ {
+ if (getActive()) {
+ setActive(false);
+ }
+ needsInvUpdate = true;
+ }
}
- final ForgeDirection fwdDir = ForgeDirection.VALID_DIRECTIONS[this.getFacing()];
- final ForgeDirection rightDir = fwdDir.getRotation(ForgeDirection.DOWN);
-
- final int xMaxDist = Math.abs(length * fwdDir.offsetX + box * rightDir.offsetX);
-
- final int zMaxDist = Math.abs(length * fwdDir.offsetZ + box * rightDir.offsetZ);
-
- final ChunkCache chunkCache = new ChunkCache(this.worldObj, this.xCoord - xMaxDist, this.yCoord - box,
- this.zCoord - zMaxDist, this.xCoord + xMaxDist, this.yCoord + box, this.zCoord + zMaxDist, 0);
+ else
+ {
+ if (getActive()) {
+ setActive(false);
+ }
+ needsInvUpdate = true;
+ }
+ if (getActive())
+ {
+ this.crossSection = (getRotorDiameter() / 2 * 2 * 2 + 1);
- int ret = 0;
- for (int up = -box; up <= box; up++) {
- final int y = this.yCoord + up;
- for (int right = -box; right <= box; right++) {
- boolean occupied = false;
- for (int fwd = lentemp - length; fwd <= length; fwd++) {
- final int x = this.xCoord + fwd * fwdDir.offsetX + right * rightDir.offsetX;
+ this.crossSection *= this.crossSection;
+ this.obstructedCrossSection = checkSpace(getRotorDiameter() * 3, false);
+ if ((this.obstructedCrossSection > 0) && (this.obstructedCrossSection <= (getRotorDiameter() + 1) / 2)) {
+ this.obstructedCrossSection = 0;
+ } else if (this.obstructedCrossSection < 0) {
+ this.obstructedCrossSection = this.crossSection;
+ }
+ this.windStrength = calcWindStrength();
- final int z = this.zCoord + fwd * fwdDir.offsetZ + right * rightDir.offsetZ;
+ float speed = (float)Util.limit((this.windStrength - getMinWindStrength()) / getMaxWindStrength(), 0.0D, 2.0D);
- assert Math.abs(x - this.xCoord) <= xMaxDist;
- assert Math.abs(z - this.zCoord) <= zMaxDist;
- final Block block = chunkCache.getBlock(x, y, z);
- if (!block.isAir(chunkCache, x, y, z)) {
- occupied = true;
- if ((up != 0 || right != 0 || fwd != 0)
- && chunkCache.getTileEntity(x, y, z) instanceof TileEntityKineticWindGenerator
- && !onlyrotor) {
- return -1;
- }
- }
- }
- if (occupied) {
- ret++;
+ setRotationSpeed(speed*2);
+ if (this.windStrength >= getMinWindStrength()) {
+ if (this.windStrength <= getMaxWindStrength()) {
+ this.rotorSlot.damage(1, false);
+ } else {
+ this.rotorSlot.damage(4, false);
}
}
}
- return ret;
}
- public boolean enableUpdateEntity() {
- return IC2.platform.isSimulating();
- }
- @Override
- public boolean facingMatchesDirection(final ForgeDirection direction) {
- return direction.ordinal() == this.getFacing();
- }
@Override
- public float getAngle() {
- if (this.rotationSpeed > 0.0F) {
- final long period = (long) (5.0E+008F / this.rotationSpeed);
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = new Vector<String>(1);
- return (float) (System.nanoTime() % period) / (float) period * 360.0F;
- }
- return 0.0F;
+ ret.add("rotationSpeed");
+ ret.add("rotorSlot");
+ ret.addAll(super.getNetworkedFields());
+
+ return ret;
}
@Override
- public float getefficiency() {
- final ItemStack stack = this.rotorSlot.get();
- if (stack != null && stack.getItem() instanceof IKineticRotor) {
- return (float) (((IKineticRotor) stack.getItem()).getEfficiency(stack) * 1.5);
- }
- return 0.0F;
+ public ContainerBase<TileEntityWindKineticGenerator> getGuiContainer(EntityPlayer entityPlayer)
+ {
+ return new ContainerWindKineticGenerator(entityPlayer, this);
}
@Override
@SideOnly(Side.CLIENT)
- public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin) {
+ public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin)
+ {
return new GuiWindKineticGenerator(new ContainerWindKineticGenerator(entityPlayer, this));
}
@Override
- public ContainerBase<TileEntityWindKineticGenerator> getGuiContainer(final EntityPlayer entityPlayer) {
- return new ContainerWindKineticGenerator(entityPlayer, this);
+ public boolean facingMatchesDirection(ForgeDirection direction)
+ {
+ return direction.ordinal() == getFacing();
}
@Override
- public String getInventoryName() {
- return "Advanced Kinetic Wind Generator";
+ public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
+ {
+ if ((side == 0) || (side == 1)) {
+ return false;
+ }
+ return getFacing() != side;
}
@Override
- public int getKuOutput() {
- if (this.windStrength >= this.getMinWindStrength() && this.getActive()) {
- return (int) (this.windStrength * 50.0D * this.getefficiency());
- }
- return 0;
+ public void setFacing(short side)
+ {
+ super.setFacing(side);
+ }
+
+ public boolean enableUpdateEntity()
+ {
+ return IC2.platform.isSimulating();
}
@Override
- public int getMaxWindStrength() {
- final ItemStack stack = this.rotorSlot.get();
- if (stack != null && stack.getItem() instanceof IKineticRotor) {
- return ((IKineticRotor) stack.getItem()).getMaxWindStrength(stack) * 2;
+ public String getRotorhealth()
+ {
+ if (!this.rotorSlot.isEmpty()) {
+ return StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.rotorhealth", new Object[] { Integer.valueOf((int)(100.0F - this.rotorSlot.get().getItemDamage() / this.rotorSlot.get().getMaxDamage() * 100.0F)) });
}
- return 0;
+ return "";
}
@Override
- public int getMinWindStrength() {
- final ItemStack stack = this.rotorSlot.get();
- if (stack != null && stack.getItem() instanceof IKineticRotor) {
- return ((IKineticRotor) stack.getItem()).getMinWindStrength(stack) / 2;
+ public int maxrequestkineticenergyTick(ForgeDirection directionFrom)
+ {
+ return getKuOutput();
+ }
+
+ @Override
+ public int requestkineticenergy(ForgeDirection directionFrom, int requestkineticenergy)
+ {
+ if (facingMatchesDirection(directionFrom.getOpposite())) {
+ return Math.min(requestkineticenergy, getKuOutput());
}
return 0;
}
@Override
- public List<String> getNetworkedFields() {
- final List<String> ret = new Vector<String>(1);
+ public String getInventoryName()
+ {
+ return "Advanced Kinetic Wind Generator";
+ }
- ret.add("rotationSpeed");
- ret.add("rotorSlot");
- ret.addAll(super.getNetworkedFields());
+ @Override
+ public void onGuiClosed(EntityPlayer entityPlayer) {}
- return ret;
+ @Override
+ public boolean shouldRenderInPass(int pass)
+ {
+ return pass == 0;
}
@Override
- public int getRotorDiameter() {
- final ItemStack stack = this.rotorSlot.get();
- if (stack != null && stack.getItem() instanceof IKineticRotor) {
- return ((IKineticRotor) stack.getItem()).getDiameter(stack) / 2;
+ public int checkSpace(int length, boolean onlyrotor)
+ {
+ int box = getRotorDiameter() / 2;
+ int lentemp = 0;
+ if (onlyrotor)
+ {
+ length = 1;
+ lentemp = length + 1;
}
- return 0;
+ if (!onlyrotor) {
+ box *= 2;
+ }
+ ForgeDirection fwdDir = ForgeDirection.VALID_DIRECTIONS[getFacing()];
+ ForgeDirection rightDir = fwdDir.getRotation(ForgeDirection.DOWN);
+
+ int xMaxDist = Math.abs(length * fwdDir.offsetX + box * rightDir.offsetX);
+
+ int zMaxDist = Math.abs(length * fwdDir.offsetZ + box * rightDir.offsetZ);
+
+
+ ChunkCache chunkCache = new ChunkCache(this.worldObj, this.xCoord - xMaxDist, this.yCoord - box, this.zCoord - zMaxDist, this.xCoord + xMaxDist, this.yCoord + box, this.zCoord + zMaxDist, 0);
+
+
+
+ int ret = 0;
+ for (int up = -box; up <= box; up++)
+ {
+ int y = this.yCoord + up;
+ for (int right = -box; right <= box; right++)
+ {
+ boolean occupied = false;
+ for (int fwd = lentemp - length; fwd <= length; fwd++)
+ {
+ int x = this.xCoord + fwd * fwdDir.offsetX + right * rightDir.offsetX;
+
+ int z = this.zCoord + fwd * fwdDir.offsetZ + right * rightDir.offsetZ;
+
+
+ assert (Math.abs(x - this.xCoord) <= xMaxDist);
+ assert (Math.abs(z - this.zCoord) <= zMaxDist);
+
+ Block block = chunkCache.getBlock(x, y, z);
+ if (!block.isAir(chunkCache, x, y, z))
+ {
+ occupied = true;
+ if (((up != 0) || (right != 0) || (fwd != 0)) && ((chunkCache.getTileEntity(x, y, z) instanceof TileEntityKineticWindGenerator)) && (!onlyrotor)) {
+ return -1;
+ }
+ }
+ }
+ if (occupied) {
+ ret++;
+ }
+ }
+ }
+ return ret;
}
@Override
- public String getRotorhealth() {
- if (!this.rotorSlot.isEmpty()) {
- return StatCollector.translateToLocalFormatted("ic2.WindKineticGenerator.gui.rotorhealth", new Object[] {
- Integer.valueOf((int) (100.0F
- - this.rotorSlot.get().getItemDamage() / this.rotorSlot.get().getMaxDamage() * 100.0F))
- });
- }
- return "";
+ public boolean checkrotor()
+ {
+ return !this.rotorSlot.isEmpty();
}
@Override
- public ResourceLocation getRotorRenderTexture() {
- final ItemStack stack = this.rotorSlot.get();
- if (stack != null && stack.getItem() instanceof IKineticRotor) {
- return ((IKineticRotor) stack.getItem()).getRotorRenderTexture(stack);
+ public boolean rotorspace()
+ {
+ return checkSpace(1, true) == 0;
+ }
+
+ private void setRotationSpeed(float speed)
+ {
+ if (this.rotationSpeed != speed)
+ {
+ this.rotationSpeed = speed;
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "rotationSpeed");
}
- return new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorWoodmodel.png");
}
@Override
- public int getTickRate() {
+ public int getTickRate()
+ {
return 32;
}
@Override
- public int getWindStrength() {
- return (int) this.windStrength;
- }
+ public double calcWindStrength()
+ {
+ double windStr = WorldData.get(this.worldObj).windSim.getWindAt(this.yCoord);
- @Override
- public boolean guiisminWindStrength() {
- return this.windStrength >= this.getMinWindStrength();
+ windStr *= (1.0D - Math.pow(this.obstructedCrossSection / this.crossSection, 2.0D));
+
+
+ return Math.max(0.0D, windStr);
}
@Override
- public boolean guiisoverload() {
- if (this.windStrength > this.getMaxWindStrength()) {
- return true;
+ public float getAngle()
+ {
+ if (this.rotationSpeed > 0.0F)
+ {
+ long period = (long) (5.0E+008F / this.rotationSpeed);
+
+
+ return (float)(System.nanoTime() % period) / (float)period * 360.0F;
}
- return false;
+ return 0.0F;
}
@Override
- public int maxrequestkineticenergyTick(final ForgeDirection directionFrom) {
- return this.getKuOutput();
+ public float getefficiency()
+ {
+ ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return (float) (((IKineticRotor)stack.getItem()).getEfficiency(stack)*1.5);
+ }
+ return 0.0F;
}
@Override
- public void onGuiClosed(final EntityPlayer entityPlayer) {
+ public int getMinWindStrength()
+ {
+ ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor)stack.getItem()).getMinWindStrength(stack)/2;
+ }
+ return 0;
}
@Override
- public int requestkineticenergy(final ForgeDirection directionFrom, final int requestkineticenergy) {
- if (this.facingMatchesDirection(directionFrom.getOpposite())) {
- return Math.min(requestkineticenergy, this.getKuOutput());
+ public int getMaxWindStrength()
+ {
+ ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor)stack.getItem()).getMaxWindStrength(stack)*2;
}
return 0;
}
@Override
- public boolean rotorspace() {
- return this.checkSpace(1, true) == 0;
+ public int getRotorDiameter()
+ {
+ ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor)stack.getItem()).getDiameter(stack)/2;
+ }
+ return 0;
}
@Override
- public void setFacing(final short side) {
- super.setFacing(side);
+ public ResourceLocation getRotorRenderTexture()
+ {
+ ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor)stack.getItem()).getRotorRenderTexture(stack);
+ }
+ return new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorWoodmodel.png");
}
- private void setRotationSpeed(final float speed) {
- if (this.rotationSpeed != speed) {
- this.rotationSpeed = speed;
- IC2.network.get().updateTileEntityField(this, "rotationSpeed");
+ @Override
+ public boolean guiisoverload()
+ {
+ if (this.windStrength > getMaxWindStrength()) {
+ return true;
}
+ return false;
}
@Override
- public boolean shouldRenderInPass(final int pass) {
- return pass == 0;
+ public boolean guiisminWindStrength()
+ {
+ return this.windStrength >= getMinWindStrength();
}
- public void update2Entity() {
- super.updateEntity();
-
- assert IC2.platform.isSimulating();
- if (this.updateTicker++ % this.getTickRate() != 0) {
- return;
- }
- boolean needsInvUpdate = false;
- if (!this.rotorSlot.isEmpty()) {
- if (this.checkSpace(1, true) == 0) {
- if (this.getActive() != true) {
- this.setActive(true);
- }
- needsInvUpdate = true;
- }
- else {
- if (this.getActive()) {
- this.setActive(false);
- }
- needsInvUpdate = true;
- }
- }
- else {
- if (this.getActive()) {
- this.setActive(false);
- }
- needsInvUpdate = true;
- }
- if (this.getActive()) {
- this.crossSection = this.getRotorDiameter() / 2 * 2 * 2 + 1;
-
- this.crossSection *= this.crossSection;
- this.obstructedCrossSection = this.checkSpace(this.getRotorDiameter() * 3, false);
- if (this.obstructedCrossSection > 0 && this.obstructedCrossSection <= (this.getRotorDiameter() + 1) / 2) {
- this.obstructedCrossSection = 0;
- }
- else if (this.obstructedCrossSection < 0) {
- this.obstructedCrossSection = this.crossSection;
- }
- this.windStrength = this.calcWindStrength();
-
- final float speed = (float) Util
- .limit((this.windStrength - this.getMinWindStrength()) / this.getMaxWindStrength(), 0.0D, 2.0D);
-
- this.setRotationSpeed(speed * 2);
- if (this.windStrength >= this.getMinWindStrength()) {
- if (this.windStrength <= this.getMaxWindStrength()) {
- this.rotorSlot.damage(1, false);
- }
- else {
- this.rotorSlot.damage(4, false);
- }
- }
+ @Override
+ public int getKuOutput()
+ {
+ if ((this.windStrength >= getMinWindStrength()) && (getActive())) {
+ return (int)(this.windStrength * 50.0D * getefficiency());
}
+ return 0;
}
@Override
- public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) {
- if (side == 0 || side == 1) {
- return false;
- }
- return this.getFacing() != side;
+ public int getWindStrength()
+ {
+ return (int)this.windStrength;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
index 96c61d65b5..b6ec4d66df 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
@@ -1,33 +1,42 @@
package gtPlusPlus.xmod.ic2.item;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+
import java.util.List;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.*;
-public class IC2_ItemGradual extends CoreItem {
- public IC2_ItemGradual(final String internalName) {
+public class IC2_ItemGradual
+extends CoreItem
+{
+ public IC2_ItemGradual(String internalName)
+ {
super(internalName, AddToCreativeTab.tabMachines, 1, 10000, "", EnumRarity.uncommon);
- this.setNoRepair();
+ setNoRepair();
}
@Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item item, final CreativeTabs tabs, final List itemList) {
- itemList.add(new ItemStack(this, 1, 1));
+ public boolean isDamaged(ItemStack stack)
+ {
+ return getDamage(stack) > 1;
}
@Override
- public boolean isDamaged(final ItemStack stack) {
- return this.getDamage(stack) > 1;
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
}
@Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList)
+ {
+ itemList.add(new ItemStack(this, 1, 1));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
index 54e8ae855e..4922e0f806 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
@@ -6,41 +6,48 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-public class IC2_ItemGradualInteger extends IC2_ItemGradual implements ICustomDamageItem {
- private final int maxDmg;
-
- public IC2_ItemGradualInteger(final String internalName, final int maxdmg) {
- super(internalName);
-
- this.maxDmg = maxdmg;
- }
-
- @Override
- public boolean applyCustomDamage(final ItemStack stack, final int damage, final EntityLivingBase src) {
- this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
- return true;
- }
-
- @Override
- public int getCustomDamage(final ItemStack stack) {
- final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
- return nbt.getInteger("advDmg");
- }
-
- @Override
- public int getMaxCustomDamage(final ItemStack stack) {
- return this.maxDmg;
- }
-
- @Override
- public void setCustomDamage(final ItemStack stack, final int damage) {
- final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
- nbt.setInteger("advDmg", 0);
-
- final int maxStackDamage = stack.getMaxDamage();
- if (maxStackDamage > 2) {
- // stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg,
- // maxStackDamage - 2));
- }
- }
+public class IC2_ItemGradualInteger
+ extends IC2_ItemGradual
+ implements ICustomDamageItem
+{
+ private final int maxDmg;
+
+ public IC2_ItemGradualInteger(String internalName, int maxdmg)
+ {
+ super(internalName);
+
+ this.maxDmg = maxdmg;
+ }
+
+ @Override
+public int getCustomDamage(ItemStack stack)
+ {
+ NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
+ return nbt.getInteger("advDmg");
+ }
+
+ @Override
+public int getMaxCustomDamage(ItemStack stack)
+ {
+ return this.maxDmg;
+ }
+
+ @Override
+public void setCustomDamage(ItemStack stack, int damage)
+ {
+ NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
+ nbt.setInteger("advDmg", 0);
+
+ int maxStackDamage = stack.getMaxDamage();
+ if (maxStackDamage > 2) {
+ //stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg, maxStackDamage - 2));
+ }
+ }
+
+ @Override
+public boolean applyCustomDamage(ItemStack stack, int damage, EntityLivingBase src)
+ {
+ setCustomDamage(stack, getCustomDamage(stack) + damage);
+ return true;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
index d7cb77ee40..852830dc5c 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
@@ -1,76 +1,104 @@
package gtPlusPlus.xmod.ic2.item;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class IC2_ItemIC2 extends Item {
- private int rarity = 0;
-
- protected IIcon[] textures;
-
- /*
- * public String getTextureName(int index) { if ((!this.hasSubtypes) &&
- * (index > 0)) { return null; } String name = getUnlocalizedName(new
- * ItemStack(this, 1, index)); if ((name != null) && (name.length() > 4)) {
- * return name.substring(4); } return name; }
- *
- * @Override
- *
- * @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister
- * iconRegister) { int indexCount = 0; while (getTextureName(indexCount) !=
- * null) { indexCount++; if (indexCount > 32767) { throw new
- * RuntimeException("More Item Icons than actually possible @ " +
- * getUnlocalizedName()); } } this.textures = new IIcon[indexCount]; for
- * (int index = 0; index < indexCount; index++) { this.textures[index] =
- * iconRegister.registerIcon(CORE.MODID + ":" + getUnlocalizedName()); } }
- *
- * @Override
- *
- * @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int meta) { if
- * (meta < this.textures.length) { return this.textures[meta]; } return
- * this.textures.length < 1 ? null : this.textures[0]; }
- */
-
- public IC2_ItemIC2(final String internalName) {
- this.setUnlocalizedName(internalName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setTextureName(CORE.MODID + ":" + internalName);
+public class IC2_ItemIC2
+extends Item
+{
+ public IC2_ItemIC2(String internalName)
+ {
+ setUnlocalizedName(internalName);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setTextureName(CORE.MODID + ":" + internalName);
GameRegistry.registerItem(this, internalName);
}
- @Override
- public String getItemStackDisplayName(final ItemStack itemStack) {
- return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack));
+ public String getTextureFolder()
+ {
+ return null;
}
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack stack) {
- return EnumRarity.values()[this.rarity];
- }
+ /* public String getTextureName(int index)
+ {
+ if ((!this.hasSubtypes) && (index > 0)) {
+ return null;
+ }
+ String name = getUnlocalizedName(new ItemStack(this, 1, index));
+ if ((name != null) && (name.length() > 4)) {
+ return name.substring(4);
+ }
+ return name;
+ }
- public String getTextureFolder() {
- return null;
- }
+ @Override
+@SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ int indexCount = 0;
+ while (getTextureName(indexCount) != null)
+ {
+ indexCount++;
+ if (indexCount > 32767) {
+ throw new RuntimeException("More Item Icons than actually possible @ " + getUnlocalizedName());
+ }
+ }
+ this.textures = new IIcon[indexCount];
+ for (int index = 0; index < indexCount; index++) {
+ this.textures[index] = iconRegister.registerIcon(CORE.MODID + ":" + getUnlocalizedName());
+ }
+ }
+
+ @Override
+@SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int meta)
+ {
+ if (meta < this.textures.length) {
+ return this.textures[meta];
+ }
+ return this.textures.length < 1 ? null : this.textures[0];
+ }*/
@Override
- public String getUnlocalizedName() {
+ public String getUnlocalizedName()
+ {
return super.getUnlocalizedName();
}
@Override
- public String getUnlocalizedName(final ItemStack itemStack) {
- return this.getUnlocalizedName();
+ public String getUnlocalizedName(ItemStack itemStack)
+ {
+ return getUnlocalizedName();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack itemStack)
+ {
+ return StatCollector.translateToLocal(getUnlocalizedName(itemStack));
}
- public IC2_ItemIC2 setRarity(final int aRarity) {
+
+ public IC2_ItemIC2 setRarity(int aRarity)
+ {
this.rarity = aRarity;
return this;
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack stack)
+ {
+ return EnumRarity.values()[this.rarity];
+ }
+
+ private int rarity = 0;
+ protected IIcon[] textures;
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
index c7645d309e..bf6f3bc1cd 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
@@ -10,98 +10,62 @@ import net.minecraft.util.ResourceLocation;
public class IC2_Items {
- public static ItemStack rotor_Material_1; // Energetic Alloy
- public static ItemStack rotor_Material_2; // TungstenSteel
- public static ItemStack rotor_Material_3; // Vibrant Alloy
- public static ItemStack rotor_Material_4; // Iridium
+ public static ItemStack rotor_Material_1; //Energetic Alloy
+ public static ItemStack rotor_Material_2; //TungstenSteel
+ public static ItemStack rotor_Material_3; //Vibrant Alloy
+ public static ItemStack rotor_Material_4; //Iridium
- public static ItemStack rotor_Blade_Material_1;
- public static ItemStack rotor_Blade_Material_2;
- public static ItemStack rotor_Blade_Material_3;
- public static ItemStack rotor_Blade_Material_4;
+ public static ItemStack rotor_Blade_Material_1;
+ public static ItemStack rotor_Blade_Material_2;
+ public static ItemStack rotor_Blade_Material_3;
+ public static ItemStack rotor_Blade_Material_4;
- public static ItemStack shaft_Material_1; // Energetic Alloy
- public static ItemStack shaft_Material_2; // TungstenSteel
- public static ItemStack shaft_Material_3; // Vibrant Alloy
- public static ItemStack shaft_Material_4; // Iridium
+ public static ItemStack shaft_Material_1; //Energetic Alloy
+ public static ItemStack shaft_Material_2; //TungstenSteel
+ public static ItemStack shaft_Material_3; //Vibrant Alloy
+ public static ItemStack shaft_Material_4; //Iridium
+
+ public static ItemStack blockRTG;
+ public static ItemStack blockKineticGenerator;
- public static ItemStack blockRTG;
- public static ItemStack blockKineticGenerator;
+ public static void register(){
- public static void register() {
-
- if (LoadedMods.EnderIO) {
- // Tier 1
- IC2_Items.rotor_Blade_Material_1 = new ItemStack(new CoreItem("itemEnergeticRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_1 = new ItemStack(new CoreItem("itemEnergeticShaft", AddToCreativeTab.tabMachines,
- 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_1 = new ItemStack(new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12,
- 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemEnergeticRotor"));
- // Tier 2
- IC2_Items.rotor_Blade_Material_2 = new ItemStack(new CoreItem("itemTungstenSteelRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_2 = new ItemStack(new CoreItem("itemTungstenSteelShaft",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_2 = new ItemStack(new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14,
- 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor"));
- // Tier 3
- IC2_Items.rotor_Blade_Material_3 = new ItemStack(new CoreItem("itemVibrantRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_3 = new ItemStack(new CoreItem("itemVibrantShaft", AddToCreativeTab.tabMachines,
- 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_3 = new ItemStack(new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16,
- 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemVibrantRotor"));
- // Tier 4
- IC2_Items.rotor_Blade_Material_4 = new ItemStack(new CoreItem("itemIridiumRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_4 = new ItemStack(new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines,
- 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_4 = new ItemStack(
- new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320,
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines)
- .setUnlocalizedName("itemIridiumRotor"));
+ if(LoadedMods.EnderIO){
+ //Tier 1
+ rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemEnergeticRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_1 = new ItemStack (new CoreItem("itemEnergeticShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemEnergeticRotor"));
+ //Tier 2
+ rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor"));
+ //Tier 3
+ rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemVibrantRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_3 = new ItemStack (new CoreItem("itemVibrantShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemVibrantRotor"));
+ //Tier 4
+ rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor"));
}
else {
- // Tier 1 - Magnalium
- IC2_Items.rotor_Blade_Material_1 = new ItemStack(new CoreItem("itemMagnaliumRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_1 = new ItemStack(new CoreItem("itemMagnaliumShaft", AddToCreativeTab.tabMachines,
- 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_1 = new ItemStack(new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12,
- 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemMagnaliumRotor"));
- // Tier 2
- IC2_Items.rotor_Blade_Material_2 = new ItemStack(new CoreItem("itemTungstenSteelRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_2 = new ItemStack(new CoreItem("itemTungstenSteelShaft",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_2 = new ItemStack(new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14,
- 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor"));
- // Tier 3 - Ultimet
- IC2_Items.rotor_Blade_Material_3 = new ItemStack(new CoreItem("itemUltimetRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_3 = new ItemStack(new CoreItem("itemUltimetShaft", AddToCreativeTab.tabMachines,
- 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_3 = new ItemStack(new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16,
- 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemUltimetRotor"));
- // Tier 4
- IC2_Items.rotor_Blade_Material_4 = new ItemStack(new CoreItem("itemIridiumRotorBlade",
- AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.shaft_Material_4 = new ItemStack(new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines,
- 16, "A part for an advanced Kinetic Rotor"));
- IC2_Items.rotor_Material_4 = new ItemStack(
- new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320,
- new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"))
- .setCreativeTab(AddToCreativeTab.tabMachines)
- .setUnlocalizedName("itemIridiumRotor"));
+ //Tier 1 - Magnalium
+ rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemMagnaliumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_1 = new ItemStack (new CoreItem("itemMagnaliumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemMagnaliumRotor"));
+ //Tier 2
+ rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor"));
+ //Tier 3 - Ultimet
+ rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemUltimetRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_3 = new ItemStack (new CoreItem("itemUltimetShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemUltimetRotor"));
+ //Tier 4
+ rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor"));
+ rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor"));
}
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java b/src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
index 38f259b578..2d73638ce9 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
@@ -1,49 +1,55 @@
package gtPlusPlus.xmod.ic2.item;
+import ic2.core.item.block.ItemBlockIC2;
+
import java.util.List;
-import ic2.core.item.block.ItemBlockIC2;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-public class ItemGenerators extends ItemBlockIC2 {
- public ItemGenerators(final Block block) {
- super(block);
-
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- }
-
- @Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
- final int meta = itemStack.getItemDamage();
- switch (meta) {
- case 0:
- info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-32 EU/t "
- + StatCollector.translateToLocal("ic2.item.tooltip.max"));
- break;
- case 1:
- info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-512 EU/t "
- + StatCollector.translateToLocal("ic2.item.tooltip.max"));
- }
- }
-
- @Override
- public int getMetadata(final int i) {
- return i;
- }
-
- @Override
- public String getUnlocalizedName(final ItemStack itemstack) {
- final int meta = itemstack.getItemDamage();
- switch (meta) {
- case 0:
- return "ic2.blockRTGenerator2";
- case 1:
- return "ic2.blockKineticGenerator2";
- }
- return null;
- }
+public class ItemGenerators
+ extends ItemBlockIC2
+{
+ public ItemGenerators(Block block)
+ {
+ super(block);
+
+ setMaxDamage(0);
+ setHasSubtypes(true);
+ }
+
+ @Override
+public int getMetadata(int i)
+ {
+ return i;
+ }
+
+ @Override
+public String getUnlocalizedName(ItemStack itemstack)
+ {
+ int meta = itemstack.getItemDamage();
+ switch (meta)
+ {
+ case 0:
+ return "ic2.blockRTGenerator2";
+ case 1:
+ return "ic2.blockKineticGenerator2";
+ }
+ return null;
+ }
+
+ @Override
+public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b)
+ {
+ int meta = itemStack.getItemDamage();
+ switch (meta)
+ {
+ case 0:
+ info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-32 EU/t " + StatCollector.translateToLocal("ic2.item.tooltip.max")); break;
+ case 1:
+ info.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerOutput") + " 1-512 EU/t " + StatCollector.translateToLocal("ic2.item.tooltip.max"));
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java
index 8f1dd7f479..06e33d6793 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java
@@ -1,94 +1,99 @@
package gtPlusPlus.xmod.ic2.item;
-import java.util.List;
-
import ic2.api.item.IKineticRotor;
import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
import ic2.core.init.InternalName;
import ic2.core.item.resources.ItemWindRotor;
+
+import java.util.List;
+
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-public class RotorBase extends ItemWindRotor {
+public class RotorBase extends ItemWindRotor{
- private final int maxWindStrength;
- private final int minWindStrength;
- private final int radius;
- private final float efficiency;
- private final ResourceLocation renderTexture;
- private final boolean water;
+ private final int maxWindStrength;
+ private final int minWindStrength;
+ private final int radius;
+ private final float efficiency;
+ private final ResourceLocation renderTexture;
+ private final boolean water;
- public RotorBase(final InternalName internalName, final int Radius, final int durability, final float efficiency,
- final int minWindStrength, final int maxWindStrength, final ResourceLocation RenderTexture) {
+ public RotorBase(InternalName internalName, int Radius, int durability, float efficiency, int minWindStrength, int maxWindStrength, ResourceLocation RenderTexture)
+ {
super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
- this.setMaxStackSize(1);
- this.setMaxDamage(durability);
+
+
+ setMaxStackSize(1);
+ setMaxDamage(durability);
this.radius = Radius;
this.efficiency = efficiency;
this.renderTexture = RenderTexture;
this.minWindStrength = minWindStrength;
this.maxWindStrength = maxWindStrength;
- this.water = internalName != InternalName.itemwoodrotor;
+ this.water = (internalName != InternalName.itemwoodrotor);
}
@Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
- info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[] {
- Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength)
- }));
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b)
+ {
+ info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[] { Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength) }));
IKineticRotor.GearboxType type = null;
- if (Minecraft.getMinecraft().currentScreen != null
- && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) {
+ if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator))) {
type = IKineticRotor.GearboxType.WATER;
- }
- else if (Minecraft.getMinecraft().currentScreen != null
- && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) {
+ } else if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator))) {
type = IKineticRotor.GearboxType.WIND;
}
if (type != null) {
- // info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." +
- // isAcceptedType(itemStack, type)));
+ //info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + isAcceptedType(itemStack, type)));
}
}
@Override
- public int getDiameter(final ItemStack stack) {
- return this.radius;
+ public String getTextureFolder()
+ {
+ return "rotors";
}
@Override
- public float getEfficiency(final ItemStack stack) {
- return this.efficiency;
+ public int getDiameter(ItemStack stack)
+ {
+ return this.radius;
}
@Override
- public int getMaxWindStrength(final ItemStack stack) {
- return this.maxWindStrength;
+ public ResourceLocation getRotorRenderTexture(ItemStack stack)
+ {
+ return this.renderTexture;
}
@Override
- public int getMinWindStrength(final ItemStack stack) {
- return this.minWindStrength;
+ public float getEfficiency(ItemStack stack)
+ {
+ return this.efficiency;
}
@Override
- public ResourceLocation getRotorRenderTexture(final ItemStack stack) {
- return this.renderTexture;
+ public int getMinWindStrength(ItemStack stack)
+ {
+ return this.minWindStrength;
}
@Override
- public String getTextureFolder() {
- return "rotors";
+ public int getMaxWindStrength(ItemStack stack)
+ {
+ return this.maxWindStrength;
}
- @Override
- public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type) {
- return type == IKineticRotor.GearboxType.WIND || this.water;
+ public boolean isAcceptedType(ItemStack stack, IKineticRotor.GearboxType type)
+ {
+ return (type == IKineticRotor.GearboxType.WIND) || (this.water);
}
}
+
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
index 2aa89bd868..f35b1e88f0 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
@@ -1,12 +1,13 @@
package gtPlusPlus.xmod.ic2.item;
-import java.util.List;
-
import ic2.api.item.IKineticRotor;
import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator;
import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator;
import ic2.core.init.InternalName;
import ic2.core.util.StackUtil;
+
+import java.util.List;
+
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -15,100 +16,106 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-public class RotorIridium extends RotorBase {
+public class RotorIridium extends RotorBase{
- private final int maxWindStrength;
- private final int minWindStrength;
- private final int radius;
- private final float efficiency;
- private final ResourceLocation renderTexture;
- private final boolean water;
+ private final int maxWindStrength;
+ private final int minWindStrength;
+ private final int radius;
+ private final float efficiency;
+ private final ResourceLocation renderTexture;
+ private final boolean water;
- public RotorIridium(final InternalName internalName, final int Radius, final int durability, final float efficiency,
- final int minWindStrength, final int maxWindStrength, final ResourceLocation RenderTexture) {
+ public RotorIridium(InternalName internalName, int Radius, int durability, float efficiency, int minWindStrength, int maxWindStrength, ResourceLocation RenderTexture)
+ {
super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
- this.setMaxStackSize(1);
- this.setMaxDamage(Integer.MAX_VALUE);
+
+
+ setMaxStackSize(1);
+ setMaxDamage(Integer.MAX_VALUE);
this.radius = Radius;
this.efficiency = efficiency;
this.renderTexture = RenderTexture;
this.minWindStrength = minWindStrength;
this.maxWindStrength = maxWindStrength;
- this.water = internalName != InternalName.itemwoodrotor;
+ this.water = (internalName != InternalName.itemwoodrotor);
}
@Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) {
- info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[] {
- Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength)
- }));
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b)
+ {
+ info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[] { Integer.valueOf(this.minWindStrength), Integer.valueOf(this.maxWindStrength) }));
IKineticRotor.GearboxType type = null;
- if (Minecraft.getMinecraft().currentScreen != null
- && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) {
+ if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator))) {
type = IKineticRotor.GearboxType.WATER;
- }
- else if (Minecraft.getMinecraft().currentScreen != null
- && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) {
+ } else if ((Minecraft.getMinecraft().currentScreen != null) && ((Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator))) {
type = IKineticRotor.GearboxType.WIND;
}
if (type != null) {
- // info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." +
- // isAcceptedType(itemStack, type)));
+ //info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + isAcceptedType(itemStack, type)));
}
}
@Override
- public boolean applyCustomDamage(final ItemStack stack, final int damage, final EntityLivingBase src) {
- this.setCustomDamage(stack, this.getCustomDamage(stack) + damage);
- return true;
- }
-
- @Override
- public int getDiameter(final ItemStack stack) {
- return this.radius;
- }
-
- @Override
- public float getEfficiency(final ItemStack stack) {
- return this.efficiency;
- }
-
- @Override
- public int getMaxWindStrength(final ItemStack stack) {
- return this.maxWindStrength;
- }
-
- @Override
- public int getMinWindStrength(final ItemStack stack) {
- return this.minWindStrength;
- }
-
- @Override
- public ResourceLocation getRotorRenderTexture(final ItemStack stack) {
- return this.renderTexture;
- }
-
- @Override
- public String getTextureFolder() {
- return "rotors";
- }
-
- @Override
- public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type) {
- return type == IKineticRotor.GearboxType.WIND || this.water;
- }
-
- @Override
- public void setCustomDamage(final ItemStack stack, final int damage) {
- final NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
- nbt.setInteger("advDmg", 0);
-
- final int maxStackDamage = stack.getMaxDamage();
- if (maxStackDamage > 2) {
- // stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg,
- // maxStackDamage - 2));
- }
+ public String getTextureFolder()
+ {
+ return "rotors";
+ }
+
+ @Override
+ public int getDiameter(ItemStack stack)
+ {
+ return this.radius;
+ }
+
+ @Override
+ public ResourceLocation getRotorRenderTexture(ItemStack stack)
+ {
+ return this.renderTexture;
+ }
+
+ @Override
+ public float getEfficiency(ItemStack stack)
+ {
+ return this.efficiency;
+ }
+
+ @Override
+ public int getMinWindStrength(ItemStack stack)
+ {
+ return this.minWindStrength;
+ }
+
+ @Override
+ public int getMaxWindStrength(ItemStack stack)
+ {
+ return this.maxWindStrength;
+ }
+
+ public boolean isAcceptedType(ItemStack stack, IKineticRotor.GearboxType type)
+ {
+ return (type == IKineticRotor.GearboxType.WIND) || (this.water);
+ }
+
+
+ @Override
+ public void setCustomDamage(ItemStack stack, int damage)
+ {
+ NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
+ nbt.setInteger("advDmg", 0);
+
+ int maxStackDamage = stack.getMaxDamage();
+ if (maxStackDamage > 2) {
+ //stack.setItemDamage(1 + (int)Util.map(damage, this.maxDmg, maxStackDamage - 2));
+ }
+ }
+
+ @Override
+ public boolean applyCustomDamage(ItemStack stack, int damage, EntityLivingBase src)
+ {
+ setCustomDamage(stack, getCustomDamage(stack) + damage);
+ return true;
+ }
}
-}
+
diff --git a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
index 8fb8336ca0..6b95487773 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
@@ -1,7 +1,12 @@
package gtPlusPlus.xmod.ic2.recipe;
-import gregtech.api.enums.*;
-import gregtech.api.util.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
@@ -11,142 +16,136 @@ import gtPlusPlus.xmod.ic2.item.IC2_Items;
import net.minecraft.item.ItemStack;
public class RECIPE_IC2 {
-
- public static String plate_T1 = "plateEnergeticAlloy";
- public static String plate_T2 = "plateTungstenSteel";
- public static String plate_T3 = "plateVibrantAlloy";
- public static String plate_T4 = "plateAlloyIridium";
-
- public static ItemStack block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.EnergeticAlloy,
- 1L);
- public static ItemStack block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel,
- 1L);
- public static ItemStack block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.VibrantAlloy,
- 1L);
- public static ItemStack block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
-
- public static String ingot_T1 = "ingotEnergeticAlloy";
- public static String ingot_T2 = "ingotTungstenSteel";
- public static String ingot_T3 = "ingotVibrantAlloy";
- public static String ingot_T4 = "ingotIridium";
-
- private static ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem());
- private static ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem());
- private static ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem());
- private static ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem());
-
- private static ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_1.getItem());
- private static ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_2.getItem());
- private static ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_3.getItem());
- private static ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_4.getItem());
-
- private static ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_1.getItem());
- private static ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_2.getItem());
- private static ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_3.getItem());
- private static ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_4.getItem());
-
- private static void checkForEnderIO() {
- if (!LoadedMods.EnderIO) {
- RECIPE_IC2.plate_T1 = "plateMagnalium";
- RECIPE_IC2.plate_T2 = "plateTungstenSteel";
- RECIPE_IC2.plate_T3 = "plateUltimet";
- RECIPE_IC2.plate_T4 = "plateAlloyIridium";
-
- RECIPE_IC2.block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Magnalium, 1L);
- RECIPE_IC2.block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
- RECIPE_IC2.block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Ultimet, 1L);
- RECIPE_IC2.block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
-
- RECIPE_IC2.ingot_T1 = "ingotMagnalium";
- RECIPE_IC2.ingot_T2 = "ingotTungstenSteel";
- RECIPE_IC2.ingot_T3 = "ingotUltimet";
- RECIPE_IC2.ingot_T4 = "ingotIridium";
+
+ public static String plate_T1 = "plateEnergeticAlloy";
+ public static String plate_T2 = "plateTungstenSteel";
+ public static String plate_T3 = "plateVibrantAlloy";
+ public static String plate_T4 = "plateAlloyIridium";
+
+ public static ItemStack block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.EnergeticAlloy, 1L);
+ public static ItemStack block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
+ public static ItemStack block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.VibrantAlloy, 1L);
+ public static ItemStack block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
+
+ public static String ingot_T1 = "ingotEnergeticAlloy";
+ public static String ingot_T2 = "ingotTungstenSteel";
+ public static String ingot_T3 = "ingotVibrantAlloy";
+ public static String ingot_T4 = "ingotIridium";
+
+ private static ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem());
+ private static ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem());
+ private static ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem());
+ private static ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem());
+
+ private static ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_1.getItem());
+ private static ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_2.getItem());
+ private static ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_3.getItem());
+ private static ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_4.getItem());
+
+ private static ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_1.getItem());
+ private static ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_2.getItem());
+ private static ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_3.getItem());
+ private static ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_4.getItem());
+
+ private static void checkForEnderIO(){
+ if(!LoadedMods.EnderIO){
+ plate_T1 = "plateMagnalium";
+ plate_T2 = "plateTungstenSteel";
+ plate_T3 = "plateUltimet";
+ plate_T4 = "plateAlloyIridium";
+
+ block_T1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Magnalium, 1L);
+ block_T2 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.TungstenSteel, 1L);
+ block_T3 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Ultimet, 1L);
+ block_T4 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iridium, 1L);
+
+ ingot_T1 = "ingotMagnalium";
+ ingot_T2 = "ingotTungstenSteel";
+ ingot_T3 = "ingotUltimet";
+ ingot_T4 = "ingotIridium";
}
}
-
- public static void initRecipes() {
-
- // Rotor Blade Recipes
- RecipeUtils.recipeBuilder(RECIPE_IC2.plate_T1, RECIPE_IC2.ingot_T1, RECIPE_IC2.plate_T1, RECIPE_IC2.plate_T1,
- RECIPE_IC2.ingot_T1, RECIPE_IC2.plate_T1, RECIPE_IC2.plate_T1, RECIPE_IC2.ingot_T1, RECIPE_IC2.plate_T1,
- RECIPE_IC2.rotor_blade_T1);
-
- RecipeUtils.recipeBuilder(RECIPE_IC2.plate_T2, RECIPE_IC2.ingot_T2, RECIPE_IC2.plate_T2, RECIPE_IC2.plate_T2,
- RECIPE_IC2.ingot_T2, RECIPE_IC2.plate_T2, RECIPE_IC2.plate_T2, RECIPE_IC2.ingot_T2, RECIPE_IC2.plate_T2,
- RECIPE_IC2.rotor_blade_T2);
-
- RecipeUtils.recipeBuilder(RECIPE_IC2.plate_T3, RECIPE_IC2.ingot_T3, RECIPE_IC2.plate_T3, RECIPE_IC2.plate_T3,
- RECIPE_IC2.ingot_T3, RECIPE_IC2.plate_T3, RECIPE_IC2.plate_T3, RECIPE_IC2.ingot_T3, RECIPE_IC2.plate_T3,
- RECIPE_IC2.rotor_blade_T3);
-
- RecipeUtils.recipeBuilder(RECIPE_IC2.plate_T4, RECIPE_IC2.ingot_T4, RECIPE_IC2.plate_T4, RECIPE_IC2.plate_T4,
- RECIPE_IC2.ingot_T4, RECIPE_IC2.plate_T4, RECIPE_IC2.plate_T4, RECIPE_IC2.ingot_T4, RECIPE_IC2.plate_T4,
- RECIPE_IC2.rotor_blade_T4);
-
- // Shaft Extruder Recipe
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE,
- new Object[] {
- "hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod,
- Character.valueOf('X'), OrePrefixes.plate.get(Materials.DarkIron), Character.valueOf('S'),
- OrePrefixes.screw.get(Materials.DarkIron)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE,
- new Object[] {
- "hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod,
- Character.valueOf('X'), OrePrefixes.plate.get(Materials.TungstenSteel), Character.valueOf('S'),
- OrePrefixes.screw.get(Materials.TungstenSteel)
- });
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]),
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE,
- new Object[] {
- "hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod,
- Character.valueOf('X'), OrePrefixes.plate.get(Materials.Molybdenum), Character.valueOf('S'),
- OrePrefixes.screw.get(Materials.Molybdenum)
- });
+
+ public static void initRecipes(){
+
+ //Rotor Blade Recipes
+ RecipeUtils.recipeBuilder(
+ plate_T1, ingot_T1, plate_T1,
+ plate_T1, ingot_T1, plate_T1,
+ plate_T1, ingot_T1, plate_T1,
+ rotor_blade_T1);
+
+ RecipeUtils.recipeBuilder(
+ plate_T2, ingot_T2, plate_T2,
+ plate_T2, ingot_T2, plate_T2,
+ plate_T2, ingot_T2, plate_T2,
+ rotor_blade_T2);
+
+ RecipeUtils.recipeBuilder(
+ plate_T3, ingot_T3, plate_T3,
+ plate_T3, ingot_T3, plate_T3,
+ plate_T3, ingot_T3, plate_T3,
+ rotor_blade_T3);
+
+ RecipeUtils.recipeBuilder(
+ plate_T4, ingot_T4, plate_T4,
+ plate_T4, ingot_T4, plate_T4,
+ plate_T4, ingot_T4, plate_T4,
+ rotor_blade_T4);
+
+ //Shaft Extruder Recipe
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod, Character.valueOf('X'), OrePrefixes.plate.get(Materials.DarkIron), Character.valueOf('S'), OrePrefixes.screw.get(Materials.DarkIron)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod, Character.valueOf('X'), OrePrefixes.plate.get(Materials.TungstenSteel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.TungstenSteel)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Shape_Extruder_WindmillShaft.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hXS", "XPX", "fXd", Character.valueOf('P'), ItemList.Shape_Extruder_Rod, Character.valueOf('X'), OrePrefixes.plate.get(Materials.Molybdenum), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Molybdenum)});
Utils.LOG_INFO("Added recipe item for GT5 Extruder: Shaft Shape");
-
- // Shaft Recipes
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, RECIPE_IC2.block_T1),
- GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), RECIPE_IC2.shaft_T1, 2560, 250);
- if (LoadedMods.EnderIO) {
- Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Energetic]");
+
+ //Shaft Recipes
+ GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T1), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T1, 2560, 250);
+ if (LoadedMods.EnderIO){
+ Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Energetic]");
}
else {
Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Magnalium]");
}
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, RECIPE_IC2.block_T2),
- GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), RECIPE_IC2.shaft_T2, 5120, 500);
+ GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T2), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T2, 5120, 500);
Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [TungstenSteel]");
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, RECIPE_IC2.block_T3),
- GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), RECIPE_IC2.shaft_T3, 10240, 2000);
- if (LoadedMods.EnderIO) {
- Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Vibrant]");
+ GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T3), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T3, 10240, 2000);
+ if (LoadedMods.EnderIO){
+ Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Vibrant]");
}
else {
Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Ultimet]");
}
- GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, RECIPE_IC2.block_T4),
- GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), RECIPE_IC2.shaft_T4, 20480, 4000);
+ GT_Values.RA.addExtruderRecipe(GT_Utility.copyAmount(9L, block_T4), GregtechItemList.Shape_Extruder_WindmillShaft.get(0L, new Object[0]), shaft_T4, 20480, 4000);
Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Iridium]");
-
- // Rotor Recipes
- RecipeUtils.recipeBuilder(null, RECIPE_IC2.rotor_blade_T1, null, RECIPE_IC2.rotor_blade_T1, RECIPE_IC2.shaft_T1,
- RECIPE_IC2.rotor_blade_T1, null, RECIPE_IC2.rotor_blade_T1, null, RECIPE_IC2.rotor_T1);
-
- RecipeUtils.recipeBuilder(null, RECIPE_IC2.rotor_blade_T2, null, RECIPE_IC2.rotor_blade_T2, RECIPE_IC2.shaft_T2,
- RECIPE_IC2.rotor_blade_T2, null, RECIPE_IC2.rotor_blade_T2, null, RECIPE_IC2.rotor_T2);
-
- RecipeUtils.recipeBuilder(null, RECIPE_IC2.rotor_blade_T3, null, RECIPE_IC2.rotor_blade_T3, RECIPE_IC2.shaft_T3,
- RECIPE_IC2.rotor_blade_T3, null, RECIPE_IC2.rotor_blade_T3, null, RECIPE_IC2.rotor_T3);
-
- RecipeUtils.recipeBuilder(null, RECIPE_IC2.rotor_blade_T4, null, RECIPE_IC2.rotor_blade_T4, RECIPE_IC2.shaft_T4,
- RECIPE_IC2.rotor_blade_T4, null, RECIPE_IC2.rotor_blade_T4, null, RECIPE_IC2.rotor_T4);
-
+
+ //Rotor Recipes
+ RecipeUtils.recipeBuilder(
+ null, rotor_blade_T1, null,
+ rotor_blade_T1, shaft_T1, rotor_blade_T1,
+ null, rotor_blade_T1, null,
+ rotor_T1);
+
+ RecipeUtils.recipeBuilder(
+ null, rotor_blade_T2, null,
+ rotor_blade_T2, shaft_T2, rotor_blade_T2,
+ null, rotor_blade_T2, null,
+ rotor_T2);
+
+ RecipeUtils.recipeBuilder(
+ null, rotor_blade_T3, null,
+ rotor_blade_T3, shaft_T3, rotor_blade_T3,
+ null, rotor_blade_T3, null,
+ rotor_T3);
+
+ RecipeUtils.recipeBuilder(
+ null, rotor_blade_T4, null,
+ rotor_blade_T4, shaft_T4, rotor_blade_T4,
+ null, rotor_blade_T4, null,
+ rotor_T4);
+
}
-
+
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java b/src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java
index 659de1e9b8..84faed5479 100644
--- a/src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java
+++ b/src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java
@@ -2,24 +2,25 @@ package gtPlusPlus.xmod.psychedelicraft;
import gtPlusPlus.core.lib.LoadedMods;
+
public class HANDLER_Psych {
- public static void init() {
- if (LoadedMods.Psychedelicraft) {
- // PS_Fluids.registerAlcohols();
- }
+ public static void preInit(){
+ if (LoadedMods.Psychedelicraft){
+ //PS_Fluids.registerFluids();
+ }
}
- public static void postInit() {
- if (LoadedMods.Psychedelicraft) {
-
+ public static void init(){
+ if (LoadedMods.Psychedelicraft){
+ //PS_Fluids.registerAlcohols();
}
}
- public static void preInit() {
- if (LoadedMods.Psychedelicraft) {
- // PS_Fluids.registerFluids();
- }
+ public static void postInit(){
+ if (LoadedMods.Psychedelicraft){
+
+ }
}
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
index 36cac34040..6804737ebf 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
@@ -6,32 +6,32 @@ import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
import gtPlusPlus.xmod.thermalfoundation.recipe.TF_Gregtech_Recipes;
-public class HANDLER_TF {
+public class HANDLER_TF{
- public static void init() {
- if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) {
+ public static void preInit(){
+ if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){
+ TF_Fluids.preInit();
+ TF_Items.preInit();
+ TF_Blocks.preInit();
+ }
+ }
+
+ public static void init(){
+ if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){
TF_Fluids.init();
- TF_Blocks.init();
+ TF_Blocks.init();
TF_Items.init();
- }
+ }
}
- public static void postInit() {
- if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) {
+ public static void postInit(){
+ if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){
TF_Fluids.postInit();
TF_Items.postInit();
TF_Blocks.postInit();
- if (LoadedMods.Gregtech) {
+ if(LoadedMods.Gregtech){
TF_Gregtech_Recipes.run();
- }
- }
- }
-
- public static void preInit() {
- if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) {
- TF_Fluids.preInit();
- TF_Items.preInit();
- TF_Blocks.preInit();
- }
- }
+ }
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
index 3e8bbbc64b..58afd0c52c 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
@@ -1,180 +1,189 @@
package gtPlusPlus.xmod.thermalfoundation.block;
-import java.util.Random;
-
-import cofh.core.fluid.BlockFluidInteractive;
-import cofh.lib.util.BlockWrapper;
-import cofh.lib.util.helpers.DamageHelper;
-import cofh.lib.util.helpers.ServerHelper;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
+
+import java.util.Random;
+
import net.minecraft.block.Block;
-import net.minecraft.block.material.*;
+import net.minecraft.block.material.MapColor;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.monster.*;
+import net.minecraft.entity.monster.EntityBlaze;
+import net.minecraft.entity.monster.EntityCreeper;
+import net.minecraft.entity.monster.EntitySnowman;
+import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.init.Blocks;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.core.fluid.BlockFluidInteractive;
+import cofh.lib.util.BlockWrapper;
+import cofh.lib.util.helpers.DamageHelper;
+import cofh.lib.util.helpers.ServerHelper;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class TF_Block_Fluid_Cryotheum extends BlockFluidInteractive {
- public static final int LEVELS = 5;
- public static final Material materialFluidCryotheum = new MaterialLiquid(MapColor.iceColor);
- private static boolean enableSourceFall = true;
- private static boolean effect = true;
- Random random = new Random();
-
- public TF_Block_Fluid_Cryotheum() {
- super(CORE.MODID, TF_Fluids.fluidCryotheum, TF_Block_Fluid_Cryotheum.materialFluidCryotheum, "cryotheum");
- this.setQuantaPerBlock(5);
- this.setTickRate(15);
-
- this.setHardness(1000.0F);
- this.setLightOpacity(1);
- this.setParticleColor(0.15F, 0.7F, 1.0F);
- }
-
- protected void checkForInteraction(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
- return;
- }
- int i = paramInt1;
- int j = paramInt2;
- int k = paramInt3;
- for (int m = 0; m < 6; m++) {
- i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
- j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
- k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
-
- this.interactWithBlock(paramWorld, i, j, k);
- }
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
- }
-
- @Override
- public int getLightValue(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- return TF_Fluids.fluidCryotheum.getLuminosity();
- }
-
- protected void interactWithBlock(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
- if (localBlock == Blocks.air || localBlock == this) {
- return;
- }
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
- if (this.hasInteraction(localBlock, i)) {
- final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i);
- paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata,
- 3);
- }
- else if (paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)
- && paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)) {
- paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.snow_layer, 0, 3);
- }
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3, final Entity paramEntity) {
- paramEntity.extinguish();
- if (!TF_Block_Fluid_Cryotheum.effect) {
- return;
- }
- if (paramEntity.motionY < -0.05D || paramEntity.motionY > 0.05D) {
- paramEntity.motionY *= 0.05D;
- }
- if (paramEntity.motionZ < -0.05D || paramEntity.motionZ > 0.05D) {
- paramEntity.motionZ *= 0.05D;
- }
- if (paramEntity.motionX < -0.05D || paramEntity.motionX > 0.05D) {
- paramEntity.motionX *= 0.05D;
- }
- if (ServerHelper.isClientWorld(paramWorld)) {
- return;
- }
- if (paramWorld.getTotalWorldTime() % 8L != 0L) {
- return;
- }
- if (paramEntity instanceof EntityZombie || paramEntity instanceof EntityCreeper) {
- final EntitySnowman localEntitySnowman = new EntitySnowman(paramWorld);
- localEntitySnowman.setLocationAndAngles(paramEntity.posX, paramEntity.posY, paramEntity.posZ,
- paramEntity.rotationYaw, paramEntity.rotationPitch);
- paramWorld.spawnEntityInWorld(localEntitySnowman);
-
- paramEntity.setDead();
- }
- else if (/* ((paramEntity instanceof EntityBlizz)) || */paramEntity instanceof EntitySnowman) {
- ((EntityLivingBase) paramEntity).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120, 0));
- ((EntityLivingBase) paramEntity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 120, 0));
- }
- else if (paramEntity instanceof EntityBlaze) {
- paramEntity.attackEntityFrom(DamageHelper.cryotheum, 10.0F);
- }
- else {
- final boolean bool = paramEntity.velocityChanged;
- paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F);
- paramEntity.velocityChanged = bool;
- }
- }
-
- @Override
- public boolean preInit() {
- GameRegistry.registerBlock(this, "FluidCryotheum");
-
- this.addInteraction(Blocks.grass, Blocks.dirt);
- this.addInteraction(Blocks.water, 0, Blocks.ice);
- this.addInteraction(Blocks.water, Blocks.snow);
- this.addInteraction(Blocks.flowing_water, 0, Blocks.ice);
- this.addInteraction(Blocks.flowing_water, Blocks.snow);
- this.addInteraction(Blocks.lava, 0, Blocks.obsidian);
- this.addInteraction(Blocks.lava, Blocks.stone);
- this.addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian);
- this.addInteraction(Blocks.flowing_lava, Blocks.stone);
- this.addInteraction(Blocks.leaves, Blocks.air);
- this.addInteraction(Blocks.tallgrass, Blocks.air);
- this.addInteraction(Blocks.fire, Blocks.air);
- // addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone);
-
- final String str1 = "Fluid.Cryotheum";
- String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold.";
- TF_Block_Fluid_Cryotheum.effect = true;
-
- str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards.";
- TF_Block_Fluid_Cryotheum.enableSourceFall = true;
-
- return true;
- }
-
- protected void triggerInteractionEffects(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- }
-
- @Override
- public void updateTick(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3,
- final Random paramRandom) {
- if (TF_Block_Fluid_Cryotheum.effect) {
- this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
- }
- if (TF_Block_Fluid_Cryotheum.enableSourceFall
- && paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0) {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
- if (localBlock == this && i != 0) {
- paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
- paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
- return;
- }
- }
- super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
- }
+public class TF_Block_Fluid_Cryotheum
+ extends BlockFluidInteractive
+{
+ Random random = new Random();
+ public static final int LEVELS = 5;
+ public static final Material materialFluidCryotheum = new MaterialLiquid(MapColor.iceColor);
+ private static boolean enableSourceFall = true;
+ private static boolean effect = true;
+
+ public TF_Block_Fluid_Cryotheum()
+ {
+ super(CORE.MODID, TF_Fluids.fluidCryotheum, materialFluidCryotheum, "cryotheum");
+ setQuantaPerBlock(5);
+ setTickRate(15);
+
+ setHardness(1000.0F);
+ setLightOpacity(1);
+ setParticleColor(0.15F, 0.7F, 1.0F);
+ }
+
+ public boolean preInit()
+ {
+ GameRegistry.registerBlock(this, "FluidCryotheum");
+
+ addInteraction(Blocks.grass, Blocks.dirt);
+ addInteraction(Blocks.water, 0, Blocks.ice);
+ addInteraction(Blocks.water, Blocks.snow);
+ addInteraction(Blocks.flowing_water, 0, Blocks.ice);
+ addInteraction(Blocks.flowing_water, Blocks.snow);
+ addInteraction(Blocks.lava, 0, Blocks.obsidian);
+ addInteraction(Blocks.lava, Blocks.stone);
+ addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian);
+ addInteraction(Blocks.flowing_lava, Blocks.stone);
+ addInteraction(Blocks.leaves, Blocks.air);
+ addInteraction(Blocks.tallgrass, Blocks.air);
+ addInteraction(Blocks.fire, Blocks.air);
+ //addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone);
+
+ String str1 = "Fluid.Cryotheum";
+ String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold.";
+ effect = true;
+
+ str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards.";
+ enableSourceFall = true;
+
+ return true;
+ }
+
+ public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity)
+ {
+ paramEntity.extinguish();
+ if (!effect) {
+ return;
+ }
+ if ((paramEntity.motionY < -0.05D) || (paramEntity.motionY > 0.05D)) {
+ paramEntity.motionY *= 0.05D;
+ }
+ if ((paramEntity.motionZ < -0.05D) || (paramEntity.motionZ > 0.05D)) {
+ paramEntity.motionZ *= 0.05D;
+ }
+ if ((paramEntity.motionX < -0.05D) || (paramEntity.motionX > 0.05D)) {
+ paramEntity.motionX *= 0.05D;
+ }
+ if (ServerHelper.isClientWorld(paramWorld)) {
+ return;
+ }
+ if (paramWorld.getTotalWorldTime() % 8L != 0L) {
+ return;
+ }
+ if (((paramEntity instanceof EntityZombie)) || ((paramEntity instanceof EntityCreeper)))
+ {
+ EntitySnowman localEntitySnowman = new EntitySnowman(paramWorld);
+ localEntitySnowman.setLocationAndAngles(paramEntity.posX, paramEntity.posY, paramEntity.posZ, paramEntity.rotationYaw, paramEntity.rotationPitch);
+ paramWorld.spawnEntityInWorld(localEntitySnowman);
+
+ paramEntity.setDead();
+ }
+ else if (/*((paramEntity instanceof EntityBlizz)) ||*/((paramEntity instanceof EntitySnowman)))
+ {
+ ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120, 0));
+ ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 120, 0));
+ }
+ else if ((paramEntity instanceof EntityBlaze))
+ {
+ paramEntity.attackEntityFrom(DamageHelper.cryotheum, 10.0F);
+ }
+ else
+ {
+ boolean bool = paramEntity.velocityChanged;
+ paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F);
+ paramEntity.velocityChanged = bool;
+ }
+ }
+
+ public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3)
+ {
+ return TF_Fluids.fluidCryotheum.getLuminosity();
+ }
+
+ public void updateTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom)
+ {
+ if (effect) {
+ checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0))
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ if ((localBlock == this) && (i != 0))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
+ paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
+ return;
+ }
+ }
+ super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
+ }
+
+ protected void checkForInteraction(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
+ return;
+ }
+ int i = paramInt1;
+ int j = paramInt2;
+ int k = paramInt3;
+ for (int m = 0; m < 6; m++)
+ {
+ i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
+ j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
+ k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
+
+ interactWithBlock(paramWorld, i, j, k);
+ }
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
+ }
+
+ protected void interactWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
+ if ((localBlock == Blocks.air) || (localBlock == this)) {
+ return;
+ }
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
+ if (hasInteraction(localBlock, i))
+ {
+ BlockWrapper localBlockWrapper = getInteraction(localBlock, i);
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
+ }
+ else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.snow_layer, 0, 3);
+ }
+ }
+
+ protected void triggerInteractionEffects(World paramWorld, int paramInt1, int paramInt2, int paramInt3) {}
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
index 72fd99f181..f45cc1d839 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
@@ -1,15 +1,14 @@
package gtPlusPlus.xmod.thermalfoundation.block;
-import java.util.Random;
-
-import cofh.core.fluid.BlockFluidInteractive;
-import cofh.lib.util.BlockWrapper;
-import cofh.lib.util.helpers.ServerHelper;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
+
+import java.util.Random;
+
import net.minecraft.block.Block;
-import net.minecraft.block.material.*;
+import net.minecraft.block.material.MapColor;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,167 +16,167 @@ import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.core.fluid.BlockFluidInteractive;
+import cofh.lib.util.BlockWrapper;
+import cofh.lib.util.helpers.ServerHelper;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class TF_Block_Fluid_Pyrotheum extends BlockFluidInteractive {
- public static final int LEVELS = 5;
- public static final Material materialFluidPyrotheum = new MaterialLiquid(MapColor.tntColor);
- private static boolean effect = true;
- private static boolean enableSourceFall = true;
- Random random = new Random();
-
- public TF_Block_Fluid_Pyrotheum() {
- super(CORE.MODID, TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum");
- this.setQuantaPerBlock(5);
- this.setTickRate(10);
-
- this.setHardness(1000.0F);
- this.setLightOpacity(1);
- this.setParticleColor(1.0F, 0.7F, 0.15F);
- }
-
- protected void checkForInteraction(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
- return;
- }
- int i = paramInt1;
- int j = paramInt2;
- int k = paramInt3;
- for (int m = 0; m < 6; m++) {
- i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
- j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
- k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
-
- this.interactWithBlock(paramWorld, i, j, k);
- }
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
- this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
- }
-
- @Override
- public int getFireSpreadSpeed(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2,
- final int paramInt3, final ForgeDirection paramForgeDirection) {
- return TF_Block_Fluid_Pyrotheum.effect ? 800 : 0;
- }
-
- @Override
- public int getFlammability(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2,
- final int paramInt3, final ForgeDirection paramForgeDirection) {
- return 0;
- }
-
- @Override
- public int getLightValue(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- return TF_Fluids.fluidPyrotheum.getLuminosity();
- }
-
- protected void interactWithBlock(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
- if (localBlock == Blocks.air || localBlock == this) {
- return;
- }
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
- if (this.hasInteraction(localBlock, i)) {
- final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i);
- paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata,
- 3);
- this.triggerInteractionEffects(paramWorld, paramInt1, paramInt2, paramInt3);
- }
- else if (localBlock.isFlammable(paramWorld, paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) {
- paramWorld.setBlock(paramInt1, paramInt2, paramInt3, Blocks.fire);
- }
- else if (paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)
- && paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)) {
- paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.fire, 0, 3);
- }
- }
-
- @Override
- public boolean isFireSource(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3,
- final ForgeDirection paramForgeDirection) {
- return TF_Block_Fluid_Pyrotheum.effect;
- }
-
- @Override
- public boolean isFlammable(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2,
- final int paramInt3, final ForgeDirection paramForgeDirection) {
- return TF_Block_Fluid_Pyrotheum.effect && paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal()
- && paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this;
- }
-
- @Override
- public void onEntityCollidedWithBlock(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3, final Entity paramEntity) {
- if (!TF_Block_Fluid_Pyrotheum.effect) {
- return;
- }
- if (ServerHelper.isClientWorld(paramWorld)) {
- return;
- }
- if (!(paramEntity instanceof EntityPlayer)) {
- if (paramEntity instanceof EntityCreeper) {
- paramWorld.createExplosion(paramEntity, paramEntity.posX, paramEntity.posY, paramEntity.posZ, 6.0F,
- paramEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
- paramEntity.setDead();
- }
- }
- }
-
- @Override
- public boolean preInit() {
- GameRegistry.registerBlock(this, "FluidPyrotheum");
-
- this.addInteraction(Blocks.cobblestone, Blocks.stone);
- this.addInteraction(Blocks.grass, Blocks.dirt);
- this.addInteraction(Blocks.sand, Blocks.glass);
- this.addInteraction(Blocks.water, Blocks.stone);
- this.addInteraction(Blocks.flowing_water, Blocks.stone);
- this.addInteraction(Blocks.clay, Blocks.hardened_clay);
- this.addInteraction(Blocks.ice, Blocks.stone);
- this.addInteraction(Blocks.snow, Blocks.air);
- this.addInteraction(Blocks.snow_layer, Blocks.air);
- for (int i = 0; i < 8; i++) {
- this.addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i);
- }
- final String str1 = "Fluid.Pyrotheum";
- String str2 = "Enable this for Fluid Pyrotheum to be worse than lava.";
- TF_Block_Fluid_Pyrotheum.effect = true;
-
- str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards.";
- TF_Block_Fluid_Pyrotheum.enableSourceFall = true;
-
- return true;
- }
-
- protected void triggerInteractionEffects(final World paramWorld, final int paramInt1, final int paramInt2,
- final int paramInt3) {
- if (this.random.nextInt(16) == 0) {
- paramWorld.playSoundEffect(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, "random.fizz", 0.5F,
- 2.2F + (paramWorld.rand.nextFloat() - paramWorld.rand.nextFloat()) * 0.8F);
- }
- }
-
- @Override
- public void updateTick(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3,
- final Random paramRandom) {
- if (TF_Block_Fluid_Pyrotheum.effect) {
- this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
- }
- if (TF_Block_Fluid_Pyrotheum.enableSourceFall
- && paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0) {
- final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
- final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
- if (localBlock == this && i != 0 || localBlock.isFlammable(paramWorld, paramInt1,
- paramInt2 + this.densityDir, paramInt3, ForgeDirection.UP)) {
- paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
- paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
- return;
- }
- }
- super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
- }
+public class TF_Block_Fluid_Pyrotheum
+ extends BlockFluidInteractive
+{
+ Random random = new Random();
+ public static final int LEVELS = 5;
+ public static final Material materialFluidPyrotheum = new MaterialLiquid(MapColor.tntColor);
+ private static boolean effect = true;
+ private static boolean enableSourceFall = true;
+
+ public TF_Block_Fluid_Pyrotheum()
+ {
+ super(CORE.MODID, TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum");
+ setQuantaPerBlock(5);
+ setTickRate(10);
+
+ setHardness(1000.0F);
+ setLightOpacity(1);
+ setParticleColor(1.0F, 0.7F, 0.15F);
+ }
+
+ public boolean preInit()
+ {
+ GameRegistry.registerBlock(this, "FluidPyrotheum");
+
+ addInteraction(Blocks.cobblestone, Blocks.stone);
+ addInteraction(Blocks.grass, Blocks.dirt);
+ addInteraction(Blocks.sand, Blocks.glass);
+ addInteraction(Blocks.water, Blocks.stone);
+ addInteraction(Blocks.flowing_water, Blocks.stone);
+ addInteraction(Blocks.clay, Blocks.hardened_clay);
+ addInteraction(Blocks.ice, Blocks.stone);
+ addInteraction(Blocks.snow, Blocks.air);
+ addInteraction(Blocks.snow_layer, Blocks.air);
+ for (int i = 0; i < 8; i++) {
+ addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i);
+ }
+ String str1 = "Fluid.Pyrotheum";
+ String str2 = "Enable this for Fluid Pyrotheum to be worse than lava.";
+ effect = true;
+
+ str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards.";
+ enableSourceFall = true;
+
+ return true;
+ }
+
+ public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity)
+ {
+ if (!effect) {
+ return;
+ }
+ if (ServerHelper.isClientWorld(paramWorld)) {
+ return;
+ }
+ if (!(paramEntity instanceof EntityPlayer)) {
+ if ((paramEntity instanceof EntityCreeper))
+ {
+ paramWorld.createExplosion(paramEntity, paramEntity.posX, paramEntity.posY, paramEntity.posZ, 6.0F, paramEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
+ paramEntity.setDead();
+ }
+ }
+ }
+
+ public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3)
+ {
+ return TF_Fluids.fluidPyrotheum.getLuminosity();
+ }
+
+ public int getFireSpreadSpeed(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return effect ? 800 : 0;
+ }
+
+ public int getFlammability(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return 0;
+ }
+
+ public boolean isFlammable(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return (effect) && (paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal()) && (paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this);
+ }
+
+ public boolean isFireSource(World paramWorld, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return effect;
+ }
+
+ public void updateTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom)
+ {
+ if (effect) {
+ checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0))
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ if (((localBlock == this) && (i != 0)) || (localBlock.isFlammable(paramWorld, paramInt1, paramInt2 + this.densityDir, paramInt3, ForgeDirection.UP)))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
+ paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
+ return;
+ }
+ }
+ super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
+ }
+
+ protected void checkForInteraction(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
+ return;
+ }
+ int i = paramInt1;
+ int j = paramInt2;
+ int k = paramInt3;
+ for (int m = 0; m < 6; m++)
+ {
+ i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
+ j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
+ k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
+
+ interactWithBlock(paramWorld, i, j, k);
+ }
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
+ }
+
+ protected void interactWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
+ if ((localBlock == Blocks.air) || (localBlock == this)) {
+ return;
+ }
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
+ if (hasInteraction(localBlock, i))
+ {
+ BlockWrapper localBlockWrapper = getInteraction(localBlock, i);
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
+ triggerInteractionEffects(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ else if (localBlock.isFlammable(paramWorld, paramInt1, paramInt2, paramInt3, ForgeDirection.UP))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, Blocks.fire);
+ }
+ else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.fire, 0, 3);
+ }
+ }
+
+ protected void triggerInteractionEffects(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ if (this.random.nextInt(16) == 0) {
+ paramWorld.playSoundEffect(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, "random.fizz", 0.5F, 2.2F + (paramWorld.rand.nextFloat() - paramWorld.rand.nextFloat()) * 0.8F);
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
index 1fccf3bb8c..867f8c7f7d 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
@@ -2,22 +2,25 @@ package gtPlusPlus.xmod.thermalfoundation.block;
import cofh.core.fluid.BlockFluidCoFHBase;
-public class TF_Blocks {
-
- public static BlockFluidCoFHBase blockFluidPyrotheum;
- public static BlockFluidCoFHBase blockFluidCryotheum;
-
- public static void init() {
- }
-
- public static void postInit() {
-
- }
-
- public static void preInit() {
- TF_Blocks.blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum();
- TF_Blocks.blockFluidCryotheum = new TF_Block_Fluid_Cryotheum();
- TF_Blocks.blockFluidPyrotheum.preInit();
- TF_Blocks.blockFluidCryotheum.preInit();
- }
+public class TF_Blocks
+{
+
+ public static BlockFluidCoFHBase blockFluidPyrotheum;
+ public static BlockFluidCoFHBase blockFluidCryotheum;
+
+
+ public static void preInit()
+ {
+ blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum();
+ blockFluidCryotheum = new TF_Block_Fluid_Cryotheum();
+ blockFluidPyrotheum.preInit();
+ blockFluidCryotheum.preInit();
+ }
+
+ public static void init() {}
+
+ public static void postInit()
+ {
+
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
index 1472d0d1f0..984ff4604b 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.thermalfoundation.fluid;
-import cofh.core.util.fluid.DispenserEmptyBucketHandler;
-import cofh.core.util.fluid.DispenserFilledBucketHandler;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
@@ -10,58 +8,60 @@ import net.minecraft.init.Items;
import net.minecraft.item.EnumRarity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
+import cofh.core.util.fluid.DispenserEmptyBucketHandler;
+import cofh.core.util.fluid.DispenserFilledBucketHandler;
-public class TF_Fluids {
- public static Fluid fluidPyrotheum;
- public static Fluid fluidCryotheum;
-
- public static void init() {
- }
-
- public static void postInit() {
- }
-
- public static void preInit() {
- if (!LoadedMods.ThermalFoundation) {
- Utils.LOG_INFO("Adding in our own versions of Thermal Foundation Fluids - Non-GT");
- final Fluid pyrotheum = FluidRegistry.getFluid("pyrotheum");
- final Fluid cryotheum = FluidRegistry.getFluid("cryotheum");
+public class TF_Fluids
+{
+ public static Fluid fluidPyrotheum;
+ public static Fluid fluidCryotheum;
- if (pyrotheum == null) {
- Utils.LOG_INFO("Registering Blazing Pyrotheum as it does not exist.");
- TF_Fluids.fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200)
- .setTemperature(4000).setRarity(EnumRarity.rare);
- TF_Fluids.registerFluid(TF_Fluids.fluidPyrotheum, "pyrotheum");
- }
- else {
- Utils.LOG_INFO("Registering Blazing Pyrotheum as it is an already existing Fluid.");
- TF_Fluids.fluidPyrotheum = pyrotheum;
- }
- if (cryotheum == null) {
- Utils.LOG_INFO("Registering Gelid Cryotheum as it does not exist.");
- TF_Fluids.fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000)
- .setTemperature(50).setRarity(EnumRarity.rare);
- TF_Fluids.registerFluid(TF_Fluids.fluidCryotheum, "cryotheum");
- }
- else {
- Utils.LOG_INFO("Registering Gelid Cryotheum as it is an already existing Fluid.");
- TF_Fluids.fluidCryotheum = cryotheum;
- }
+ public static void preInit()
+ {
+ if (!LoadedMods.ThermalFoundation){
+ Utils.LOG_INFO("Adding in our own versions of Thermal Foundation Fluids - Non-GT");
+ Fluid pyrotheum = FluidRegistry.getFluid("pyrotheum");
+ Fluid cryotheum = FluidRegistry.getFluid("cryotheum");
+
+ if (pyrotheum == null){
+ Utils.LOG_INFO("Registering Blazing Pyrotheum as it does not exist.");
+ fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200).setTemperature(4000).setRarity(EnumRarity.rare);
+ registerFluid(fluidPyrotheum, "pyrotheum");
+ }
+ else {
+ Utils.LOG_INFO("Registering Blazing Pyrotheum as it is an already existing Fluid.");
+ fluidPyrotheum = pyrotheum;
+ }
+ if (cryotheum == null){
+ Utils.LOG_INFO("Registering Gelid Cryotheum as it does not exist.");
+ fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000).setTemperature(50).setRarity(EnumRarity.rare);
+ registerFluid(fluidCryotheum, "cryotheum");
+ }
+ else {
+ Utils.LOG_INFO("Registering Gelid Cryotheum as it is an already existing Fluid.");
+ fluidCryotheum = cryotheum;
+ }
}
else {
Utils.LOG_INFO("Thermal Foundation is already loaded, no need to add our own Cryotheum/Pyrotheum.");
}
}
- public static void registerDispenserHandlers() {
- BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler());
- BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler());
- }
+ public static void init() {}
- public static void registerFluid(Fluid paramFluid, final String paramString) {
+ public static void postInit() {}
+
+ public static void registerFluid(Fluid paramFluid, String paramString)
+ {
if (!FluidRegistry.isFluidRegistered(paramString)) {
FluidRegistry.registerFluid(paramFluid);
}
paramFluid = FluidRegistry.getFluid(paramString);
}
+
+ public static void registerDispenserHandlers()
+ {
+ BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler());
+ BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler());
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
index 5d5d3d12f2..4d89207817 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
@@ -1,10 +1,5 @@
package gtPlusPlus.xmod.thermalfoundation.item;
-import cofh.core.item.ItemBase;
-import cofh.core.item.ItemBucket;
-import cofh.core.util.energy.FurnaceFuelHandler;
-import cofh.core.util.fluid.BucketHandler;
-import cofh.lib.util.helpers.ItemHelper;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.xmod.thermalfoundation.block.TF_Blocks;
@@ -12,70 +7,72 @@ import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
+import cofh.core.item.ItemBase;
+import cofh.core.item.ItemBucket;
+import cofh.core.util.energy.FurnaceFuelHandler;
+import cofh.core.util.fluid.BucketHandler;
+import cofh.lib.util.helpers.ItemHelper;
public class TF_Items {
- public static ItemBase itemMaterial;
- public static ItemStack rodBlizz;
- public static ItemStack dustBlizz;
- public static ItemStack dustPyrotheum;
- public static ItemStack dustCryotheum;
- public static ItemBucket itemBucket;
- public static ItemStack bucketPyrotheum;
- public static ItemStack bucketCryotheum;
-
- public static ItemStack itemDustBlizz;
- public static ItemStack itemDustPyrotheum;
- public static ItemStack itemDustCryotheum;
- public static ItemStack itemRodBlizz;
-
- public static void init() {
-
- BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, TF_Items.bucketPyrotheum);
- BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, TF_Items.bucketCryotheum);
- FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidPyrotheum, TF_Items.bucketPyrotheum,
- FluidContainerRegistry.EMPTY_BUCKET);
- FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidCryotheum, TF_Items.bucketCryotheum,
- FluidContainerRegistry.EMPTY_BUCKET);
+ public static ItemBase itemMaterial;
+ public static ItemStack rodBlizz;
+ public static ItemStack dustBlizz;
+ public static ItemStack dustPyrotheum;
+ public static ItemStack dustCryotheum;
+ public static ItemBucket itemBucket;
+ public static ItemStack bucketPyrotheum;
+ public static ItemStack bucketCryotheum;
+
+ public static ItemStack itemDustBlizz;
+ public static ItemStack itemDustPyrotheum;
+ public static ItemStack itemDustCryotheum;
+ public static ItemStack itemRodBlizz;
+
+ public static void preInit(){
+
+
+ itemBucket = (ItemBucket)new ItemBucket("MiscUtils").setUnlocalizedName("bucket").setCreativeTab(AddToCreativeTab.tabMisc);
+ itemMaterial = (ItemBase)new ItemBase("MiscUtils").setUnlocalizedName("material").setCreativeTab(AddToCreativeTab.tabMisc);
+
+
+ bucketPyrotheum = itemBucket.addOreDictItem(1, "bucketPyrotheum");
+ bucketCryotheum = itemBucket.addOreDictItem(2, "bucketCryotheum");
+ rodBlizz = itemMaterial.addOreDictItem(1, "rodBlizz");
+ dustBlizz = itemMaterial.addOreDictItem(2, "dustBlizz");
+ dustPyrotheum = itemMaterial.addOreDictItem(3, "dustPyrotheum");
+ dustCryotheum = itemMaterial.addOreDictItem(4, "dustCryotheum");
+
+ FurnaceFuelHandler.registerFuel(dustPyrotheum, 2400);
- }
- public static void postInit() {
+ itemRodBlizz = ItemUtils.simpleMetaStack(itemMaterial, 1, 1);
+ itemDustBlizz = ItemUtils.simpleMetaStack(itemMaterial, 2, 1);
+ itemDustPyrotheum = ItemUtils.simpleMetaStack(itemMaterial, 3, 1);
+ itemDustCryotheum = ItemUtils.simpleMetaStack(itemMaterial, 4, 1);
+
- ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(TF_Items.dustPyrotheum, 1), new Object[] {
- "dustCoal", "dustSulfur", "dustRedstone", "dustBlaze"
- }));
- ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(TF_Items.dustCryotheum, 1), new Object[] {
- Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz"
- }));
- ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(TF_Items.dustCryotheum, 1), new Object[] {
- Items.snowball, "dustNitor", "dustRedstone", "dustBlizz"
- }));
- // ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustBlizz,
- // 2), new Object[] { "rodBlizz" }));
}
- public static void preInit() {
+ public static void init(){
+
+ BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, bucketPyrotheum);
+ BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, bucketCryotheum);
+ FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidPyrotheum, bucketPyrotheum, FluidContainerRegistry.EMPTY_BUCKET);
+ FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidCryotheum, bucketCryotheum, FluidContainerRegistry.EMPTY_BUCKET);
+
+
+ }
- TF_Items.itemBucket = (ItemBucket) new ItemBucket("MiscUtils").setUnlocalizedName("bucket")
- .setCreativeTab(AddToCreativeTab.tabMisc);
- TF_Items.itemMaterial = (ItemBase) new ItemBase("MiscUtils").setUnlocalizedName("material")
- .setCreativeTab(AddToCreativeTab.tabMisc);
+ public static void postInit(){
- TF_Items.bucketPyrotheum = TF_Items.itemBucket.addOreDictItem(1, "bucketPyrotheum");
- TF_Items.bucketCryotheum = TF_Items.itemBucket.addOreDictItem(2, "bucketCryotheum");
- TF_Items.rodBlizz = TF_Items.itemMaterial.addOreDictItem(1, "rodBlizz");
- TF_Items.dustBlizz = TF_Items.itemMaterial.addOreDictItem(2, "dustBlizz");
- TF_Items.dustPyrotheum = TF_Items.itemMaterial.addOreDictItem(3, "dustPyrotheum");
- TF_Items.dustCryotheum = TF_Items.itemMaterial.addOreDictItem(4, "dustCryotheum");
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustPyrotheum, 1), new Object[] { "dustCoal", "dustSulfur", "dustRedstone", "dustBlaze" }));
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz" }));
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustNitor", "dustRedstone", "dustBlizz" }));
+ //ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustBlizz, 2), new Object[] { "rodBlizz" }));
- FurnaceFuelHandler.registerFuel(TF_Items.dustPyrotheum, 2400);
- TF_Items.itemRodBlizz = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 1, 1);
- TF_Items.itemDustBlizz = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 1);
- TF_Items.itemDustPyrotheum = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 3, 1);
- TF_Items.itemDustCryotheum = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 4, 1);
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
index 2d3facb543..cab0741da2 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
@@ -1,6 +1,8 @@
package gtPlusPlus.xmod.thermalfoundation.recipe;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.util.Utils;
@@ -13,54 +15,47 @@ import net.minecraftforge.fluids.FluidStack;
public class TF_Gregtech_Recipes {
- private static FluidStack getFluidStack(final String fluidName, final int amount) {
- Utils.LOG_WARNING("Trying to get a fluid stack of " + fluidName);
- try {
- return FluidRegistry.getFluidStack(fluidName, amount);
- }
- catch (final Throwable e) {
- return null;
- }
-
- }
-
- public static void run() {
- TF_Gregtech_Recipes.start();
+ public static void run(){
+ start();
}
- private static void start() {
- // Get Items to work with
- final ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy();
- final ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy();
- final ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy();
- final ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3);
- final ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy();
- final FluidStack moltenRedstone = TF_Gregtech_Recipes.getFluidStack("molten.redstone", 250);
+ private static void start(){
+ //Get Items to work with
+ ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy();
+ ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy();
+ ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy();
+ ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3);
+ ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy();
+ FluidStack moltenRedstone = getFluidStack("molten.redstone", 250);
- // Gelid Cryotheum
+ //Gelid Cryotheum
Utils.LOG_INFO("Adding Recipes for Gelid Cryotheum");
- GT_Values.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI,
- TF_Gregtech_Recipes.getFluidStack("cryotheum", 250), 10000, 200, 240);
- GT_Values.RA.addChemicalBathRecipe(GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L),
- TF_Gregtech_Recipes.getFluidStack("cryotheum", 200),
- GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null,
- 400, 30);
+ GT_Values.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, getFluidStack("cryotheum", 250), 10000, 200, 240);
+ GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 200), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30);
- // Blizz Powder
+ //Blizz Powder
Utils.LOG_INFO("Adding Recipes for Blizz Powder");
- GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenRedstone, dust_Blizz, GT_Values.NI,
- GT_Values.NI, null, 400, 240);
+ GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenRedstone, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240);
- // Blizz Rod
+ //Blizz Rod
Utils.LOG_INFO("Adding Recipes for Blizz Rod");
- GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz,
- (int) Math.max(Materials.Blaze.getMass() * 4 * 3L, 1L));
+ GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass()*4) * 3L, 1L));
GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false);
- // Blazing Pyrotheum
- Utils.LOG_INFO("Adding Recipes for Blazing Pyrotheum");
- GT_Values.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI,
- TF_Gregtech_Recipes.getFluidStack("pyrotheum", 250), 10000, 200, 240);
+ //Blazing Pyrotheum
+ Utils.LOG_INFO("Adding Recipes for Blazing Pyrotheum");
+ GT_Values.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 10000, 200, 240);
+
+ }
+
+ private static FluidStack getFluidStack(String fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ return FluidRegistry.getFluidStack(fluidName, amount);
+ }
+ catch (Throwable e){
+ return null;
+ }
}